1!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=79)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(41)),r(n(42)),r(n(29)),r(n(90)),r(n(91)),r(n(92)),r(n(93)),r(n(43)),r(n(94)),r(n(44)),r(n(95)),r(n(96)),r(n(98)),r(n(99)),r(n(100))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(0),a=n(0),s=n(0),u=n(0),c=n(18),h=n(0);t.LUIDGenerator=function(){var e=1;return function(){return e++}}(),t.sha1=function(e){var t=s.stringToByteArray(e),n=new a.Sha1;n.update(t);var r=n.digest();return o.base64.encodeByteArray(r)};var l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n="",r=0;r<e.length;r++)Array.isArray(e[r])||e[r]&&"object"==typeof e[r]&&"number"==typeof e[r].length?n+=l.apply(null,e[r]):"object"==typeof e[r]?n+=u.stringify(e[r]):n+=e[r],n+=" ";return n};t.logger=null;var p=!0;t.enableLogging=function(e,n){r.assert(!n||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?("undefined"!=typeof console&&("function"==typeof console.log?t.logger=console.log.bind(console):"object"==typeof console.log&&(t.logger=function(e){console.log(e)})),n&&c.SessionStorage.set("logging_enabled",!0)):"function"==typeof e?t.logger=e:(t.logger=null,c.SessionStorage.remove("logging_enabled"))},t.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!0===p&&(p=!1,null===t.logger&&!0===c.SessionStorage.get("logging_enabled")&&t.enableLogging(!0)),t.logger){var r=l.apply(null,e);t.logger(r)}},t.logWrapper=function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.log.apply(void 0,[e].concat(n))}},t.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("undefined"!=typeof console){var n="FIREBASE INTERNAL ERROR: "+l.apply(void 0,e);void 0!==console.error?console.error(n):console.log(n)}},t.fatal=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=l.apply(void 0,e);throw new Error("FIREBASE FATAL ERROR: "+n)},t.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("undefined"!=typeof console){var n="FIREBASE WARNING: "+l.apply(void 0,e);void 0!==console.warn?console.warn(n):console.log(n)}},t.warnIfPageIsSecure=function(){"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&t.warn("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},t.warnAboutUnsupportedMethod=function(e){t.warn(e+" is unsupported and will likely change soon. Please do not use.")},t.isInvalidJSONNumber=function(e){return"number"==typeof e&&(e!=e||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY)},t.executeWhenDOMReady=function(e){if(h.isNodeSdk()||"complete"===document.readyState)e();else{var t=!1,n=function(){if(!document.body)return void setTimeout(n,Math.floor(10));t||(t=!0,e())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}},t.MIN_NAME="[MIN_NAME]",t.MAX_NAME="[MAX_NAME]",t.nameCompare=function(e,n){if(e===n)return 0;if(e===t.MIN_NAME||n===t.MAX_NAME)return-1;if(n===t.MIN_NAME||e===t.MAX_NAME)return 1;var r=t.tryParseInt(e),i=t.tryParseInt(n);return null!==r?null!==i?r-i==0?e.length-n.length:r-i:-1:null!==i?1:e<n?-1:1},t.stringCompare=function(e,t){return e===t?0:e<t?-1:1},t.requireKey=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+u.stringify(t))},t.ObjectToUniqueKey=function(e){if("object"!=typeof e||null===e)return u.stringify(e);var n=[];for(var r in e)n.push(r);n.sort();for(var i="{",o=0;o<n.length;o++)0!==o&&(i+=","),i+=u.stringify(n[o]),i+=":",i+=t.ObjectToUniqueKey(e[n[o]]);return i+="}"},t.splitStringBySize=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r},t.each=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;++n)t(n,e[n]);
1else i.forEach(e,function(e,n){return t(n,e)})},t.bindCallback=function(e,t){return t?e.bind(t):e},t.doubleToIEEE754String=function(e){r.assert(!t.isInvalidJSONNumber(e),"Invalid JSON number");var n,i,o,a,s,u,c;for(0===e?(i=0,o=0,n=1/e==-1/0?1:0):(n=e<0,e=Math.abs(e),e>=Math.pow(2,-1022)?(a=Math.min(Math.floor(Math.log(e)/Math.LN2),1023),i=a+1023,o=Math.round(e*Math.pow(2,52-a)-Math.pow(2,52))):(i=0,o=Math.round(e/Math.pow(2,-1074)))),u=[],s=52;s;s-=1)u.push(o%2?1:0),o=Math.floor(o/2);for(s=11;s;s-=1)u.push(i%2?1:0),i=Math.floor(i/2);u.push(n?1:0),u.reverse(),c=u.join("");var h="";for(s=0;s<64;s+=8){var l=parseInt(c.substr(s,8),2).toString(16);1===l.length&&(l="0"+l),h+=l}return h.toLowerCase()},t.isChromeExtensionContentScript=function(){return!("object"!=typeof window||!window.chrome||!window.chrome.extension||/^chrome/.test(window.location.href))},t.isWindowsStoreApp=function(){return"object"==typeof Windows&&"object"==typeof Windows.UI},t.errorForServerCode=function(e,t){var n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==e?n="Client doesn't have permission to access the desired data.":"unavailable"==e&&(n="The service is unavailable");var r=new Error(e+" at "+t.path.toString()+": "+n);return r.code=e.toUpperCase(),r},t.INTEGER_REGEXP_=new RegExp("^-?\\d{1,10}$"),t.tryParseInt=function(e){if(t.INTEGER_REGEXP_.test(e)){var n=Number(e);if(n>=-2147483648&&n<=2147483647)return n}return null},t.exceptionGuard=function(e){try{e()}catch(e){setTimeout(function(){var n=e.stack||"";throw t.warn("Exception was thrown by user callback.",n),e},Math.floor(0))}},t.callUserCallback=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"function"==typeof e&&t.exceptionGuard(function(){e.apply(void 0,n)})},t.beingCrawled=function(){return("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},t.exportPropGetter=function(e,t,n){Object.defineProperty(e,t,{get:n})},t.setTimeoutNonBlocking=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(0),o=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!0,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t<this.pieces_.length&&t++,new e(this.pieces_,t)},e.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+encodeURIComponent(String(this.pieces_[t])));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.pieces_.slice(this.pieceNum_+e)},e.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)t.push(this.pieces_[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(t instanceof e)for(var r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);else for(var i=t.split("/"),r=0;r<i.length;r++)i[r].length>0&&n.push(i[r]);return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());
1throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),i=t.slice(),o=0;o<n.length&&o<i.length;o++){var a=r.nameCompare(n[o],i[o]);if(0!==a)return a}return n.length===i.length?0:n.length<i.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.pieceNum_,n=e.pieceNum_;t<=this.pieces_.length;t++,n++)if(this.pieces_[t]!==e.pieces_[n])return!1;return!0},e.prototype.contains=function(e){var t=this.pieceNum_,n=e.pieceNum_;if(this.getLength()>e.getLength())return!1;for(;t<this.pieces_.length;){if(this.pieces_[t]!==e.pieces_[n])return!1;++t,++n}return!0},e}();t.Path=o;var a=function(){function e(e,t){this.errorPrefix_=t,this.parts_=e.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=i.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),e.prototype.push=function(e){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=i.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=i.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0==this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}();t.ValidationPath=a},function(e,t,n){"use strict";function r(e){a=e}function i(e){s=e}var o=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var a,s,u=n(20),c=n(1),h=n(5),l=n(21);t.setNodeFromJSON=r,t.setMaxNode=i;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?c.nameCompare(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return h.NamedNode.MIN},t.prototype.maxPost=function(){return new h.NamedNode(c.MAX_NAME,new l.LeafNode("[PRIORITY-POST]",s))},t.prototype.makePost=function(e,t){var n=a(e);return new h.NamedNode(t,new l.LeafNode("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(u.Index);t.PriorityIndex=p,t.PRIORITY_INDEX=new p},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(0),a=n(1),s=n(22),u=n(5),c=n(50),h=n(3),l=n(14),p=n(52),f=n(21),d=n(54),v=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&c.validatePriorityNode(this.priorityNode_),this.children_.isEmpty()&&o.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return i||
1(i=new e(new s.SortedMap(d.NAME_COMPARATOR),null,p.IndexMap.Default))},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||i},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?i:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if(o.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var r=new u.NamedNode(t,n),a=void 0,s=void 0,c=void 0;return n.isEmpty()?(a=this.children_.remove(t),s=this.indexMap_.removeFromIndexes(r,this.children_)):(a=this.children_.insert(t,n),s=this.indexMap_.addToIndexes(r,this.children_)),c=a.isEmpty()?i:this.priorityNode_,new e(a,c,s)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;o.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,r)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(h.PRIORITY_INDEX,function(a,s){n[a]=s.val(t),r++,o&&e.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1}),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+c.priorityHashText(this.getPriority().val())+":"),this.forEachChild(h.PRIORITY_INDEX,function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)}),this.lazyHash_=""===e?"":a.sha1(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new u.NamedNode(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new u.NamedNode(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new u.NamedNode(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal(function(e){return t(e.name,e.node)}):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,function(e){return e});for(var r=this.children_.getIteratorFrom(e.name,u.NamedNode.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,function(e){return e});for(var r=this.children_.getReverseIteratorFrom(e.name,u.NamedNode.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===t.MAX_NODE?-1:0},e.prototype.withIndex=function(t){if(t===l.KEY_INDEX||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===l.KEY_INDEX||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;
1if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(h.PRIORITY_INDEX),r=t.getIterator(h.PRIORITY_INDEX),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===l.KEY_INDEX?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}();t.ChildrenNode=v;var _=function(e){function t(){return e.call(this,new s.SortedMap(d.NAME_COMPARATOR),v.EMPTY_NODE,p.IndexMap.Default)||this}return r(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return v.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(v);t.MaxNode=_,t.MAX_NODE=new _,Object.defineProperties(u.NamedNode,{MIN:{value:new u.NamedNode(a.MIN_NAME,v.EMPTY_NODE)},MAX:{value:new u.NamedNode(a.MAX_NAME,t.MAX_NODE)}}),l.KeyIndex.__EMPTY_NODE=v.EMPTY_NODE,f.LeafNode.__childrenNodeConstructor=v,c.setMaxNode(t.MAX_NODE),h.setMaxNode(t.MAX_NODE)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}();t.NamedNode=r},function(e,t,n){"use strict";function r(e){return null!=e}function i(e){return void 0!==e}function o(e){return"function"==typeof e}function a(e){return"object"==typeof e}function s(e){return a(e)&&null!==e}function u(e){return a(e)&&!Array.isArray(e)}function c(e){return"string"==typeof e||e instanceof String}function h(e){return"number"==typeof e||e instanceof Number}function l(e){return p()&&e instanceof Blob}function p(){return"undefined"!=typeof Blob}t.a=r,t.c=i,t.b=o,t.i=a,t.g=s,t.f=u,t.j=c,t.h=h,t.d=l,t.e=p},function(e,t,n){"use strict";function r(e){return"storage/"+e}function i(){return new E(C.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function o(e){return new E(C.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function a(e){return new E(C.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function s(){return new E(C.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again.")}function u(e){return new E(C.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function c(){return new E(C.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function h(){return new E(C.CANCELED,"User canceled the upload/download.")}function l(e){return new E(C.INVALID_URL,"Invalid URL '"+e+"'.")}function p(e){return new E(C.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function f(){return new E(C.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function d(){return new E(C.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function v(){return new E(C.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function _(e,t,n){return new E(C.INVALID_ARGUMENT,"Invalid argument in `"+t+"` at index "+e+": "+n)}function g(e,t,n,r){var i,o;return e===t?(i=e,o=1===e?"argument":"arguments"):(i="between "+e+" and "+t,o="arguments"),new E(C.INVALID_ARGUMENT_COUNT,"Invalid argument count in `"+n+"`: Expected "+i+" "+o+", received "+r+".")}function y(){return new E(C.APP_DELETED,"The Firebase app was deleted.")}function m(e){return new E(C.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function b(e,t){return new E(C.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function w(e){throw new E(C.INTERNAL_ERROR,"Internal error: "+e)}n.d(t,"a",function(){return C}),t.s=i,t.m=o,t.n=a,t.q=s,t.r=u,t.o=c,t.c=h,t.k=l,t.h=p,t.d=f,t.p=d,t.l=v,t.f=_,t.g=g,t.b=y,t.j=m,t.i=b,t.e=w;
1var E=(n(26),function(){function e(e,t){this.code_=r(e),this.message_="Firebase Storage: "+t,this.serverResponse_=null,this.name_="FirebaseError"}return e.prototype.codeProp=function(){return this.code},e.prototype.codeEquals=function(e){return r(e)===this.codeProp()},e.prototype.serverResponseProp=function(){return this.serverResponse_},e.prototype.setServerResponseProp=function(e){this.serverResponse_=e},Object.defineProperty(e.prototype,"name",{get:function(){return this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"code",{get:function(){return this.code_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this.message_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"serverResponse",{get:function(){return this.serverResponse_},enumerable:!0,configurable:!0}),e}()),C={UNKNOWN:"unknown",OBJECT_NOT_FOUND:"object-not-found",BUCKET_NOT_FOUND:"bucket-not-found",PROJECT_NOT_FOUND:"project-not-found",QUOTA_EXCEEDED:"quota-exceeded",UNAUTHENTICATED:"unauthenticated",UNAUTHORIZED:"unauthorized",RETRY_LIMIT_EXCEEDED:"retry-limit-exceeded",INVALID_CHECKSUM:"invalid-checksum",CANCELED:"canceled",INVALID_EVENT_NAME:"invalid-event-name",INVALID_URL:"invalid-url",INVALID_DEFAULT_BUCKET:"invalid-default-bucket",NO_DEFAULT_BUCKET:"no-default-bucket",CANNOT_SLICE_BLOB:"cannot-slice-blob",SERVER_FILE_WRONG_SIZE:"server-file-wrong-size",NO_DOWNLOAD_URL:"no-download-url",INVALID_ARGUMENT:"invalid-argument",INVALID_ARGUMENT_COUNT:"invalid-argument-count",APP_DELETED:"app-deleted",INVALID_ROOT_OPERATION:"invalid-root-operation",INVALID_FORMAT:"invalid-format",INTERNAL_ERROR:"internal-error"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"firebase",function(){return i});var r=n(89),i=Object(r.a)();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(0),o=n(1),a=n(0),s=n(0);t.INVALID_KEY_REGEX_=/[\[\].#$\/\u0000-\u001F\u007F]/,t.INVALID_PATH_REGEX_=/[\[\].#$\u0000-\u001F\u007F]/,t.MAX_LEAF_SIZE_=10485760,t.isValidKey=function(e){return"string"==typeof e&&0!==e.length&&!t.INVALID_KEY_REGEX_.test(e)},t.isValidPathString=function(e){return"string"==typeof e&&0!==e.length&&!t.INVALID_PATH_REGEX_.test(e)},t.isValidRootPathString=function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),t.isValidPathString(e)},t.isValidPriority=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!o.isInvalidJSONNumber(e)||e&&"object"==typeof e&&i.contains(e,".sv")},t.validateFirebaseDataArg=function(e,n,r,i,o){o&&void 0===r||t.validateFirebaseData(a.errorPrefix(e,n,o),r,i)},t.validateFirebaseData=function(e,n,a){var u=a instanceof r.Path?new r.ValidationPath(a,e):a;if(void 0===n)throw new Error(e+"contains undefined "+u.toErrorString());if("function"==typeof n)throw new Error(e+"contains a function "+u.toErrorString()+" with contents = "+n.toString());if(o.isInvalidJSONNumber(n))throw new Error(e+"contains "+n.toString()+" "+u.toErrorString());if("string"==typeof n&&n.length>t.MAX_LEAF_SIZE_/3&&s.stringLength(n)>t.MAX_LEAF_SIZE_)throw new Error(e+"contains a string greater than "+t.MAX_LEAF_SIZE_+" utf8 bytes "+u.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"==typeof n){var c=!1,h=!1;if(i.forEach(n,function(n,r){if(".value"===n)c=!0;else if(".priority"!==n&&".sv"!==n&&(h=!0,!t.isValidKey(n)))throw new Error(e+" contains an invalid key ("+n+") "+u.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');u.push(n),t.validateFirebaseData(e,r,u),u.pop()}),c&&h)throw new Error(e+' contains ".value" child '+u.toErrorString()+" in addition to actual children.")}},t.validateFirebaseMergePaths=function(e,n){var i,o;for(i=0;i<n.length;i++){o=n[i];for(var a=o.slice(),s=0;s<a.length;s++)if(".priority"===a[s]&&s===a.length-1);else if(!t.isValidKey(a[s]))throw new Error(e+"contains an invalid key ("+a[s]+") in path "+o.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}n.sort(r.Path.comparePaths);var u=null;for(i=0;i<n.length;i++){if(o=n[i],null!==u&&u.contains(o))throw new Error(e+"contains a path "+u.toString()+" that is ancestor of another path "+o.toString());u=o}},t.validateFirebaseMergeDataArg=function(e,n,o,s,u){if(!u||void 0!==o){var c=a.errorPrefix(e,n,u);if(!o||"object"!=typeof o||Array.isArray(o))throw new Error(c+" must be an object c
1ontaining the children to replace.");var h=[];i.forEach(o,function(e,n){var i=new r.Path(e);if(t.validateFirebaseData(c,n,s.child(i)),".priority"===i.getBack()&&!t.isValidPriority(n))throw new Error(c+"contains an invalid value for '"+i.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");h.push(i)}),t.validateFirebaseMergePaths(c,h)}},t.validatePriority=function(e,n,r,i){if(!i||void 0!==r){if(o.isInvalidJSONNumber(r))throw new Error(a.errorPrefix(e,n,i)+"is "+r.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!t.isValidPriority(r))throw new Error(a.errorPrefix(e,n,i)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},t.validateEventType=function(e,t,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(a.errorPrefix(e,t,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},t.validateKey=function(e,n,r,i){if(!(i&&void 0===r||t.isValidKey(r)))throw new Error(a.errorPrefix(e,n,i)+'was an invalid key = "'+r+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},t.validatePathString=function(e,n,r,i){if(!(i&&void 0===r||t.isValidPathString(r)))throw new Error(a.errorPrefix(e,n,i)+'was an invalid path = "'+r+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},t.validateRootPathString=function(e,n,r,i){r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),t.validatePathString(e,n,r,i)},t.validateWritablePath=function(e,t){if(".info"===t.getFront())throw new Error(e+" failed = Can't modify data under /.info/")},t.validateUrl=function(e,n,r){var i=r.path.toString();if("string"!=typeof r.repoInfo.host||0===r.repoInfo.host.length||!t.isValidKey(r.repoInfo.namespace)||0!==i.length&&!t.isValidRootPathString(i))throw new Error(a.errorPrefix(e,n,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},t.validateCredential=function(e,t,n,r){if((!r||void 0!==n)&&"string"!=typeof n)throw new Error(a.errorPrefix(e,t,r)+"must be a valid credential (a string).")},t.validateBoolean=function(e,t,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(a.errorPrefix(e,t,r)+"must be a boolean.")},t.validateString=function(e,t,n,r){if((!r||void 0!==n)&&"string"!=typeof n)throw new Error(a.errorPrefix(e,t,r)+"must be a valid string.")},t.validateObject=function(e,t,n,r){if(!(r&&void 0===n||n&&"object"==typeof n&&null!==n))throw new Error(a.errorPrefix(e,t,r)+"must be a valid object.")},t.validateObjectContainsKey=function(e,t,n,r,o,s){if(!n||"object"!=typeof n||!i.contains(n,r)){if(o)return;throw new Error(a.errorPrefix(e,t,o)+'must contain the key "'+r+'"')}if(s){var u=i.safeGet(n,r);if("number"===s&&"number"!=typeof u||"string"===s&&"string"!=typeof u||"boolean"===s&&"boolean"!=typeof u||"function"===s&&"function"!=typeof u||"object"===s&&"object"!=typeof u&&u)throw o?new Error(a.errorPrefix(e,t,o)+'contains invalid value for key "'+r+'" (must be of type "'+s+'")'):new Error(a.errorPrefix(e,t,o)+'must contain the key "'+r+'" with type "'+s+'"')}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(t.OperationType||(t.OperationType={}));var i=function(){function e(e,t,n,i){this.fromUser=e,this.fromServer=t,this.queryId=n,this.tagged=i,r.assert(!i||t,"Tagged queries must be from server.")}return e.User=new e(!0,!1,null,!1),e.Server=new e(!1,!0,null,!1),e.forServerTaggedQuery=function(t){return new e(!1,!0,t,!0)},e}();t.OperationSource=i},function(e,t,n){"use strict";function r(e){return new Promise(e)}function i(e){return Promise.resolve(e)}function o(e){return Promise.reject(e)}t.a=r,t.c=i,t.b=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r,i){this.type=e,this.snapshotNode=t,this.childName=n,this.oldSnap=r,this.prevName=i}return e.valueChange=function(t){return new e(e.VALUE,t)},e.childAddedChange=function(t,n){return new e(e.CHILD_ADDED,n,t)},e.childRemovedChange=function(t,n){return new e(e.CHILD_REMOVED,n,t)},e.childChangedChange=function(t,n,r){return new e(e.CHILD_CHANGED,n,t,r)},e.childMovedChange=function(t,n){return new e(e.CHILD_MOVED,n,t)},e.CHILD_ADDED="child_added",e.CHILD_REMOVED="child_removed",e.CHILD_CHANGED="child_changed",e.CHILD_MOVED="child_moved",e.VALUE="value",e}();t.Change=r},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function i(e,t){for(var n in e)r(e,n)&&t(n,e[n])}function o(e){if(null==e)return{};var t={};return i(e,function(e,n){t[e]=n}),t}t.b=i,t.a=o},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
1Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(20),a=n(5),s=n(1),u=n(0),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return i},set:function(e){i=e},enumerable:!0,configurable:!0}),t.prototype.compare=function(e,t){return s.nameCompare(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw u.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return a.NamedNode.MIN},t.prototype.maxPost=function(){return new a.NamedNode(s.MAX_NAME,i)},t.prototype.makePost=function(e,t){return u.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new a.NamedNode(e,i)},t.prototype.toString=function(){return".key"},t}(o.Index);t.KeyIndex=c,t.KEY_INDEX=new c},function(e,t,n){"use strict";function r(e,t){if(void 0===t&&(t=null),null===e)return i.ChildrenNode.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),u.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e){var n=e;return new o.LeafNode(n,r(t))}if(e instanceof Array||!f){var d=i.ChildrenNode.EMPTY_NODE,v=e;return s.forEach(v,function(e,t){if(s.contains(v,e)&&"."!==e.substring(0,1)){var n=r(t);!n.isLeafNode()&&n.isEmpty()||(d=d.updateImmediateChild(e,n))}}),d.updatePriority(r(t))}var _=[],g=!1,y=e;if(s.forEach(y,function(e,t){if("string"!=typeof e||"."!==e.substring(0,1)){var n=r(y[e]);n.isEmpty()||(g=g||!n.getPriority().isEmpty(),_.push(new a.NamedNode(e,n)))}}),0==_.length)return i.ChildrenNode.EMPTY_NODE;var m=c.buildChildSet(_,h.NAME_ONLY_COMPARATOR,function(e){return e.name},h.NAME_COMPARATOR);if(g){var b=c.buildChildSet(_,p.PRIORITY_INDEX.getCompare());return new i.ChildrenNode(m,r(t),new l.IndexMap({".priority":b},{".priority":p.PRIORITY_INDEX}))}return new i.ChildrenNode(m,r(t),l.IndexMap.Default)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(21),a=n(5),s=n(0),u=n(0),c=n(53),h=n(54),l=n(52),p=n(3),f=!0;t.nodeFromJSON=r,p.setNodeFromJSON(r)},function(e,t,n){"use strict";function r(e){switch(e){case p.RAW:case p.BASE64:case p.BASE64URL:case p.DATA_URL:return;default:throw"Expected one of the event types: ["+p.RAW+", "+p.BASE64+", "+p.BASE64URL+", "+p.DATA_URL+"]."}}function i(e,t){switch(e){case p.RAW:return new f(o(t));case p.BASE64:case p.BASE64URL:return new f(s(e,t));case p.DATA_URL:return new f(u(t),c(t))}throw l.s()}function o(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t.push(r);else if(r<=2047)t.push(192|r>>6,128|63&r);else if(55296==(64512&r)){var i=n<e.length-1&&56320==(64512&e.charCodeAt(n+1));if(i){var o=r,a=e.charCodeAt(++n);r=65536|(1023&o)<<10|1023&a,t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else t.push(239,191,189)}else 56320==(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function a(e){var t;try{t=decodeURIComponent(e)}catch(e){throw l.i(p.DATA_URL,"Malformed data URL.")}return o(t)}function s(e,t){switch(e){case p.BASE64:var n=-1!==t.indexOf("-"),r=-1!==t.indexOf("_");if(n||r){var i=n?"-":"_";throw l.i(e,"Invalid character '"+i+"' found: is it base64url encoded?")}break;case p.BASE64URL:var o=-1!==t.indexOf("+"),a=-1!==t.indexOf("/");if(o||a){var i=o?"+":"/";throw l.i(e,"Invalid character '"+i+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/")}var s;try{s=atob(t)}catch(t){throw l.i(e,"Invalid character found")}for(var u=new Uint8Array(s.length),c=0;c<s.length;c++)u[c]=s.charCodeAt(c);return u}function u(e){var t=new d(e);return t.base64?s(p.BASE64,t.rest):a(t.rest)}function c(e){return new d(e).contentType}function h(e,t){return!!(e.length>=t.length)&&e.substring(e.length-t.length)===t}n.d(t,"a",function(){return p}),t.c=r,t.b=i;var l=n(7),p={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},f=function(){function e(e,t){this.data=e,this.contentType=t||null}return e}(),d=function(){function e(e){this.base64=!1,this.contentType=null;var t=e.match(/^data:([^,]+)?,/);if(null===t)throw l.i(p.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=t[1]||null;null!=n&&(this.base64=h(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=e.substring(e.indexOf(",")+1)}return e}()},function(e,t,n){"use strict";function r(e){switch(e){case o.RUNNING:case o.PAUSING:case o.CANCELING:return a.RUNNING;case o.PAUSED:return a.PAUSED;case o.SUCCESS:return a.SUCCESS;case o.CANCELED:return a.CANCELED;case o.ERROR:default:return a.ERROR}}n.d(t,"b",function(){return i}),n.d(t,"a",function(){return o}
1),n.d(t,"c",function(){return a}),t.d=r;var i={STATE_CHANGED:"state_changed"},o={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},a={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(105),i=n(106),o=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new r.DOMStorageWrapper(t)}}catch(e){}return new i.MemoryStorage};t.PersistentStorage=o("localStorage"),t.SessionStorage=o("sessionStorage")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_VERSION="5",t.VERSION_PARAM="v",t.TRANSPORT_SESSION_PARAM="s",t.REFERER_PARAM="r",t.FORGE_REF="f",t.FORGE_DOMAIN="firebaseio.com",t.LAST_SESSION_PARAM="ls",t.WEBSOCKET="websocket",t.LONG_POLLING="long_polling"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(1),o=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new r.NamedNode(i.MIN_NAME,e),o=new r.NamedNode(i.MIN_NAME,t);return 0!==this.compare(n,o)},e.prototype.minPost=function(){return r.NamedNode.MIN},e}();t.Index=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(1),a=n(50),s=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,i.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),a.validatePriorityNode(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return r},set:function(e){r=e},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(i.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+a.priorityHashText(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?o.doubleToIEEE754String(this.value_):this.value_,this.lazyHash_=o.sha1(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(i.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,r=typeof this.value_,o=e.VALUE_TYPE_ORDER.indexOf(n),a=e.VALUE_TYPE_ORDER.indexOf(r);return i.assert(o>=0,"Unknown leaf type: "+n),i.assert(a>=0,"Unknown leaf type: "+r),o===a?"object"===r?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:a-o},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;
1if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();t.LeafNode=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}();t.SortedMapIterator=r;var i=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:a.EMPTY_NODE,this.right=null!=o?o:a.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r,i;return i=this,r=n(e,i.key),i=r<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===r?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return a.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()},e.prototype.remove=function(e,t){var n,r;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return a.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){var e;
1if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");if((e=this.left.check_())!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}();t.LLRBNode=i;var o=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new i(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}();t.LLRBEmptyNode=o;var a=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,i.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,i.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new r(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new r(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new r(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new r(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new o,e}();t.SortedMap=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(56),i=n(15),o=n(2),a=n(57),s=n(111),u=n(122),c=n(0),h=n(1),l=n(0),p=n(123),f=n(34),d=n(125),v=n(62),_=n(126),g=n(63),y=n(131),m=n(45),b=function(){function e(e,t,n){var r=this;this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new _.EventQueue,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new a.SparseSnapshotTree,this.persistentConnection_=null;var i=new p.AuthTokenProvider(n);if(this.stats_=f.StatsManager.getCollection(e),t||h.beingCrawled())this.server_=new y.ReadonlyRestClient(this.repoInfo_,this.onDataUpdate_.bind(this),i),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(void 0!==o&&null!==o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{c.stringify(o)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}this.persistentConnection_=new g.PersistentConnection(this.repoInfo_,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),i,o),this.server_=this.persistentConnection_}i.addTokenChangeListener(function(e){r.server_.refreshAuthToken(e)}),this.statsReporter_=f.StatsManager.getOrCreateReporter(e,function(){return new d.StatsReporter(r.stats_,r.server_)}),this.transactions_init_(),this.infoData_=new u.SnapshotHolder,this.infoSyncTree_=new s.SyncTree({startListening:function(e,t,n,i){var o=[],a=r.infoData_.getNode(e.path);return a.isEmpty()||(o=r.infoSyncTree_.applyServerOverwrite(e.path,a),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new s.SyncTree({startListening:function(e,t,n,i){return r.server_.listen(e,n,t,function(t,n){var o=i(t,n);r.eventQueue_.raiseEventsForChangedPath(e.path,o)}),[]},stopListening:function(e,t){r.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new o.Path(".info/serverTimeOffset")),t=e.val()||0;return(new Date).getTime()+t},e.prototype.generateServerValues=function(){return r.generateWithValues({timestamp:this.serverTime()})},e.prototype.onDataUpdate_=function(e,t,n,r){this.dataUpdateCount++;var a=new o.Path(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var s=[];if(r)if(n){var u=l.map(t,function(e){return i.nodeFromJSON(e)});s=this.serverSyncTree_.applyTaggedQueryMerge(a,u,r)}else{var c=i.nodeFromJSON(t);s=this.serverSyncTree_.applyTaggedQueryOverwrite(a,c,r)}else if(n){var h=l.map(t,function(e){return i.nodeFromJSON(e)});s=this.serverSyncTree_.applyServerMerge(a,h)}else{var p=i.nodeFromJSON(t);s=this.serverSyncTree_.applyServerOverwrite(a,p)}var f=a;s.length>0&&(f=this.rerunTransactions_(a)),this.eventQueue_.raiseEventsForChangedPath(f,s)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;h.each(e,function(e,n){t.updateInfo_(n,e)})},e.prototype.updateInfo_=function(e,t){var n=new o.Path("/.info/"+e),r=i.nodeFromJSON(t);this.infoData_.updateSnapshot(n,r);var a=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,a)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,o){var a=this;this.log_("set",{path:e.toString(),value:t,priority:n});var s=this.generateServerValues(),u=i.nodeFromJSON(t,n),c=r.resolveDeferredValueSnapshot(u,s),l=this.getNextWriteId_(),p=this.serverSyncTree_.applyUserOverwrite(e,c,l,!0);this.eventQueue_.queueEvents(p),this.server_.put(e.toString(),u.val(!0),function(t,n){var r="ok"===t;r||h.warn("set at "+e+" failed: "+t);var i=a.serverSyncTree_.ackUserWrite(l,!r);a.eventQueue_.raiseEventsForChangedPath(e,i),a.callOnCompleteCallback(o,t,n)});var f=this.abortTransactions_(e);this.rerunTransactions_(f),this.eventQueue_.raiseEventsForChangedPath(f,[])},e.prototype.update=function(e,t,n){var o=this;this.log_("update",{path:e.toString(),value:t});var a=!0,s=this.generateServerValues(),u={};if(l.forEach(t,function(e,t){a=!1;var n=i.nodeFromJSON(t);u[e]=r.resolveDeferredValueSnapshot(n,s)}),a)h.log("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var c=this.getNextWriteId_(),p=this.serverSyncTree_.applyUserMerge(e,u,c);this.eventQueue_.queueEvents(p),this.server_.merge(e.toString(),t,function(t,r){var i="ok"===t;i||h.warn("update at "+e+" failed: "+t);var a=o.serverSyncTree_.ackUserWrite(c,!i),s=a.length>0?o.rerunTransactions_(e):e;o.eventQueue_.raiseEventsForChangedPath(s,a),o.callOnCompleteCallback(n,t,r)}),l.forEach(t,function(t){var n=o.abortTransactions_(e.child(t));o.rerunTransactions_(n)}),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=r.resolveDeferredValueTree(this.onDisconnect_,t),i=[];
1n.forEachTree(o.Path.Empty,function(t,n){i=i.concat(e.serverSyncTree_.applyServerOverwrite(t,n));var r=e.abortTransactions_(t);e.rerunTransactions_(r)}),this.onDisconnect_=new a.SparseSnapshotTree,this.eventQueue_.raiseEventsForChangedPath(o.Path.Empty,i)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),function(r,i){"ok"===r&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,r,i)})},e.prototype.onDisconnectSet=function(e,t,n){var r=this,o=i.nodeFromJSON(t);this.server_.onDisconnectPut(e.toString(),o.val(!0),function(t,i){"ok"===t&&r.onDisconnect_.remember(e,o),r.callOnCompleteCallback(n,t,i)})},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var o=this,a=i.nodeFromJSON(t,n);this.server_.onDisconnectPut(e.toString(),a.val(!0),function(t,n){"ok"===t&&o.onDisconnect_.remember(e,a),o.callOnCompleteCallback(r,t,n)})},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(l.isEmpty(t))return h.log("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,function(o,a){"ok"===o&&l.forEach(t,function(t,n){var o=i.nodeFromJSON(n);r.onDisconnect_.remember(e.child(t),o)}),r.callOnCompleteCallback(n,o,a)})},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.statsListener_||(this.statsListener_=new v.StatsListener(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce(function(e,t){return Math.max(t.length,e)},0);l.forEach(t,function(e,t){for(var r=e.length;r<n+2;r++)e+=" ";console.log(e+t)})}},e.prototype.statsIncrementCounter=function(e){this.stats_.incrementCounter(e),this.statsReporter_.includeStat(e)},e.prototype.log_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),h.log.apply(void 0,[n].concat(e))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&h.exceptionGuard(function(){if("ok"==t)e(null);else{var r=(t||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,e(o)}})},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new m.Database(this))},enumerable:!0,configurable:!0}),e}();t.Repo=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(e.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var t=e.getFront();return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}();t.CacheNode=r},function(e,t,n){"use strict";var r={AVAILABLE_IN_WINDOW:"only-available-in-window",AVAILABLE_IN_SW:"only-available-in-sw",SHOULD_BE_INHERITED:"should-be-overriden",BAD_SENDER_ID:"bad-sender-id",INCORRECT_GCM_SENDER_ID:"incorrect-gcm-sender-id",PERMISSION_DEFAULT:"permission-default",PERMISSION_BLOCKED:"permission-blocked",UNSUPPORTED_BROWSER:"unsupported-browser",NOTIFICATIONS_BLOCKED:"notifications-blocked",FAILED_DEFAULT_REGISTRATION:"failed-serviceworker-registration",SW_REGISTRATION_EXPECTED:"sw-registration-expected",GET_SUBSCRIPTION_FAILED:"get-subscription-failed",INVALID_SAVED_TOKEN:"invalid-saved-token",SW_REG_REDUNDANT:"sw-reg-redundant",TOKEN_SUBSCRIBE_FAILED:"token-subscribe-failed",TOKEN_SUBSCRIBE_NO_TOKEN:"token-subscribe-no-token",TOKEN_SUBSCRIBE_NO_PUSH_SET:"token-subscribe-no-push-set",USE_SW_BEFORE_GET_TOKEN:"use-sw-before-get-token",INVALID_DELETE_TOKEN:"invalid-delete-token",DELETE_TOKEN_NOT_FOUND:"delete-token-not-found",DELETE_SCOPE_NOT_FOUND:"delete-scope-not-found",BG_HANDLER_FUNCTION_EXPECTED:"bg-handler-function-expected",NO_WINDOW_CLIENT_TO_MSG:"no-window-client-to-msg",UNABLE_TO_RESUBSCRIBE:"unable-to-resubscribe",NO_FCM_TOKEN_FOR_RESUBSCRIBE:"no-fcm-token-for-resubscribe",FAILED_TO_DELETE_TOKEN:"failed-to-delete-token",NO_SW_IN_REG:"no-sw-in-reg",BAD_SCOPE:"bad-scope",BAD_VAPID_KEY:"bad-va
1pid-key",BAD_SUBSCRIPTION:"bad-subscription",BAD_TOKEN:"bad-token",BAD_PUSH_SET:"bad-push-set",FAILED_DELETE_VAPID_KEY:"failed-delete-vapid-key"},i=(o={},o[r.AVAILABLE_IN_WINDOW]="This method is available in a Window context.",o[r.AVAILABLE_IN_SW]="This method is available in a service worker context.",o[r.SHOULD_BE_INHERITED]="This method should be overriden by extended classes.",o[r.BAD_SENDER_ID]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",o[r.PERMISSION_DEFAULT]="The required permissions were not granted and dismissed instead.",o[r.PERMISSION_BLOCKED]="The required permissions were not granted and blocked instead.",o[r.UNSUPPORTED_BROWSER]="This browser doesn't support the API's required to use the firebase SDK.",o[r.NOTIFICATIONS_BLOCKED]="Notifications have been blocked.",o[r.FAILED_DEFAULT_REGISTRATION]="We are unable to register the default service worker. {$browserErrorMessage}",o[r.SW_REGISTRATION_EXPECTED]="A service worker registration was the expected input.",o[r.GET_SUBSCRIPTION_FAILED]="There was an error when trying to get any existing Push Subscriptions.",o[r.INVALID_SAVED_TOKEN]="Unable to access details of the saved token.",o[r.SW_REG_REDUNDANT]="The service worker being used for push was made redundant.",o[r.TOKEN_SUBSCRIBE_FAILED]="A problem occured while subscribing the user to FCM: {$message}",o[r.TOKEN_SUBSCRIBE_NO_TOKEN]="FCM returned no token when subscribing the user to push.",o[r.TOKEN_SUBSCRIBE_NO_PUSH_SET]="FCM returned an invalid response when getting an FCM token.",o[r.USE_SW_BEFORE_GET_TOKEN]="You must call useServiceWorker() before calling getToken() to ensure your service worker is used.",o[r.INVALID_DELETE_TOKEN]="You must pass a valid token into deleteToken(), i.e. the token from getToken().",o[r.DELETE_TOKEN_NOT_FOUND]="The deletion attempt for token could not be performed as the token was not found.",o[r.DELETE_SCOPE_NOT_FOUND]="The deletion attempt for service worker scope could not be performed as the scope was not found.",o[r.BG_HANDLER_FUNCTION_EXPECTED]="The input to setBackgroundMessageHandler() must be a function.",o[r.NO_WINDOW_CLIENT_TO_MSG]="An attempt was made to message a non-existant window client.",o[r.UNABLE_TO_RESUBSCRIBE]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",o[r.NO_FCM_TOKEN_FOR_RESUBSCRIBE]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",o[r.FAILED_TO_DELETE_TOKEN]="Unable to delete the currently saved token.",o[r.NO_SW_IN_REG]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",o[r.INCORRECT_GCM_SENDER_ID]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",o[r.BAD_SCOPE]="The service worker scope must be a string with at least one character.",o[r.BAD_VAPID_KEY]="The public VAPID key must be a string with at least one character.",o[r.BAD_SUBSCRIPTION]="The subscription must be a valid PushSubscription.",o[r.BAD_TOKEN]="The FCM Token used for storage / lookup was not a valid token string.",o[r.BAD_PUSH_SET]="The FCM push set used for storage / lookup was not not a valid push set string.",o[r.FAILED_DELETE_VAPID_KEY]="The VAPID key could not be deleted.",o);t.a={codes:r,map:i};var o},function(e,t,n){"use strict";n.d(t,"f",function(){return r}),n.d(t,"g",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n.d(t,"c",function(){return s}),n.d(t,"d",function(){return u}),n.d(t,"e",function(){return c}),n.d(t,"h",function(){return h});var r="https://firebasestorage.googleapis.com",i="https://firebasestorage.googleapis.com",o="/v0",a="/v0",s="storageBucket",u=12e4,c=6e4,h=-9007199254740991},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(7),i=function(){function e(e,t){this.bucket=e,this.path_=t}return Object.defineProperty(e.prototype,"path",{get:function(){return this.path_},enumerable:!0,configurable:!0}),e.prototype.fullServerUrl=function(){var e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)},e.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},e.makeFromBucketSpec=function(t){var n;try{n=e.makeFromUrl(t)}catch(n){return new e(t,"")}if(""===n.path)return n;throw r.h(t)},e.makeFromUrl=function(t){function n(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}function i(e){e.path_=decodeURIComponent(e.path)}for(var o=null,a=new RegExp("^gs://([A-Za-z0-9.\\-]+)(/(.*))?$","i"),s={bucket:1,path:3},u=new RegExp("^https?://firebasestorage\\.googleapis\\.com/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-]+)/o(/([^?#]*).*)?$","i"),c={bucket:1,path:3},h=[{regex:a,indices:s,postModify:n},{regex:u,indices:c,postModify:i}],l=0;l<h.length;l++){var p=h[l],f=p.regex.exec(t);if(f){var d=f[p.indices.bucket],v=f[p.indices.path];v||(v=""),o=new e(d,v),p.postModify(o);break}}if(null==o)throw r.k(t);return o},e}()},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTANTS={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(48),o=n(107),a=n(1),s=n(108),u=n(49),c=n(23),h=n(2),l=n(132),p=n(9),f=n(0),d=n(0),v=n(60),_=function(e){function t(t,n){if(!(t instanceof c.Repo))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,l.QueryParams.DEFAULT,!1)||this}return r(t,e),t.prototype.getKey=function(){return f.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return f.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e=String(e):e instanceof h.Path||(null===this.path.getFront()?p.validateRootPathString("Reference.child",1,e,!1):p.validatePathString("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){f.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){f.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){f.validateArgCount("Reference.set",1,2,arguments.length),p.validateWritablePath("Reference.set",this.path),p.validateFirebaseDataArg("Reference.set",1,e,this.path,!1),f.validateCallback("Reference.set",2,t,!0);var n=new d.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(f.validateArgCount("Reference.update",1,2,arguments.length),p.validateWritablePath("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,a.warn("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}p.validateFirebaseMergeDataArg("Reference.update",1,e,this.path,!1),f.validateCallback("Reference.update",2,t,!0);var i=new d.Deferred;return this.repo.update(this.path,e,i.wrapCallback(t)),i.promise},t.prototype.setWithPriority=function(e,t,n){if(f.validateArgCount("Reference.setWithPriority",2,3,arguments.length),p.validateWritablePath("Reference.setWithPriority",this.path),p.validateFirebaseDataArg("Reference.setWithPriority",1,e,this.path,!1),p.validatePriority("Reference.setWithPriority",2,t,!1),f.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new d.Deferred;return this.repo.setWithPriority(this.path,e,t,r.wrapCallback(n)),r.promise},t.prototype.remove=function(e){return f.validateArgCount("Reference.remove",0,1,arguments.length),p.validateWritablePath("Reference.remove",this.path),f.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(f.validateArgCount("Reference.transaction",1,3,arguments.length),p.validateWritablePath("Reference.transaction",this.path),f.validateCallback("Reference.transaction",1,e,!1),f.validateCallback("Reference.transaction",2,t,!0),p.validateBoolean("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new d.Deferred;"function"==typeof t&&r.promise.catch(function(){});var i=function(e,n,i){e?r.reject(e):r.resolve(new o.TransactionResult(n,i)),"function"==typeof t&&t(e,n,i)};return this.repo.startTransaction(this.path,e,i,n),r.promise},t.prototype.setPriority=function(e,t){f.validateArgCount("Reference.setPriority",1,2,arguments.length),p.validateWritablePath("Reference.setPriority",this.path),p.validatePriority("Reference.setPriority",1,e,!1),f.validateCallback("Reference.setPriority",2,t,!0);var n=new d.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){f.validateArgCount("Reference.push",0,2,arguments.length),p.validateWritablePath("Reference.push",this.path),p.validateFirebaseDataArg("Reference.push",1,e,this.path,!0),f.validateCallback("Reference.push",2,t,!0);var n,r=this.repo.serverTime(),i=s.nextPushId(r),o=this.child(i),a=this.child(i);return n=null!=e?o.set(e,t).then(function(){return a}):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof t&&n.catch(function(){}),o},t.prototype.onDisconnect=function(){return p.validateWritablePath("Reference.onDisconnect",this.path),new i.O
1nDisconnect(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),t}(u.Query);t.Reference=_,u.Query.__referenceConstructor=_,v.SyncPoint.__referenceConstructor=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(2),a=n(3),s=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return r.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return r.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return r.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return r.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){r.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),i.validatePathString("DataSnapshot.child",1,t,!1);var n=new o.Path(t),s=this.ref_.child(n);return new e(this.node_.getChild(n),s,a.PRIORITY_INDEX)},e.prototype.hasChild=function(e){r.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),i.validatePathString("DataSnapshot.hasChild",1,e,!1);var t=new o.Path(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return r.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;return r.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),r.validateCallback("DataSnapshot.forEach",1,t,!1),!this.node_.isLeafNode()&&!!this.node_.forEachChild(this.index_,function(r,i){return t(new e(i,n.ref_.child(r),a.PRIORITY_INDEX))})},e.prototype.hasChildren=function(){return r.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),e.prototype.numChildren=function(){return r.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return r.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}();t.DataSnapshot=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(22),o=n(2),a=n(1),s=n(0),u=function(){return r||(r=new i.SortedMap(a.stringCompare)),r},c=function(){function e(e,t){void 0===t&&(t=u()),this.value=e,this.children=t}return e.fromObject=function(t){var n=e.Empty;return s.forEach(t,function(e,t){n=n.set(new o.Path(e),t)}),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:o.Path.Empty,value:this.value};if(e.isEmpty())return null;var n=e.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(e.popFront(),t);return null!=i?{path:new o.Path(n).child(i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,function(){return!0})},e.prototype.subtree=function(t){if(t.isEmpty())return this;var n=t.getFront(),r=this.children.get(n);return null!==r?r.subtree(t.popFront()):e.Empty},e.prototype.set=function(t,n){if(t.isEmpty())return new e(n,this.children);var r=t.getFront(),i=this.children.get(r)||e.Empty,o=i.set(t.popFront(),n),a=this.children.insert(r,o);return new e(this.value,a)},e.prototype.remove=function(t){if(t.isEmpty())return this.children.isEmpty()?e.Empty:new e(null,this.children);var n=t.getFront(),r=this.children.get(n);if(r){var i=r.remove(t.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?e.Empty:new e(this.value,o)}return this},e.prototype.get=function(e){if(e.isEmpty())return this.value;var t=e.getFront(),n=this.children.get(t);return n?n.get(e.popFront()):null},e.prototype.setTree=function(t,n){if(t.isEmpty())return n;var r=t.getFront(),i=this.children.get(r)||e.Empty,o=i.setTree(t.popFront(),n),a=void 0;return a=o.isEmpty()?this.children.remove(r):this.children.insert(r,o),new e(this.value,a)},e.prototype.fold=function(e){return this.fold_(o.Path.Empty,e)}
1,e.prototype.fold_=function(e,t){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.fold_(e.child(r),t)}),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,o.Path.Empty,t)},e.prototype.findOnPath_=function(e,t,n){var r=!!this.value&&n(t,this.value);if(r)return r;if(e.isEmpty())return null;var i=e.getFront(),o=this.children.get(i);return o?o.findOnPath_(e.popFront(),t.child(i),n):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,o.Path.Empty,t)},e.prototype.foreachOnPath_=function(t,n,r){if(t.isEmpty())return this;this.value&&r(n,this.value);var i=t.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(t.popFront(),n.child(i),r):e.Empty},e.prototype.foreach=function(e){this.foreach_(o.Path.Empty,e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal(function(n,r){r.foreach_(e.child(n),t)}),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal(function(t,n){n.value&&e(t,n.value)})},e.Empty=new e(null),e}();t.ImmutableTree=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(12),o=n(4),a=n(3),s=function(){function e(e){this.index_=e}return e.prototype.updateChild=function(e,t,n,o,a,s){r.assert(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");var u=e.getImmediateChild(t);return u.getChild(o).equals(n.getChild(o))&&u.isEmpty()==n.isEmpty()?e:(null!=s&&(n.isEmpty()?e.hasChild(t)?s.trackChildChange(i.Change.childRemovedChange(t,u)):r.assert(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):u.isEmpty()?s.trackChildChange(i.Change.childAddedChange(t,n)):s.trackChildChange(i.Change.childChangedChange(t,n,u))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(a.PRIORITY_INDEX,function(e,r){t.hasChild(e)||n.trackChildChange(i.Change.childRemovedChange(e,r))}),t.isLeafNode()||t.forEachChild(a.PRIORITY_INDEX,function(t,r){if(e.hasChild(t)){var o=e.getImmediateChild(t);o.equals(r)||n.trackChildChange(i.Change.childChangedChange(t,r,o))}else n.trackChildChange(i.Change.childAddedChange(t,r))})),t.withIndex(this.index_)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?o.ChildrenNode.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.index_},e}();t.IndexedFilter=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(124),i=function(){function e(){}return e.getCollection=function(e){var t=e.toString();return this.collections_[t]||(this.collections_[t]=new r.StatsCollection),this.collections_[t]},e.getOrCreateReporter=function(e,t){var n=e.toString();return this.reporters_[n]||(this.reporters_[n]=t()),this.reporters_[n]},e.collections_={},e.reporters_={},e}();t.StatsManager=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(23),o=n(1),a=n(46),s=n(9);n(134);var u,c=function(){function e(){this.repos_={},this.useRestClient_=!1}return e.getInstance=function(){return u||(u=new e),u},e.prototype.interrupt=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].interrupt()},e.prototype.resume=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].resume()},e.prototype.databaseFromApp=function(e,t){var n=t||e.options.databaseURL;void 0===n&&o.fatal("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var r=a.parseRepoInfo(n),i=r.repoInfo;return s.validateUrl("Invalid Firebase Database URL",1,r),r.path.isEmpty()||o.fatal("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(i,e).database},e.prototype.deleteRepo=function(e){var t=r.safeGet(this.repos_,e.app.name);t&&r.safeGet(t,e.repoInfo_.toURLString())===e||o.fatal("Database "+e.app.name+"("+e.repoInfo_+") has already been deleted."),e.interrupt(),delete t[e.repoInfo_.toURLString()]},e.prototype.createRepo=function(e,t){var n=r.safeGet(this.repos_,t.name);n||(n={},this.repos_[t.name]=n);var a=r.safeGet(n,e.toURLString());return a&&o.fatal("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),a=new i.Repo(e,this.useRestClient_,t),n[e.toURLString()]=a,a},e.prototype.forceRestClient=function(e){this.useRestClient_=e},e}();t.RepoManager=c},function(e,t,n){"use strict";function r(e,t,n){for(var r=t.length,i=t.length,o=0;o<t.length;o++)if(t[o].optional){r=o;break}if(!(r<=n.length&&n.length<=i))throw l.g(r,i,e,n.length);for(var o=0;o<n.length;o++)try{t[o].validator(n[o])}catch(t){throw t instanceof Error?l.f(o,e,t.message):l.f(o,e,t)}}function i(e,t){return function(n){e(n),t(n)}}function o(e,t){function n(e){if(!f.j(e))throw"Expected string."}var r;return r=e?i(n,e):n,new d(r,t)}function a(){function e(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||f.e()&&e instanceof Blob))throw"Expected Blob or File."}return new d(e)}function s(e){return new d(p.c,e)}function u(){function e(e){if(!(f.h(e)&&e>=0))throw"Expected a number 0 or greater."}return new d(e)}function c(e,t){function n(t){if(!(null===t||f.a(t)&&t instanceof Object))throw"Expected an Object.";void 0!==e&&null!==e&&e(t)}return new d(n,t)}function h(e){function t(e){if(null!==e&&!f.b(e))throw"Expected a Function."}return new d(t,e)}t.g=r,t.e=o,t.f=a,t.b=s,t.c=u,t.a=c,t.d=h;var l=n(7),p=n(37),f=n(6),d=function(){function e(e,t){var n=this;this.validator=function(t){n.optional&&!f.c(t)||e(t)},this.optional=!!t}return e}()},function(e,t,n){"use strict";function r(e,t){return t}function i(e){return!d.j(e)||e.length<2?e:(e=e,f.b(e))}function o(){function e(e,t){return i(t)}function t(e,t){return d.a(t)?+t:t}function n(e,t){if(!(d.j(t)&&t.length>0))return[];var n=encodeURIComponent;return t.split(",").map(function(t){var r=e.bucket,i=e.fullPath,o="/b/"+n(r)+"/o/"+n(i);return v.a(o)+v.c({alt:"media",token:t})})}if(g)return g;var r=[];r.push(new _("bucket")),r.push(new _("generation")),r.push(new _("metageneration")),r.push(new _("name","fullPath",!0));var o=new _("name");
1o.xform=e,r.push(o);var a=new _("size");return a.xform=t,r.push(a),r.push(new _("timeCreated")),r.push(new _("updated")),r.push(new _("md5Hash",null,!0)),r.push(new _("cacheControl",null,!0)),r.push(new _("contentDisposition",null,!0)),r.push(new _("contentEncoding",null,!0)),r.push(new _("contentLanguage",null,!0)),r.push(new _("contentType",null,!0)),r.push(new _("metadata","customMetadata",!0)),r.push(new _("downloadTokens","downloadURLs",!1,n)),g=r}function a(e,t){function n(){var n=e.bucket,r=e.fullPath,i=new p.a(n,r);return t.makeStorageReference(i)}Object.defineProperty(e,"ref",{get:n})}function s(e,t,n){var r={};r.type="file";for(var i=n.length,o=0;o<i;o++){var s=n[o];r[s.local]=s.xform(r,t[s.server])}return a(r,e),r}function u(e,t,n){var r=l.a(t);return null===r?null:s(e,r,n)}function c(e,t){for(var n={},r=t.length,i=0;i<r;i++){var o=t[i];o.writable&&(n[o.server]=e[o.local])}return JSON.stringify(n)}function h(e){if(!e||!d.i(e))throw"Expected Metadata object.";for(var t in e){var n=e[t];if("customMetadata"===t){if(!d.i(n))throw"Expected object for 'customMetadata' mapping."}else if(d.g(n))throw"Mapping for '"+t+"' cannot be an object."}}t.b=o,t.a=u,t.d=c,t.c=h;var l=n(149),p=n(27),f=n(76),d=n(6),v=n(38),_=function(){function e(e,t,n,i){this.server=e,this.local=t||e,this.writable=!!n,this.xform=i||r}return e}(),g=null},function(e,t,n){"use strict";function r(e){return s.f+s.a+e}function i(e){return s.g+s.a+e}function o(e){return s.f+s.b+e}function a(e){var t=encodeURIComponent,n="?";return u.b(e,function(e,r){var i=t(e)+"="+t(r);n=n+i+"&"}),n=n.slice(0,-1)}t.b=r,t.a=i,t.d=o,t.c=a;var s=n(26),u=n(13)},function(e,t,n){"use strict";function r(e,t){return-1!==e.indexOf(t)}function i(e){return Array.prototype.slice.call(e)}function o(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}t.b=r,t.a=i,t.c=o},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(h===setTimeout)return setTimeout(e,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function o(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){v&&f&&(v=!1,f.length?d=f.concat(d):_=-1,d.length&&s())}function s(){if(!v){var e=i(a);v=!0;for(var t=d.length;t;){for(f=d,d=[];++_<t;)f&&f[_].run();_=-1,t=d.length}f=null,v=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var h,l,p=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(e){h=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var f,d=[],v=!1,_=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new u(e,t)),1!==d.length||v||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(29);t.assert=function(e,n){if(!e)throw t.assertionError(n)},t.assertionError=function(e){return new Error("Firebase Database ("+r.CONSTANTS.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},i=function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var o=e[n++],a=e[n++],s=e[n++],u=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&s)-65536;t[r++]=String.fromCharCode(55296+(u>>10)),t[r++]=String.fromCharCode(56320+(1023&u))}else{var o=e[n++],a=e[n++];
1t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return t.join("")};t.base64={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<e.length;i+=3){var o=e[i],a=i+1<e.length,s=a?e[i+1]:0,u=i+2<e.length,c=u?e[i+2]:0,h=o>>2,l=(3&o)<<4|s>>4,p=(15&s)<<2|c>>6,f=63&c;u||(f=64,a||(p=64)),r.push(n[h],n[l],n[p],n[f])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(r(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):i(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<e.length;){var o=n[e.charAt(i++)],a=i<e.length,s=a?n[e.charAt(i)]:0;++i;var u=i<e.length,c=u?n[e.charAt(i)]:64;++i;var h=i<e.length,l=h?n[e.charAt(i)]:64;if(++i,null==o||null==s||null==c||null==l)throw Error();var p=o<<2|s>>4;if(r.push(p),64!=c){var f=s<<4&240|c>>2;if(r.push(f),64!=l){var d=c<<6&192|l;r.push(d)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},t.base64Encode=function(e){var n=r(e);return t.base64.encodeByteArray(n,!0)},t.base64Decode=function(e){try{return t.base64.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}},function(e,t,n){"use strict";function r(e){return JSON.parse(e)}function i(e){return JSON.stringify(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.jsonEval=r,t.stringify=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.forEach=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},t.extend=function(e,n){return t.forEach(n,function(t,n){e[t]=n}),e},t.clone=function(e){return t.extend({},e)},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.map=function(e,t,n){var r={};for(var i in e)r[i]=t.call(n,e[i],i,e);return r},t.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},t.findValue=function(e,n,r){var i=t.findKey(e,n,r);return i&&e[i]},t.getAnyKey=function(e){for(var t in e)return t},t.getValues=function(e){var t=[],n=0;for(var r in e)t[n++]=e[r];return t},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(46),o=n(2),a=n(30),s=n(23),u=n(35),c=n(0),h=n(9),l=function(){function e(e){this.repo_=e,e instanceof s.Repo||r.fatal("Don't call new Database() directly - please use firebase.database()."),this.root_=new a.Reference(e,o.Path.Empty),this.INTERNAL=new p(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),e.prototype.ref=function(e){return this.checkDeleted_("ref"),c.validateArgCount("database.ref",0,1,arguments.length),void 0!==e?this.root_.child(e):this.root_},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.checkDeleted_(t),c.validateArgCount(t,1,1,arguments.length);var n=i.parseRepoInfo(e);h.validateUrl(t,1,n);var o=n.repoInfo;return o.host!==this.repo_.repoInfo_.host&&r.fatal(t+": Host name does not match the current database: (found "+o.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},e.prototype.checkDeleted_=function(e){null===this.repo_&&r.fatal("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){c.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},e.prototype.goOnline=function(){c.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"}},e}();t.Database=l;var p=function(){function e(e){this.database=e}return e.prototype.delete=function(){return this.database.checkDeleted_("delete"),u.RepoManager.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,Promise.resolve()},e}();t.DatabaseInternals=p},function(e,t,n){"use strict";function r(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(e){}t+="/"+i}return t}
1Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(47),a=n(1);t.parseRepoInfo=function(e){var n=t.parseURL(e),r=n.subdomain;"firebase"===n.domain&&a.fatal(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!=r||a.fatal("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||a.warnIfPageIsSecure();var s="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new o.RepoInfo(n.host,n.secure,r,s),path:new i.Path(n.pathString)}},t.parseURL=function(e){var t="",n="",i="",o="",a=!0,s="https",u=443;if("string"==typeof e){var c=e.indexOf("//");c>=0&&(s=e.substring(0,c-1),e=e.substring(c+2));var h=e.indexOf("/");-1===h&&(h=e.length),t=e.substring(0,h),o=r(e.substring(h));var l=t.split(".");3===l.length?(n=l[1],i=l[0].toLowerCase()):2===l.length&&(n=l[0]),(c=t.indexOf(":"))>=0&&(a="https"===s||"wss"===s,u=parseInt(t.substring(c+1),10))}return{host:t,port:u,domain:n,subdomain:i,secure:a,scheme:s,pathString:o}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(18),a=n(19),s=function(){function e(e,t,n,r,i){void 0===i&&(i=""),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=o.PersistentStorage.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&o.PersistentStorage.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){r.assert("string"==typeof e,"typeof type must == string"),r.assert("object"==typeof t,"typeof params must == object");var n;if(e===a.WEBSOCKET)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(e!==a.LONG_POLLING)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var o=[];return i.forEach(t,function(e,t){o.push(e+"="+t)}),n+o.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();t.RepoInfo=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(1),a=n(0),s=function(){function e(e,t){this.repo_=e,this.path_=t}return e.prototype.cancel=function(e){r.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),r.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new a.Deferred;return this.repo_.onDisconnectCancel(this.path_,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){r.validateArgCount("OnDisconnect.remove",0,1,arguments.length),i.validateWritablePath("OnDisconnect.remove",this.path_),r.validateCallback("OnDisconnect.remove",1,e,!0);var t=new a.Deferred;return this.repo_.onDisconnectSet(this.path_,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){r.validateArgCount("OnDisconnect.set",1,2,arguments.length),i.validateWritablePath("OnDisconnect.set",this.path_),i.validateFirebaseDataArg("OnDisconnect.set",1,e,this.path_,!1),r.validateCallback("OnDisconnect.set",2,t,!0);var n=new a.Deferred;return this.repo_.onDisconnectSet(this.path_,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){r.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),i.validateWritablePath("OnDisconnect.setWithPriority",this.path_),i.validateFirebaseDataArg("OnDisconnect.setWithPriority",1,e,this.path_,!1),i.validatePriority("OnDisconnect.setWithPriority",2,t,!1),r.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var o=new a.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,e,t,o.wrapCallback(n)),o.promise},e.prototype.update=function(e,t){if(r.validateArgCount("OnDisconnect.update",1,2,arguments.length),i.val
1idateWritablePath("OnDisconnect.update",this.path_),Array.isArray(e)){for(var n={},s=0;s<e.length;++s)n[""+s]=e[s];e=n,o.warn("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}i.validateFirebaseMergeDataArg("OnDisconnect.update",1,e,this.path_,!1),r.validateCallback("OnDisconnect.update",2,t,!0);var u=new a.Deferred;return this.repo_.onDisconnectUpdate(this.path_,e,u.wrapCallback(t)),u.promise},e}();t.OnDisconnect=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(14),a=n(3),s=n(51),u=n(55),c=n(1),h=n(2),l=n(9),p=n(0),f=n(109),d=n(0),v=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return i.assert(r,"Reference.ts has not been loaded"),r},set:function(e){r=e},enumerable:!0,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===o.KEY_INDEX){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",h="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!=c.MIN_NAME)throw new Error(r);if("string"!=typeof t)throw new Error(h)}if(e.hasEnd()){if(e.getIndexEndName()!=c.MAX_NAME)throw new Error(r);if("string"!=typeof n)throw new Error(h)}}else if(e.getIndex()===a.PRIORITY_INDEX){if(null!=t&&!l.isValidPriority(t)||null!=n&&!l.isValidPriority(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(i.assert(e.getIndex()instanceof u.PathIndex||e.getIndex()===s.VALUE_INDEX,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return p.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){p.validateArgCount("Query.on",2,4,arguments.length),l.validateEventType("Query.on",1,t,!1),p.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new f.ValueEventRegistration(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new f.ChildEventRegistration(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){p.validateArgCount("Query.off",0,3,arguments.length),l.validateEventType("Query.off",1,e,!0),p.validateCallback("Query.off",2,t,!0),p.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new f.ValueEventRegistration(o,null,n||null)}else e&&(t&&(i={},i[e]=t),r=new f.ChildEventRegistration(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;p.validateArgCount("Query.once",1,4,arguments.length),l.validateEventType("Query.once",1,t,!1),p.validateCallback("Query.once",2,n,!0);var a=e.getCancelAndContextArgs_("Query.once",r,i),s=!0,u=new d.Deferred;u.promise.catch(function(){});var c=function(e){s&&(s=!1,o.off(t,c),n&&n.bind(a.context)(e),u.resolve(e))};return this.on(t,c,function(e){o.off(t,c),a.cancel&&a.cancel.bind(a.context)(e),u.reject(e)}),u.promise},e.prototype.limitToFirst=function(t){if(p.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set
1(by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(p.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(p.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');l.validatePathString("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new h.Path(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new u.PathIndex(n),i=this.queryParams_.orderBy(r);return e.validateQueryEndpoints_(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){p.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(o.KEY_INDEX);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){p.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(a.PRIORITY_INDEX);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){p.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(s.VALUE_INDEX);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),p.validateArgCount("Query.startAt",0,2,arguments.length),l.validateFirebaseDataArg("Query.startAt",1,t,this.path,!0),l.validateKey("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),p.validateArgCount("Query.endAt",0,2,arguments.length),l.validateFirebaseDataArg("Query.endAt",1,t,this.path,!0),l.validateKey("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(p.validateArgCount("Query.equalTo",1,2,arguments.length),l.validateFirebaseDataArg("Query.equalTo",1,e,this.path,!1),l.validateKey("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return p.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return p.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=c.ObjectToUniqueKey(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(p.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e))throw new Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.");var n=this.repo===t.repo,r=this.path.equals(t.path),i=this.queryIdentifier()===t.queryIdentifier();return n&&r&&i},e.getCancelAndContextArgs_=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,p.validateCallback(e,3,r.cancel,!0),r.context=n,p.validateContextObject(e,4,r.context,!0);else if(t)if("object"==typeof t&&null!==t)r.context=t;else{if("function"!=typeof t)throw new Error(p.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}();t.Query=v},function(e,t,n){"use strict";function r(e){i=e}
1Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(0),a=n(1),s=n(0);t.setMaxNode=r,t.priorityHashText=function(e){return"number"==typeof e?"number:"+a.doubleToIEEE754String(e):"string:"+e},t.validatePriorityNode=function(e){if(e.isLeafNode()){var t=e.val();o.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&s.contains(t,".sv"),"Priority must be a string or number.")}else o.assert(e===i||e.isEmpty(),"priority of unexpected type.");o.assert(e===i||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(20),o=n(5),a=n(1),s=n(15),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?a.nameCompare(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return o.NamedNode.MIN},t.prototype.maxPost=function(){return o.NamedNode.MAX},t.prototype.makePost=function(e,t){var n=s.nodeFromJSON(e);return new o.NamedNode(t,n)},t.prototype.toString=function(){return".value"},t}(i.Index);t.ValueIndex=u,t.VALUE_INDEX=new u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(53),a=n(0),s=n(5),u=n(3),c=n(14),h={},l=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return i.assert(h&&u.PRIORITY_INDEX,"ChildrenNode.ts has not been loaded"),r=r||new e({".priority":h},{".priority":u.PRIORITY_INDEX})},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=a.safeGet(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t===h?null:t},e.prototype.hasIndex=function(e){return a.contains(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){i.assert(t!==c.KEY_INDEX,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r=[],u=!1,l=n.getIterator(s.NamedNode.Wrap),p=l.getNext();p;)u=u||t.isDefinedOn(p.node),r.push(p),p=l.getNext();var f;f=u?o.buildChildSet(r,t.getCompare()):h;var d=t.toString(),v=a.clone(this.indexSet_);v[d]=t;var _=a.clone(this.indexes_);return _[d]=f,new e(_,v)},e.prototype.addToIndexes=function(t,n){var r=this;return new e(a.map(this.indexes_,function(e,u){var c=a.safeGet(r.indexSet_,u);if(i.assert(c,"Missing index implementation for "+u),e===h){if(c.isDefinedOn(t.node)){for(var l=[],p=n.getIterator(s.NamedNode.Wrap),f=p.getNext();f;)f.name!=t.name&&l.push(f),f=p.getNext();return l.push(t),o.buildChildSet(l,c.getCompare())}return h}var d=n.get(t.name),v=e;return d&&(v=v.remove(new s.NamedNode(t.name,d))),v.insert(t,t.node)}),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e(a.map(this.indexes_,function(e){if(e===h)return e;var r=n.get(t.name);return r?e.remove(new s.NamedNode(t.name,r)):e}),this.indexSet_)},e}();t.IndexMap=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),i=n(22),o=Math.log(2),a=function(){function e(e){this.count=function(e){return parseInt(Math.log(e)/o,10)}(e+1),this.current_=this.count-1;var t=function(e){return parseInt(Array(e+1).join("1"),2)}(this.count);this.bits_=e+1&t}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}();t.buildChildSet=function(e,t,n,o){e.sort(t);var s=function(t,i){var o,a,u=i-t;if(0==u)return null;if(1==u)return o=e[t],a=n?n(o):o,new r.LLRBNode(a,o.node,r.LLRBNode.BLACK,null,null);var c=parseInt(u/2,10)+t,h=s(t,c),l=s(c+1,i);return o=e[c],a=n?n(o):o,new r.LLRBNode(a,o.node,r.LLRBNode.BLACK,h,l)},u=new a(e.length),c=function(t){for(var i=null,o=null,a=e.length,u=function(t,i){var o=a-t,u=a;a-=t;var h=s(o+1,u),l=e[o],p=n?n(l):l;c(new r.LLRBNode(p,l.node,i,null,h))},c=function(e){i?(i.left=e,i=e):(o=e,i=e)},h=0;h<t.count;++h){var l=t.nextBitIsOne(),p=Math.pow(2,t.count-(h+1));l?u(p,r.LLRBNode.BLACK):(u(p,r.LLRBNode.BLACK),u(p,r.LLRBNode.RED))}return o}(u);return new i.SortedMap(o||t,c)}},function(e,t,n){"use strict";function r(e,t){return o.nameCompare(e.name,t.name)}function i(e,t){return o.nameCompare(e,t)}
1Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);t.NAME_ONLY_COMPARATOR=r,t.NAME_COMPARATOR=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),a=n(20),s=n(4),u=n(5),c=n(15),h=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,i.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return r(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?o.nameCompare(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=c.nodeFromJSON(e),r=s.ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_,n);return new u.NamedNode(t,r)},t.prototype.maxPost=function(){var e=s.ChildrenNode.EMPTY_NODE.updateChild(this.indexPath_,s.MAX_NODE);return new u.NamedNode(o.MAX_NAME,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(a.Index);t.PathIndex=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(57),a=n(21),s=n(15),u=n(3);t.generateWithValues=function(e){return e=e||{},e.timestamp=e.timestamp||(new Date).getTime(),e},t.resolveDeferredValue=function(e,t){return e&&"object"==typeof e?(r.assert(".sv"in e,"Unexpected leaf node or priority contents"),t[e[".sv"]]):e},t.resolveDeferredValueTree=function(e,n){var r=new o.SparseSnapshotTree;return e.forEachTree(new i.Path(""),function(e,i){r.remember(e,t.resolveDeferredValueSnapshot(i,n))}),r},t.resolveDeferredValueSnapshot=function(e,n){var r,i=e.getPriority().val(),o=t.resolveDeferredValue(i,n);if(e.isLeafNode()){var c=e,h=t.resolveDeferredValue(c.getValue(),n);return h!==c.getValue()||o!==c.getPriority().val()?new a.LeafNode(h,s.nodeFromJSON(o)):e}var l=e;return r=l,o!==l.getPriority().val()&&(r=r.updatePriority(new a.LeafNode(o))),l.forEachChild(u.PRIORITY_INDEX,function(e,i){var o=t.resolveDeferredValueSnapshot(i,n);o!==i&&(r=r.updateImmediateChild(e,o))}),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(3),o=n(58),a=function(){function e(){this.value_=null,this.children_=null}return e.prototype.find=function(e){if(null!=this.value_)return this.value_.getChild(e);if(e.isEmpty()||null==this.children_)return null;var t=e.getFront();return e=e.popFront(),this.children_.contains(t)?this.children_.get(t).find(e):null},e.prototype.remember=function(t,n){if(t.isEmpty())this.value_=n,this.children_=null;else if(null!==this.value_)this.value_=this.value_.updateChild(t,n);else{null==this.children_&&(this.children_=new o.CountedSet);var r=t.getFront();this.children_.contains(r)||this.children_.add(r,new e);var i=this.children_.get(r);t=t.popFront(),i.remember(t,n)}},e.prototype.forget=function(e){if(e.isEmpty())return this.value_=null,this.children_=null,!0;if(null!==this.value_){if(this.value_.isLeafNode())return!1;var t=this.value_;this.value_=null;var n=this;return t.forEachChild(i.PRIORITY_INDEX,function(e,t){n.remember(new r.Path(e),t)}),this.forget(e)}if(null!==this.children_){var o=e.getFront();return e=e.popFront(),this.children_.contains(o)&&this.children_.get(o).forget(e)&&this.children_.remove(o),!!this.children_.isEmpty()&&(this.children_=null,!0)}return!0},e.prototype.forEachTree=function(e,t){null!==this.value_?t(e,this.value_):this.forEachChild(function(n,i){var o=new r.Path(e.toString()+"/"+n);i.forEachTree(o,t)})},e.prototype.forEachChild=function(e){null!==this.children_&&this.children_.each(function(t,n){e(t,n)})},e}();t.SparseSnapshotTree=a},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.set={}}return e.prototype.add=function(e,t){this.set[e]=null===t||t},e.prototype.contains=function(e){return r.contains(this.set,e)},e.prototype.get=function(e){return this.contains(e)?this.set[e]:void 0},e.prototype.remove=function(e){delete this.set[e]},e.prototype.clear=function(){this.set={}},e.prototype.isEmpty=function(){return r.isEmpty(this.set)},e.prototype.count=function(){return r.getCount(this.set)},e.prototype.each=function(e){r.forEach(this.set,function(t,n){return e(t,n)})},e.prototype.keys=function(){var e=[];return r.forEach(this.set,function(t){e.push(t)}),e},e}();t.CountedSet=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(2),o=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=r.OperationType.OVERWRITE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,i.Path.Empty,this.snap.getImmediateChild(t)):new e(this.source,this.path.popFront(),this.snap)},e}();t.Overwrite=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(24),o=n(4),a=n(0),s=n(0),u=n(61),c=n(115),h=function(){function e(){this.views_={}}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return a.assert(r,"Reference.ts has not been loaded"),r},set:function(e){a.assert(!r,"__referenceConstructor has already been defined"),r=e},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return s.isEmpty(this.views_)},e.prototype.applyOperation=function(e,t,n){var r=e.source.queryId;if(null!==r){var i=s.safeGet(this.views_,r);return a.assert(null!=i,"SyncTree gave us an op for an invalid query."),i.applyOperation(e,t,n)}var o=[];return s.forEach(this.views_,function(r,i){o=o.concat(i.applyOperation(e,t,n))}),o},e.prototype.addEventRegistration=function(e,t,n,r,a){var h=e.queryIdentifier(),l=s.safeGet(this.views_,h);if(!l){var p=n.calcCompleteEventCache(a?r:null),f=!1;p?f=!0:r instanceof o.ChildrenNode?(p=n.calcCompleteEventChildren(r),f=!1):(p=o.ChildrenNode.EMPTY_NODE,f=!1);var d=new u.ViewCache(new i.CacheNode(p,f,!1),new i.CacheNode(r,a,!1));l=new c.View(e,d),this.views_[h]=l}return l.addEventRegistration(t),l.getInitialEvents(t)},e.prototype.removeEventRegistration=function(t,n,r){var i=t.queryIdentifier(),o=[],a=[],u=this.hasCompleteView();if("default"===i){var c=this;s.forEach(this.views_,function(e,t){a=a.concat(t.removeEventRegistration(n,r)),t.isEmpty()&&(delete c.views_[e],t.getQuery().getQueryParams().loadsAllData()||o.push(t.getQuery()))})}else{var h=s.safeGet(this.views_,i);h&&(a=a.concat(h.removeEventRegistration(n,r)),h.isEmpty()&&(delete this.views_[i],h.getQuery().getQueryParams().loadsAllData()||o.push(h.getQuery())))}return u&&!this.hasCompleteView()&&o.push(new e.__referenceConstructor(t.repo,t.path)),{removed:o,events:a}},e.prototype.getQueryViews=function(){var e=this;return Object.keys(this.views_).map(function(t){return e.views_[t]}).filter(function(e){return!e.getQuery().getQueryParams().loadsAllData()})},e.prototype.getCompleteServerCache=function(e){var t=null;return s.forEach(this.views_,function(n,r){t=t||r.getCompleteServerCache(e)}),t},e.prototype.viewForQuery=function(e){if(e.getQueryParams().loadsAllData())return this.getCompleteView();var t=e.queryIdentifier();return s.safeGet(this.views_,t)},e.prototype.viewExistsForQuery=function(e){return null!=this.viewForQuery(e)},e.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},e.prototype.getCompleteView=function(){return s.findValue(this.views_,function(e){return e.getQuery().getQueryParams().loadsAllData()})||null},e}();t.SyncPoint=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(24),o=function(){function e(e,t){this.eventCache_=e,this.serverCache_=t}return e.prototype.updateEventSnap=function(t,n,r){return new e(new i.CacheNode(t,n,r),this.serverCache_)},e.prototype.updateServerSnap=function(t,n,r){return new e(this.eventCache_,new i.CacheNode(t,n,r))},e.prototype.getEventCache=function(){return this.eventCache_},e.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},e.prototype.getServerCache=function(){return this.serverCache_},e.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},e.Empty=new e(new i.CacheNode(r.ChildrenNode.EMPTY_NODE,!1,!1),new i.CacheNode(r.ChildrenNode.EMPTY_NODE,!1,!1)),e}();t.ViewCache=o},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.collection_=e,this.last_=null}return e.prototype.get=function(){var e=this.collection_.get(),t=r.clone(e);return this.last_&&r.forEach(this.last_,function(e,n){t[e]=t[e]-n}),this.last_=e,t},e}();t.StatsListener=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),o=n(0),a=n(0),s=n(0),u=n(1),c=n(2),h=n(127),l=n(128),p=n(0),f=n(65),d=n(0),v=n(0),_=n(68),g=1e3,y=3e5,m=function(e){function t(n,r,i,o,a,s){var c=e.call(this)||this;if(c.repoInfo_=n,c.onDataUpdate_=r,c.onConnectStatus_=i,c.onServerInfoUpdate_=o,c.authTokenProvider_=a,c.authOverride_=s,c.id=t.nextPersistentConnectionId_++,c.log_=u.logWrapper("p:"+c.id+":"),c.interruptReasons_={},c.listens_={},c.outstandingPuts_=[],c.outstandingPutCount_=0,c.onDisconnectRequestQueue_=[],c.connected_=!1,c.reconnectDelay_=g,c.maxReconnectDelay_=y,c.securityDebugCallback_=null,c.lastSessionId=null,c.establishConnectionTimer_=null,c.visible_=!1,c.requestCBHash_={},c.requestNumber_=0,c.realtime_=null,c.authToken_=null,c.forceTokenRefresh_=!1,c.invalidAuthTokenCount_=0,c.firstConnection_=!0,c.lastConnectionAttemptTime_=null,c.lastConnectionEstablishedTime_=null,s&&!v.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return c.scheduleConnect_(0),h.VisibilityMonitor.getInstance().on("visible",c.onVisible_,c),-1===n.host.indexOf("fblocal")&&l.OnlineMonitor.getInstance().on("online",c.onOnline_,c),c}return r(t,e),t.prototype.sendRequest=function(e,t,n){var r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_(a.stringify(i)),s.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},t.prototype.listen=function(e,t,n,r){var i=e.queryIdentifier(),o=e.path.toString();this.log_("Listen called for "+o+" "+i),this.listens_[o]=this.listens_[o]||{},s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),s.assert(!this.listens_[o][i],"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:t,query:e,tag:n};this.listens_[o][i]=a,this.connected_&&this.sendListen_(a)},t.prototype.sendListen_=function(e){var n=this,r=e.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r.queryObject(),a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,function(a){var s=a.d,u=a.s;t.warnOnListenWarnings_(s,r),(n.listens_[i]&&n.listens_[i][o])===e&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),e.onComplete&&e.onComplete(u,s))})},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&o.contains(e,"w")){var n=o.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+t.getQueryParams().getIndex().toString()+'"',i=t.path.toString();u.warn("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||p.isAdmin(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=p.isValidFormat(t)?"auth":"gauth",r={cred:t};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,function(n){var r=n.s,i=n.d||"error";
1e.authToken_===t&&("ok"===r?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(r,i))})}},t.prototype.unlisten=function(e,t){var n=e.path.toString(),r=e.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e.queryObject(),t)},t.prototype.sendUnlisten_=function(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,r){var i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,function(e){r&&setTimeout(function(){r(e.s,e.d)},Math.floor(0))})},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){var o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,function(r){t.log_(n+" response",r),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(r.s,r.d)})},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}})}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+a.stringify(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):u.error("Unrecognized action received from server: "+a.stringify(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;s.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){t.establishConnectionTimer_=null,t.establishConnection_()},Math.floor(e))},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=g,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=g,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){var e=(new Date).getTime()-this.lastConnectionEstablishedTime_;e>3e4&&(this.reconnectDelay_=g),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,n=Math.max(0,this.reconnectDelay_-t);
1n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this,a=this.lastSessionId,c=!1,h=null,l=function(){h?h.close():(c=!0,r())},p=function(e){s.assert(h,"sendRequest call when we're not connected not allowed."),h.sendRequest(e)};this.realtime_={close:l,sendRequest:p};var v=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(v).then(function(t){c?u.log("getToken() completed but was canceled"):(u.log("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,h=new f.Connection(i,o.repoInfo_,e,n,r,function(e){u.warn(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")},a))}).then(null,function(e){o.log_("Failed to get token: "+e),c||(d.CONSTANTS.NODE_ADMIN&&u.warn(e),l())})}},t.prototype.interrupt=function(e){u.log("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){u.log("Resuming connection for reason: "+e),delete this.interruptReasons_[e],o.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=g,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map(function(e){return u.ObjectToUniqueKey(e)}).join("$"):"default";var r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,r=new c.Path(e).toString();return void 0!==this.listens_[r]?(n=this.listens_[r][t],delete this.listens_[r][t],0===o.getCount(this.listens_[r])&&delete this.listens_[r]):n=void 0,n},t.prototype.onAuthRevoked_=function(e,t){u.log("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||++this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken())},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&"undefined"!=typeof console&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e=this;this.tryAuth(),o.forEach(this.listens_,function(t,n){o.forEach(n,function(t,n){e.sendListen_(n)})});for(var t=0;t<this.outstandingPuts_.length;t++)this.outstandingPuts_[t]&&this.sendPut_(t);for(;this.onDisconnectRequestQueue_.length;){var n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}},t.prototype.sendConnectStats_=function(){var e={},t="js";d.CONSTANTS.NODE_ADMIN?t="admin_node":d.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+i.default.SDK_VERSION.replace(/\./g,"-")]=1,v.isMobileCordova()?e["framework.cordova"]=1:v.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=l.OnlineMonitor.getInstance().currentlyOnline();return o.isEmpty(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(_.ServerActions);t.PersistentConnection=m},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.allowedEvents_=e,this.listeners_={},r.assert(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Array.isArray(this.listeners_[e]))for(var r=this.listeners_[e].slice(),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,t)},e.prototype.on=function(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});var r=this.getInitialEvent(e);r&&t.apply(n,r)},e.prototype.off=function(e,t,n){this.validateEventType_(e);for(var r=this.listeners_[e]||[],i=0;i<r.length;i++)if(r[i].callback===t&&(!n||n===r[i].context))return void r.splice(i,1)},e.prototype.validateEventType_=function(e){r.assert(this.allowedEvents_.find(function(t){return t===e}),"Unknown event: "+e)},e}();t.EventEmitter=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(18),o=n(19),a=n(129),s=function(){function e(e,t,n,i,o,s,u){this.id=e,this.repoInfo_=t,this.onMessage_=n,this.onReady_=i,this.onDisconnect_=o,this.onKill_=s,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=r.logWrapper("c:"+this.id+":"),this.transportManager_=new a.TransportManager(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(function(){e.conn_&&e.conn_.open(n,i)},Math.floor(0));var o=t.healthyTimeout||0;o>0&&(this.healthyTimeout_=r.setTimeoutNonBlocking(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(o)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!=t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=r.requireKey("t",e),n=r.requireKey("d",e);if("c"==t)this.onSecondaryControl_(n);else{if("d"!=t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t
1:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=r.requireKey("t",e),n=r.requireKey("d",e);"c"==t?this.onControl_(n):"d"==t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||--this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy())},e.prototype.onControl_=function(e){var t=r.requireKey("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?r.error("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):r.error("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.updateHost(i),0==this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),o.PROTOCOL_VERSION!==n&&r.warn("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),i=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,i),r.setTimeoutNonBlocking(function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())},Math.floor(6e4))},e.prototype.onReset_=function(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.updateHost(e),1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):r.setTimeoutNonBlocking(function(){n.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(i.PersistentStorage.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},e}();t.Connection=s},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(58),o=n(34),a=n(130),s=n(19),u=n(0),c=n(0);t.FIREBASE_LONGPOLL_START_PARAM="start",t.FIREBASE_LONGPOLL_CLOSE_COMMAND="close",t.FIREBASE_LONGPOLL_COMMAND_CB_NAME="pLPCommand",t.FIREBASE_LONGPOLL_DATA_CB_NAME="pRTLPCB",t.FIREBASE_LONGPOLL_ID_PARAM="id",t.FIREBASE_LONGPOLL_PW_PARAM="pw",t.FIREBASE_LONGPOLL_SERIAL_PARAM="ser",t.FIREBASE_LONGPOLL_CALLBACK_ID_PARAM="cb",t.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM="seg",t.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET="ts",t.FIREBASE_LONGPOLL_DATA_PARAM="d",t.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM="disconn",t.FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM="dframe";var h=function(){function e(e,t,n,i){this.connId=e,this.repoInfo=t,this.transportSessionId=n,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=r.logWrapper(e),this.stats_=o.StatsManager.getCollection(t),this.urlFn=function(e){return t.connectionURL(s.LONG_POLLING,e)}}return e.prototype.open=function(e,n){var i=this;this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new a.PacketReceiver(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){i.log_("Timed out trying to connect."),i.onClosed_(),i.connectTimeoutTimer_=null},Math.floor(3e4)),r.executeWhenDOMReady(function(){if(!i.isClosed_){i.scriptTagHolder=new l(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e[1],a=e[2];if(e[3],e[4],i.incrementIncomingBytes_(e),i.scriptTagHolder)if(i.connectTimeoutTimer_&&(clearTimeout(i.connectTimeoutTimer_),i.connectTimeoutTimer_=null),i.everConnected_=!0,r==t.FIREBASE_LONGPOLL_START_PARAM)i.id=o,i.password=a;else{if(r!==t.FIREBASE_LONGPOLL_CLOSE_COMMAND)throw new Error("Unrecognized command received: "+r);o?(i.scriptTagHolder.sendNewPolls=!1,i.myPacketOrderer.closeAfter(o,function(){i.onClosed_()})):i.onClosed_()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[0],r=e[1];i.incrementIncomingBytes_(e),i.myPacketOrderer.handleResponse(n,r)},function(){i.onClosed_()},i.urlFn);var e={};e[t.FIREBASE_LONGPOLL_START_PARAM]="t",e[t.FIREBASE_LONGPOLL_SERIAL_PARAM]=Math.floor(1e8*Math.random()),i.scriptTagHolder.uniqueCallbackIdentifier&&(e[t.FIREBASE_LONGPOLL_CALLBACK_ID_PARAM]=i.scriptTagHolder.uniqueCallbackIdentifier),e[s.VERSION_PARAM]=s.PROTOCOL_VERSION,i.transportSessionId&&(e[s.TRANSPORT_SESSION_PARAM]=i.transportSessionId),i.lastSessionId&&(e[s.LAST_SESSION_PARAM]=i.lastSessionId),!c.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(s.FORGE_DOMAIN)&&(e[s.REFERER_PARAM]=s.FORGE_REF);var n=i.urlFn(e);i.log_("Connecting via long-poll to "+n),i.scriptTagHolder.addTag(n,function(){})}})},e.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},e.forceAllow=function(){e.forceAllow_=!0},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){return e.forceAllow_||!e.forceDisallow_&&"undefined"!=typeof document&&null!=document.createElement&&!r.isChromeExtensionContentScript()&&!r.isWindowsStoreApp()&&!c.isNodeSdk()},e.prototype.markConnectionHealthy=function(){},e.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},e.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},e.prototype.send=function(e){var t=u.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);for(var n=u.base64Encode(t),i=r.splitStringBySize(n,1840),o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++},e.prototype.addDisconnectPingFrame=function(e,n){if(!c.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var r={};r[t.FIREBASE_LONGPOLL_DISCONN_FRAME_REQUEST_PARAM]="t",r[t.FIREBASE_LONGPOLL_ID_PARAM]=e,r[t.FIREBASE_LONGPOLL_PW_PARAM]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},e.prototype.incrementIncomingBytes_=function(e){var t=u.stringify(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)},e}();t.BrowserPollConnection=h;
1var l=function(){function e(n,o,a,s){if(this.onDisconnect=a,this.urlFn=s,this.outstandingRequests=new i.CountedSet,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,c.isNodeSdk())this.commandCB=n,this.onMessageCB=o;else{this.uniqueCallbackIdentifier=r.LUIDGenerator(),window[t.FIREBASE_LONGPOLL_COMMAND_CB_NAME+this.uniqueCallbackIdentifier]=n,window[t.FIREBASE_LONGPOLL_DATA_CB_NAME+this.uniqueCallbackIdentifier]=o,this.myIFrame=e.createIFrame_();var u="";this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length)&&(u='<script>document.domain="'+document.domain+'";<\/script>');var h="<html><body>"+u+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(h),this.myIFrame.doc.close()}catch(e){r.log("frame writing exception"),e.stack&&r.log(e.stack),r.log(e)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||r.log("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var n=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==n.myIFrame&&(document.body.removeChild(n.myIFrame),n.myIFrame=null)},Math.floor(0))),c.isNodeSdk()&&this.myID){var r={};r[t.FIREBASE_LONGPOLL_DISCONN_FRAME_PARAM]="t",r[t.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,r[t.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW;var i=this.urlFn(r);e.nodeRestRequest(i)}var o=this.onDisconnect;o&&(this.onDisconnect=null,o())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e[t.FIREBASE_LONGPOLL_ID_PARAM]=this.myID,e[t.FIREBASE_LONGPOLL_PW_PARAM]=this.myPW,e[t.FIREBASE_LONGPOLL_SERIAL_PARAM]=this.currentSerial;for(var n=this.urlFn(e),r="",i=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+r.length<=1870;){var o=this.pendingSegs.shift();r=r+"&"+t.FIREBASE_LONGPOLL_SEGMENT_NUM_PARAM+i+"="+o.seg+"&"+t.FIREBASE_LONGPOLL_SEGMENTS_IN_PACKET+i+"="+o.ts+"&"+t.FIREBASE_LONGPOLL_DATA_PARAM+i+"="+o.d,i++}return n+=r,this.addLongPollTag_(n,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var n=this;this.outstandingRequests.add(t,1);var r=function(){n.outstandingRequests.remove(t),n.newRequest_()},i=setTimeout(r,Math.floor(25e3)),o=function(){clearTimeout(i),r()};this.addTag(e,o)},e.prototype.addTag=function(e,t){var n=this;c.isNodeSdk()?this.doNodeLongPoll(e,t):setTimeout(function(){try{if(!n.sendNewPolls)return;var i=n.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var e=i.readyState;e&&"loaded"!==e&&"complete"!==e||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=function(){r.log("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(i)}catch(e){}},Math.floor(1))},e}();t.FirebaseIFrameScriptHolder=l},function(e,t,n){"use strict";(function(e){function r(e){f=e}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),o=n(0),a=n(1),s=n(34),u=n(19),c=n(0),h=n(18),l=n(0),p=n(0),f=null;"undefined"!=typeof MozWebSocket?f=MozWebSocket:"undefined"!=typeof WebSocket&&(f=WebSocket),t.setWebSocketImpl=r;var d=function(){function t(e,n,r,i){this.connId=e,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=a.logWrapper(this.connId),this.stats_=s.StatsManager.getCollection(n),this.connURL=t.connectionURL_(n,r,i)}return t.connectionURL_=function(e,t,n){var r={};return r[u.VERSION_PARAM]=u.PROTOCOL_VERSION,!p.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf(u.FORGE_DOMAIN)&&(r[u.REFERER_PARAM]=u.FORGE_REF),t&&(r[u.TRANSPORT_SESSION_PARAM]=t),n&&(r[u.LAST_SESSION_PARAM]=n),e.connectionURL(u.WEBSOCKET,r)},t.prototype.open=function(t,n){var r=this;this.onDisconnect=n,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,h.PersistentStorage.set("previous_websocket_failure",!0);try{if(p.isNodeSdk()){var o=c.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",a={headers:{"User-Agent":"Firebase/"+u.PROTOCOL_VERSION+"/"+i.default.SDK_VERSION+"/"+e.platform+"/"+o}},s=Object({NODE_ENV:"production"}),l=0==this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;l&&(a.proxy={origin:l}),this.mySock=new f(this.connURL,[],a)}else this.mySock=new f(this.connURL)}catch(e){this.log_("Error instantiating WebSocket.");var d=e.message||e.data;return d&&this.log_(d),void this.onClosed_()}this.mySock.onopen=function(){r.log_("Websocket connected."),r.everConnected_=!0}
1,this.mySock.onclose=function(){r.log_("Websocket connection was disconnected."),r.mySock=null,r.onClosed_()},this.mySock.onmessage=function(e){r.handleIncomingFrame(e)},this.mySock.onerror=function(e){r.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&r.log_(t),r.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&null!==f&&!t.forceDisallow_},t.previouslyFailed=function(){return h.PersistentStorage.isInMemoryStorage||!0===h.PersistentStorage.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){h.PersistentStorage.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length==this.totalFrames){var t=this.frames.join("");this.frames=null;var n=l.jsonEval(t);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},t.prototype.extractFrameCount_=function(e){if(o.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},t.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(e){this.resetKeepAlive();var t=l.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=a.splitStringBySize(t,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()},Math.floor(45e3))},t.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}();t.WebSocketConnection=d}).call(t,n(40))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}();t.ServerActions=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(33),i=n(3),o=n(5),a=n(4),s=function(){function e(t){this.indexedFilter_=new r.IndexedFilter(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,s){return this.matches(new o.NamedNode(t,n))||(n=a.ChildrenNode.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,s)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=a.ChildrenNode.EMPTY_NODE);var r=t.withIndex(this.index_);r=r.updatePriority(a.ChildrenNode.EMPTY_NODE);var s=this;return t.forEachChild(i.PRIORITY_INDEX,function(e,t){s.matches(new o.NamedNode(e,t))||(r=r.updateImmediateChild(e,a.ChildrenNode.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}();t.RangedFilter=s},function(e,t,n){"use strict";var r=n(0),i=(n.n(r),n(25)),o=n(141),a=n(72),s="messagingSenderId",u=function(){function e(e){var t=this;if(this.errorFactory_=new r.ErrorFactory("messaging","Messaging",i.a.map),!e.options[s]||"string"!=typeof e.o
1ptions[s])throw this.errorFactory_.create(i.a.codes.BAD_SENDER_ID);this.messagingSenderId_=e.options[s],this.tokenManager_=new o.a,this.app=e,this.INTERNAL={},this.INTERNAL.delete=function(){return t.delete}}return e.prototype.getToken=function(){var e=this,t=this.getNotificationPermission_();return t!==a.a.granted?t===a.a.denied?Promise.reject(this.errorFactory_.create(i.a.codes.NOTIFICATIONS_BLOCKED)):Promise.resolve(null):this.getSWRegistration_().then(function(t){return e.tokenManager_.getSavedToken(e.messagingSenderId_,t).then(function(n){return n||e.tokenManager_.createToken(e.messagingSenderId_,t)})})},e.prototype.deleteToken=function(e){var t=this;return this.tokenManager_.deleteToken(e).then(function(){return t.getSWRegistration_().then(function(e){if(e)return e.pushManager.getSubscription()}).then(function(e){if(e)return e.unsubscribe()})})},e.prototype.getSWRegistration_=function(){throw this.errorFactory_.create(i.a.codes.SHOULD_BE_INHERITED)},e.prototype.requestPermission=function(){throw this.errorFactory_.create(i.a.codes.AVAILABLE_IN_WINDOW)},e.prototype.useServiceWorker=function(e){throw this.errorFactory_.create(i.a.codes.AVAILABLE_IN_WINDOW)},e.prototype.onMessage=function(e,t,n){throw this.errorFactory_.create(i.a.codes.AVAILABLE_IN_WINDOW)},e.prototype.onTokenRefresh=function(e,t,n){throw this.errorFactory_.create(i.a.codes.AVAILABLE_IN_WINDOW)},e.prototype.setBackgroundMessageHandler=function(e){throw this.errorFactory_.create(i.a.codes.AVAILABLE_IN_SW)},e.prototype.delete=function(){return this.tokenManager_.closeDatabase()},e.prototype.getNotificationPermission_=function(){return Notification.permission},e.prototype.getTokenManager=function(){return this.tokenManager_},e}();t.a=u},function(e,t,n){"use strict";var r=[4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110],i={userVisibleOnly:!0,applicationServerKey:new Uint8Array(r)};t.a={ENDPOINT:"https://fcm.googleapis.com",APPLICATION_SERVER_KEY:r,SUBSCRIPTION_OPTIONS:i}},function(e,t,n){"use strict";t.a={granted:"granted",default:"default",denied:"denied"}},function(e,t,n){"use strict";var r={TYPE_OF_MSG:"firebase-messaging-msg-type",DATA:"firebase-messaging-msg-data"},i={PUSH_MSG_RECEIVED:"push-msg-received",NOTIFICATION_CLICKED:"notification-clicked"},o=function(e,t){return n={},n[r.TYPE_OF_MSG]=e,n[r.DATA]=t,n;var n};t.a={PARAMS:r,TYPES_OF_MSG:i,createNewMsg:o}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r;!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",function(){return d});var r=n(36),i=n(77),o=n(7),a=n(27),s=n(37),u=n(13),c=n(76),h=n(78),l=n(16),p=n(6),f=n(152),d=function(){function e(e,t){this.authWrapper=e,t instanceof a.a?this.location=t:this.location=a.a.makeFromUrl(t)}return e.prototype.toString=function(){return r.g("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},e.prototype.newRef=function(t,n){return new e(t,n)},e.prototype.mappings=function(){return s.b()},e.prototype.child=function(e){r.g("child",[r.e()],arguments);var t=c.a(this.location.path,e),n=new a.a(this.location.bucket,t);return this.newRef(this.authWrapper,n)},Object.defineProperty(e.prototype,"parent",{get:function(){var e=c.c(this.location.path);if(null===e)return null;var t=new a.a(this.location.bucket,e);return this.newRef(this.authWrapper,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){var e=new a.a(this.location.bucket,"");return this.newRef(this.authWrapper,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return c.b(this.location.path)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storage",{get:function(){return this.authWrapper.service()},enumerable:!0,configurable:!0}),e.prototype.put=function(e,t){return void 0===t&&(t=null),r.g("put",[r.f(),r.b(!0)],arguments),this.throwIfRoot_("put"),new f.a(this,this.authWrapper,this.location,this.mappings(),new i.a(e),t)},e.prototype.putString=function(e,t,n){void 0===t&&(t=l.a.RAW),r.g("putString",[r.e(),r.e(l.c,!0),r.b(!0)],arguments),this.throwIfRoot_("putString");var o=l.b(t,e),a=u.a(n);
1return!p.a(a.contentType)&&p.a(o.contentType)&&(a.contentType=o.contentType),new f.a(this,this.authWrapper,this.location,this.mappings(),new i.a(o.data,!0),a)},e.prototype.delete=function(){r.g("delete",[],arguments),this.throwIfRoot_("delete");var e=this;return this.authWrapper.getAuthToken().then(function(t){var n=h.d(e.authWrapper,e.location);return e.authWrapper.makeRequest(n,t).getPromise()})},e.prototype.getMetadata=function(){r.g("getMetadata",[],arguments),this.throwIfRoot_("getMetadata");var e=this;return this.authWrapper.getAuthToken().then(function(t){var n=h.e(e.authWrapper,e.location,e.mappings());return e.authWrapper.makeRequest(n,t).getPromise()})},e.prototype.updateMetadata=function(e){r.g("updateMetadata",[r.b()],arguments),this.throwIfRoot_("updateMetadata");var t=this;return this.authWrapper.getAuthToken().then(function(n){var r=h.i(t.authWrapper,t.location,e,t.mappings());return t.authWrapper.makeRequest(r,n).getPromise()})},e.prototype.getDownloadURL=function(){return r.g("getDownloadURL",[],arguments),this.throwIfRoot_("getDownloadURL"),this.getMetadata().then(function(e){var t=e.downloadURLs[0];if(p.a(t))return t;throw o.l()})},e.prototype.throwIfRoot_=function(e){if(""===this.location.path)throw o.j(e)},e}()},function(e,t,n){"use strict";function r(e){if(0==e.length)return null;var t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}function i(e,t){var n=t.split("/").filter(function(e){return e.length>0}).join("/");return 0===e.length?n:e+"/"+n}function o(e){var t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}t.c=r,t.a=i,t.b=o},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(150),i=n(16),o=n(6),a=function(){function e(e,t){var n=0,r="";o.d(e)?(this.data_=e,n=e.size,r=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=r}return e.prototype.size=function(){return this.size_},e.prototype.type=function(){return this.type_},e.prototype.slice=function(t,n){if(o.d(this.data_)){var i=this.data_,a=r.b(i,t,n);return null===a?null:new e(a)}return new e(new Uint8Array(this.data_.buffer,t,n-t),!0)},e.getBlob=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(o.e()){var a=t.map(function(t){return t instanceof e?t.data_:t});return new e(r.a.apply(null,a))}var s=t.map(function(e){return o.j(e)?i.b(i.a.RAW,e).data:e.data_}),u=0;s.forEach(function(e){u+=e.byteLength});var c=new Uint8Array(u),h=0;return s.forEach(function(e){for(var t=0;t<e.length;t++)c[h++]=e[t]}),new e(c,!0)},e.prototype.uploadData=function(){return this.data_},e}()},function(e,t,n){"use strict";function r(e){if(!e)throw m.s()}function i(e,t){function n(n,i){var o=b.a(e,i,t);return r(null!==o),o}return n}function o(e){function t(t,n){var r;return r=401===t.getStatus()?m.q():402===t.getStatus()?m.n(e.bucket):403===t.getStatus()?m.r(e.path):n,r.setServerResponseProp(n.serverResponseProp()),r}return t}function a(e){function t(t,r){var i=n(t,r);return 404===t.getStatus()&&(i=m.m(e.path)),i.setServerResponseProp(r.serverResponseProp()),i}var n=o(e);return t}function s(e,t,n){var r=t.fullServerUrl(),o=T.b(r),s=e.maxOperationRetryTime(),u=new E.a(o,"GET",i(e,n),s);return u.errorHandler=a(t),u}function u(e,t,n,r){var o=t.fullServerUrl(),s=T.b(o),u=b.d(n,r),c={"Content-Type":"application/json; charset=utf-8"},h=e.maxOperationRetryTime(),l=new E.a(s,"PATCH",i(e,r),h);return l.headers=c,l.body=u,l.errorHandler=a(t),l}function c(e,t){function n(e,t){}var r=t.fullServerUrl(),i=T.b(r),o=e.maxOperationRetryTime(),s=new E.a(i,"DELETE",n,o);return s.successCodes=[200,204],s.errorHandler=a(t),s}function h(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function l(e,t,n){var r=w.a(n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=h(null,t)),r}function p(e,t,n,r,a){var s=t.bucketOnlyServerUrl(),u={"X-Goog-Upload-Protocol":"multipart"},c=function(){for(var e="",t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();u["Content-Type"]="multipart/related; boundary="+c;var h=l(t,r,a),p=b.d(h,n),f="--"+c+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+p+"\r\n--"+c+"\r\nContent-Type: "+h.contentType+"\r\n\r\n",d="\r\n--"+c+"--",v=y.a.getBlob(f,r,d);if(null===v)throw m.d();var _={name:h.fullPath},g=T.d(s),w=e.maxUploadRetryTime(),C=new E.a(g,"POST",i(e,n),w);
1return C.urlParams=_,C.headers=u,C.body=v.uploadData(),C.errorHandler=o(t),C}function f(e,t){var n;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){r(!1)}var i=t||["active"];return r(g.b(i,n)),n}function d(e,t,n,i,a){function s(e,t){f(e);var n;try{n=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){r(!1)}return r(C.j(n)),n}var u=t.bucketOnlyServerUrl(),c=l(t,i,a),h={name:c.fullPath},p=T.d(u),d={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":i.size(),"X-Goog-Upload-Header-Content-Type":c.contentType,"Content-Type":"application/json; charset=utf-8"},v=b.d(c,n),_=e.maxUploadRetryTime(),g=new E.a(p,"POST",s,_);return g.urlParams=h,g.headers=d,g.body=v,g.errorHandler=o(t),g}function v(e,t,n,i){function a(e,t){var n,o=f(e,["active","final"]);try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){r(!1)}var a=parseInt(n,10);return r(!isNaN(a)),new S(a,i.size(),"final"===o)}var s={"X-Goog-Upload-Command":"query"},u=e.maxUploadRetryTime(),c=new E.a(n,"POST",a,u);return c.headers=s,c.errorHandler=o(t),c}function _(e,t,n,r,a,s,u,c){function h(e,n){var o,a=f(e,["active","final"]),u=l.current+d,c=r.size();return o="final"===a?i(t,s)(e,n):null,new S(u,c,"final"===a,o)}var l=new S(0,0);if(u?(l.current=u.current,l.total=u.total):(l.current=0,l.total=r.size()),r.size()!==l.total)throw m.p();var p=l.total-l.current,d=p;a>0&&(d=Math.min(d,a));var v=l.current,_=v+d,g=d===p?"upload, finalize":"upload",y={"X-Goog-Upload-Command":g,"X-Goog-Upload-Offset":l.current},b=r.slice(v,_);if(null===b)throw m.d();var w=t.maxUploadRetryTime(),C=new E.a(n,"POST",h,w);return C.headers=y,C.body=b.uploadData(),C.progressCallback=c||null,C.errorHandler=o(e),C}t.e=s,t.i=u,t.d=c,t.g=p,n.d(t,"a",function(){return S}),t.c=d,t.f=v,n.d(t,"h",function(){return N}),t.b=_;var g=n(39),y=n(77),m=n(7),b=n(37),w=n(13),E=n(151),C=n(6),T=n(38),S=function(){function e(e,t,n,r){this.current=e,this.total=t,this.finalized=!!n,this.metadata=r||null}return e}(),N=262144},function(e,t,n){"use strict";var r=n(80),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),o=n(162),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s={"mamzdanie.radiozet.pl":{topic:"mamzdanie_radiozet",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"www.chillizet.pl":{topic:"chillizet",background:"#bd2ab8",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"www.antyradio.pl":{topic:"antyradio",background:"#cf080f",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"www.planeta.pl":{topic:"planeta",background:"#e01301",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"zdrowie.radiozet.pl":{topic:"radiozet_zdrowie",background:"#d50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"wiadomosci.radiozet.pl":{topic:"radiozet_wiadomosci",background:"#D50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"sport.radiozet.pl":{topic:"radiozet_sport",background:"#D50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"biznes.radiozet.pl":{topic:"radiozet_biznes",background:"#D50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"www.radiozet.pl":{topic:"radiozet_www",background:"#D50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"localhost:3001":{topic:"test",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"localhost:8010":{topic:"test",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"localhost:8011":{topic:"test",background:"#e01301",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"10.10.97.50:8011":{topic:"test",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"192.168.1.220:3000":{topic:"mamzdanie_radiozet",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"radiozetplayer.lab.eurozet.pl":{topic:"player_radiozet",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"player.lab.eurozet.pl":{topic:"player_radiozet",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"chillizetplayer.lab.eurozet.pl":{topic:"player_chillizet",background:"#d50032",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"stylzycia.radiozet.pl":{topic:"radiozet_stylzycia",background:"#D50033",marginTop:20,serviceWorkerFile:"radio-notif-sw.js"},"player.chillizet.pl":{topic:"player_chillizet",background:"#bd2ab8",marginTop:20,serviceWorkerFile:"sw-player-chillizet.js"},"player.meloradio.pl":{topic:"player_meloradio",background:"#bd2ab8",marginTop:20,serviceWorkerFile:"sw-player-meloradio.js"},"player.antyradio.pl":{topic:"player_antyradio",background:"#bd2ab8",marginTop:20,serviceWorkerFile:"sw-player-antyradio.js"},"player.radiozet.pl":{topic:"player_radiozet",background:"#bd2ab8",marginTop:20,serviceWorkerFile:"sw-player-radiozet.js"}},u=window.location.host;s[u]?new a.default({firebase:i,topic:s[u].topic,background:s[u].background,domain:u,marginTop:s[u].marginTop,serviceWorkerFile:s[u].serviceWorkerFile}):console.log("Nie ma takiej domeny!")},function(e,t,n){var r=n(81);n(101),n(103),n(138),n(145),e.exports=r},function(e,t,n){n(82),e.exports=n(8).default},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(83),i=(n.n(r),n(87)),o=(n.n(i),n(88));n.n(o)},function(e,t,n){(function(e){var t=function(){if(void 0!==e)return e;if("undefined"!=typeof window)return window;if("undefined"!=typeof self)return self;throw new Error("unable to locate global object")}();"undefined"==typeof Promise&&(t.Promise=Promise=n(84))}).call(t,n(28))},function(e,t,n){(function(t){!function(n){function r(){}function i(e,t){return function(){e.apply(t,arguments)}}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e._deferreds.push(t);e._handled=!0,o._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?s:u)(t.promise,e._value);var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}s(t.promise,r)})}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void l(i(n,t),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function h(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,s(t,e))},function(e){n||(n=!0,u(t,e))})}catch(e){if(n)return;n=!0,u(t,e)}}var p=setTimeout;o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return a(this,new h(e,t,n)),n},o.all=function(e){return new o(function(t,n){function r(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(t){r(e,t)},n)}i[e]=a,0==--o&&t(i)}catch(e){n(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);for(var o=i.length,a=0;a<i.length;a++)r(a,i[a])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(e){return new o(function(t,n){n(e)})},o.race=function(e){return new o(function(t,n){for(var r=0,i=e.length;r<i;r++)e[r].then(t,n)})},o._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){p(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},void 0!==e&&e.exports?e.exports=o:n.Promise||(n.Promise=o)}(this)}).call(t,n(85).setImmediate)},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(86),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return c[u]=r,s(u),u++}function i(e){delete c[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function a(e){if(h)setTimeout(a,0,e);else{var t=c[e];if(t){h=!0;try{o(t)}finally{i(e),h=!1}}}}if(!e.setImmediate){var s,u=1,c={},h=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&a(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},s=function(t){e.port2.postMessage(t)}}():l&&"onreadystatechange"in l.createElement("script")?function(){var e=l.documentElement;s=function(t){var n=l.createElement("script");n.onreadystatechange=function(){a(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(a,0,e)}}(),p.setImmediate=r,p.clearImmediate=i}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(28),n(40))},function(e,t){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i++}}})},function(e,t){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return i;i++}return-1}})},function(e,t,n){"use strict";function r(){function e(e){p(d[e],"delete"),delete d[e]}function t(e){return e=e||s,a(d,e)||i("no-app",{name:e}),d[e]}function n(e,t){void 0===t?t=s:"string"==typeof t&&""!==t||i("bad-app-name",{name:t+""}),a(d,t)&&i("duplicate-app",{name:t});var n=new c(e,t,g);return d[t]=n,p(n,"create"),n}function u(){return Object.keys(d).map(function(e){return d[e]})}function h(e,n,r,a,s){v[e]&&i("duplicate-service",{name:e}
1),v[e]=n,a&&(_[e]=a,u().forEach(function(e){a("create",e)}));var h=function(n){return void 0===n&&(n=t()),"function"!=typeof n[e]&&i("invalid-app-argument",{name:e}),n[e]()};return void 0!==r&&Object(o.deepExtend)(h,r),g[e]=h,c.prototype[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._getService.bind(this,e).apply(this,s?t:[])},h}function l(e){Object(o.deepExtend)(g,e)}function p(e,t){Object.keys(v).forEach(function(n){var r=f(e,n);null!==r&&_[r]&&_[r](t,e)})}function f(e,t){if("serverAuth"===t)return null;var n=t;return e.options,n}var d={},v={},_={},g={__esModule:!0,initializeApp:n,app:t,apps:null,Promise:Promise,SDK_VERSION:"4.9.0",INTERNAL:{registerService:h,createFirebaseNamespace:r,extendNamespace:l,createSubscribe:o.createSubscribe,ErrorFactory:o.ErrorFactory,removeApp:e,factories:v,useAsService:f,Promise:Promise,deepExtend:o.deepExtend}};return Object(o.patchProperty)(g,"default",g),Object.defineProperty(g,"apps",{get:u}),Object(o.patchProperty)(t,"App",c),g}function i(e,t){throw l.create(e,t)}t.a=r;var o=n(0),a=(n.n(o),function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}),s="[DEFAULT]",u=[],c=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t,this.options_=Object(o.deepCopy)(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){u.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){u=u.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);var t=[];return Object.keys(e.services_).forEach(function(n){Object.keys(e.services_[n]).forEach(function(r){t.push(e.services_[n][r])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=s),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==s?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;Object(o.deepExtend)(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(u.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),u=[])},e.prototype.checkDestroyed_=function(){this.isDeleted_&&i("app-deleted",{name:this.name_})},e}();c.prototype.name&&c.prototype.options||c.prototype.delete||console.log("dc");var h={"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."},l=new o.ErrorFactory("app","Firebase",h)},function(e,t,n){"use strict";function r(e){return i(void 0,e)}function i(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:var n=t;return new Date(n.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var r in t)t.hasOwnProperty(r)&&(e[r]=i(e[r],t[r]));return e}function o(e,t,n){e[t]=n}Object.defineProperty(t,"__esModule",{value:!0}),t.deepCopy=r,t.deepExtend=i,t.patchProperty=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,r))}},e}();t.Deferred=r},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(29);t.getUA=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(t.getUA())},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isNodeSdk=function(){return!0===r.CONSTANTS.NODE_CLIENT||!0===r.CONSTANTS.NODE_ADMIN}},function(e,t,n){"use strict";function r(e){var t=o;return o=e,t}Object.defineProperty(t,"__esModule",{value:!0});var i="FirebaseError",o=Error.captureStackTrace;t.patchCapture=r;var a=function(){function e(e,t){if(this.code=e,this.message=t,o)o(this,s.prototype.create);else{var n=Error.apply(this,arguments);this.name=i,Object.defineProperty(this,"stack",{get:function(){return n.stack}})}}return e}();t.FirebaseError=a,a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a.prototype.name=i;var s=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n,r=this.errors[e],i=this.service+"/"+e;n=void 0===r?"Error":r.replace(this.pattern,function(e,n){var r=t[n];return void 0!==r?r.toString():"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+i+").";var o=new a(i,n);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(o[s]=t[s]);return o},e}();t.ErrorFactory=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42),i=n(43);t.decode=function(e){var t={},n={},o={},a="";try{var s=e.split(".");t=i.jsonEval(r.base64Decode(s[0])||""),n=i.jsonEval(r.base64Decode(s[1])||""),a=s[2],o=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:o,signature:a}},t.isValidTimestamp=function(e){var n,r,i=t.decode(e).claims,o=Math.floor((new Date).getTime()/1e3);return"object"==typeof i&&(i.hasOwnProperty("nbf")?n=i.nbf:i.hasOwnProperty("iat")&&(n=i.iat),r=i.hasOwnProperty("exp")?i.exp:n+86400),o&&n&&r&&o>=n&&o<=r},t.issuedAtTime=function(e){var n=t.decode(e).claims;return"object"==typeof n&&n.hasOwnProperty("iat")?n.iat:null},t.isValidFormat=function(e){var n=t.decode(e),r=n.claims;return!!n.signature&&!!r&&"object"==typeof r&&r.hasOwnProperty("iat")},t.isAdmin=function(e){var n=t.decode(e).claims;return"object"==typeof n&&!0===n.admin}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44);t.querystring=function(e){var t=[];return r.forEach(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(97),o=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n<t.blockSize;++n)t.pad_[n]=0;return t.reset(),t}return r(t,e),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(e,t){t||(t=0);var n=this.W_;if("string"==typeof e)for(var r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(var r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(var r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}for(var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4],r=0;r<80;r++){r<40?r<20?(o=h^u&(c^h),a=1518500249):(o=u^c^h,a=1859775393):r<60?(o=u&c|h&(u|c),a=2400959708):(o=u^c^h,a=3395469782);var i=(s<<5|s>>>27)+o+l+a+n[r]&4294967295;l=h,h=c,c=4294967295&(u<<30|u>>>2),u=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<t;){if(0==o)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(i[o]=e.charCodeAt(r),++o,++r,o==this.blockSize){this.compress_(i),o=0;break}}else for(;r<t;)if(i[o]=e[r],++o,++r,o==this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=t}},t.prototype.digest=function(){var e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);for(var r=0,n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},t}(i.Hash);t.Sha1=o},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.blockSize=-1}return e}();t.Hash=r},function(e,t,n){"use strict";function r(e,t){var n=new s(e,t);return n.subscribe.bind(n)}function i(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then(function(){e.apply(void 0,n)}).catch(function(e){t&&t(e)})}}function o(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i in e&&"function"==typeof e[i])return!0}return!1}function a(){}Object.defineProperty(t,"__esModule",{value:!0}),t.createSubscribe=r;var s=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=o(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=a),void 0===r.error&&(r.error=a),void 0===r.complete&&(r.complete=a);var s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}}),this.observers.push(r),s},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();t.async=i},function(e,t,n){"use strict";function r(e,t,n){var r="";switch(t){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var i=e+" failed: ";return i+=r+" argument "}function i(e,t,n,i){if((!i||n)&&"string"!=typeof n)throw new Error(r(e,t,i)+"must be a valid firebase namespace.")}function o(e,t,n,i){if((!i||n)&&"function"!=typeof n)throw new Error(r(e,t,i)+"must be a valid function.")}function a(e,t,n,i){if((!i||n)&&("object"!=typeof n||null===n))throw new Error(r(e,t,i)+"must be a valid context object.")}Object.defineProperty(t,"__esModule",{value:!0}),t.validateArgCount=function(e,t,n,r){var i;if(r<t?i="at least "+t:r>n&&(i=0===n?"none":"no more than "+n),i){var o=e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".";throw new Error(o)}},t.errorPrefix=r,t.validateNamespace=i,t.validateCallback=o,t.validateContextObject=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41);t.stringToByteArray=function(e){for(var t=[],n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);if(o>=55296&&o<=56319){var a=o-55296;i++,r.assert(i<e.length,"Surrogate pair missing trail surrogate."),o=65536+(a<<10)+(e.charCodeAt(i)-56320)}o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t},t.stringLength=function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t}},function(e,t,n){n(102)},function(e,t,n){(function(e){(function(){function e(e){return"string"==typeof e}function t(e){return"boolean"==typeof e}function r(){}function i(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);
1if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function o(e){return null===e}function a(e){return"array"==i(e)}function s(e){var t=i(e);return"array"==t||"object"==t&&"number"==typeof e.length}function u(e){return"function"==i(e)}function c(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function h(e,t,n){return e.call.apply(e.bind,arguments)}function l(e,t,n){if(!e)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),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function p(e,t,n){return p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?h:l,p.apply(null,arguments)}function f(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function d(e,t){function n(){}n.prototype=t.prototype,e.ib=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Rc=function(e,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[n].apply(e,i)}}function v(e){if(Error.captureStackTrace)Error.captureStackTrace(this,v);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e))}function _(e,t){for(var n=e.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function g(e){return mu.test(e)?(-1!=e.indexOf("&")&&(e=e.replace(fu,"&")),-1!=e.indexOf("<")&&(e=e.replace(du,"<")),-1!=e.indexOf(">")&&(e=e.replace(vu,">")),-1!=e.indexOf('"')&&(e=e.replace(_u,""")),-1!=e.indexOf("'")&&(e=e.replace(gu,"'")),-1!=e.indexOf("\0")&&(e=e.replace(yu,"�")),e):e}function y(e,t){return-1!=e.indexOf(t)}function m(e,t){return e<t?-1:e>t?1:0}function b(e,t){t.unshift(e),v.call(this,_.apply(null,t)),t.shift()}function w(e,t){throw new b("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function E(t,n){var r=t.length,i=e(t)?t.split(""):t;for(--r;0<=r;--r)r in i&&n.call(void 0,i[r],r,t)}function C(t){e:{for(var n=Cn,r=t.length,i=e(t)?t.split(""):t,o=0;o<r;o++)if(o in i&&n.call(void 0,i[o],o,t)){n=o;break e}n=-1}return 0>n?null:e(t)?t.charAt(n):t[n]}function T(e,t){return 0<=wu(e,t)}function S(e,t){t=wu(e,t);var n;return(n=0<=t)&&Array.prototype.splice.call(e,t,1),n}function N(e,t){var n=0;E(e,function(r,i){t.call(void 0,r,i,e)&&1==Array.prototype.splice.call(e,i,1).length&&n++})}function I(e){return Array.prototype.concat.apply([],arguments)}function O(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]}function P(e){return y(bu,e)}function R(e,t){for(var n in e)t.call(void 0,e[n],n,e)}function A(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n}function k(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n}function D(e){for(var t in e)return!1;return!0}function x(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(n in t)if(!(n in e))return!1;return!0}function L(e){var t,n={};for(t in e)n[t]=e[t];return n}function M(e,t){for(var n,r,i=1;i<arguments.length;i++){r=arguments[i];for(n in r)e[n]=r[n];for(var o=0;o<Iu.length;o++)n=Iu[o],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function F(e){return F[" "](e),e}function U(e,t){var n=ju;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}function j(){var e=uu.document;return e?e.documentMode:void 0}function W(e){return U(e,function(){for(var t=0,n=pu(String(Ou)).split("."),r=pu(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;t=m(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||m(0==a[2].length,0==s[2].length)||m(a[2],s[2]),a=a[3],s=s[3]}while(0==t)}return 0<=t})}function V(e){e.prototype.then=e.prototype.then,e.prototype.$goog_The
1nable=!0}function B(e){if(!e)return!1;try{return!!e.$goog_Thenable}catch(e){return!1}}function q(e,t,n){this.f=n,this.c=e,this.g=t,this.b=0,this.a=null}function K(e,t){e.g(t),e.b<e.f&&(e.b++,t.next=e.a,e.a=t)}function H(){var e=Hu,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function G(){this.next=this.b=this.a=null}function z(e){uu.setTimeout(function(){throw e},0)}function Q(){var e=uu.MessageChannel;if(void 0===e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!P("Presto")&&(e=function(){var e=document.createElement("IFRAME");e.style.display="none",e.src="",document.documentElement.appendChild(e);var t=e.contentWindow;e=t.document,e.open(),e.write(""),e.close();var n="callImmediate"+Math.random(),r="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;e=p(function(e){"*"!=r&&e.origin!=r||e.data!=n||this.port1.onmessage()},this),t.addEventListener("message",e,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(n,r)}}}),void 0!==e&&!P("Trident")&&!P("MSIE")){var t=new e,n={},r=n;return t.port1.onmessage=function(){if(void 0!==n.next){n=n.next;var e=n.pb;n.pb=null,e()}},function(e){r.next={pb:e},r=r.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(e){var t=document.createElement("SCRIPT");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){uu.setTimeout(e,0)}}function X(e,t){qu||Y(),Ku||(qu(),Ku=!0);var n=Hu,r=Vu.get();r.set(e,t),n.b?n.b.next=r:n.a=r,n.b=r}function Y(){if(-1!=String(uu.Promise).indexOf("[native code]")){var e=uu.Promise.resolve(void 0);qu=function(){e.then(J)}}else qu=function(){var e=J;!u(uu.setImmediate)||uu.Window&&uu.Window.prototype&&!P("Edge")&&uu.Window.prototype.setImmediate==uu.setImmediate?(Bu||(Bu=Q()),Bu(e)):uu.setImmediate(e)}}function J(){for(var e;e=H();){try{e.a.call(e.b)}catch(e){z(e)}K(Vu,e)}Ku=!1}function $(e,t){if(this.a=Gu,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,e!=r)try{var n=this;e.call(t,function(e){he(n,zu,e)},function(e){if(!(e instanceof ye))try{if(e instanceof Error)throw e;throw Error("Promise rejected.")}catch(e){}he(n,Qu,e)})}catch(e){he(this,Qu,e)}}function Z(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}function ee(e,t,n){var r=Xu.get();return r.g=e,r.b=t,r.f=n,r}function te(e){if(e instanceof $)return e;var t=new $(r);return he(t,zu,e),t}function ne(e){return new $(function(t,n){n(e)})}function re(e,t,n){le(e,t,n,null)||X(f(t,e))}function ie(e){return new $(function(t,n){var r=e.length,i=[];if(r)for(var o,a=function(e,n){r--,i[e]=n,0==r&&t(i)},s=function(e){n(e)},u=0;u<e.length;u++)o=e[u],re(o,f(a,u),s);else t(i)})}function oe(e){return new $(function(t){var n=e.length,r=[];if(n)for(var i,o=function(e,i,o){n--,r[e]=i?{Ub:!0,value:o}:{Ub:!1,reason:o},0==n&&t(r)},a=0;a<e.length;a++)i=e[a],re(i,f(o,a,!0),f(o,a,!1));else t(r)})}function ae(e,t){return t=ee(t,t,void 0),t.c=!0,ue(e,t),e}function se(e,t){if(e.a==Gu)if(e.c){var n=e.c;if(n.b){for(var r=0,i=null,o=null,a=n.b;a&&(a.c||(r++,a.a==e&&(i=a),!(i&&1<r)));a=a.next)i||(o=a);i&&(n.a==Gu&&1==r?se(n,t):(o?(r=o,r.next==n.f&&(n.f=r),r.next=r.next.next):de(n),ve(n,i,Qu,t)))}e.c=null}else he(e,Qu,t)}function ue(e,t){e.b||e.a!=zu&&e.a!=Qu||fe(e),e.f?e.f.next=t:e.b=t,e.f=t}function ce(e,t,n,r){var i=ee(null,null,null);return i.a=new $(function(e,o){i.g=t?function(n){try{var i=t.call(r,n);e(i)}catch(e){o(e)}}:e,i.b=n?function(t){try{var i=n.call(r,t);void 0===i&&t instanceof ye?o(t):e(i)}catch(e){o(e)}}:o}),i.a.c=e,ue(e,i),i.a}function he(e,t,n){e.a==Gu&&(e===n&&(t=Qu,n=new TypeError("Promise cannot resolve to itself")),e.a=1,le(n,e.Ac,e.Bc,e)||(e.i=n,e.a=t,e.c=null,fe(e),t!=Qu||n instanceof ye||ge(e,n)))}function le(e,t,n,i){if(e instanceof $)return ue(e,ee(t||r,n||null,i)),!0;if(B(e))return e.then(t,n,i),!0;if(c(e))try{var o=e.then;if(u(o))return pe(e,o,t,n,i),!0}catch(e){return n.call(i,e),!0}return!1}function pe(e,t,n,r,i){function o(e){s||(s=!0,r.call(i,e))}function a(e){s||(s=!0,n.call(i,e))}var s=!1;try{t.call(e,a,o)}catch(e){o(e)}}function fe(e){e.h||(e.h=!0,X(e.Qb,e))}function de(e){var t=null;return e.b&&(t=e.b,e.b=t.next,t.next=null),e.b||(e.f=null),t}function ve(e,t,n,r){if(n==Qu&&t.b&&!t.c)for(;e&&e.g;e=e.c)e.g=!1;if(t.a)t.a.c=null,_e(t,n,r);else try{t.c?t.g.call(t.f):_e(t,n,r)}catch(e){Yu.call(null,e)}K(Xu,t)}function _e(e,t,n){t==zu?e.g.call(e.f,n):e.b&&e.b.call(e.f,n)}function ge(e,t){e.g=!0,X(function(){e.g&&Yu.call(null,t)})}function ye(e){v.call(this,e)}function me(){this.a="",this.b=$u}function be(e){return e instanceof me&&e.constructor===me&&e.b===$u?e.a:(w("expected object of type Const, got '"+e+"'"),"type_error:Const")}function we(e){var t=new me;return t.a=e,t}function Ee(){this.a="",this.b=tc}function Ce(e){return e instanceof Ee&&e.constructor===Ee&&e.b===tc?e.a:(w("expected object of type TrustedResourceUrl, got '"+e+"' of type "+i(e)),"type_error:TrustedResourceUrl")}function Te(e,t){return e=Se(e,t),t=new Ee,t.a=e,t}function Se(e,t){var n=be(e);if(!ec.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return n.replace(Zu,function(e,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format str
1ing, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return e=t[r],e instanceof me?be(e):encodeURIComponent(String(e))})}function Ne(){this.a="",this.b=rc}function Ie(e){return e instanceof Ne&&e.constructor===Ne&&e.b===rc?e.a:(w("expected object of type SafeUrl, got '"+e+"' of type "+i(e)),"type_error:SafeUrl")}function Oe(e){return e instanceof Ne?e:(e=e.la?e.ja():String(e),nc.test(e)||(e="about:invalid#zClosurez"),Pe(e))}function Pe(e){var t=new Ne;return t.a=e,t}function Re(){this.a="",this.b=ic}function Ae(e){return e instanceof Re&&e.constructor===Re&&e.b===ic?e.a:(w("expected object of type SafeHtml, got '"+e+"' of type "+i(e)),"type_error:SafeHtml")}function ke(e){var t=new Re;return t.a=e,t}function De(t){var n=document;return e(t)?n.getElementById(t):t}function xe(e,t){R(t,function(t,n){t&&t.la&&(t=t.ja()),"style"==n?e.style.cssText=t:"class"==n?e.className=t:"for"==n?e.htmlFor=t:oc.hasOwnProperty(n)?e.setAttribute(oc[n],t):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?e.setAttribute(n,t):e[n]=t})}function Le(t,n,r){var i=arguments,o=document,s=String(i[0]),u=i[1];if(!Ju&&u&&(u.name||u.type)){if(s=["<",s],u.name&&s.push(' name="',g(u.name),'"'),u.type){s.push(' type="',g(u.type),'"');var c={};M(c,u),delete c.type,u=c}s.push(">"),s=s.join("")}return s=o.createElement(s),u&&(e(u)?s.className=u:a(u)?s.className=u.join(" "):xe(s,u)),2<i.length&&Me(o,s,i),s}function Me(t,n,r){function i(r){r&&n.appendChild(e(r)?t.createTextNode(r):r)}for(var o=2;o<r.length;o++){var a=r[o];!s(a)||c(a)&&0<a.nodeType?i(a):Eu(Fe(a)?O(a):a,i)}}function Fe(e){if(e&&"number"==typeof e.length){if(c(e))return"function"==typeof e.item||"string"==typeof e.item;if(u(e))return"function"==typeof e.item}return!1}function Ue(e){var t=[];return We(new je,e,t),t.join("")}function je(){}function We(e,t,n){if(null==t)n.push("null");else{if("object"==typeof t){if(a(t)){var r=t;t=r.length,n.push("[");for(var i="",o=0;o<t;o++)n.push(i),We(e,r[o],n),i=",";return void n.push("]")}if(!(t instanceof String||t instanceof Number||t instanceof Boolean)){n.push("{"),i="";for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&"function"!=typeof(o=t[r])&&(n.push(i),Ve(r,n),n.push(":"),We(e,o,n),i=",");return void n.push("}")}t=t.valueOf()}switch(typeof t){case"string":Ve(t,n);break;case"number":n.push(isFinite(t)&&!isNaN(t)?String(t):"null");break;case"boolean":n.push(String(t));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof t)}}}function Ve(e,t){t.push('"',e.replace(sc,function(e){var t=ac[e];return t||(t="\\u"+(65536|e.charCodeAt(0)).toString(16).substr(1),ac[e]=t),t}),'"')}function Be(){0!=uc&&(cc[this[cu]||(this[cu]=++hu)]=this),this.oa=this.oa,this.Fa=this.Fa}function qe(e){e.oa||(e.oa=!0,e.ta(),0!=uc&&(e=e[cu]||(e[cu]=++hu),delete cc[e]))}function Ke(e,t){this.type=e,this.b=this.target=t,this.Bb=!0}function He(t,n){if(Ke.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var r=this.type=t.type,i=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=n,n=t.relatedTarget){if(Du){e:{try{F(n.nodeName);var o=!0;break e}catch(e){}o=!1}o||(n=null)}}else"mouseover"==r?n=t.fromElement:"mouseout"==r&&(n=t.toElement);this.relatedTarget=n,null===i?(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.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.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=e(t.pointerType)?t.pointerType:dc[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.c()}}function Ge(e,t,n,r,i){this.listener=e,this.a=null,this.src=t,this.type=n,this.capture=!!r,this.La=i,this.key=++_c,this.ma=this.Ha=!1}function ze(e){e.ma=!0,e.listener=null,e.a=null,e.src=null,e.La=null}function Qe(e){this.src=e,this.a={},this.b=0}function Xe(e,t,n,r,i,o){var a=t.toString();(t=e.a[a])||(t=e.a[a]=[],e.b++);var s=Je(t,n,i,o);return-1<s?(e=t[s],r||(e.Ha=!1)):(e=new Ge(n,e.src,a,!!i,o),e.Ha=r,t.push(e)),e}function Ye(e,t){var n=t.type;n in e.a&&S(e.a[n],t)&&(ze(t),0==e.a[n].length&&(delete e.a[n],e.b--))}function Je(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.ma&&o.listener==t&&o.capture==!!n&&o.La==r)return i}return-1}function $e(e,t,n,r,i){if(r&&r.once)tt(e,t,n,r,i);else if(a(t))for(var o=0;o<t.length;o++)$e(e,t[o],n,r,i);else n=ct(n),e&&e[vc]?pt(e,t,n,c(r)?!!r.capture:!!r,i):Ze(e,t,n,!1,r,i)}function Ze(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var a=c(i)?!!i.capture:!!i,s=ut(e);if(s||(e[gc]=s=new Qe(e)),n=Xe(s,t,n,r,a,o),!n.a){if(r=et(),n.a=r,r.src=e,r.listener=n,e.addEventListener)fc||(i=a),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else{if(!e.attachEvent)throw Error("addEventListener and attachEvent are unavailable.");e.attachEvent(it(t.toString()),r)}mc++}}function et(){var e=st,t=lc?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}function tt(e,t,n,r,i){if(a(t))for(var o=0;o<t.length;o++)tt(e,t[o],n,r,i);else n=ct(n),e&&e[vc]?ft(e,t,n,c(r)?!!r.capture:!!r,i):Ze(e,t,n,!0,r,i)}function nt(e,t,n,r,i){if(a(t))for(var o=0;o<t.length;o++)nt(e,t[o],n,r,i);else r=c(r)?!!r.capture:!!r,n=ct(n),e&&e[vc]?(e=e.u,(t=String(t).toString())in e.a&&(o=e.a[t],-1<(n=Je(o,n,r,i))&&(ze(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete e.a[t],e.b--)))):e&&(e=ut(e))&&(t=e.a[t.toString()],e=-1,t&&(e=Je(t,n,r,i)),(n=-1<e?t[e]:null)&&rt(n))}function rt(e){if("number"!=typeof e&&e&&!e.ma){var t=e.src;if(t&&t[vc])Ye(t.u,e);else{var n=e.type,r=e.a;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent&&t.detachEvent(it(n),r),mc--,(n=ut(t))?(Ye(n,e),0==n.b&&(n.src=null,t[gc]=null)):ze(e)}}}function it(e){return e in yc?yc[e]:yc[e]="on"+e}function ot(e,t,n,r){var i=!0;if((e=ut(e))&&(t=e.a[t.toString()]))for(t=t.concat(),e=0;e<t.length;e++){var o=t[e];o&&o.capture==n&&!o.ma&&(o=at(o,r),i=i&&!1!==o)}return i}function at(e,t){var n=e.listener,r=e.La||e.src;return e.Ha&&rt(e),n.call(r,t)}function st(e,t){if(e.ma)return!0;
1if(!lc){if(!t)e:{t=["window","event"];for(var n=uu,r=0;r<t.length;r++)if(null==(n=n[t[r]])){t=null;break e}t=n}if(r=t,t=new He(r,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){e:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break e}catch(e){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=t.b;i;i=i.parentNode)r.push(i);for(e=e.type,i=r.length-1;0<=i;i--){t.b=r[i];var o=ot(r[i],e,!0,t);n=n&&o}for(i=0;i<r.length;i++)t.b=r[i],o=ot(r[i],e,!1,t),n=n&&o}return n}return at(e,new He(t,this))}function ut(e){return e=e[gc],e instanceof Qe?e:null}function ct(e){return u(e)?e:(e[bc]||(e[bc]=function(t){return e.handleEvent(t)}),e[bc])}function ht(){Be.call(this),this.u=new Qe(this),this.Ib=this,this.Ra=null}function lt(t,n){var r,i=t.Ra;if(i)for(r=[];i;i=i.Ra)r.push(i);if(t=t.Ib,i=n.type||n,e(n))n=new Ke(n,t);else if(n instanceof Ke)n.target=n.target||t;else{var o=n;n=new Ke(i,t),M(n,o)}if(o=!0,r)for(var a=r.length-1;0<=a;a--){var s=n.b=r[a];o=dt(s,i,!0,n)&&o}if(s=n.b=t,o=dt(s,i,!0,n)&&o,o=dt(s,i,!1,n)&&o,r)for(a=0;a<r.length;a++)s=n.b=r[a],o=dt(s,i,!1,n)&&o}function pt(e,t,n,r,i){Xe(e.u,String(t),n,!1,r,i)}function ft(e,t,n,r,i){Xe(e.u,String(t),n,!0,r,i)}function dt(e,t,n,r){if(!(t=e.u.a[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var a=t[o];if(a&&!a.ma&&a.capture==n){var s=a.listener,u=a.La||a.src;a.Ha&&Ye(e.u,a),i=!1!==s.call(u,r)&&i}}return i&&0!=r.Bb}function vt(e,t,n){if(u(e))n&&(e=p(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=p(e.handleEvent,e)}return 2147483647<Number(t)?-1:uu.setTimeout(e,t||0)}function _t(e){var t=null;return new $(function(n,r){-1==(t=vt(function(){n(void 0)},e))&&r(Error("Failed to schedule timer."))}).s(function(e){throw uu.clearTimeout(t),e})}function gt(e,t,n,r,i){this.reset(e,t,n,r,i)}function yt(e){this.f=e,this.b=this.c=this.a=null}function mt(e,t){this.name=e,this.value=t}function bt(e){return e.c?e.c:e.a?bt(e.a):(w("Root logger has no level set."),null)}function wt(e){Nc||(Nc=new yt(""),Sc[""]=Nc,Nc.c=Cc);var t;if(!(t=Sc[e])){t=new yt(e);var n=e.lastIndexOf("."),r=e.substr(n+1);n=wt(e.substr(0,n)),n.b||(n.b={}),n.b[r]=t,t.a=n,Sc[e]=t}return t}function Et(e,t){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(e){e instanceof Et?(n=e.S(),r=e.P()):(n=k(e),r=A(e));for(var i=0;i<n.length;i++)this.set(n[i],r[i])}}function Ct(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var r=e.a[t];Tt(e.b,r)&&(e.a[n++]=r),t++}e.a.length=n}if(e.c!=e.a.length){var i={};for(n=t=0;t<e.a.length;)r=e.a[t],Tt(i,r)||(e.a[n++]=r,i[r]=1),t++;e.a.length=n}}function Tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function St(e,t){e&&e.log(Tc,t,void 0)}function Nt(e){return Cu(e,function(e){return e=e.toString(16),1<e.length?e:"0"+e}).join("")}function It(e){var t="";return Ot(e,function(e){t+=String.fromCharCode(e)}),t}function Ot(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=Oc[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}Pt();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=s&&t(a<<6&192|s))}}function Pt(){if(!Ic){Ic={},Oc={};for(var e=0;65>e;e++)Ic[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),Oc[Ic[e]]=e,62<=e&&(Oc["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}function Rt(e,t){this.g=[],this.v=e,this.o=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function At(e,t,n){e.a=!0,e.c=n,e.f=!t,Mt(e)}function kt(e){if(e.a){if(!e.u)throw new Ft;e.u=!1}}function Dt(e,t){xt(e,null,t,void 0)}function xt(e,t,n,r){e.g.push([t,n,r]),e.a&&Mt(e)}function Lt(e){return Tu(e.g,function(e){return u(e[1])})}function Mt(e){if(e.h&&e.a&&Lt(e)){var t=e.h,n=Rc[t];n&&(uu.clearTimeout(n.a),delete Rc[t]),e.h=0}e.b&&(e.b.l--,delete e.b),t=e.c;for(var r=n=!1;e.g.length&&!e.i;){var i=e.g.shift(),o=i[0],a=i[1];if(i=i[2],o=e.f?a:o)try{var s=o.call(i||e.o,t);void 0!==s&&(e.f=e.f&&(s==t||s instanceof Error),e.c=t=s),(B(t)||"function"==typeof uu.Promise&&t instanceof uu.Promise)&&(r=!0,e.i=!0)}catch(r){t=r,e.f=!0,Lt(e)||(n=!0)}}e.c=t,r&&(s=p(e.m,e,!0),r=p(e.m,e,!1),t instanceof Rt?(xt(t,s,r),t.w=!0):t.then(s,r)),n&&(t=new jt(t),Rc[t.a]=t,e.h=t.a)}function Ft(){v.call(this)}function Ut(){v.call(this)}function jt(e){this.a=uu.setTimeout(p(this.c,this),0),this.b=e}function Wt(){this.b=-1}function Vt(e,t){this.b=-1,this.b=Ac,this.f=uu.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.l=uu.Int32Array?new Int32Array(64):Array(64),Pc||(Pc=uu.Int32Array?new Int32Array(Mc):Mc),this.reset()}function Bt(e){for(var t=e.f,n=e.l,r=0,i=0;i<t.length;)n[r++]=t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3],i=4*r;for(t=16;64>t;t++){i=0|n[t-15],r=0|n[t-2];var o=(0|n[t-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[t-7])+((r>>>17|r<<15)^(r>>
1>19|r<<13)^r>>>10)|0;n[t]=o+a|0}r=0|e.a[0],i=0|e.a[1];var s=0|e.a[2],u=0|e.a[3],c=0|e.a[4],h=0|e.a[5],l=0|e.a[6];for(o=0|e.a[7],t=0;64>t;t++){var p=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=c&h^~c&l,o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0,a=a+(0|Pc[t])|0,a=o+(a+(0|n[t])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=i,i=r,r=a+p|0}e.a[0]=e.a[0]+r|0,e.a[1]=e.a[1]+i|0,e.a[2]=e.a[2]+s|0,e.a[3]=e.a[3]+u|0,e.a[4]=e.a[4]+c|0,e.a[5]=e.a[5]+h|0,e.a[6]=e.a[6]+l|0,e.a[7]=e.a[7]+o|0}function qt(t,n,r){void 0===r&&(r=n.length);var i=0,o=t.c;if(e(n))for(;i<r;)t.f[o++]=n.charCodeAt(i++),o==t.b&&(Bt(t),o=0);else{if(!s(n))throw Error("message must be string or array");for(;i<r;){var a=n[i++];if(!("number"==typeof a&&0<=a&&255>=a&&a==(0|a)))throw Error("message must be a byte array");t.f[o++]=a,o==t.b&&(Bt(t),o=0)}}t.c=o,t.g+=r}function Kt(){Vt.call(this,8,Fc)}function Ht(t){if(t.P&&"function"==typeof t.P)return t.P();if(e(t))return t.split("");if(s(t)){for(var n=[],r=t.length,i=0;i<r;i++)n.push(t[i]);return n}return A(t)}function Gt(t){if(t.S&&"function"==typeof t.S)return t.S();if(!t.P||"function"!=typeof t.P){if(s(t)||e(t)){var n=[];t=t.length;for(var r=0;r<t;r++)n.push(r);return n}return k(t)}}function zt(t,n){if(t.forEach&&"function"==typeof t.forEach)t.forEach(n,void 0);else if(s(t)||e(t))Eu(t,n,void 0);else for(var r=Gt(t),i=Ht(t),o=i.length,a=0;a<o;a++)n.call(void 0,i[a],r&&r[a],t)}function Qt(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}function Xt(e,t){if(this.b=this.l=this.c="",this.i=null,this.h=this.g="",this.f=!1,e instanceof Xt){this.f=void 0!==t?t:e.f,Yt(this,e.c),this.l=e.l,this.b=e.b,Jt(this,e.i),this.g=e.g,t=e.a;var n=new sn;n.c=t.c,t.a&&(n.a=new Et(t.a),n.b=t.b),$t(this,n),this.h=e.h}else e&&(n=String(e).match(Uc))?(this.f=!!t,Yt(this,n[1]||"",!0),this.l=rn(n[2]||""),this.b=rn(n[3]||"",!0),Jt(this,n[4]),this.g=rn(n[5]||"",!0),$t(this,n[6]||"",!0),this.h=rn(n[7]||"")):(this.f=!!t,this.a=new sn(null,0,this.f))}function Yt(e,t,n){e.c=n?rn(t,!0):t,e.c&&(e.c=e.c.replace(/:$/,""))}function Jt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.i=t}else e.i=null}function $t(e,t,n){t instanceof sn?(e.a=t,vn(e.a,e.f)):(n||(t=on(t,Bc)),e.a=new sn(t,0,e.f))}function Zt(e,t,n){e.a.set(t,n)}function en(e,t){return e.a.get(t)}function tn(e){return e instanceof Xt?new Xt(e):new Xt(e,void 0)}function nn(e,t){var n=new Xt(null,void 0);return Yt(n,"https"),e&&(n.b=e),t&&(n.g=t),n}function rn(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function on(t,n,r){return e(t)?(t=encodeURI(t).replace(n,an),r&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function an(e){return e=e.charCodeAt(0),"%"+(e>>4&15).toString(16)+(15&e).toString(16)}function sn(e,t,n){this.b=this.a=null,this.c=e||null,this.f=!!n}function un(e){e.a||(e.a=new Et,e.b=0,e.c&&Qt(e.c,function(t,n){hn(e,decodeURIComponent(t.replace(/\+/g," ")),n)}))}function cn(e){var t=Gt(e);if(void 0===t)throw Error("Keys are undefined");var n=new sn(null,0,void 0);e=Ht(e);for(var r=0;r<t.length;r++){var i=t[r],o=e[r];a(o)?fn(n,i,o):hn(n,i,o)}return n}function hn(e,t,n){un(e),e.c=null,t=dn(e,t);var r=e.a.get(t);r||e.a.set(t,r=[]),r.push(n),e.b+=1}function ln(e,t){un(e),t=dn(e,t),Tt(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,e=e.a,Tt(e.b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Ct(e)))}function pn(e,t){return un(e),t=dn(e,t),Tt(e.a.b,t)}function fn(e,t,n){ln(e,t),0<n.length&&(e.c=null,e.a.set(dn(e,t),O(n)),e.b+=n.length)}function dn(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}function vn(e,t){t&&!e.f&&(un(e),e.c=null,e.a.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(ln(this,t),fn(this,n,e))},e)),e.f=t}function _n(){}function gn(e){return e.c||(e.c=e.b())}function yn(){}function mn(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<t.length;n++){var r=t[n];try{return new ActiveXObject(r),e.f=r}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return e.f}function bn(e){ht.call(this),this.headers=new Et,this.w=e||null,this.b=!1,this.v=this.a=null,this.g=this.I=this.i="",this.c=this.G=this.h=this.A=!1,this.f=0,this.m=null,this.l=Hc,this.o=this.N=!1}function wn(e,t,n,r,i){if(e.a)throw Error("[goog.net.XhrIo] Object is active with another request="+e.i+"; newUri="+t);n=n?n.toUpperCase():"GET",e.i=t,e.g="",e.I=n,e.A=!1,e.b=!0,e.a=e.w?e.w.a():Kc.a(),e.v=gn(e.w?e.w:Kc),e.a.onreadystatechange=p(e.Ab,e);try{St(e.J,kn(e,"Opening Xhr")),e.G=!0,e.a.open(n,String(t),!0),e.G=!1}catch(t){return St(e.J,kn(e,"Error opening Xhr: "+t.message)),void Tn(e,t)}t=r||"";var o=new Et(e.headers);i&&zt(i,function(e,t){o.set(t,e)}),i=C(o.S()),r=uu.FormData&&t instanceof uu.FormData,!T(Xc,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach(function(e,t){this.a.setRequestHeader(t,e)},e),e.l&&(e.a.responseType=e.l),"withCredentials"in e.a&&e.a.withCredentials!==e.N&&(e.a.withCredentials=e.N);try{On(e),0<e.f&&(e.o=En(e.a),St(e.J,kn(e,"Will abort after "+e.f+"ms if incomplete, xhr2 "+e.o)),e.o?(e.a.timeout=e.f,e.a.ontimeout=p(e.Ea,e)):e.m=vt(e.Ea,e.f,e)),St(e.J,kn(e,"Sending request")),e.h=!0,e.a.send(t),e.h=!1}catch(t){St(e.J,kn(e,"Send error: "+t.message)),Tn(e,t)}}function En(e){return Ru&&W(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}function Cn(e){return"content-type"==e.toLowerCase()}function Tn(e,t){e.b=!1,e.a&&(e.c=!0,e.a.abort(),e.c=!1),e.g=t,Sn(e),In(e)}function Sn(e){e.A||(e.A=!0,lt(e,"complete"),lt(e,"error"))}function Nn(e){if(e.b&&void 0!==su)if(e.v[1]&&4==Pn(e)&&2==Rn(e))St(e.J,kn(e,"Local request error detected and ignored"));else if(e.h&&4==Pn(e))vt(e.Ab,0,e);else if(lt(e,"readystatechange"),4==Pn(e)){St(e.J,kn(e,"Request complete")),e.b=!1;try{var t=Rn(e);e:switch(t){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var n=!0;break e;default:n=!1}var r;if(!(r=n)){var i;if(i=0===t){var o=String(e.i).match(Uc)[1]||null;if(!o&&uu.self&&uu.self.location){var a=uu.self.location.protocol;o=a.substr(0,a.length-1)}i=!Qc.test(o?o.toLowerCase():"")}r=i}if(r)lt(e,"complete"),lt(e,"success");else{try{var s=2<Pn(e)?e.a.statusText:""}catch(t){St(e.J,"Can not get status: "+t.message),s=""}e.g=s+" ["+Rn(e)+"]",Sn(e)}}finally{In(e)}}}function In(e,t){if(e.a){On(e);var n=e.a,i=e.v[0]?r:null;e.a=null,e.v=null,t||lt(e,"ready");try{n.onreadystatechange=i}catch(t){(e=e.J)&&e.log(Ec,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function On(e){e.a&&e.o&&(e.a.ontimeout=null),"number"==typeof e.m&&(uu.clearTimeout(e.m),e.m=null)}function Pn(e){return e.a?e.a.readyState:0}function Rn(e){try{return 2<Pn(e)?e.a.status:-1}catch(e){return-1}}function An(e){try{return e.a?e.a.responseText:""}catch(t){return St(e.J,"Can not get responseText: "+t.message),""}}function kn(e,t){return t+" ["+e.I+" "+e.i+" "+Rn(e)+"]"}function Dn(e){var t={},n=t.document||document,r=Ce(e),i=document.createElement("SCRIPT"),o={Cb:i,Ea:void 0},a=new Rt(Ln,o),s=null,u=null!=t.timeout?t.timeout:5e3;return 0<u&&(s=window.setTimeout(function(){Mn(i,!0);var e=new Fn($c,"Timeout reached for loading script "+r);kt(a),At(a,!1,e)},u),o.Ea=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Mn(i,t.Sc||!1,s),a.A(null))},i.onerror=function(){Mn(i,!0,s);var e=new Fn(Jc,"Error while loading script "+r);kt(a),At(a,!1,e)},o=t.attributes||{}
1,M(o,{type:"text/javascript",charset:"UTF-8"}),xe(i,o),i.src=Ce(e),xn(n).appendChild(i),a}function xn(e){var t;return(t=(e||document).getElementsByTagName("HEAD"))&&0!=t.length?t[0]:e.documentElement}function Ln(){if(this&&this.Cb){var e=this.Cb;e&&"SCRIPT"==e.tagName&&Mn(e,!0,this.Ea)}}function Mn(e,t,n){null!=n&&uu.clearTimeout(n),e.onload=r,e.onerror=r,e.onreadystatechange=r,t&&window.setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)},0)}function Fn(e,t){var n="Jsloader error (code #"+e+")";t&&(n+=": "+t),v.call(this,n),this.code=e}function Un(){}function jn(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText=this.responseXML=null,this.a.onload=p(this.Wb,this),this.a.onerror=p(this.xb,this),this.a.onprogress=p(this.Xb,this),this.a.ontimeout=p(this.Yb,this)}function Wn(e,t){e.readyState=t,e.onreadystatechange&&e.onreadystatechange()}function Vn(){var e=ir();return Ru&&!!Uu&&11==Uu||/Edge\/\d+/.test(e)}function Bn(){return uu.window&&uu.window.location.href||""}function qn(e,t){t=t||uu.window;var n="about:blank";e&&(n=Ie(Oe(e))),t.location.href=n}function Kn(e,t){var n,r=[];for(n in e)n in t?typeof e[n]!=typeof t[n]?r.push(n):a(e[n])?x(e[n],t[n])||r.push(n):"object"==typeof e[n]&&null!=e[n]&&null!=t[n]?0<Kn(e[n],t[n]).length&&r.push(n):e[n]!==t[n]&&r.push(n):r.push(n);for(n in t)n in e||r.push(n);return r}function Hn(){var e=ir();return!((e=nr(e)!=th?null:(e=e.match(/\sChrome\/(\d+)/i))&&2==e.length?parseInt(e[1],10):null)&&30>e||Ru&&Uu&&!(9<Uu))}function Gn(e){return e=(e||ir()).toLowerCase(),!!(e.match(/android/)||e.match(/webos/)||e.match(/iphone|ipad|ipod/)||e.match(/blackberry/)||e.match(/windows phone/)||e.match(/iemobile/))}function zn(e){e=e||uu.window;try{e.close()}catch(e){}}function Qn(e,t,n){var r=Math.floor(1e9*Math.random()).toString();t=t||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-t)/2;t={width:t,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=ir().toLowerCase(),r&&(t.target=r,y(n,"crios/")&&(t.target="_blank")),nr(ir())==eh&&(e=e||"http://localhost",t.scrollbars=!0),n=e||"",(r=t)||(r={}),e=window,t=n instanceof Ne?n:Oe(void 0!==n.href?n.href:String(n)),n=r.target||n.target,i=[];for(a in r)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+r[a]);break;case"target":case"noreferrer":break;default:i.push(a+"="+(r[a]?1:0))}var a=i.join(",");if((P("iPhone")&&!P("iPod")&&!P("iPad")||P("iPad")||P("iPod"))&&e.navigator&&e.navigator.standalone&&n&&"_self"!=n?(a=e.document.createElement("A"),t instanceof Ne||t instanceof Ne||(t=t.la?t.ja():String(t),nc.test(t)||(t="about:invalid#zClosurez"),t=Pe(t)),a.href=Ie(t),a.setAttribute("target",n),r.noreferrer&&a.setAttribute("rel","noreferrer"),r=document.createEvent("MouseEvent"),r.initMouseEvent("click",!0,!0,e,1),a.dispatchEvent(r),a={}):r.noreferrer?(a=e.open("",n,a),e=Ie(t),a&&(ku&&y(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),a.opener=null,we("b/12014412, meta tag with sanitized URL"),e='<META HTTP-EQUIV="refresh" content="0; url='+g(e)+'">',e=ke(e),a.document.write(Ae(e)),a.document.close())):a=e.open(Ie(t),n,a),a)try{a.focus()}catch(e){}return a}function Xn(e){return new $(function(t){function n(){_t(2e3).then(function(){if(e&&!e.closed)return n();t()})}return n()})}function Yn(){var e=null;return new $(function(t){"complete"==uu.document.readyState?t():(e=function(){t()},tt(window,"load",e))}).s(function(t){throw nt(window,"load",e),t})}function Jn(){return $n(void 0)?Yn().then(function(){return new $(function(e,t){var n=uu.document,r=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);n.addEventListener("deviceready",function(){clearTimeout(r),e()},!1)})}):ne(Error("Cordova must run in an Android or iOS file scheme."))}function $n(e){return e=e||ir(),!("file:"!==cr()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function Zn(){var e=uu.window;try{return!(!e||e==e.top)}catch(e){return!1}}function er(){return au.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":au.INTERNAL.hasOwnProperty("node")?"Node":"Browser"}function tr(){var e=er();return"ReactNative"===e||"Node"===e}function nr(e){var t=e.toLowerCase();return y(t,"opera/")||y(t,"opr/")||y(t,"opios/")?"Opera":y(t,"iemobile")?"IEMobile":y(t,"msie")||y(t,"trident/")?"IE":y(t,"edge/")?"Edge":y(t,"firefox/")?eh:y(t,"silk/")?"Silk":y(t,"blackberry")?"Blackberry":y(t,"webos")?"Webos":!y(t,"safari/")||y(t,"chrome/")||y(t,"crios/")||y(t,"android")?!y(t,"chrome/")&&!y(t,"crios/")||y(t,"edge/")?y(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":th:"Safari"}function rr(e,t){t=t||[];var n,r=[],i={};for(n in nh)i[nh[n]]=!0;for(n=0;n<t.length;n++)void 0!==i[t[n]]&&(delete i[t[n]],r.push(t[n]));return r.sort(),t=r,t.length||(t=["FirebaseCore-web"]),r=er(),i="",(i="Browser"===r?nr(ir()):r)+"/JsCore/"+e+"/"+t.join(",")}function ir(){return uu.navigator&&uu.navigator.userAgent||""}function or(e,t){e=e.split("."),t=t||uu;for(var n=0;n<e.length&&"object"==typeof t&&null!=t;n++)t=t[e[n]];return n!=e.length&&(t=void 0),t}function ar(){try{var e=uu.localStorage,t=dr();if(e)return e.setItem(t,"1"),e.removeItem(t),!Vn()||!!uu.indexedDB}catch(e){}return!1}function sr(){return(ur()||"chrome-extension:"===cr()||$n())&&!tr()&&ar()}function ur(){return"http:"===cr()||"https:"===cr()}function cr(){return uu.location&&uu.location.protocol||null}function hr(e){return e=e||ir(),!Gn(e)&&nr(e)!=eh}
1function lr(e){return void 0===e?null:Ue(e)}function pr(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&null!==e[t]&&void 0!==e[t]&&(n[t]=e[t]);return n}function fr(e){if(null!==e)return JSON.parse(e)}function dr(e){return e||""+Math.floor(1e9*Math.random()).toString()}function vr(e){return e=e||ir(),"Safari"!=nr(e)&&!e.toLowerCase().match(/iphone|ipad|ipod/)}function _r(){var e=uu.___jsl;if(e&&e.H)for(var t in e.H)if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=e.H[t].L.concat(),e.CP)for(var n=0;n<e.CP.length;n++)e.CP[n]=null}function gr(){var e=uu.navigator;return!e||"boolean"!=typeof e.onLine||!ur()&&"chrome-extension:"!==cr()&&void 0===e.connection||e.onLine}function yr(e,t,n,r){if(e>t)throw Error("Short delay should be less than long delay!");this.c=e,this.b=t,e=n||ir(),r=r||er(),this.a=Gn(e)||"ReactNative"===r}function mr(){var e=uu.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function br(){var e=uu.document,t=null;return mr()||!e?te():new $(function(n){t=function(){mr()&&(e.removeEventListener("visibilitychange",t,!1),n())},e.addEventListener("visibilitychange",t,!1)}).s(function(n){throw e.removeEventListener("visibilitychange",t,!1),n})}function wr(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function Er(e,t,n){rh?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n}):e[t]=n}function Cr(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Er(e,n,t[n])}function Tr(e){var t={};return Cr(t,e),t}function Sr(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Nr(e,t){if(!t||!t.length)return!0;if(!e)return!1;for(var n=0;n<t.length;n++){var r=e[t[n]];if(void 0===r||null===r||""===r)return!1}return!0}function Ir(e){var t=e;if("object"==typeof e&&null!=e){t="length"in e?[]:{};for(var n in e)Er(t,n,Ir(e[n]))}return t}function Or(e){var t={},n=e[ah],r=e[sh];if(e=e[uh],!n||!e)throw Error("Invalid provider user info!");t[hh]=r||null,t[ch]=n,Er(this,ph,e),Er(this,lh,Ir(t))}function Pr(e,t){this.code=fh+e,this.message=t||dh[e]||""}function Rr(e){var t=e&&e.code;return t?new Pr(t.substring(fh.length),e.message):null}function Ar(e){var t=e[yh];if(void 0===t)throw new Pr("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new Pr("invalid-continue-uri");this.h=t,this.c=this.a=null,this.g=!1;var n=e[vh];if(n&&"object"==typeof n){t=n[wh];var r=n[mh];if(n=n[bh],"string"==typeof t&&t.length){if(this.a=t,void 0!==r&&"boolean"!=typeof r)throw new Pr("argument-error",mh+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new Pr("argument-error",bh+" property must be a non empty string when specified.");this.c=n||null}else{if(void 0!==t)throw new Pr("argument-error",wh+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new Pr("missing-android-pkg-name")}}else if(void 0!==n)throw new Pr("argument-error",vh+" property must be a non null object when specified.");if(this.b=null,(t=e[gh])&&"object"==typeof t){if("string"==typeof(t=t[Eh])&&t.length)this.b=t;else if(void 0!==t)throw new Pr("argument-error",Eh+" property must be a non empty string when specified.")}else if(void 0!==t)throw new Pr("argument-error",gh+" property must be a non null object when specified.");if(void 0!==(e=e[_h])&&"boolean"!=typeof e)throw new Pr("argument-error",_h+" property must be a boolean when specified.");if((this.f=!!e)&&!this.b&&!this.a)throw new Pr("argument-error",_h+" property can't be true when no mobile application is provided.")}function kr(e){var t={};t.continueUrl=e.h,t.canHandleCodeInApp=e.f,(t.androidPackageName=e.a)&&(t.androidMinimumVersion=e.c,t.androidInstallApp=e.g),t.iOSBundleId=e.b;for(var n in t)null===t[n]&&delete t[n];return t}function Dr(e){this.b=e.sub,lu(),this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null}function xr(e){if(e=e.split("."),3!=e.length)return null;e=e[1];for(var t=(4-e.length%4)%4,n=0;n<t;n++)e+=".";try{var r=JSON.parse(It(e));if(r.sub&&r.iss&&r.aud&&r.exp)return new Dr(r)}catch(e){}return null}function Lr(e){for(var t in Sh)if(Sh[t].Na==e)return Sh[t];return null}function Mr(e){var t={};t["facebook.com"]=jr,t["google.com"]=Vr,t["github.com"]=Wr,t["twitter.com"]=Br;var n=e&&e[Ih];try{if(n)return t[n]?new t[n](e):new Ur(e);if(void 0!==e[Nh])return new Fr(e)}catch(e){}return null}function Fr(e){var t=e[Ih];
1if(!t&&e[Nh]){var n=xr(e[Nh]);n&&n.a&&(t=n.a)}if(!t)throw Error("Invalid additional user info!");"anonymous"!=t&&"custom"!=t||(t=null),n=!1,void 0!==e.isNewUser?n=!!e.isNewUser:"identitytoolkit#SignupNewUserResponse"===e.kind&&(n=!0),Er(this,"providerId",t),Er(this,"isNewUser",n)}function Ur(e){Fr.call(this,e),e=fr(e.rawUserInfo||"{}"),Er(this,"profile",Ir(e||{}))}function jr(e){if(Ur.call(this,e),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Wr(e){if(Ur.call(this,e),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Er(this,"username",this.profile&&this.profile.login||null)}function Vr(e){if(Ur.call(this,e),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Br(e){if(Ur.call(this,e),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Er(this,"username",e.screenName||null)}function qr(e,t){return e.then(function(e){if(e[Ph]){var n=xr(e[Ph]);if(!n||t!=n.b)throw new Pr("user-mismatch");return e}throw new Pr("user-mismatch")}).s(function(e){throw e&&e.code&&e.code==fh+"user-not-found"?new Pr("user-mismatch"):e})}function Kr(e,t){if(t.idToken||t.accessToken)t.idToken&&Er(this,"idToken",t.idToken),t.accessToken&&Er(this,"accessToken",t.accessToken);else{if(!t.oauthToken||!t.oauthTokenSecret)throw new Pr("internal-error","failed to construct a credential");Er(this,"accessToken",t.oauthToken),Er(this,"secret",t.oauthTokenSecret)}Er(this,"providerId",e)}function Hr(e){var t={};return e.idToken&&(t.id_token=e.idToken),e.accessToken&&(t.access_token=e.accessToken),e.secret&&(t.oauth_token_secret=e.secret),t.providerId=e.providerId,{postBody:cn(t).toString(),requestUri:"http://localhost"}}function Gr(e,t){this.rc=t||[],Cr(this,{providerId:e,isOAuthProvider:!0}),this.rb={},this.Wa=(Lr(e)||{}).Ma||null,this.Ua=null}function zr(e){Gr.call(this,e,Th),this.a=[]}function Qr(){zr.call(this,"facebook.com")}function Xr(e){if(!e)throw new Pr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return c(e)&&(t=e.accessToken),(new Qr).credential(null,t)}function Yr(){zr.call(this,"github.com")}function Jr(e){if(!e)throw new Pr("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return c(e)&&(t=e.accessToken),(new Yr).credential(null,t)}function $r(){zr.call(this,"google.com"),this.sa("profile")}function Zr(e,t){var n=e;return c(e)&&(n=e.idToken,t=e.accessToken),(new $r).credential(n,t)}function ei(){Gr.call(this,"twitter.com",Ch)}function ti(e,t){var n=e;if(c(n)||(n={oauthToken:e,oauthTokenSecret:t}),!n.oauthToken||!n.oauthTokenSecret)throw new Pr("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Kr("twitter.com",n)}function ni(e,t){this.a=e,this.f=t,Er(this,"providerId","password")}function ri(){Cr(this,{providerId:"password",isOAuthProvider:!1})}function ii(e){if(!(e.Pa&&e.Oa||e.Da&&e.Y))throw new Pr("internal-error");this.a=e,Er(this,"providerId","phone")}function oi(e){return e.a.Da&&e.a.Y?{temporaryProof:e.a.Da,phoneNumber:e.a.Y}:{sessionInfo:e.a.Pa,code:e.a.Oa}}function ai(e){try{this.a=e||au.auth()}catch(e){throw new Pr("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Cr(this,{providerId:"phone",isOAuthProvider:!1})}function si(e,t){if(!e)throw new Pr("missing-verification-id");if(!t)throw new Pr("missing-verification-code");return new ii({Pa:e,Oa:t})}function ui(e){if(e.temporaryProof&&e.phoneNumber)return new ii({Da:e.temporaryProof,Y:e.phoneNumber});var t=e&&e.providerId;if(!t||"password"===t)return null;var n=e&&e.oauthAccessToken,r=e&&e.oauthTokenSecret;e=e&&e.oauthIdToken;try{switch(t){case"google.com":return Zr(e,n);case"facebook.com":return Xr(n);case"github.com":return Jr(n);case"twitter.com":return ti(n,r);default:return new zr(t).credential(e,n)}}catch(e){return null}}function ci(e){if(!e.isOAuthProvider)throw new Pr("invalid-oauth-provider")}function hi(e,t,n,r,i){if(this.b=e,this.c=t||null,this.f=n||null,this.g=r||null,this.a=i||null,!this.f&&!this.a)throw new Pr("invalid-auth-event");
1if(this.f&&this.a)throw new Pr("invalid-auth-event");if(this.f&&!this.g)throw new Pr("invalid-auth-event")}function li(e){return e=e||{},e.type?new hi(e.type,e.eventId,e.urlResponse,e.sessionId,e.error&&Rr(e.error)):null}function pi(e){var t="unauthorized-domain",n=void 0,r=tn(e);e=r.b,r=r.c,"chrome-extension"==r?n=_("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):"http"==r||"https"==r?n=_("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",Pr.call(this,t,n)}function fi(e,t,n){Pr.call(this,e,n),e=t||{},e.sb&&Er(this,"email",e.sb),e.Y&&Er(this,"phoneNumber",e.Y),e.credential&&Er(this,"credential",e.credential)}function di(e){if(e.code){var t=e.code||"";0==t.indexOf(fh)&&(t=t.substring(fh.length));var n={credential:ui(e)};if(e.email)n.sb=e.email;else{if(!e.phoneNumber)return new Pr(t,e.message||void 0);n.Y=e.phoneNumber}return new fi(t,n,e.message)}return null}function vi(e){this.f=e}function _i(e,t,n){var r="Node"==er();if(!(r=uu.XMLHttpRequest||r&&au.INTERNAL.node&&au.INTERNAL.node.XMLHttpRequest))throw new Pr("internal-error","The XMLHttpRequest compatibility library was not found.");this.b=e,e=t||{},this.i=e.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=e.secureTokenTimeout||Rh,this.c=L(e.secureTokenHeaders||Ah),this.g=e.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=e.firebaseTimeout||kh,this.a=L(e.firebaseHeaders||Dh),n&&(this.a["X-Client-Version"]=n,this.c["X-Client-Version"]=n),this.f=new Un,this.o=new vi(r)}function gi(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function yi(e,t){t?(e.a["X-Client-Version"]=t,e.c["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.c["X-Client-Version"])}function mi(e,t,n,r,i,o,a){gr()?(Hn()?e=p(e.m,e):(Oh||(Oh=new $(function(e,t){bi(e,t)})),e=p(e.u,e)),e(t,n,r,i,o,a)):n&&n(null)}function bi(e,t){((window.gapi||{}).client||{}).request?e():(uu[Lh]=function(){((window.gapi||{}).client||{}).request?e():t(Error("CORS_UNSUPPORTED"))},Dt(Dn(Te(xh,{onload:Lh}
1)),function(){t(Error("CORS_UNSUPPORTED"))}))}function wi(e,t){return new $(function(n,r){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?mi(e,e.i+"?key="+encodeURIComponent(e.b),function(e){e?e.error?r(ji(e)):e.access_token&&e.refresh_token?n(e):r(new Pr("internal-error")):r(new Pr("network-request-failed"))},"POST",cn(t).toString(),e.c,e.l.get()):r(new Pr("internal-error"))})}function Ei(e,t,n,r,i,o){var a=tn(e.g+t);Zt(a,"key",e.b),o&&Zt(a,"cb",lu().toString());var s="GET"==n;if(s)for(var u in r)r.hasOwnProperty(u)&&Zt(a,u,r[u]);return new $(function(t,o){mi(e,a.toString(),function(e){e?e.error?o(ji(e,i||{})):t(e):o(new Pr("network-request-failed"))},n,s?void 0:Ue(pr(r)),e.a,e.h.get())})}function Ci(e){if(!Yc.test(e.email))throw new Pr("invalid-email")}function Ti(e){"email"in e&&Ci(e)}function Si(e,t){return Fi(e,Vh,{identifier:t,continueUri:ur()?Bn():"http://localhost"}).then(function(e){return e.allProviders||[]})}function Ni(e){return Fi(e,zh,{}).then(function(e){return e.authorizedDomains||[]})}function Ii(e){if(!e[Ph])throw new Pr("internal-error")}function Oi(e){if(e.phoneNumber||e.temporaryProof){if(!e.phoneNumber||!e.temporaryProof)throw new Pr("internal-error")}else{if(!e.sessionInfo)throw new Pr("missing-verification-id");if(!e.code)throw new Pr("missing-verification-code")}}function Pi(e,t){return Fi(e,Yh,t)}function Ri(e,t,n){return Fi(e,qh,{idToken:t,deleteProvider:n})}function Ai(e){if(!e.requestUri||!e.sessionId&&!e.postBody)throw new Pr("internal-error")}function ki(e){var t=null;if(e.needConfirmation?(e.code="account-exists-with-different-credential",t=di(e)):"FEDERATED_USER_ID_ALREADY_LINKED"==e.errorMessage?(e.code="credential-already-in-use",t=di(e)):"EMAIL_EXISTS"==e.errorMessage?(e.code="email-already-in-use",t=di(e)):e.errorMessage&&(t=Ui(e.errorMessage)),t)throw t;if(!e[Ph])throw new Pr("internal-error")}function Di(e,t){return t.returnIdpCredential=!0,Fi(e,el,t)}function xi(e,t){return t.returnIdpCredential=!0,Fi(e,nl,t)}function Li(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,Fi(e,tl,t)}function Mi(e){if(!e.oobCode)throw new Pr("invalid-action-code")}function Fi(e,t,n){if(!Nr(n,t.ea))return ne(new Pr("internal-error"));var r,i=t.zb||"POST";return te(n).then(t.D).then(function(){return t.T&&(n.returnSecureToken=!0),Ei(e,t.endpoint,i,n,t.Pb,t.nb||!1)}).then(function(e){return r=e}).then(t.O).then(function(){if(!t.ga)return r;if(!(t.ga in r))throw new Pr("internal-error");return r[t.ga]})}function Ui(e){return ji({error:{errors:[{message:e}],code:400,message:e}})}function ji(e,t){var n=(e.error&&e.error.errors&&e.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new Pr(r[n]):null)return n;n=e.error&&e.error.message||"",r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},M(r,t||{}),t=(t=n.match(/^[^\s]+\s*:\s*(.*)$/))&&1<t.length?t[1]:void 0;for(var i in r)if(0===n.indexOf(i))return new Pr(r[i],t);return!t&&e&&(t=lr(e)),new Pr("internal-error",t)}function Wi(e){for(var t in ul)if(ul[t].id===e)return e=ul[t],{firebaseEndpoint:e.Va,secureTokenEndpoint:e.ab};return null}function Vi(e){this.b=e,this.a=null,this.Ya=Bi(this)}function Bi(e){return Hi().then(function(){return new $(function(t,n){or("gapi.iframes.getContext")().open({where:document.body,url:e.b,messageHandlersFilter:or("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(r){function i(){clearTimeout(o),t()}e.a=r,e.a.restyle({setHideOnLeave:!1});var o=setTimeout(function(){n(Error("Network Error"))},ll.get());r.ping(i).then(i,function(){n(Error("Network Error"))})})})})}function qi(e,t){return e.Ya.then(function(){return new $(function(n){e.a.send(t.type,t,n,or("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}function Ki(e,t){e.Ya.then(function(){e.a.register("authEvent",t,or("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}function Hi(){return pl||(pl=new $(function(e,t){if(gr()){var n=function(){_r(),or("gapi.load")("gapi.iframes",{callback:e,ontimeout:function(){_r(),t(Error("Network Error"))},timeout:hl.get()})};if(or("gapi.iframes.Iframe"))e();else if(or("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();uu[r]=function(){or("gapi.load")?n():t(Error("Network Error"))},r=Te(cl,{onload:r}),te(Dn(r)).s(function(){t(Error("Network Error"))})}}else t(Error("Network Error"))}).s(function(e){throw pl=null,e}))}function Gi(e,t,n){this.i=e,this.g=t,this.h=n,this.f=null,this.a=nn(this.i,"/__/auth/iframe"),Zt(this.a,"apiKey",this.g),Zt(this.a,"appName",this.h),this.b=null,this.c=[]}function zi(e,t,n,r,i){this.m=e,this.u=t,this.c=n,this.l=r,this.i=this.g=this.h=null,this.a=i,this.f=null}function Qi(e){try{return au.app(e).auth().Ka()}catch(e){return[]}}function Xi(e,t,n,r,i){this.u=e,this.f=t,this.b=n,this.c=r||null,this.h=i||null,this.m=this.o=this.v=null,this.g=[],this.l=this.a=null}function Yi(e){var t=Bn();return Ni(e).then(function(e){e:{var n=tn(t),r=n.c;n=n.b;for(var i=0;i<e.length;i++){var o=e[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=tn(o).b==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:Zc.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){e=!0;break e}}e=!1}if(!e)throw new pi(Bn())})}function Ji(e){return e.l?e.l:(e.l=Yn().then(function(){if(!e.o){var t=e.c,n=e.h,r=Qi(e.b),i=new Gi(e.u,e.f,e.b);i.f=t,i.b=n,i.c=O(r||[]),e.o=i.toString()}e.i=new Vi(e.o),eo(e)}),e.l)}function $i(e){return e.m||(e.v=e.c?rr(e.c,Qi(e.b)):null,e.m=new _i(e.f,Wi(e.h),e.v)),e.m}function Zi(e,t,n,r,i,o,a,s,u,c){return e=new zi(e,t,n,r,i),e.h=o,e.g=a,e.i=s,e.b=L(u||null),e.f=c,e.toString()}function eo(e){if(!e.i)throw Error("IfcHandler must be initialized!");Ki(e.i,function(t){var n={};if(t&&t.authEvent){var r=!1;for(t=li(t.authEvent),n=0;n<e.g.length;n++)r=e.g[n](t)||r;return n={},n.status=r?"ACK":"ERROR",te(n)}return n.status="ERROR",te(n)})}function to(e){var t={type:"webStorageSupport"};return Ji(e).then(function(){return qi(e.i,t)}).then(function(e){if(e&&e.length&&void 0!==e[0].webStorageSupport)return e[0].webStorageSupport;throw Error()})}function no(e){if(this.a=e||au.INTERNAL.reactNative&&au.INTERNAL.reactNative.AsyncStorage,!this.a)throw new Pr("internal-error","The React Native compatibility library was not found.")}function ro(){this.a={}}function io(e,t,n,r,i,o){try{var a=!!uu.indexedDB}catch(e){a=!1}if(!a)throw new Pr("web-storage-unsupported");this.u=e,this.h=t,this.g=n,this.l=r,this.m=i,this.f={},this.c=[],this.a=0,this.o=o||uu.indexedDB}function oo(e){return new $(function(t,n){var r=e.o.open(e.u,e.m);r.onerror=function(e){n(Error(e.target.errorCode))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore(e.h,{keyPath:e.g})}catch(e){n(e)}},r.onsuccess=function(e){t(e.target.result)}})}function ao(e){return e.i||(e.i=oo(e)),e.i}function so(e,t){return t.objectStore(e.h)}function uo(e,t,n){return t.transaction([e.h],n?"readwrite":"readonly")}function co(e){return new $(function(t,n){e.onsuccess=function(e){e&&e.target?t(e.target.result):t()},e.onerror=function(e){n(Error(e.target.errorCode))}})}function ho(e){function t(){return e.b=_t(800).then(p(e.zc,e)).then(function(t){0<t.length&&Eu(e.c,function(e){e(t)})}).then(t).s(function(e){"STOP_EVENT"!=e.message&&t()}),e.b}e.b&&e.b.cancel("STOP_EVENT"),t()}
1function lo(){if(!fo()){if("Node"==er())throw new Pr("internal-error","The LocalStorage compatibility library was not found.");throw new Pr("web-storage-unsupported")}this.a=po()||au.INTERNAL.node.localStorage}function po(){try{var e=uu.localStorage,t=dr();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}function fo(){var e="Node"==er();if(!(e=po()||e&&au.INTERNAL.node&&au.INTERNAL.node.localStorage))return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}function vo(){}function _o(){if(!yo()){if("Node"==er())throw new Pr("internal-error","The SessionStorage compatibility library was not found.");throw new Pr("web-storage-unsupported")}this.a=go()||au.INTERNAL.node.sessionStorage}function go(){try{var e=uu.sessionStorage,t=dr();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}function yo(){var e="Node"==er();if(!(e=go()||e&&au.INTERNAL.node&&au.INTERNAL.node.sessionStorage))return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}function mo(){var e={};e.Browser=_l,e.Node=gl,e.ReactNative=yl,this.a=e[er()]}function bo(e){var t=new Pr("invalid-persistence-type"),n=new Pr("unsupported-persistence-type");e:{for(r in ml)if(ml[r]==e){var r=!0;break e}r=!1}if(!r||"string"!=typeof e)throw t;switch(er()){case"ReactNative":if("session"===e)throw n;break;case"Node":if("none"!==e)throw n;break;default:if(!ar()&&"none"!==e)throw n}}function wo(e,t,n,r,i){this.i=e,this.g=t,this.A=n,this.u=r,this.v=i,this.a={},dl||(dl=new mo),e=dl;try{if(Vn()){fl||(fl=new io("firebaseLocalStorageDb","firebaseLocalStorage","fbase_key","value",1));var o=fl}else o=new e.a.C;this.l=o}catch(e){this.l=new ro,this.u=!0}try{this.o=new e.a.jb}catch(e){this.o=new ro}this.w=new ro,this.h=p(this.m,this),this.b={}}function Eo(){return vl||(vl=new wo("firebase",":",!(vr(ir())||!Zn()),hr(),ar())),vl}function Co(e,t){switch(t){case"session":return e.o;case"none":return e.w;default:return e.l}}function To(e,t,n){return e.i+e.g+t.name+(n?e.g+n:"")}function So(e,t,n){return n=To(e,t,n),"local"==t.C&&(e.b[n]=null),Co(e,t.C).X(n)}function No(e,t,n,r){t=To(e,t,n),e.v&&(e.b[t]=uu.localStorage.getItem(t)),D(e.a)&&(Co(e,"local").ia(e.h),e.u||Vn()||!e.v||Oo(e)),e.a[t]||(e.a[t]=[]),e.a[t].push(r)}function Io(e,t,n){t=To(e,cs("local"),t),e.a[t]&&(N(e.a[t],function(e){return e==n}),0==e.a[t].length&&delete e.a[t]),D(e.a)&&Ro(e)}function Oo(e){Po(e),e.f=setInterval(function(){for(var t in e.a){var n=uu.localStorage.getItem(t),r=e.b[t];n!=r&&(e.b[t]=n,n=new He({type:"storage",key:t,target:window,oldValue:r,newValue:n,a:!0}),e.m(n))}},1e3)}function Po(e){e.f&&(clearInterval(e.f),e.f=null)}function Ro(e){Co(e,"local").da(e.h),Po(e)}function Ao(e){this.a=e,this.b=Eo()}function ko(e){return e.b.get(bl,e.a).then(function(e){return li(e)})}function Do(){this.a=Eo()}function xo(e,t,n,r,i,o,a){this.u=e,this.i=t,this.l=n,this.m=r||null,this.o=a||null,this.h=t+":"+n,this.A=new Do,this.g=new Ao(this.h),this.f=null,this.b=[],this.v=i||500,this.w=o||2e3,this.a=this.c=null}function Lo(e){return new Pr("invalid-cordova-configuration",e)}function Mo(){for(var e=20,t=[];0<e;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),e--;return t.join("")}function Fo(e){var t=new Kt;qt(t,e),e=[];var n=8*t.g;56>t.c?qt(t,Lc,56-t.c):qt(t,Lc,t.b-(t.c-56));for(var r=63;56<=r;r--)t.f[r]=255&n,n/=256;for(Bt(t),r=n=0;r<t.i;r++)for(var i=24;0<=i;i-=8)e[n++]=t.a[r]>>i&255;return Nt(e)}function Uo(e,t,n,r){var i=Mo(),o=new hi(t,r,null,i,new Pr("no-auth-event")),a=or("BuildInfo.packageName",uu);if("string"!=typeof a)throw new Pr("invalid-cordova-configuration");var s=or("BuildInfo.displayName",uu),u={};if(ir().toLowerCase().match(/iphone|ipad|ipod/))u.ibi=a;else{if(!ir().toLowerCase().match(/android/))return ne(new Pr("operation-not-supported-in-this-environment"));u.apn=a}s&&(u.appDisplayName=s),i=Fo(i),u.sessionId=i;var c=Zi(e.u,e.i,e.l,t,n,null,r,e.m,u,e.o);return e.ba().then(function(){var t=e.h;return e.A.a.set(bl,o.B(),t)}).then(function(){var t=or("cordova.plugins.browsertab.isAvailable",uu);if("function"!=typeof t)throw new Pr("invalid-cordova-configuration");var n=null;t(function(t){if(t){if("function"!=typeof(n=or("cordova.plugins.browsertab.openUrl",uu)))throw new Pr("invalid-cordova-configuration");n(c)}else{if("function"!=typeof(n=or("cordova.InAppBrowser.open",uu)))throw new Pr("invalid-cordova-configuration");t=ir(),t=!(!t.match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!t.match(/(iPad|iPhone|iPod).*OS 8_\d/i)),e.a=n(c,t?"_blank":"_system","location=yes")}})})}function jo(e,t){for(var n=0;n<e.b.length;n++)try{e.b[n](t)}catch(e){}}function Wo(e){return e.f||(e.f=e.ba().then(function(){return new $(function(t){function n(r){return t(r),e.Ja(n),!1}e.ua(n),Bo(e)})})),e.f}function Vo(e){var t=null;return ko(e.g).then(function(n){return t=n,n=e.g,So(n.b,bl,n.a)}).then(function(){return t})}function Bo(e){function t(t){i=!0,o&&o.cancel(),Vo(e).then(function(n){var i=r;if(n&&t&&t.url){i=null;var o=t.url,a=tn(o),s=en(a,"link"),u=en(tn(s),"link");a=en(a,"deep_link_id"),o=en(tn(a),"link")||a||u||s||o,-1!=o.indexOf("/__/auth/callback")&&(i=tn(o),i=fr(en(i,"firebaseError")||null),i=(i="object"==typeof i?Rr(i):null)?new hi(n.b,n.c,null,null,i):new hi(n.b,n.c,o,n.g)),i=i||r}jo(e,i)})}var n=or("universalLinks.subscribe",uu);if("function"!=typeof n)throw new Pr("invalid-cordova-configuration");var r=new hi("unknown",null,null,null,new Pr("no-auth-event")),i=!1,o=_t(e.v).then(function(){return Vo(e).then(function(){i||jo(e,r)})}),a=uu.handleOpenURL;uu.handleOpenURL=function(e){if(0==e.toLowerCase().indexOf(or("BuildInfo.packageName",uu).toLowerCase()+"://")&&t({url:e}),"function"==typeof a)try{a(e)}catch(e){console.error(e)}},n(null,t)}function qo(e){this.a=e,this.b=Eo()}function Ko(e){return e.b.set(wl,"pending",e.a)}function Ho(e){return So(e.b,wl,e.a)}function Go(e){return e.b.get(wl,e.a).then(function(e){return"pending"==e})}function zo(e,t,n){this.v=e,this.l=t,this.u=n,this.h=[],this.f=!1,this.i=p(this.m,this),this.c=new ea,this.o=new sa,this.g=new qo(this.l+":"+this.u),this.b={},this.b.unknown=this.c,this.b.signInViaRedirect=this.c,this.b.linkViaRedirect=this.c,this.b.reauthViaRedirect=this.c,this.b.signInViaPopup=this.o,this.b.linkViaPopup=this.o,this.b.reauthViaPopup=this.o,this.a=Qo(this.v,this.l,this.u,Fh)}function Qo(e,t,n,r){var i=au.SDK_VERSION||null;return $n()?new xo(e,t,n,i,void 0,void 0,r):new Xi(e,t,n,i,r)}function Xo(e){e.f||(e.f=!0,e.a.ua(e.i));var t=e.a;return e.a.ba().s(function(n){throw e.a==t&&e.reset(),n})}function Yo(e){e.a.Db()&&Xo(e).s(function(t){var n=new hi("unknown",null,null,null,new Pr("operation-not-supported-in-this-environment"));$o(t)&&e.m(n)}),e.a.yb()||ta(e.c)}function Jo(e,t,n,r,i,o){return e.a.vb(t,n,r,function(){e.f||(e.f=!0,e.a.ua(e.i))},function(){e.reset()},i,o)}function $o(e){return!(!e||"auth/cordova-not-ready"!=e.code)}
1function Zo(e,t,n){var r=t+":"+n;return Tl[r]||(Tl[r]=new zo(e,t,n)),Tl[r]}function ea(){this.b=null,this.f=[],this.c=[],this.a=null,this.g=!1}function ta(e){e.g||(e.g=!0,oa(e,!1,null,null))}function na(e,t,n){n=n.va(t.b,t.c);var r=t.f,i=t.g,o=!!t.b.match(/Redirect$/);return n(r,i).then(function(t){oa(e,o,t,null)}).s(function(t){oa(e,o,null,t)})}function ra(e,t){if(e.b=function(){return ne(t)},e.c.length)for(var n=0;n<e.c.length;n++)e.c[n](t)}function ia(e,t){if(e.b=function(){return te(t)},e.f.length)for(var n=0;n<e.f.length;n++)e.f[n](t)}function oa(e,t,n,r){t?r?ra(e,r):ia(e,n):ia(e,{user:null}),e.f=[],e.c=[]}function aa(e){var t=new Pr("timeout");e.a&&e.a.cancel(),e.a=_t(Cl.get()).then(function(){e.b||oa(e,!0,null,t)})}function sa(){}function ua(e,t){var n=e.c,r=e.b;return t.va(r,n)(e.f,e.g).then(function(e){t.fa(r,e,null,n)}).s(function(e){t.fa(r,null,e,n)})}function ca(e,t){this.a=t,Er(this,"verificationId",e)}function ha(e,t,n,r){return new ai(e).Qa(t,n).then(function(e){return new ca(e,r)})}function la(e,t,n,r,i,o){if(this.h=e,this.i=t,this.g=n,this.c=r,this.f=i,this.l=!!o,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function pa(e,t){return t?(e.a=e.c,e.g()):(t=e.a,e.a*=2,e.a>e.f&&(e.a=e.f),t)}function fa(e,t){da(e),e.b=_t(pa(e,t)).then(function(){return e.l?te():br()}).then(function(){return e.h()}).then(function(){fa(e,!0)}).s(function(t){e.i(t)&&fa(e,!1)})}function da(e){e.b&&(e.b.cancel(),e.b=null)}function va(e){this.f=e,this.b=this.a=null,this.c=0}function _a(e,t){var n=t[Ph],r=t.refreshToken;t=ga(t.expiresIn),e.b=n,e.c=t,e.a=r}function ga(e){return lu()+1e3*parseInt(e,10)}function ya(e,t){return wi(e.f,t).then(function(t){return e.b=t.access_token,e.c=ga(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t})}function ma(e,t){this.a=e||null,this.b=t||null,Cr(this,{lastSignInTime:wr(t||null),creationTime:wr(e||null)})}function ba(e){return new ma(e.a,e.b)}function wa(e,t,n,r,i,o){Cr(this,{uid:e,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:t})}function Ea(e,t){Ke.call(this,e);for(var n in t)this[n]=t[n]}function Ca(e,t,n){this.A=[],this.G=e.apiKey,this.o=e.appName,this.w=e.authDomain||null,e=au.SDK_VERSION?rr(au.SDK_VERSION):null,this.c=new _i(this.G,Wi(Fh),e),this.h=new va(this.c),Aa(this,t[Ph]),_a(this.h,t),Er(this,"refreshToken",this.h.a),La(this,n||{}),ht.call(this),this.I=!1,this.w&&sr()&&(this.a=Zo(this.w,this.G,this.o)),this.N=[],this.i=null,this.l=Oa(this),this.U=p(this.Ga,this);var r=this;this.ha=null,this.ra=function(e){r.na(e.h)},this.W=null,this.R=[],this.qa=function(e){Sa(r,e.f)},this.V=null}function Ta(e,t){e.W&&nt(e.W,"languageCodeChanged",e.ra),(e.W=t)&&$e(t,"languageCodeChanged",e.ra)}function Sa(e,t){e.R=t,yi(e.c,au.SDK_VERSION?rr(au.SDK_VERSION,e.R):null)}function Na(e,t){e.V&&nt(e.V,"frameworkChanged",e.qa),(e.V=t)&&$e(t,"frameworkChanged",e.qa)}function Ia(e){try{return au.app(e.o).auth()}catch(t){throw new Pr("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function Oa(e){return new la(function(){return e.F(!0)},function(e){return!(!e||"auth/network-request-failed"!=e.code)},function(){var t=e.h.c-lu()-3e5;return 0<t?t:0},3e4,96e4,!1)}function Pa(e){e.m||e.l.b||(e.l.start(),nt(e,"tokenChanged",e.U),$e(e,"tokenChanged",e.U))}function Ra(e){nt(e,"tokenChanged",e.U),da(e.l)}function Aa(e,t){e.pa=t,Er(e,"_lat",t)}function ka(e,t){N(e.N,function(e){return e==t})}function Da(e){for(var t=[],n=0;n<e.N.length;n++)t.push(e.N[n](e));return oe(t).then(function(){return e})}function xa(e){e.a&&!e.I&&(e.I=!0,e.a.subscribe(e))}function La(e,t){Cr(e,{uid:t.uid,displayName:t.displayName||null,photoURL:t.photoURL||null,email:t.email||null,emailVerified:t.emailVerified||!1,phoneNumber:t.phoneNumber||null,isAnonymous:t.isAnonymous||!1,metadata:new ma(t.createdAt,t.lastLoginAt),providerData:[]})}function Ma(){}function Fa(e){return te().then(function(){if(e.m)throw new Pr("app-deleted")})}function Ua(e){return Cu(e.providerData,function(e){return e.providerId})}function ja(e,t){t&&(Wa(e,t.providerId),e.providerData.push(t))}function Wa(e,t){N(e.providerData,function(e){return e.providerId==t})}function Va(e,t,n){("uid"!=t||n)&&e.hasOwnProperty(t)&&Er(e,t,n)}function Ba(e,t){e!=t&&(Cr(e,{uid:t.uid,displayName:t.displayName,photoURL:t.photoURL,email:t.email,emailVerified:t.emailVerified,phoneNumber:t.phoneNumber,isAnonymous:t.isAnonymous,providerData:[]}
1),t.metadata?Er(e,"metadata",ba(t.metadata)):Er(e,"metadata",new ma),Eu(t.providerData,function(t){ja(e,t)}),e.h=t.h,Er(e,"refreshToken",e.h.a))}function qa(e){return e.F().then(function(t){var n=e.isAnonymous;return Ha(e,t).then(function(){return n||Va(e,"isAnonymous",!1),t})})}function Ka(e,t){t[Ph]&&e.pa!=t[Ph]&&(_a(e.h,t),lt(e,new Ea("tokenChanged")),Aa(e,t[Ph]),Va(e,"refreshToken",e.h.a))}function Ha(e,t){return Fi(e.c,Kh,{idToken:t}).then(p(e.kc,e))}function Ga(e){return(e=e.providerUserInfo)&&e.length?Cu(e,function(e){return new wa(e.rawId,e.providerId,e.email,e.displayName,e.photoUrl,e.phoneNumber)}):[]}function za(e,t){return qa(e).then(function(){if(T(Ua(e),t))return Da(e).then(function(){throw new Pr("provider-already-linked")})})}function Qa(e,t,n){var r=ui(t);return t=Mr(t),Tr({user:e,credential:r,additionalUserInfo:t,operationType:n})}function Xa(e,t){return Ka(e,t),e.reload().then(function(){return e})}function Ya(e,t,n,r,i){if(!sr())return ne(new Pr("operation-not-supported-in-this-environment"));if(e.i&&!i)return ne(e.i);var o=Lr(n.providerId),a=dr(e.uid+":::"),s=null;(!hr()||Zn())&&e.w&&n.isOAuthProvider&&(s=Zi(e.w,e.G,e.o,t,n,null,a,au.SDK_VERSION||null));var u=Qn(s,o&&o.za,o&&o.ya);return r=r().then(function(){if($a(e),!i)return e.F().then(function(){})}).then(function(){return Jo(e.a,u,t,n,a,!!s)}).then(function(){return new $(function(n,r){e.fa(t,null,new Pr("cancelled-popup-request"),e.g||null),e.f=n,e.v=r,e.g=a,e.b=e.a.Ca(e,t,u,a)})}).then(function(e){return u&&zn(u),e?Tr(e):null}).s(function(e){throw u&&zn(u),e}),Za(e,r,i)}function Ja(e,t,n,r,i){if(!sr())return ne(new Pr("operation-not-supported-in-this-environment"));if(e.i&&!i)return ne(e.i);var o=null,a=dr(e.uid+":::");return r=r().then(function(){if($a(e),!i)return e.F().then(function(){})}).then(function(){return e.Z=a,Da(e)}).then(function(t){return e.ca&&(t=e.ca,t=t.b.set(Sl,e.B(),t.a)),t}).then(function(){return e.a.Aa(t,n,a)}).s(function(t){if(o=t,e.ca)return is(e.ca);throw o}).then(function(){if(o)throw o}),Za(e,r,i)}function $a(e){if(!e.a||!e.I){if(e.a&&!e.I)throw new Pr("internal-error");throw new Pr("auth-domain-config-required")}}function Za(e,t,n){var r=es(e,t,n);return e.A.push(r),ae(r,function(){S(e.A,r)}),r}
1function es(e,t,n){return e.i&&!n?(t.cancel(),ne(e.i)):t.s(function(t){throw!t||"auth/user-disabled"!=t.code&&"auth/user-token-expired"!=t.code||(e.i||lt(e,new Ea("userInvalidated")),e.i=t),t})}function ts(e){if(!e.apiKey)return null;var t={apiKey:e.apiKey,authDomain:e.authDomain,appName:e.appName},n={};if(!(e.stsTokenManager&&e.stsTokenManager.accessToken&&e.stsTokenManager.expirationTime))return null;n[Ph]=e.stsTokenManager.accessToken,n.refreshToken=e.stsTokenManager.refreshToken||null,n.expiresIn=(e.stsTokenManager.expirationTime-lu())/1e3;var r=new Ca(t,n,e);return e.providerData&&Eu(e.providerData,function(e){e&&ja(r,Tr(e))}),e.redirectEventId&&(r.Z=e.redirectEventId),r}function ns(e,t,n,r){var i=new Ca(e,t);return n&&(i.ca=n),r&&Sa(i,r),i.reload().then(function(){return i})}function rs(e){this.a=e,this.b=Eo()}function is(e){return So(e.b,Sl,e.a)}function os(e,t){return e.b.get(Sl,e.a).then(function(e){return e&&t&&(e.authDomain=t),ts(e||{})})}function as(e,t){this.a=e,this.b=t||Eo(),this.c=null,this.f=us(this),No(this.b,cs("local"),this.a,p(this.g,this))}function ss(e,t){var n,r=[];for(n in ml)ml[n]!==t&&r.push(So(e.b,cs(ml[n]),e.a));return r.push(So(e.b,Nl,e.a)),ie(r)}function us(e){var t=cs("local"),n=cs("session"),r=cs("none");return e.b.get(n,e.a).then(function(i){return i?n:e.b.get(r,e.a).then(function(n){return n?r:e.b.get(t,e.a).then(function(n){return n?t:e.b.get(Nl,e.a).then(function(e){return e?cs(e):t})})})}).then(function(t){return e.c=t,ss(e,t.C)}).s(function(){e.c||(e.c=t)})}function cs(e){return{name:"authUser",C:e}}function hs(e){return ds(e,function(){return e.b.set(Nl,e.c.C,e.a)})}function ls(e,t){return ds(e,function(){return e.b.set(e.c,t.B(),e.a)})}function ps(e){return ds(e,function(){return So(e.b,e.c,e.a)})}function fs(e,t){return ds(e,function(){return e.b.get(e.c,e.a).then(function(e){return e&&t&&(e.authDomain=t),ts(e||{})})})}function ds(e,t){return e.f=e.f.then(t,t),e.f}function vs(e){if(this.l=!1,Er(this,"app",e),!Is(this).options||!Is(this).options.apiKey)throw new Pr("invalid-api-key");e=au.SDK_VERSION?rr(au.SDK_VERSION):null,this.c=new _i(Is(this).options&&Is(this).options.apiKey,Wi(Fh),e),this.N=[],this.m=[],this.I=[],this.Kb=au.INTERNAL.createSubscribe(p(this.ac,this)),this.R=void 0,this.Lb=au.INTERNAL.createSubscribe(p(this.bc,this)),Es(this,null),this.h=new as(Is(this).options.apiKey+":"+Is(this).name),this.G=new rs(Is(this).options.apiKey+":"+Is(this).name),this.U=ks(this,Ts(this)),this.i=ks(this,Ss(this)),this.W=!1,this.ha=p(this.yc,this),this.Ga=p(this.ka,this),this.pa=p(this.Tb,this),this.qa=p(this.Zb,this),this.ra=p(this.$b,this),bs(this),this.INTERNAL={},this.INTERNAL.delete=p(this.delete,this),this.INTERNAL.logFramework=p(this.gc,this),this.o=0,ht.call(this),ys(this),this.A=[]}function _s(e){Ke.call(this,"languageCodeChanged"),this.h=e}function gs(e){Ke.call(this,"frameworkChanged"),this.f=e}function ys(e){Object.defineProperty(e,"lc",{get:function(){return this.$()},set:function(e){this.na(e)},enumerable:!1}),e.V=null}function ms(e){return e.Jb||ne(new Pr("auth-domain-config-required"))}function bs(e){var t=Is(e).options.authDomain,n=Is(e).options.apiKey;t&&sr()&&(e.Jb=e.U.then(function(){if(!e.l){if(e.a=Zo(t,n,Is(e).name),e.a.subscribe(e),Os(e)&&xa(Os(e)),e.w){xa(e.w);var r=e.w;r.na(e.$()),Ta(r,e),r=e.w,Sa(r,e.A),Na(r,e),e.w=null}return e.a}}))}function ws(e,t){var n={};return n.apiKey=Is(e).options.apiKey,n.authDomain=Is(e).options.authDomain,n.appName=Is(e).name,e.U.then(function(){return ns(n,t,e.G,e.Ka())}).then(function(t){return Os(e)&&t.uid==Os(e).uid?(Ba(Os(e),t),e.ka(t)):(Es(e,t),xa(t),e.ka(t))}).then(function(){Rs(e)})}function Es(e,t){Os(e)&&(ka(Os(e),e.Ga),nt(Os(e),"tokenChanged",e.pa),nt(Os(e),"userDeleted",e.qa),nt(Os(e),"userInvalidated",e.ra),Ra(Os(e))),t&&(t.N.push(e.Ga),$e(t,"tokenChanged",e.pa),$e(t,"userDeleted",e.qa),$e(t,"userInvalidated",e.ra),0<e.o&&Pa(t)),Er(e,"currentUser",t),t&&(t.na(e.$()),Ta(t,e),Sa(t,e.A),Na(t,e))}function Cs(e){var t=os(e.G,Is(e).options.authDomain).then(function(t){return(e.w=t)&&(t.ca=e.G),is(e.G)});return ks(e,t)}function Ts(e){var t=Is(e).options.authDomain,n=Cs(e).then(function(){return fs(e.h,t)}
1).then(function(t){return t?(t.ca=e.G,e.w&&(e.w.Z||null)==(t.Z||null)?t:t.reload().then(function(){return ls(e.h,t).then(function(){return t})}).s(function(n){return"auth/network-request-failed"==n.code?t:ps(e.h)})):null}).then(function(t){Es(e,t||null)});return ks(e,n)}function Ss(e){return e.U.then(function(){return e.aa()}).s(function(){}).then(function(){if(!e.l)return e.ha()}).s(function(){}).then(function(){if(!e.l){e.W=!0;var t=e.h;No(t.b,cs("local"),t.a,e.ha)}})}function Ns(e,t){var n=null,r=null;return ks(e,t.then(function(t){return n=ui(t),r=Mr(t),ws(e,t)}).then(function(){return Tr({user:Os(e),credential:n,additionalUserInfo:r,operationType:"signIn"})}))}function Is(e){return e.app}function Os(e){return e.currentUser}function Ps(e){return Os(e)&&Os(e)._lat||null}function Rs(e){if(e.W){for(var t=0;t<e.m.length;t++)e.m[t]&&e.m[t](Ps(e));if(e.R!==e.getUid()&&e.I.length)for(e.R=e.getUid(),t=0;t<e.I.length;t++)e.I[t]&&e.I[t](Ps(e))}}function As(e,t){e.I.push(t),ks(e,e.i.then(function(){!e.l&&T(e.I,t)&&e.R!==e.getUid()&&(e.R=e.getUid(),t(Ps(e)))}))}function ks(e,t){return e.N.push(t),ae(t,function(){S(e.N,t)}),t}function Ds(e,t,n,r){e:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<t.length;a++)if(t[a].optional)o=!0;else{if(o)throw new Pr("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=t.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=t[i].optional&&void 0===n[i],!t[i].M(n[i])&&!o){if(t=t[i],0>i||i>=Il.length)throw new Pr("internal-error","Argument validator received an unsupported number of arguments.");n=Il[i],r=(r?"":n+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.K+".";break e}r=null}}if(r)throw new Pr("argument-error",e+" failed: "+r)}function xs(t,n){return{name:t||"",K:"a valid string",optional:!!n,M:e}}function Ls(){return{name:"opt_forceRefresh",K:"a boolean",optional:!0,M:t}}function Ms(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:c}}function Fs(e,t){return{name:e||"",K:"a function",optional:!!t,M:u}}function Us(e,t){return{name:e||"",K:"null",optional:!!t,M:o}}function js(){return{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}}}function Ws(){return{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof vs)}}}function Vs(){return{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof au.app.App)}}}function Bs(e){return{name:e?e+"Credential":"credential",K:e?"a valid "+e+" credential":"a valid credential",optional:!1,M:function(t){if(!t)return!1;var n=!e||t.providerId===e;return!(!t.wa||!n)}}}function qs(){return{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}}function Ks(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!!(t&&e(t.type)&&u(t.verify))}}}function Hs(e,t,n,r){return{name:n||"",K:e.K+" or "+t.K,optional:!!r,M:function(n){return e.M(n)||t.M(n)}}}function Gs(e,t,n,r,i,o){if(Er(this,"type","recaptcha"),this.b=this.c=null,this.m=!1,this.l=t,this.a=n||{theme:"light",type:"image"},this.g=[],this.a[Rl])throw new Pr("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.h="invisible"===this.a[Al],!De(t)||!this.h&&De(t).hasChildNodes())throw new Pr("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new _i(e,o||null,i||null),this.o=r||function(){return null};var a=this;this.i=[];var s=this.a[Ol];this.a[Ol]=function(e){if(zs(a,e),"function"==typeof s)s(e);else if("string"==typeof s){var t=or(s,uu);"function"==typeof t&&t(e)}};var u=this.a[Pl];this.a[Pl]=function(){if(zs(a,null),"function"==typeof u)u();else if("string"==typeof u){var e=or(u,uu);"function"==typeof e&&e()}}}function zs(e,t){for(var n=0;n<e.i.length;n++)try{e.i[n](t)}catch(e){}}function Qs(e,t){N(e.i,function(e){return e==t})}function Xs(e,t){return e.g.push(t),ae(t,function(){S(e.g,t)}),t}function Ys(e){if(e.m)throw new Pr("internal-error","RecaptchaVerifier instance has been destroyed.")}function Js(){this.b=uu.grecaptcha?1/0:0,this.c=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}function $s(e,t){return new $(function(n,r){if(gr())if(!uu.grecaptcha||t!==e.c&&!e.b){uu[e.a]=function(){if(uu.grecaptcha){e.c=t;var i=uu.grecaptcha.render;uu.grecaptcha.render=function(t,n){return t=i(t,n),e.b++,t},n()}else r(new Pr("internal-error"));delete uu[e.a]};
1var i=Te(kl,{onload:e.a,hl:t||""});te(Dn(i)).s(function(){r(new Pr("internal-error","Unable to load external reCAPTCHA dependencies!"))})}else n();else r(new Pr("network-request-failed"))})}function Zs(){return Dl||(Dl=new Js),Dl}function eu(e,t,n){try{this.f=n||au.app()}catch(e){throw new Pr("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.f.options||!this.f.options.apiKey)throw new Pr("invalid-api-key");n=this.f.options.apiKey;var r=this,i=null;try{i=this.f.auth().Ka()}catch(e){}i=au.SDK_VERSION?rr(au.SDK_VERSION,i):null,Gs.call(this,n,e,t,function(){try{var e=r.f.auth().$()}catch(t){e=null}return e},i,Wi(Fh))}function tu(e,t){for(var n in t){var r=t[n].name;e[r]=ru(r,e[n],t[n].j)}}function nu(e,t,n,r){e[t]=ru(t,n,r)}function ru(e,t,n){function r(){var e=Array.prototype.slice.call(arguments);return Ds(o,n,e),t.apply(this,e)}if(!n)return t;var i,o=iu(e);for(i in t)r[i]=t[i];for(i in t.prototype)r.prototype[i]=t.prototype[i];return r}function iu(e){return e=e.split("."),e[e.length-1]}var ou,au=n(8).default,su=su||{},uu=this,cu="closure_uid_"+(1e9*Math.random()>>>0),hu=0,lu=Date.now||function(){return+new Date};d(v,Error),v.prototype.name="CustomError";var pu=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},fu=/&/g,du=/</g,vu=/>/g,_u=/"/g,gu=/'/g,yu=/\x00/g,mu=/[\x00&<>"']/;d(b,v),b.prototype.name="AssertionError";var bu,wu=Array.prototype.indexOf?function(e,t,n){return Array.prototype.indexOf.call(e,t,n)}:function(t,n,r){if(r=null==r?0:0>r?Math.max(0,t.length+r):r,e(t))return e(n)&&1==n.length?t.indexOf(n,r):-1;for(;r<t.length;r++)if(r in t&&t[r]===n)return r;return-1},Eu=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(t,n,r){for(var i=t.length,o=e(t)?t.split(""):t,a=0;a<i;a++)a in o&&n.call(r,o[a],a,t)},Cu=Array.prototype.map?function(e,t,n){return Array.prototype.map.call(e,t,n)}:function(t,n,r){for(var i=t.length,o=Array(i),a=e(t)?t.split(""):t,s=0;s<i;s++)s in a&&(o[s]=n.call(r,a[s],s,t));return o},Tu=Array.prototype.some?function(e,t,n){return Array.prototype.some.call(e,t,n)}:function(t,n,r){for(var i=t.length,o=e(t)?t.split(""):t,a=0;a<i;a++)if(a in o&&n.call(r,o[a],a,t))return!0;return!1};e:{var Su=uu.navigator;if(Su){var Nu=Su.userAgent;if(Nu){bu=Nu;break e}}bu=""}var Iu="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");F[" "]=r;var Ou,Pu=P("Opera"),Ru=P("Trident")||P("MSIE"),Au=P("Edge"),ku=Au||Ru,Du=P("Gecko")&&!(y(bu.toLowerCase(),"webkit")&&!P("Edge"))&&!(P("Trident")||P("MSIE"))&&!P("Edge"),xu=y(bu.toLowerCase(),"webkit")&&!P("Edge");e:{var Lu="",Mu=function(){var e=bu;return Du?/rv\:([^\);]+)(\)|;)/.exec(e):Au?/Edge\/([\d\.]+)/.exec(e):Ru?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):xu?/WebKit\/(\S+)/.exec(e):Pu?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(Mu&&(Lu=Mu?Mu[1]:""),Ru){var Fu=j();if(null!=Fu&&Fu>parseFloat(Lu)){Ou=String(Fu);break e}}Ou=Lu}var Uu,ju={},Wu=uu.document;Uu=Wu&&Ru?j()||("CSS1Compat"==Wu.compatMode?parseInt(Ou,10):5):void 0,q.prototype.get=function(){if(0<this.b){this.b--;var e=this.a;this.a=e.next,e.next=null}else e=this.c();return e};var Vu=new q(function(){return new G},function(e){e.reset()},100);G.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},G.prototype.reset=function(){this.next=this.b=this.a=null};var Bu,qu,Ku=!1,Hu=new function(){this.b=this.a=null},Gu=0,zu=2,Qu=3;Z.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Xu=new q(function(){return new Z},function(e){e.reset()},100);$.prototype.then=function(e,t,n){return ce(this,u(e)?e:null,u(t)?t:null,n)},V($),ou=$.prototype,ou.s=function(e,t){return ce(this,null,e,t)},ou.cancel=function(e){this.a==Gu&&X(function(){se(this,new ye(e))},this)},ou.Ac=function(e){this.a=Gu,he(this,zu,e)},ou.Bc=function(e){this.a=Gu,he(this,Qu,e)},ou.Qb=function(){for(var e;e=de(this);)ve(this,e,this.a,this.i);this.h=!1};var Yu=z;d(ye,v),ye.prototype.name="cancel";var Ju=!Ru||9<=Number(Uu);me.prototype.la=!0,me.prototype.ja=function(){return this.a},me.prototype.toString=function(){return"Const{"+this.a+"}"};var $u={};we(""),Ee.prototype.la=!0,Ee.prototype.ja=function(){return this.a},Ee.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Zu=/%{(\w+)}/g,ec=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank(#|$)/i,tc={};Ne.prototype.la=!0,Ne.prototype.ja=function(){return this.a},Ne.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var nc=/^(?:(?:https?|mailto|ftp):|[^:\/?#]*(?:[\/?#]|$))/i,rc={};Pe("about:blank"),Re.prototype.la=!0,Re.prototype.ja=function(){return this.a},Re.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var ic={};ke("<!DOCTYPE html>"),ke(""),ke("<br>");var oc={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",
1nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"},ac={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},sc=/\uffff/.test("ï¿¿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,uc=0,cc={};Be.prototype.oa=!1,Be.prototype.ta=function(){if(this.Fa)for(;this.Fa.length;)this.Fa.shift()()};var hc=Object.freeze||function(e){return e},lc=!Ru||9<=Number(Uu),pc=Ru&&!W("9"),fc=function(){if(!uu.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return uu.addEventListener("test",r,t),uu.removeEventListener("test",r,t),e}();Ke.prototype.c=function(){this.Bb=!1},d(He,Ke);var dc=hc({2:"touch",3:"pen",4:"mouse"});He.prototype.c=function(){He.ib.c.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,pc)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},He.prototype.g=function(){return this.a};var vc="closure_listenable_"+(1e6*Math.random()|0),_c=0,gc="closure_lm_"+(1e6*Math.random()|0),yc={},mc=0,bc="__closure_events_fn_"+(1e9*Math.random()>>>0);d(ht,Be),ht.prototype[vc]=!0,ht.prototype.removeEventListener=function(e,t,n,r){nt(this,e,t,n,r)},ht.prototype.ta=function(){if(ht.ib.ta.call(this),this.u){var e,t=this.u,n=0;for(e in t.a){for(var r=t.a[e],i=0;i<r.length;i++)++n,ze(r[i]);delete t.a[e],t.b--}}this.Ra=null},gt.prototype.a=null;var wc=0;gt.prototype.reset=function(e,t,n,r,i){"number"==typeof i||wc++,r||lu(),this.b=t,delete this.a},mt.prototype.toString=function(){return this.name};var Ec=new mt("SEVERE",1e3),Cc=new mt("CONFIG",700),Tc=new mt("FINE",500);yt.prototype.log=function(e,t,n){if(e.value>=bt(this).value)for(u(t)&&(t=t()),e=new gt(e,String(t),this.f),n&&(e.a=n),n="log:"+e.b,(e=uu.console)&&e.timeStamp&&e.timeStamp(n),(e=uu.msWriteProfilerMark)&&e(n),n=this;n;)n=n.a};var Sc={},Nc=null;ou=Et.prototype,ou.P=function(){Ct(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},ou.S=function(){return Ct(this),this.a.concat()},ou.clear=function(){this.b={},this.c=this.a.length=0},ou.get=function(e,t){return Tt(this.b,e)?this.b[e]:t},ou.set=function(e,t){Tt(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},ou.forEach=function(e,t){for(var n=this.S(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);e.call(t,o,i,this)}};var Ic=null,Oc=null;Rt.prototype.cancel=function(e){if(this.a)this.c instanceof Rt&&this.c.cancel();else{if(this.b){var t=this.b;delete this.b,e?t.cancel(e):0>=--t.l&&t.cancel()}this.v?this.v.call(this.o,this):this.u=!0,this.a||(e=new Ut,kt(this),At(this,!1,e))}},Rt.prototype.m=function(e,t){this.i=!1,At(this,e,t)},Rt.prototype.A=function(e){kt(this),At(this,!0,e)},Rt.prototype.then=function(e,t,n){var r,i,o=new $(function(e,t){r=e,i=t});return xt(this,r,function(e){e instanceof Ut?o.cancel():i(e)}),o.then(e,t,n)},V(Rt),d(Ft,v),Ft.prototype.message="Deferred has already fired",Ft.prototype.name="AlreadyCalledError",d(Ut,v),Ut.prototype.message="Deferred was canceled",Ut.prototype.name="CanceledError",jt.prototype.c=function(){throw delete Rc[this.a],this.b};var Pc,Rc={};d(Vt,Wt);for(var Ac=64,kc=Ac-1,Dc=[],xc=0;xc<kc;xc++)Dc[xc]=0;var Lc=I(128,Dc);Vt.prototype.reset=function(){this.g=this.c=0,this.a=uu.Int32Array?new Int32Array(this.h):O(this.h)};var Mc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];d(Kt,Vt);var Fc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Uc=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;Xt.prototype.toString=function(){var e=[],t=this.c;
1t&&e.push(on(t,jc,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.l)&&e.push(on(t,jc,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&e.push(":",String(n))),(n=this.g)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(on(n,"/"==n.charAt(0)?Vc:Wc,!0))),(n=this.a.toString())&&e.push("?",n),(n=this.h)&&e.push("#",on(n,qc)),e.join("")};var jc=/[#\/\?@]/g,Wc=/[\#\?:]/g,Vc=/[\#\?]/g,Bc=/[\#\?@]/g,qc=/#/g;ou=sn.prototype,ou.clear=function(){this.a=this.c=null,this.b=0},ou.forEach=function(e,t){un(this),this.a.forEach(function(n,r){Eu(n,function(n){e.call(t,n,r,this)},this)},this)},ou.S=function(){un(this);for(var e=this.a.P(),t=this.a.S(),n=[],r=0;r<t.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(t[r]);return n},ou.P=function(t){un(this);var n=[];if(e(t))pn(this,t)&&(n=I(n,this.a.get(dn(this,t))));else{t=this.a.P();for(var r=0;r<t.length;r++)n=I(n,t[r])}return n},ou.set=function(e,t){return un(this),this.c=null,e=dn(this,e),pn(this,e)&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},ou.get=function(e,t){return e=e?this.P(e):[],0<e.length?String(e[0]):t},ou.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.S(),n=0;n<t.length;n++){var r=t[n],i=encodeURIComponent(String(r));r=this.P(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),e.push(a)}}return this.c=e.join("&")},_n.prototype.c=null;var Kc;d(yn,_n),yn.prototype.a=function(){var e=mn(this);return e?new ActiveXObject(e):new XMLHttpRequest},yn.prototype.b=function(){var e={};return mn(this)&&(e[0]=!0,e[1]=!0),e},Kc=new yn,d(bn,ht);var Hc="",Gc=bn.prototype,zc=wt("goog.net.XhrIo");Gc.J=zc;var Qc=/^https?$/i,Xc=["POST","PUT"];ou=bn.prototype,ou.Ea=function(){void 0!==su&&this.a&&(this.g="Timed out after "+this.f+"ms, aborting",St(this.J,kn(this,this.g)),lt(this,"timeout"),this.abort(8))},ou.abort=function(){this.a&&this.b&&(St(this.J,kn(this,"Aborting")),this.b=!1,this.c=!0,this.a.abort(),this.c=!1,lt(this,"complete"),lt(this,"abort"),In(this))},ou.ta=function(){this.a&&(this.b&&(this.b=!1,this.c=!0,this.a.abort(),this.c=!1),In(this,!0)),bn.ib.ta.call(this)},ou.Ab=function(){this.oa||(this.G||this.h||this.c?Nn(this):this.jc())},ou.jc=function(){Nn(this)},ou.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.l){case Hc:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var e=this.J;return e&&e.log(Ec,"Response type "+this.l+" is not supported on this browser",void 0),null}catch(e){return St(this.J,"Can not get response: "+e.message),null}};var Yc=/^[+a-zA-Z0-9_.!#$%&'*\/=?^`{|}~-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,63}$/,Jc=0,$c=1;d(Fn,v),d(Un,_n),Un.prototype.a=function(){var e=new XMLHttpRequest;if("withCredentials"in e)return e;if("undefined"!=typeof XDomainRequest)return new jn;throw Error("Unsupported browser")},Un.prototype.b=function(){return{}},ou=jn.prototype,ou.open=function(e,t,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(e,t)},ou.send=function(e){if(e){if("string"!=typeof e)throw Error("Only string data is supported");this.a.send(e)}else this.a.send()},ou.abort=function(){this.a.abort()},ou.setRequestHeader=function(){},ou.getResponseHeader=function(e){return"content-type"==e.toLowerCase()?this.a.contentType:""},ou.Wb=function(){this.status=200,this.responseText=this.a.responseText,Wn(this,4)},ou.xb=function(){this.status=500,this.responseText="",Wn(this,4)},ou.Yb=function(){this.xb()},ou.Xb=function(){this.status=200,Wn(this,1)},ou.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType};var Zc=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,eh="Firefox",th="Chrome",nh={Gc:"FirebaseCore-web",Ic:"FirebaseUI-web"};yr.prototype.get=function(){return this.a?this.b:this.c};var rh,ih={};try{var oh={};Object.defineProperty(oh,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(oh,"abcd",{configurable:!0,enumerable:!0,value:2}),rh=2==oh.abcd}catch(e){rh=!1}var ah="email",sh="newEmail",uh="requestType",ch="email",hh="fromEmail",lh="data",ph="operation";d(Pr,Error),Pr.prototype.B=function(){return{code:this.code,message:this.message}},Pr.prototype.toJSON=function(){return this.B()};var fh="auth/",dh={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invali
1d-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"The user's credential is no longer valid. The user must sign in again.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
1d-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},vh="android",_h="handleCodeInApp",gh="iOS",yh="url",mh="installApp",bh="minimumVersion",wh="packageName",Eh="bundleId",Ch="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Th=["client_id","response_type","scope","redirect_uri","state"],Sh={Hc:{Ma:"locale",za:500,ya:600,Na:"facebook.com",$a:Th},Jc:{Ma:null,za:500,ya:620,Na:"github.com",$a:Th},Kc:{Ma:"hl",za:515,ya:680,Na:"google.com",$a:Th},Qc:{Ma:"lang",za:485,ya:705,Na:"twitter.com",$a:Ch}},Nh="idToken",Ih="providerId";d(Ur,Fr),d(jr,Ur),d(Wr,Ur),d(Vr,Ur),d(Br,Ur),Kr.prototype.wa=function(e){return Di(e,Hr(this))},Kr.prototype.b=function(e,t){var n=Hr(this);return n.idToken=t,xi(e,n)},Kr.prototype.c=function(e,t){return qr(Li(e,Hr(this)),t)},Kr.prototype.B=function(){var e={providerId:this.providerId};return this.idToken&&(e.oauthIdToken=this.idToken),this.accessToken&&(e.oauthAccessToken=this.accessToken),this.secret&&(e.oauthTokenSecret=this.secret),e},Gr.prototype.Ba=function(e){return this.rb=L(e),this},d(zr,Gr),zr.prototype.sa=function(e){return T(this.a,e)||this.a.push(e),this},zr.prototype.wb=function(){return O(this.a)},zr.prototype.credential=function(e,t){if(!e&&!t)throw new Pr("argument-error","credential failed: must provide the ID token and/or the access token.");return new Kr(this.providerId,{idToken:e||null,accessToken:t||null})},d(Qr,zr),Er(Qr,"PROVIDER_ID","facebook.com"),d(Yr,zr),Er(Yr,"PROVIDER_ID","github.com"),d($r,zr),Er($r,"PROVIDER_ID","google.com"),d(ei,Gr),Er(ei,"PROVIDER_ID","twitter.com"),ni.prototype.wa=function(e){return Fi(e,il,{email:this.a,password:this.f})},ni.prototype.b=function(e,t){return Fi(e,$h,{idToken:t,email:this.a,password:this.f})},ni.prototype.c=function(e,t){return qr(this.wa(e),t)},ni.prototype.B=function(){return{email:this.a,password:this.f}},Cr(ri,{PROVIDER_ID:"password"}),ii.prototype.wa=function(e){return e.Qa(oi(this))},ii.prototype.b=function(e,t){var n=oi(this);return n.idToken=t,Fi(e,al,n)},ii.prototype.c=function(e,t){var n=oi(this);return n.operation="REAUTH",e=Fi(e,sl,n),qr(e,t)},ii.prototype.B=function(){var e={providerId:"phone"};return this.a.Pa&&(e.verificationId=this.a.Pa),this.a.Oa&&(e.verificationCode=this.a.Oa),this.a.Da&&(e.temporaryProof=this.a.Da),this.a.Y&&(e.phoneNumber=this.a.Y),e},ai.prototype.Qa=function(t,n){var r=this.a.c;return te(n.verify()).then(function(i){if(!e(i))throw new Pr("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");
1switch(n.type){case"recaptcha":return Pi(r,{phoneNumber:t,recaptchaToken:i}).then(function(e){return"function"==typeof n.reset&&n.reset(),e},function(e){throw"function"==typeof n.reset&&n.reset(),e});default:throw new Pr("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})},Cr(ai,{PROVIDER_ID:"phone"}),hi.prototype.B=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,error:this.a&&this.a.B()}},d(pi,Pr),d(fi,Pr),fi.prototype.B=function(){var e={code:this.code,message:this.message};this.email&&(e.email=this.email),this.phoneNumber&&(e.phoneNumber=this.phoneNumber);var t=this.credential&&this.credential.B();return t&&M(e,t),e},fi.prototype.toJSON=function(){return this.B()},d(vi,_n),vi.prototype.a=function(){return new this.f},vi.prototype.b=function(){return{}};var Oh,Ph="idToken",Rh=new yr(3e4,6e4),Ah={"Content-Type":"application/x-www-form-urlencoded"},kh=new yr(3e4,6e4),Dh={"Content-Type":"application/json"};_i.prototype.m=function(e,t,n,r,i,o){var a="Node"==er(),s=tr()?a?new bn(this.o):new bn:new bn(this.f);if(o){s.f=Math.max(0,o);var u=setTimeout(function(){lt(s,"timeout")},o)}pt(s,"complete",function(){u&&clearTimeout(u);var e=null;try{e=JSON.parse(An(this))||null}catch(t){e=null}t&&t(e)}),ft(s,"ready",function(){u&&clearTimeout(u),qe(this)}),ft(s,"timeout",function(){u&&clearTimeout(u),qe(this),t&&t(null)}),wn(s,e,n,r,i)};var xh=we("https://apis.google.com/js/client.js?onload=%{onload}"),Lh="__fcb"+Math.floor(1e6*Math.random()).toString();_i.prototype.u=function(e,t,n,r,i){var o=this;Oh.then(function(){window.gapi.client.setApiKey(o.b);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:e,method:n,body:r,headers:i,authType:"none",callback:function(e){window.gapi.auth.setToken(a),t&&t(e)}})}).s(function(e){t&&t({error:{message:e&&e.message||"CORS_UNSUPPORTED"}})})},_i.prototype.gb=function(){return Fi(this,Zh,{})},_i.prototype.kb=function(e,t){return Fi(this,Jh,{idToken:e,email:t})},_i.prototype.lb=function(e,t){return Fi(this,$h,{idToken:e,password:t})};var Mh={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};ou=_i.prototype,ou.mb=function(e,t){var n={idToken:e},r=[];return R(Mh,function(e,i){var o=t[i];null===o?r.push(e):i in t&&(n[i]=o)}),r.length&&(n.deleteAttribute=r),Fi(this,Jh,n)},ou.cb=function(e,t){return e={requestType:"PASSWORD_RESET",email:e},M(e,t),Fi(this,Gh,e)},ou.bb=function(e,t){return e={requestType:"VERIFY_EMAIL",idToken:e},M(e,t),Fi(this,Hh,e)},ou.Qa=function(e){return Fi(this,ol,e)},ou.Ta=function(e,t){return Fi(this,Xh,{oobCode:e,newPassword:t})},ou.Ia=function(e){return Fi(this,jh,{oobCode:e})},ou.Sa=function(e){return Fi(this,Uh,{oobCode:e})};var Fh,Uh={endpoint:"setAccountInfo",D:Mi,ga:"email"},jh={endpoint:"resetPassword",D:Mi,O:function(e){if(!e.email||!e.requestType)throw new Pr("internal-error")}},Wh={endpoint:"signupNewUser",D:function(e){if(Ci(e),!e.password)throw new Pr("weak-password")},O:Ii,T:!0},Vh={endpoint:"createAuthUri"},Bh={endpoint:"deleteAccount",ea:["idToken"]},qh={endpoint:"setAccountInfo",ea:["idToken","deleteProvider"],D:function(e){if(!a(e.deleteProvider))throw new Pr("internal-error")}},Kh={endpoint:"getAccountInfo"},Hh={endpoint:"getOobConfirmationCode",ea:["idToken","requestType"],D:function(e){if("VERIFY_EMAIL"!=e.requestType)throw new Pr("internal-error")},ga:"email"},Gh={endpoint:"getOobConfirmationCode",ea:["requestType"],D:function(e){if("PASSWORD_RESET"!=e.requestType)throw new Pr("internal-error");Ci(e)},ga:"email"},zh={nb:!0,endpoint:"getProjectConfig",zb:"GET"},Qh={nb:!0,endpoint:"getRecaptchaParam",zb:"GET",O:function(e){if(!e.recaptchaSiteKey)throw new Pr("internal-error")}},Xh={endpoint:"resetPassword",D:Mi,ga:"email"},Yh={endpoint:"sendVerificationCode",ea:["phoneNumber","recaptchaToken"],ga:"sessionInfo"},Jh={endpoint:"setAccountInfo",ea:["idToken"],D:Ti,T:!0},$h={endpoint:"setAccountInfo",ea:["idToken"],D:function(e){if(Ti(e),!e.password)throw new Pr("weak-password")},O:Ii,T:!0},Zh={endpoint:"signupNewUser",O:Ii,T:!0},el={endpoint:"verifyAssertion",D:Ai,O:ki,T:!0},tl={endpoint:"verifyAssertion",D:Ai,O:function(e){if(e.errorMessage&&"USER_NOT_FOUND"==e.errorMessage)throw new Pr("user-not-found");if(e.errorMessage)throw Ui(e.errorMessage);if(!e[Ph])throw new Pr("internal-error")},T:!0}
1,nl={endpoint:"verifyAssertion",D:function(e){if(Ai(e),!e.idToken)throw new Pr("internal-error")},O:ki,T:!0},rl={endpoint:"verifyCustomToken",D:function(e){if(!e.token)throw new Pr("invalid-custom-token")},O:Ii,T:!0},il={endpoint:"verifyPassword",D:function(e){if(Ci(e),!e.password)throw new Pr("wrong-password")},O:Ii,T:!0},ol={endpoint:"verifyPhoneNumber",D:Oi,O:Ii},al={endpoint:"verifyPhoneNumber",D:function(e){if(!e.idToken)throw new Pr("internal-error");Oi(e)},O:function(e){if(e.temporaryProof)throw e.code="credential-already-in-use",di(e);Ii(e)}},sl={Pb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",D:Oi,O:Ii},ul={Mc:{Va:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",ab:"https://securetoken.googleapis.com/v1/token",id:"p"},Oc:{Va:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",ab:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},Pc:{Va:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",ab:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}};Fh=Wi("__EID__")?"__EID__":void 0;var cl=we("https://apis.google.com/js/api.js?onload=%{onload}"),hl=new yr(3e4,6e4),ll=new yr(5e3,15e3),pl=null;Gi.prototype.toString=function(){return this.f?Zt(this.a,"v",this.f):ln(this.a.a,"v"),this.b?Zt(this.a,"eid",this.b):ln(this.a.a,"eid"),this.c.length?Zt(this.a,"fw",this.c.join(",")):ln(this.a.a,"fw"),this.a.toString()},zi.prototype.toString=function(){var e=nn(this.m,"/__/auth/handler");if(Zt(e,"apiKey",this.u),Zt(e,"appName",this.c),Zt(e,"authType",this.l),this.a.isOAuthProvider){var t=this.a;try{var n=au.app(this.c).auth().$()}catch(e){n=null}t.Ua=n,Zt(e,"providerId",this.a.providerId),t=this.a,n=pr(t.rb);for(var r in n)n[r]=n[r].toString();r=t.rc,n=L(n);for(var i=0;i<r.length;i++){var o=r[i];o in n&&delete n[o]}t.Wa&&t.Ua&&!n[t.Wa]&&(n[t.Wa]=t.Ua),D(n)||Zt(e,"customParameters",lr(n))}if("function"==typeof this.a.wb&&(t=this.a.wb(),t.length&&Zt(e,"scopes",t.join(","))),this.h?Zt(e,"redirectUrl",this.h):ln(e.a,"redirectUrl"),this.g?Zt(e,"eventId",this.g):ln(e.a,"eventId"),this.i?Zt(e,"v",this.i):ln(e.a,"v"),this.b)for(var a in this.b)this.b.hasOwnProperty(a)&&!en(e,a)&&Zt(e,a,this.b[a]);return this.f?Zt(e,"eid",this.f):ln(e.a,"eid"),a=Qi(this.c),a.length&&Zt(e,"fw",a.join(",")),e.toString()},ou=Xi.prototype,ou.Ca=function(e,t,n){var r=new Pr("popup-closed-by-user"),i=new Pr("web-storage-unsupported"),o=this,a=!1;return this.ba().then(function(){to(o).then(function(n){n||(e&&zn(e),t(i),a=!0)})}).s(function(){}).then(function(){if(!a)return Xn(e)}).then(function(){if(!a)return _t(n).then(function(){t(r)})})},ou.Db=function(){var e=ir();return!hr(e)&&!vr(e)},ou.yb=function(){return!1},ou.vb=function(e,t,n,r,i,o,a){if(!e)return ne(new Pr("popup-blocked"));if(a&&!hr())return this.ba().s(function(t){zn(e),i(t)}),r(),te();this.a||(this.a=Yi($i(this)));var s=this;return this.a.then(function(){var t=s.ba().s(function(t){throw zn(e),i(t),t});return r(),t}).then(function(){ci(n),a||qn(Zi(s.u,s.f,s.b,t,n,null,o,s.c,void 0,s.h),e)}).s(function(e){throw"auth/network-request-failed"==e.code&&(s.a=null),e})},ou.Aa=function(e,t,n){this.a||(this.a=Yi($i(this)));var r=this;return this.a.then(function(){ci(t),qn(Zi(r.u,r.f,r.b,e,t,Bn(),n,r.c,void 0,r.h))}).s(function(e){throw"auth/network-request-failed"==e.code&&(r.a=null),e})},ou.ba=function(){var e=this;return Ji(this).then(function(){return e.i.Ya}).s(function(){throw e.a=null,new Pr("network-request-failed")})},ou.Hb=function(){return!0},ou.ua=function(e){this.g.push(e)},ou.Ja=function(e){N(this.g,function(t){return t==e})},ou=no.prototype,ou.get=function(e){return te(this.a.getItem(e)).then(function(e){return e&&fr(e)})},ou.set=function(e,t){return te(this.a.setItem(e,lr(t)))},ou.X=function(e){return te(this.a.removeItem(e))},ou.ia=function(){},ou.da=function(){},ou=ro.prototype,ou.get=function(e){return te(this.a[e])},ou.set=function(e,t){return this.a[e]=t,te()},ou.X=function(e){return delete this.a[e],te()},ou.ia=function(){},ou.da=function(){};var fl;ou=io.prototype,ou.set=function(e,t){var n,r=!1,i=this;return ae(ao(this).then(function(t){return n=t,t=so(i,uo(i,n,!0)),co(t.get(e))}).then(function(o){var a=so(i,uo(i,n,!0));return o?(o.value=t,co(a.put(o))):(i.a++,r=!0,o={},o[i.g]=e,o[i.l]=t,co(a.add(o)))}).then(function(){i.f[e]=t}),function(){r&&i.a--})},ou.get=function(e){var t=this;return ao(this).then(function(n){return co(so(t,uo(t,n,!1)).get(e))}).then(function(e){return e&&e.value})},ou.X=function(e){var t=!1,n=this;return ae(ao(this).then(function(r){return t=!0,n.a++,co(so(n,uo(n,r,!0)).delete(e))}).then(function(){delete n.f[e]}),function(){t&&n.a--})},ou.zc=function(){var e=this;return ao(this).then(function(t){var n=so(e,uo(e,t,!1));return n.getAll?co(n.getAll()):new $(function(e,t){var r=[],i=n.openCursor();i.onsuccess=function(t){(t=t.target.result)?(r.push(t.value),t.continue()):e(r)},i.onerror=function(e){t(Error(e.target.errorCode))}})}).then(function(t){var n={},r=[];if(0==e.a){for(r=0;r<t.length;r++)n[t[r][e.g]]=t[r][e.l];r=Kn(e.f,n),e.f=n}return r})},ou.ia=function(e){0==this.c.length&&ho(this),this.c.push(e)},ou.da=function(e){N(this.c,function(t){return t==e}),0==this.c.length&&this.b&&this.b.cancel("STOP_EVENT")},ou=lo.prototype,ou.get=function(e){var t=this;return te().then(function(){return fr(t.a.getItem(e))})},ou.set=function(e,t){var n=this;return te().then(function(){var r=lr(t);null===r?n.X(e):n.a.setItem(e,r)})},ou.X=function(e){var t=this;return te().then(function(){t.a.removeItem(e)})},ou.ia=function(e){uu.window&&$e(uu.window,"storage",e)},ou.da=function(e){uu.window&&nt(uu.window,"storage",e)},ou=vo.prototype,ou.get=function(){return te(null)},ou.set=function(){return te()},ou.X=function(){return te()},ou.ia=function(){},ou.da=function(){},ou=_o.prototype,ou.get=function(e){var t=this;return te().then(function(){return fr(t.a.getItem(e))})},ou.set=function(e,t){var n=this;return te().then(function(){var r=lr(t);null===r?n.X(e):n.a.setItem(e,r)})},ou.X=function(e){var t=this;return te().then(function(){t.a.removeItem(e)})},ou.ia=function(){},ou.da=function(){};var dl,vl,_l={C:lo,jb:_o},gl={C:lo,jb:_o},yl={C:no,jb:vo}
1,ml={Lc:"local",NONE:"none",Nc:"session"};wo.prototype.get=function(e,t){return Co(this,e.C).get(To(this,e,t))},wo.prototype.set=function(e,t,n){var r=To(this,e,n),i=this,o=Co(this,e.C);return o.set(r,t).then(function(){return o.get(r)}).then(function(t){"local"==e.C&&(i.b[r]=t)})},wo.prototype.m=function(e){if(e&&e.g){var t=e.a.key;if(null==t)for(var n in this.a){var r=this.b[n];void 0===r&&(r=null);var i=uu.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.c(n))}else if(0==t.indexOf(this.i+this.g)&&this.a[t]){if(void 0!==e.a.a?Co(this,"local").da(this.h):Po(this),this.A)if(n=uu.localStorage.getItem(t),(r=e.a.newValue)!==n)null!==r?uu.localStorage.setItem(t,r):uu.localStorage.removeItem(t);else if(this.b[t]===r&&void 0===e.a.a)return;var o=this;n=function(){void 0===e.a.a&&o.b[t]===uu.localStorage.getItem(t)||(o.b[t]=uu.localStorage.getItem(t),o.c(t))},Ru&&Uu&&10==Uu&&uu.localStorage.getItem(t)!==e.a.newValue&&e.a.newValue!==e.a.oldValue?setTimeout(n,10):n()}}else Eu(e,p(this.c,this))},wo.prototype.c=function(e){this.a[e]&&Eu(this.a[e],function(e){e()})};var bl={name:"authEvent",C:"local"};ou=xo.prototype,ou.ba=function(){return this.xa?this.xa:this.xa=Jn().then(function(){if("function"!=typeof or("universalLinks.subscribe",uu))throw Lo("cordova-universal-links-plugin is not installed");if(void 0===or("BuildInfo.packageName",uu))throw Lo("cordova-plugin-buildinfo is not installed");if("function"!=typeof or("cordova.plugins.browsertab.openUrl",uu))throw Lo("cordova-plugin-browsertab is not installed");if("function"!=typeof or("cordova.InAppBrowser.open",uu))throw Lo("cordova-plugin-inappbrowser is not installed")},function(){throw new Pr("cordova-not-ready")})},ou.Ca=function(e,t){return t(new Pr("operation-not-supported-in-this-environment")),te()},ou.vb=function(){return ne(new Pr("operation-not-supported-in-this-environment"))},ou.Hb=function(){return!1},ou.Db=function(){return!0},ou.yb=function(){return!0},ou.Aa=function(e,t,n){if(this.c)return ne(new Pr("redirect-operation-pending"));var r=this,i=uu.document,o=null,a=null,s=null,u=null;return this.c=ae(te().then(function(){return ci(t),Wo(r)}).then(function(){return Uo(r,e,t,n)}).then(function(){return new $(function(e,t){a=function(){var t=or("cordova.plugins.browsertab.close",uu);return e(),"function"==typeof t&&t(),r.a&&"function"==typeof r.a.close&&(r.a.close(),r.a=null),!1},r.ua(a),s=function(){o||(o=_t(r.w).then(function(){t(new Pr("redirect-cancelled-by-user"))}))},u=function(){mr()&&s()},i.addEventListener("resume",s,!1),ir().toLowerCase().match(/android/)||i.addEventListener("visibilitychange",u,!1)}).s(function(e){return Vo(r).then(function(){throw e})})}),function(){s&&i.removeEventListener("resume",s,!1),u&&i.removeEventListener("visibilitychange",u,!1),o&&o.cancel(),a&&r.Ja(a),r.c=null})},ou.ua=function(e){this.b.push(e),Wo(this).s(function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new hi("unknown",null,null,null,new Pr("no-auth-event")),e(t))})},ou.Ja=function(e){N(this.b,function(t){return t==e})};var wl={name:"pendingRedirect",C:"session"};zo.prototype.reset=function(){this.f=!1,this.a.Ja(this.i),this.a=Qo(this.v,this.l,this.u)},zo.prototype.subscribe=function(e){if(T(this.h,e)||this.h.push(e),!this.f){var t=this;Go(this.g).then(function(e){e?Ho(t.g).then(function(){Xo(t).s(function(e){var n=new hi("unknown",null,null,null,new Pr("operation-not-supported-in-this-environment"));$o(e)&&t.m(n)})}):Yo(t)}).s(function(){Yo(t)})}},zo.prototype.unsubscribe=function(e){N(this.h,function(t){return t==e})},zo.prototype.m=function(e){if(!e)throw new Pr("invalid-auth-event");for(var t=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.ob(e.b,e.c)){(t=this.b[e.b])&&t.h(e,r),t=!0;break}}return ta(this.c),t};var El=new yr(2e3,1e4),Cl=new yr(3e4,6e4);zo.prototype.aa=function(){return this.c.aa()},zo.prototype.Aa=function(e,t,n){var r,i=this;return Ko(this.g).then(function(){return i.a.Aa(e,t,n).s(function(e){if($o(e))throw new Pr("operation-not-supported-in-this-environment");return r=e,Ho(i.g).then(function(){throw r})}).then(function(){return i.a.Hb()?new $(function(){}):Ho(i.g).then(function(){return i.aa()}).then(function(){}).s(function(){})})})},zo.prototype.Ca=function(e,t,n,r){return this.a.Ca(n,function(n){e.fa(t,null,n,r)},El.get())};var Tl={};ea.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},ea.prototype.h=function(e,t){if(!e)return ne(new Pr("invalid-auth-event"));this.reset(),this.g=!0;var n=e.b,r=e.c,i=e.a&&"auth/web-storage-unsupported"==e.a.code,o=e.a&&"auth/operation-not-supported-in-this-environment"==e.a.code;return"unknown"!=n||i||o?e.a?(oa(this,!0,null,e.a),e=te()):e=t.va(n,r)?na(this,e,t):ne(new Pr("invalid-auth-event")):(oa(this,!1,null,null),e=te()),e},ea.prototype.aa=function(){var e=this;return new $(function(t,n){e.b?e.b().then(t,n):(e.f.push(t),e.c.push(n),aa(e))})},sa.prototype.h=function(e,t){if(!e)return ne(new Pr("invalid-auth-event"));var n=e.b,r=e.c;return e.a?(t.fa(e.b,null,e.a,e.c),e=te()):e=t.va(n,r)?ua(e,t):ne(new Pr("invalid-auth-event")),e},ca.prototype.confirm=function(e){return e=si(this.verificationId,e),this.a(e)},la.prototype.start=function(){this.a=this.c,fa(this,!0)},va.prototype.B=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},va.prototype.getToken=function(e){return e=!!e,this.b&&!this.a?ne(new Pr("user-token-expired")):e||!this.b||lu()>this.c-3e4?this.a?ya(this,{grant_type:"refresh_token",refresh_token:this.a}):te(null):te({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},ma.prototype.B=function(){return{lastLoginAt:this.b,createdAt:this.a}},d(Ea,Ke),d(Ca,ht),Ca.prototype.na=function(e){this.ha=e,gi(this.c,e)},Ca.prototype.$=function(){return this.ha},Ca.prototype.Ka=function(){return O(this.R)},Ca.prototype.Ga=function(){this.l.b&&(da(this.l),this.l.start())},Er(Ca.prototype,"providerId","firebase"),ou=Ca.prototype,ou.reload=function(){var e=this;return Za(this,Fa(this).then(function(){return qa(e).then(function(){return Da(e)}).then(Ma)}))},ou.F=function(e){var t=this;return Za(this,Fa(this).then(function(){return t.h.getToken(e)}).then(function(e){if(!e)throw new Pr("internal-error");return e.accessToken!=t.pa&&(Aa(t,e.accessToken),lt(t,new Ea("tokenChanged"))),Va(t,"refreshToken",e.refreshToken),e.accessToken}))},ou.getToken=function(e){return ih["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]||(ih["firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead."]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("firebase.User.prototype.getToken is deprecated. Please use firebase.User.prototype.getIdToken instead.")),this.F(e)},ou.kc=function(e){if(!(e=e.users)||!e.length)throw new Pr("internal-error");e=e[0],La(this,{uid:e.localId,displayName:e.displayName,photoURL:e.ph
1otoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt});for(var t=Ga(e),n=0;n<t.length;n++)ja(this,t[n]);Va(this,"isAnonymous",!(this.email&&e.passwordHash||this.providerData&&this.providerData.length))},ou.Za=function(e){var t=this,n=null;return Za(this,e.c(this.c,this.uid).then(function(e){return Ka(t,e),n=Qa(t,e,"reauthenticate"),t.i=null,t.reload()}).then(function(){return n}),!0)},ou.mc=function(e){return this.Za(e).then(function(){})},ou.Xa=function(e){var t=this,n=null;return Za(this,za(this,e.providerId).then(function(){return t.F()}).then(function(n){return e.b(t.c,n)}).then(function(e){return n=Qa(t,e,"link"),Xa(t,e)}).then(function(){return n}))},ou.cc=function(e){return this.Xa(e).then(function(e){return e.user})},ou.dc=function(e,t){var n=this;return Za(this,za(this,"phone").then(function(){return ha(Ia(n),e,t,p(n.Xa,n))}))},ou.nc=function(e,t){var n=this;return Za(this,te().then(function(){return ha(Ia(n),e,t,p(n.Za,n))}),!0)},ou.kb=function(e){var t=this;return Za(this,this.F().then(function(n){return t.c.kb(n,e)}).then(function(e){return Ka(t,e),t.reload()}))},ou.Dc=function(e){var t=this;return Za(this,this.F().then(function(n){return e.b(t.c,n)}).then(function(e){return Ka(t,e),t.reload()}))},ou.lb=function(e){var t=this;return Za(this,this.F().then(function(n){return t.c.lb(n,e)}).then(function(e){return Ka(t,e),t.reload()}))},ou.mb=function(e){if(void 0===e.displayName&&void 0===e.photoURL)return Fa(this);var t=this;return Za(this,this.F().then(function(n){return t.c.mb(n,{displayName:e.displayName,photoUrl:e.photoURL})}).then(function(e){return Ka(t,e),Va(t,"displayName",e.displayName||null),Va(t,"photoURL",e.photoUrl||null),Eu(t.providerData,function(e){"password"===e.providerId&&(Er(e,"displayName",t.displayName),Er(e,"photoURL",t.photoURL))}),Da(t)}).then(Ma))},ou.Cc=function(e){var t=this;return Za(this,qa(this).then(function(n){return T(Ua(t),e)?Ri(t.c,n,[e]).then(function(e){var n={};return Eu(e.providerUserInfo||[],function(e){n[e.providerId]=!0}),Eu(Ua(t),function(e){n[e]||Wa(t,e)}),n[ai.PROVIDER_ID]||Er(t,"phoneNumber",null),Da(t)}):Da(t).then(function(){throw new Pr("no-such-provider")})}))},ou.delete=function(){var e=this;return Za(this,this.F().then(function(t){return Fi(e.c,Bh,{idToken:t})}).then(function(){lt(e,new Ea("userDeleted"))})).then(function(){for(var t=0;t<e.A.length;t++)e.A[t].cancel("app-deleted");Ta(e,null),Na(e,null),e.A=[],e.m=!0,Ra(e),Er(e,"refreshToken",null),e.a&&e.a.unsubscribe(e)})},ou.ob=function(e,t){return!!("linkViaPopup"==e&&(this.g||null)==t&&this.f||"reauthViaPopup"==e&&(this.g||null)==t&&this.f||"linkViaRedirect"==e&&(this.Z||null)==t||"reauthViaRedirect"==e&&(this.Z||null)==t)},ou.fa=function(e,t,n,r){"linkViaPopup"!=e&&"reauthViaPopup"!=e||r!=(this.g||null)||(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.b&&(this.b.cancel(),this.b=null),delete this.f,delete this.v)},ou.va=function(e,t){return"linkViaPopup"==e&&t==(this.g||null)?p(this.tb,this):"reauthViaPopup"==e&&t==(this.g||null)?p(this.ub,this):"linkViaRedirect"==e&&(this.Z||null)==t?p(this.tb,this):"reauthViaRedirect"==e&&(this.Z||null)==t?p(this.ub,this):null},ou.ec=function(e){var t=this;return Ya(this,"linkViaPopup",e,function(){return za(t,e.providerId).then(function(){return Da(t)})},!1)},ou.oc=function(e){return Ya(this,"reauthViaPopup",e,function(){return te()},!0)},ou.fc=function(e){var t=this;return Ja(this,"linkViaRedirect",e,function(){return za(t,e.providerId)},!1)},ou.pc=function(e){return Ja(this,"reauthViaRedirect",e,function(){return te()},!0)},ou.tb=function(e,t){var n=this;this.b&&(this.b.cancel(),this.b=null);var r=null;return Za(this,this.F().then(function(r){return xi(n.c,{requestUri:e,sessionId:t,idToken:r})}).then(function(e){return r=Qa(n,e,"link"),Xa(n,e)}).then(function(){return r}))},ou.ub=function(e,t){var n=this;this.b&&(this.b.cancel(),this.b=null);var r=null;return Za(this,te().then(function(){return qr(Li(n.c,{requestUri:e,sessionId:t}),n.uid)}).then(function(e){return r=Qa(n,e,"reauthenticate"),Ka(n,e),n.i=null,n.reload()}).then(function(){return r}),!0)},ou.bb=function(e){var t=this,n=null;return Za(this,this.F().then(function(t){return n=t,void 0===e||D(e)?{}:kr(new Ar(e))}).then(function(e){return t.c.bb(n,e)}).then(function(e){if(t.email!=e)return t.reload()}).then(function(){}))},ou.toJSON=function(){return this.B()},ou.B=function(){var e={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.G,appName:this.o,authDomain:this.w,stsTokenManager:this.h.B(),redirectEventId:this.Z||null};return this.metadata&&M(e,this.metadata.B()),Eu(this.providerData,function(t){e.providerData.push(Sr(t))}),e};var Sl={name:"redirectUser",C:"session"};as.prototype.g=function(){var e=this,t=cs("local");ds(this,function(){return te().then(function(){return e.c&&"local"!=e.c.C?e.b.get(t,e.a):null}).then(function(n){if(n)return ss(e,"local").then(function(){e.c=t})})})};var Nl={name:"persistence",C:"session"};as.prototype.eb=function(e){var t=null,n=this;
1return bo(e),ds(this,function(){return e!=n.c.C?n.b.get(n.c,n.a).then(function(r){return t=r,ss(n,e)}).then(function(){if(n.c=cs(e),t)return n.b.set(n.c,t,n.a)}):te()})},d(vs,ht),d(_s,Ke),d(gs,Ke),ou=vs.prototype,ou.eb=function(e){return e=this.h.eb(e),ks(this,e)},ou.na=function(e){this.V===e||this.l||(this.V=e,gi(this.c,this.V),lt(this,new _s(this.$())))},ou.$=function(){return this.V},ou.Ec=function(){var e=uu.navigator;this.na(e?e.languages&&e.languages[0]||e.language||e.userLanguage||null:null)},ou.gc=function(e){this.A.push(e),yi(this.c,au.SDK_VERSION?rr(au.SDK_VERSION,this.A):null),lt(this,new gs(this.A))},ou.Ka=function(){return O(this.A)},ou.toJSON=function(){return{apiKey:Is(this).options.apiKey,authDomain:Is(this).options.authDomain,appName:Is(this).name,currentUser:Os(this)&&Os(this).B()}},ou.ob=function(e,t){switch(e){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==t&&!!this.f;default:return!1}},ou.fa=function(e,t,n,r){"signInViaPopup"==e&&this.g==r&&(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.b&&(this.b.cancel(),this.b=null),delete this.f,delete this.v)},ou.va=function(e,t){return"signInViaRedirect"==e||"signInViaPopup"==e&&this.g==t&&this.f?p(this.Sb,this):null},ou.Sb=function(e,t){var n=this;e={requestUri:e,sessionId:t},this.b&&(this.b.cancel(),this.b=null);var r=null,i=null,o=Di(n.c,e).then(function(e){return r=ui(e),i=Mr(e),e});return e=n.U.then(function(){return o}).then(function(e){return ws(n,e)}).then(function(){return Tr({user:Os(n),credential:r,additionalUserInfo:i,operationType:"signIn"})}),ks(this,e)},ou.wc=function(e){if(!sr())return ne(new Pr("operation-not-supported-in-this-environment"));var t=this,n=Lr(e.providerId),r=dr(),i=null;(!hr()||Zn())&&Is(this).options.authDomain&&e.isOAuthProvider&&(i=Zi(Is(this).options.authDomain,Is(this).options.apiKey,Is(this).name,"signInViaPopup",e,null,r,au.SDK_VERSION||null));var o=Qn(i,n&&n.za,n&&n.ya);return n=ms(this).then(function(t){return Jo(t,o,"signInViaPopup",e,r,!!i)}).then(function(){return new $(function(e,n){t.fa("signInViaPopup",null,new Pr("cancelled-popup-request"),t.g),t.f=e,t.v=n,t.g=r,t.b=t.a.Ca(t,"signInViaPopup",o,r)})}).then(function(e){return o&&zn(o),e?Tr(e):null}).s(function(e){throw o&&zn(o),e}),ks(this,n)},ou.xc=function(e){if(!sr())return ne(new Pr("operation-not-supported-in-this-environment"));var t=this;return ks(this,ms(this).then(function(){return hs(t.h)}).then(function(){return t.a.Aa("signInViaRedirect",e)}))},ou.aa=function(){if(!sr())return ne(new Pr("operation-not-supported-in-this-environment"));var e=this;return ks(this,ms(this).then(function(){return e.a.aa()}).then(function(e){return e?Tr(e):null}))},ou.hb=function(){var e=this;return ks(this,this.i.then(function(){return Os(e)?(Es(e,null),ps(e.h).then(function(){Rs(e)})):te()}))},ou.yc=function(){var e=this;return fs(this.h,Is(this).options.authDomain).then(function(t){if(!e.l){var n;if(n=Os(e)&&t){n=Os(e).uid;var r=t.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return Ba(Os(e),t),Os(e).F();(Os(e)||t)&&(Es(e,t),t&&(xa(t),t.ca=e.G),e.a&&e.a.subscribe(e),Rs(e))}})},ou.ka=function(e){return ls(this.h,e)},ou.Tb=function(){Rs(this),this.ka(Os(this))},ou.Zb=function(){this.hb()},ou.$b=function(){this.hb()},ou.ac=function(e){var t=this;this.addAuthTokenListener(function(){e.next(Os(t))})},ou.bc=function(e){var t=this;As(this,function(){e.next(Os(t))})},ou.ic=function(e,t,n){var r=this;return this.W&&au.Promise.resolve().then(function(){u(e)?e(Os(r)):u(e.next)&&e.next(Os(r))}),this.Kb(e,t,n)},ou.hc=function(e,t,n){var r=this;return this.W&&au.Promise.resolve().then(function(){r.R=r.getUid(),u(e)?e(Os(r)):u(e.next)&&e.next(Os(r))}),this.Lb(e,t,n)},ou.Vb=function(e){var t=this;return ks(this,this.i.then(function(){return Os(t)?Os(t).F(e).then(function(e){return{accessToken:e}}):null}))},ou.tc=function(e){return this.Eb(e).then(function(e){return e.user})},ou.Eb=function(e){var t=this;return this.i.then(function(){return Ns(t,Fi(t.c,rl,{token:e}))}).then(function(e){var n=e.user;return Va(n,"isAnonymous",!1),t.ka(n),e})},ou.Fb=function(e,t){var n=this;return this.i.then(function(){return Ns(n,Fi(n.c,il,{email:e,password:t}))})},ou.uc=function(e,t){return this.Fb(e,t).then(function(e){return e.user})},ou.Ob=function(e,t){return this.qb(e,t).then(function(e){return e.user})},ou.qb=function(e,t){var n=this;return this.i.then(function(){return Ns(n,Fi(n.c,Wh,{email:e,password:t}))})},ou.sc=function(e){return this.fb(e).then(function(e){return e.user})},ou.fb=function(e){var t=this;return this.i.then(function(){return Ns(t,e.wa(t.c))})},ou.gb=function(){return this.Gb().then(function(e){return e.user})},ou.Gb=function(){var e=this;return this.i.then(function(){var t=Os(e);return t&&t.isAnonymous?Tr({user:t,credential:null,additionalUserInfo:Tr({providerId:null,isNewUser:!1}),operationType:"signIn"}):Ns(e,e.c.gb()).then(function(t){var n=t.user;return Va(n,"isAnonymous",!0),e.ka(n),t})})},ou.getUid=function(){return Os(this)&&Os(this).uid||null},ou.Mb=function(e){this.addAuthTokenListener(e),0<++this.o&&Os(this)&&Pa(Os(this))},ou.qc=function(e){var t=this;Eu(this.m,function(n){n==e&&t.o--}),0>this.o&&(this.o=0),0==this.o&&Os(this)&&Ra(Os(this)),this.removeAuthTokenListener(e)},ou.addAuthTokenListener=function(e){var t=this;this.m.push(e),ks(this,this.i.then(function(){t.l||T(t.m,e)&&e(Ps(t))}))},ou.removeAuthTokenListener=function(e){N(this.m,function(t){return t==e})},ou.delete=function(){this.l=!0;for(var e=0;e<this.N.length;e++)this.N[e].cancel("app-deleted");return this.N=[],this.h&&(e=this.h,Io(e.b,e.a,this.ha)),this.a&&this.a.unsubscribe(this),au.Promise.resolve()},ou.Rb=function(e){return ks(this,Si(this.c,e))},ou.Fc=function(e){return this.Ia(e).then(function(e){return e.data.email})},ou.Ta=function(e,t){return ks(this,this.c.Ta(e,t).then(function(){}))},ou.Ia=function(e){return ks(this,this.c.Ia(e).then(function(e){return new Or(e)}))},ou.Sa=function(e){return ks(this,this.c.Sa(e).then(function(){}))},ou.cb=function(e,t){var n=this;return ks(this,te().then(function(){return void 0===t||D(t)?{}:kr(new Ar(t))}).then(function(t){return n.c.cb(e,t)}).then(function(){}))},ou.vc=function(e,t){return ks(this,ha(this,e,t,p(this.fb,this)))};var Il="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" "),Ol="callback",Pl="expired-callback",Rl="sitekey",Al="size";ou=Gs.prototype,ou.xa=function(){var e=this;return this.c?this.c:this.c=Xs(this,te().then(function(){if(ur())return Yn();throw new Pr("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return $s(Zs(),e.o())}).then(function(){return Fi(e.u,Qh,{})}).then(function(t){e.a[Rl]=t.recaptchaSiteKey}).s(function(t){throw e.c=null,t}))},ou.render=function(){Ys(this);var e=this;return Xs(this,this.xa().then(function(){if(null===e.b){var t=e.l;if(!e.h){var n=De(t);t=Le("DIV"),n.appendChild(t)}e.b=grecaptcha.render(t,e.a)}return e.b}))},ou.verify=function(){Ys(this);var e=this;return Xs(this,this.render().then(function(t){return new $(function(n){var r=grecaptcha.getResponse(t);if(r)n(r);else{var i=function(t){t&&(Qs(e,i),n(t))};e.i.push(i),e.h&&grecaptcha.execute(e.b)}})}))},ou.reset=function(){Ys(this),null!==this.b&&grecaptcha.reset(this.b)},ou.clear=function(){Ys(this),this.m=!0,Zs().b--;for(var e=0;e<this.g.length;e++)this.g[e].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.h){e=De(this.l);for(var t;t=e.firstChild;)e.removeChild(t)}};var kl=we("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Dl=null;d(eu,Gs),tu(vs.prototype,{Sa:{name:"applyActionCode",j:[xs("code")]},Ia:{name:"checkActionCode",j:[xs("code")]},Ta:{name:"confirmPasswordReset",j:[xs("code"),xs("newPassword")]},Ob:{name:"createUserWithEmailAndPassword",j:[xs("email"),xs("password")]},qb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[xs("email"),xs("password")]}
1,Rb:{name:"fetchProvidersForEmail",j:[xs("email")]},aa:{name:"getRedirectResult",j:[]},hc:{name:"onAuthStateChanged",j:[Hs(Ms(),Fs(),"nextOrObserver"),Fs("opt_error",!0),Fs("opt_completed",!0)]},ic:{name:"onIdTokenChanged",j:[Hs(Ms(),Fs(),"nextOrObserver"),Fs("opt_error",!0),Fs("opt_completed",!0)]},cb:{name:"sendPasswordResetEmail",j:[xs("email"),Hs(Ms("opt_actionCodeSettings",!0),Us(null,!0),"opt_actionCodeSettings",!0)]},eb:{name:"setPersistence",j:[xs("persistence")]},fb:{name:"signInAndRetrieveDataWithCredential",j:[Bs()]},gb:{name:"signInAnonymously",j:[]},Gb:{name:"signInAnonymouslyAndRetrieveData",j:[]},sc:{name:"signInWithCredential",j:[Bs()]},tc:{name:"signInWithCustomToken",j:[xs("token")]},Eb:{name:"signInAndRetrieveDataWithCustomToken",j:[xs("token")]},uc:{name:"signInWithEmailAndPassword",j:[xs("email"),xs("password")]},Fb:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[xs("email"),xs("password")]},vc:{name:"signInWithPhoneNumber",j:[xs("phoneNumber"),Ks()]},wc:{name:"signInWithPopup",j:[qs()]},xc:{name:"signInWithRedirect",j:[qs()]},hb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[xs(null,!0)]},Ec:{name:"useDeviceLanguage",j:[]},Fc:{name:"verifyPasswordResetCode",j:[xs("code")]}}),function(e,t){for(var n in t){var r=t[n].name;if(r!==n){var i=t[n].Nb;Object.defineProperty(e,r,{get:function(){return this[n]},set:function(e){Ds(r,[i],[e],!0),this[n]=e},enumerable:!0})}}}(vs.prototype,{lc:{name:"languageCode",Nb:Hs(xs(),Us(),"languageCode")}}),vs.Persistence=ml,vs.Persistence.LOCAL="local",vs.Persistence.SESSION="session",vs.Persistence.NONE="none",tu(Ca.prototype,{delete:{name:"delete",j:[]},F:{name:"getIdToken",j:[Ls()]},getToken:{name:"getToken",j:[Ls()]},Xa:{name:"linkAndRetrieveDataWithCredential",j:[Bs()]},cc:{name:"linkWithCredential",j:[Bs()]},dc:{name:"linkWithPhoneNumber",j:[xs("phoneNumber"),Ks()]},ec:{name:"linkWithPopup",j:[qs()]},fc:{name:"linkWithRedirect",j:[qs()]},Za:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Bs()]},mc:{name:"reauthenticateWithCredential",j:[Bs()]},nc:{name:"reauthenticateWithPhoneNumber",j:[xs("phoneNumber"),Ks()]},oc:{name:"reauthenticateWithPopup",j:[qs()]},pc:{name:"reauthenticateWithRedirect",j:[qs()]},reload:{name:"reload",j:[]},bb:{name:"sendEmailVerification",j:[Hs(Ms("opt_actionCodeSettings",!0),Us(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[xs(null,!0)]},Cc:{name:"unlink",j:[xs("provider")]},kb:{name:"updateEmail",j:[xs("email")]},lb:{name:"updatePassword",j:[xs("password")]},Dc:{name:"updatePhoneNumber",j:[Bs("phone")]},mb:{name:"updateProfile",j:[Ms("profile")]}}),tu($.prototype,{s:{name:"catch"},then:{name:"then"}}),tu(ca.prototype,{confirm:{name:"confirm",j:[xs("verificationCode")]}}),nu(ri,"credential",function(e,t){return new ni(e,t)},[xs("email"),xs("password")]),tu(Qr.prototype,{sa:{name:"addScope",j:[xs("scope")]},Ba:{name:"setCustomParameters",j:[Ms("customOAuthParameters")]}}),nu(Qr,"credential",Xr,[Hs(xs(),Ms(),"token")]),tu(Yr.prototype,{sa:{name:"addScope",j:[xs("scope")]},Ba:{name:"setCustomParameters",j:[Ms("customOAuthParameters")]}}),nu(Yr,"credential",Jr,[Hs(xs(),Ms(),"token")]),tu($r.prototype,{sa:{name:"addScope",j:[xs("scope")]},Ba:{name:"setCustomParameters",j:[Ms("customOAuthParameters")]}}),nu($r,"credential",Zr,[Hs(xs(),Hs(Ms(),Us()),"idToken"),Hs(xs(),Us(),"accessToken",!0)]),tu(ei.prototype,{Ba:{name:"setCustomParameters",j:[Ms("customOAuthParameters")]}}),nu(ei,"credential",ti,[Hs(xs(),Ms(),"token"),xs("secret",!0)]),tu(zr.prototype,{sa:{name:"addScope",j:[xs("scope")]},credential:{name:"credential",j:[Hs(xs(),Us(),"idToken",!0),Hs(xs(),Us(),"accessToken",!0)]},Ba:{name:"setCustomParameters",j:[Ms("customOAuthParameters")]}}),nu(ai,"credential",si,[xs("verificationId"),xs("verificationCode")]),tu(ai.prototype,{Qa:{name:"verifyPhoneNumber",j:[xs("phoneNumber"),Ks()]}}),tu(Pr.prototype,{toJSON:{name:"toJSON",j:[xs(null,!0)]}}),tu(fi.prototype,{toJSON:{name:"toJSON",j:[xs(null,!0)]}}),tu(pi.prototype,{toJSON:{name:"toJSON",j:[xs(null,!0)]}}),tu(eu.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if(void 0===au||!au.INTERNAL||!au.INTERNAL.registerService)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var e={Auth:vs,Error:Pr};nu(e,"EmailAuthProvider",ri,[]),nu(e,"FacebookAuthProvider",Qr,[]),nu(e,"GithubAuthProvider",Yr,[]),nu(e,"GoogleAuthProvider",$r,[]),nu(e,"TwitterAuthProvider",ei,[]),nu(e,"OAuthProvider",zr,[xs("providerId")]),nu(e,"PhoneAuthProvider",ai,[Ws()]),nu(e,"RecaptchaVerifier",eu,[Hs(xs(),js(),"recaptchaContainer"),Ms("recaptchaParameters",!0),Vs()]),au.INTERNAL.registerService("auth",function(e,t){return e=new vs(e),t({INTERNAL:{getUid:p(e.getUid,e),getToken:p(e.Vb,e),addAuthTokenListener:p(e.Mb,e),removeAuthTokenListener:p(e.qc,e)}}),e},e,function(e,t){if("create"===e)try{t.auth()}catch(e){}}),au.INTERNAL.extendNamespace({User:Ca})}()}).call(void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).call(t,n(28))},function(e,t,n){e.exports=n(104)},function(e,t,n){"use strict";function r(t){var n=t.INTERNAL.registerService("database",function(e,t,n){return c.RepoManager.getInstance().databaseFromApp(e,n)},{Reference:s.Reference,Query:a.Query,Database:o.Database,enableLogging:u.enableLogging,INTERNAL:h,ServerValue:f,TEST_ACCESS:l},null,!0);p.isNodeSdk()&&(e.exports=n)}
1Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),o=n(45);t.Database=o.Database;var a=n(49);t.Query=a.Query;var s=n(30);t.Reference=s.Reference;var u=n(1);t.enableLogging=u.enableLogging;var c=n(35),h=n(136),l=n(137),p=n(0),f=o.Database.ServerValue;t.ServerValue=f,t.registerDatabase=r,r(i.default);var d=n(31);t.DataSnapshot=d.DataSnapshot;var v=n(48);t.OnDisconnect=v.OnDisconnect},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),r.stringify(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:r.jsonEval(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}();t.DOMStorageWrapper=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return r.contains(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}();t.MemoryStorage=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return r.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}();t.TransactionResult=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.nextPushId=function(){var e="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",t=0,n=[];return function(i){var o=i===t;t=i;var a,s=new Array(8);for(a=7;a>=0;a--)s[a]=e.charAt(i%64),i=Math.floor(i/64);r.assert(0===i,"Cannot push at time == 0");var u=s.join("");if(o){for(a=11;a>=0&&63===n[a];a--)n[a]=0;n[a]++}else for(a=0;a<12;a++)n[a]=Math.floor(64*Math.random());for(a=0;a<12;a++)u+=e.charAt(n[a]);return r.assert(20===u.length,"nextPushId: Length should be 20."),u}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(31),i=n(110),o=n(0),a=n(0),s=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new i.DataEvent("value",this,new r.DataSnapshot(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){a.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callback_;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new i.CancelEvent(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}();t.ValueEventRegistration=s;var u=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,o.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new i.CancelEvent(this,e,t):null},e.prototype.createEvent=function(e,t){a.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),o=t.getQueryParams().getIndex();return new i.DataEvent(e.type,this,new r.DataSnapshot(e.snapshotNode,n,o),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){a.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callbacks_[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;
1if(this.context_===t.context_){var n=o.getCount(t.callbacks_);if(n===o.getCount(this.callbacks_)){if(1===n){var r=o.getAnyKey(t.callbacks_),i=o.getAnyKey(this.callbacks_);return!(i!==r||t.callbacks_[r]&&this.callbacks_[i]&&t.callbacks_[r]!==this.callbacks_[i])}return o.every(this.callbacks_,function(e,n){return t.callbacks_[e]===n})}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}();t.ChildEventRegistration=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+r.stringify(this.snapshot.exportVal())},e}();t.DataEvent=i;var o=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}();t.CancelEvent=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(112),a=n(4),s=n(0),u=n(32),c=n(113),h=n(114),l=n(10),p=n(59),f=n(2),d=n(60),v=n(120),_=function(){function e(e){this.listenProvider_=e,this.syncPointTree_=u.ImmutableTree.Empty,this.pendingWriteTree_=new v.WriteTree,this.tagToQueryMap_={},this.queryToTagMap_={}}return e.prototype.applyUserOverwrite=function(e,t,n,r){return this.pendingWriteTree_.addOverwrite(e,t,n,r),r?this.applyOperationToSyncPoints_(new p.Overwrite(l.OperationSource.User,e,t)):[]},e.prototype.applyUserMerge=function(e,t,n){this.pendingWriteTree_.addMerge(e,t,n);var r=u.ImmutableTree.fromObject(t);return this.applyOperationToSyncPoints_(new h.Merge(l.OperationSource.User,e,r))},e.prototype.ackUserWrite=function(e,t){void 0===t&&(t=!1);var n=this.pendingWriteTree_.getWrite(e);if(this.pendingWriteTree_.removeWrite(e)){var r=u.ImmutableTree.Empty;return null!=n.snap?r=r.set(f.Path.Empty,!0):s.forEach(n.children,function(e,t){r=r.set(new f.Path(e),t)}),this.applyOperationToSyncPoints_(new o.AckUserWrite(n.path,r,t))}return[]},e.prototype.applyServerOverwrite=function(e,t){return this.applyOperationToSyncPoints_(new p.Overwrite(l.OperationSource.Server,e,t))},e.prototype.applyServerMerge=function(e,t){var n=u.ImmutableTree.fromObject(t);return this.applyOperationToSyncPoints_(new h.Merge(l.OperationSource.Server,e,n))},e.prototype.applyListenComplete=function(e){return this.applyOperationToSyncPoints_(new c.ListenComplete(l.OperationSource.Server,e))},e.prototype.applyTaggedQueryOverwrite=function(t,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=e.parseQueryKey_(i),a=o.path,s=o.queryId,u=f.Path.relativePath(a,t),c=new p.Overwrite(l.OperationSource.forServerTaggedQuery(s),u,n);return this.applyTaggedOperation_(a,c)}return[]},e.prototype.applyTaggedQueryMerge=function(t,n,r){var i=this.queryKeyForTag_(r);if(i){var o=e.parseQueryKey_(i),a=o.path,s=o.queryId,c=f.Path.relativePath(a,t),p=u.ImmutableTree.fromObject(n),d=new h.Merge(l.OperationSource.forServerTaggedQuery(s),c,p);return this.applyTaggedOperation_(a,d)}return[]},e.prototype.applyTaggedListenComplete=function(t,n){var r=this.queryKeyForTag_(n);if(r){var i=e.parseQueryKey_(r),o=i.path,a=i.queryId,s=f.Path.relativePath(o,t),u=new c.ListenComplete(l.OperationSource.forServerTaggedQuery(a),s);return this.applyTaggedOperation_(o,u)}return[]},e.prototype.addEventRegistration=function(t,n){var i=t.path,o=null,s=!1;this.syncPointTree_.foreachOnPath(i,function(e,t){var n=f.Path.relativePath(e,i);o=o||t.getCompleteServerCache(n),s=s||t.hasCompleteView()});var u=this.syncPointTree_.get(i);u?(s=s||u.hasCompleteView(),o=o||u.getCompleteServerCache(f.Path.Empty)):(u=new d.SyncPoint,this.syncPointTree_=this.syncPointTree_.set(i,u));var c;null!=o?c=!0:(c=!1,o=a.ChildrenNode.EMPTY_NODE,this.syncPointTree_.subtree(i).foreachChild(function(e,t){var n=t.getCompleteServerCache(f.Path.Empty);n&&(o=o.updateImmediateChild(e,n))}));var h=u.viewExistsForQuery(t);
1if(!h&&!t.getQueryParams().loadsAllData()){var l=e.makeQueryKey_(t);r.assert(!(l in this.queryToTagMap_),"View does not exist, but we have a tag");var p=e.getNextQueryTag_();this.queryToTagMap_[l]=p,this.tagToQueryMap_["_"+p]=l}var v=this.pendingWriteTree_.childWrites(i),_=u.addEventRegistration(t,n,v,o,c);if(!h&&!s){var g=u.viewForQuery(t);_=_.concat(this.setupListener_(t,g))}return _},e.prototype.removeEventRegistration=function(t,n,r){var i=this,o=t.path,a=this.syncPointTree_.get(o),s=[];if(a&&("default"===t.queryIdentifier()||a.viewExistsForQuery(t))){var u=a.removeEventRegistration(t,n,r);a.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;s=u.events;var h=-1!==c.findIndex(function(e){return e.getQueryParams().loadsAllData()}),l=this.syncPointTree_.findOnPath(o,function(e,t){return t.hasCompleteView()});if(h&&!l){var p=this.syncPointTree_.subtree(o);if(!p.isEmpty())for(var f=this.collectDistinctViewsForSubTree_(p),d=0;d<f.length;++d){var v=f[d],_=v.getQuery(),g=this.createListenerForView_(v);this.listenProvider_.startListening(e.queryForListening_(_),this.tagForQuery_(_),g.hashFn,g.onComplete)}}!l&&c.length>0&&!r&&(h?this.listenProvider_.stopListening(e.queryForListening_(t),null):c.forEach(function(t){var n=i.queryToTagMap_[e.makeQueryKey_(t)];i.listenProvider_.stopListening(e.queryForListening_(t),n)})),this.removeTags_(c)}return s},e.prototype.calcCompleteEventCache=function(e,t){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(e,function(t,n){var r=f.Path.relativePath(t,e),i=n.getCompleteServerCache(r);if(i)return i});return n.calcCompleteEventCache(e,r,t,!0)},e.prototype.collectDistinctViewsForSubTree_=function(e){return e.fold(function(e,t,n){if(t&&t.hasCompleteView())return[t.getCompleteView()];var r=[];return t&&(r=t.getQueryViews()),s.forEach(n,function(e,t){r=r.concat(t)}),r})},e.prototype.removeTags_=function(t){for(var n=0;n<t.length;++n){var r=t[n];if(!r.getQueryParams().loadsAllData()){var i=e.makeQueryKey_(r),o=this.queryToTagMap_[i];delete this.queryToTagMap_[i],delete this.tagToQueryMap_["_"+o]}}},e.queryForListening_=function(e){return e.getQueryParams().loadsAllData()&&
1!e.getQueryParams().isDefault()?e.getRef():e},e.prototype.setupListener_=function(t,n){var i=t.path,o=this.tagForQuery_(t),a=this.createListenerForView_(n),u=this.listenProvider_.startListening(e.queryForListening_(t),o,a.hashFn,a.onComplete),c=this.syncPointTree_.subtree(i);if(o)r.assert(!c.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var h=c.fold(function(e,t,n){if(!e.isEmpty()&&t&&t.hasCompleteView())return[t.getCompleteView().getQuery()];var r=[];return t&&(r=r.concat(t.getQueryViews().map(function(e){return e.getQuery()}))),s.forEach(n,function(e,t){r=r.concat(t)}),r}),l=0;l<h.length;++l){var p=h[l];this.listenProvider_.stopListening(e.queryForListening_(p),this.tagForQuery_(p))}return u},e.prototype.createListenerForView_=function(e){var t=this,n=e.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(e.getServerCache()||a.ChildrenNode.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return r?t.applyTaggedListenComplete(n.path,r):t.applyListenComplete(n.path);var o=i.errorForServerCode(e,n);return t.removeEventRegistration(n,null,o)}}},e.makeQueryKey_=function(e){return e.path.toString()+"$"+e.queryIdentifier()},e.parseQueryKey_=function(e){var t=e.indexOf("$");return r.assert(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new f.Path(e.substr(0,t))}},e.prototype.queryKeyForTag_=function(e){return this.tagToQueryMap_["_"+e]},e.prototype.tagForQuery_=function(t){var n=e.makeQueryKey_(t);return s.safeGet(this.queryToTagMap_,n)},e.getNextQueryTag_=function(){return e.nextQueryTag_++},e.prototype.applyTaggedOperation_=function(e,t){var n=this.syncPointTree_.get(e);r.assert(n,"Missing sync point for query tag that we're tracking");var i=this.pendingWriteTree_.childWrites(e);return n.applyOperation(t,i,null)},e.prototype.applyOperationToSyncPoints_=function(e){return this.applyOperationHelper_(e,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(f.Path.Empty))},e.prototype.applyOperationHelper_=function(e,t,n,r){if(e.path.isEmpty())return this.applyOperationDescendantsHelper_(e,t,n,r);var i=t.get(f.Path.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(f.Path.Empty));var o=[],a=e.path.getFront(),s=e.operationForChild(a),u=t.children.get(a);if(u&&s){var c=n?n.getImmediateChild(a):null,h=r.child(a);o=o.concat(this.applyOperationHelper_(s,u,c,h))}return i&&(o=o.concat(i.applyOperation(e,r,n))),o},e.prototype.applyOperationDescendantsHelper_=function(e,t,n,r){var i=this,o=t.get(f.Path.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(f.Path.Empty));var a=[];return t.children.inorderTraversal(function(t,o){var s=n?n.getImmediateChild(t):null,u=r.child(t),c=e.operationForChild(t);c&&(a=a.concat(i.applyOperationDescendantsHelper_(c,o,s,u)))}),o&&(a=a.concat(o.applyOperation(e,r,n))),a},e.nextQueryTag_=1,e}();t.SyncTree=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(10),a=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=o.OperationType.ACK_USER_WRITE,this.source=o.OperationSource.User}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return r.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new i.Path(t));return new e(i.Path.Empty,n,this.revert)}return r.assert(this.path.getFront()===t,"operationForChild called for unrelated child."),new e(this.path.popFront(),this.affectedTree,this.revert)},e}();t.AckUserWrite=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=n(10),o=function(){function e(e,t){this.source=e,this.path=t,this.type=i.OperationType.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,r.Path.Empty):new e(this.source,this.path.popFront())},e}();t.ListenComplete=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(59),o=n(2),a=n(0),s=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=r.OperationType.MERGE}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){var n=this.children.subtree(new o.Path(t));return n.isEmpty()?null:n.value?new i.Overwrite(this.source,o.Path.Empty,n.value):new e(this.source,o.Path.Empty,n)}return a.assert(this.path.getFront()===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,this.path.popFront(),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}();t.Merge=s},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(33),i=n(116),o=n(4),a=n(24),s=n(61),u=n(119),c=n(0),h=n(10),l=n(12),p=n(3),f=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),c=new r.IndexedFilter(n.getIndex()),h=n.getNodeFilter();this.processor_=new i.ViewProcessor(h);var l=t.getServerCache(),p=t.getEventCache(),f=c.updateFullNode(o.ChildrenNode.EMPTY_NODE,l.getNode(),null),d=h.updateFullNode(o.ChildrenNode.EMPTY_NODE,p.getNode(),null),v=new a.CacheNode(f,l.isFullyInitialized(),c.filtersNodes()),_=new a.CacheNode(d,p.isFullyInitialized(),h.filtersNodes());this.viewCache_=new s.ViewCache(_,v),this.eventGenerator_=new u.EventGenerator(this.query_)}return e.prototype.getQuery=function(){return this.query_},e.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},e.prototype.getCompleteServerCache=function(e){var t=this.viewCache_.getCompleteServerSnap();return t&&(this.query_.getQueryParams().loadsAllData()||!e.isEmpty()&&!t.getImmediateChild(e.getFront()).isEmpty())?t.getChild(e):null},e.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},e.prototype.addEventRegistration=function(e){this.eventRegistrations_.push(e)},e.prototype.removeEventRegistration=function(e,t){var n=[];if(t){c.assert(null==e,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach(function(e){t=t;var i=e.createCancelEvent(t,r);i&&n.push(i)})}if(e){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(e)){if(e.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},e.prototype.applyOperation=function(e,t,n){e.type===h.OperationType.MERGE&&null!==e.source.queryId&&(c.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),c.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,e,t,n);return this.processor_.assertIndexed(i.viewCache),c.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},e.prototype.getInitialEvents=function(e){var t=this.viewCache_.getEventCache(),n=[];return t.getNode().isLeafNode()||t.getNode().forEachChild(p.PRIORITY_INDEX,function(e,t){n.push(l.Change.childAddedChange(e,t))}),t.isFullyInitialized()&&n.push(l.Change.valueChange(t.getNode())),this.generateEventsForChanges_(n,t.getNode(),e)},e.prototype.generateEventsForChanges_=function(e,t,n){var r=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(e,t,r)},e}();t.View=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(0),o=n(117),a=n(12),s=n(4),u=n(14),c=n(32),h=n(2),l=n(118),p=function(){function e(e,t){this.viewCache=e,this.changes=t}return e}();t.ProcessorResult=p;var f=function(){function e(e){this.filter_=e}return e.prototype.assertIndexed=function(e){i.assert(e.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),i.assert(e.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},e.prototype.applyOperation=function(t,n,a,s){var u,c,h=new o.ChildChangeAccumulator;if(n.type===r.OperationType.OVERWRITE){var l=n;l.source.fromUser?u=this.applyUserOverwrite_(t,l.path,l.snap,a,s,h):(i.assert(l.source.fromServer,"Unknown source."),c=l.source.tagged||t.getServerCache().isFiltered()&&!l.path.isEmpty(),u=this.applyServerOverwrite_(t,l.path,l.snap,a,s,c,h))}else if(n.type===r.OperationType.MERGE){var f=n;f.source.fromUser?u=this.applyUserMerge_(t,f.path,f.children,a,s,h):(i.assert(f.source.fromServer,"Unknown source."),c=f.source.tagged||t.getServerCache().isFiltered(),u=this.applyServerMerge_(t,f.path,f.children,a,s,c,h))}else if(n.type===r.OperationType.ACK_USER_WRITE){var d=n;u=d.revert?this.revertUserWrite_(t,d.path,a,s,h):this.ackUserWrite_(t,d.path,d.affectedTree,a,s,h)}else{if(n.type!==r.OperationType.LISTEN_COMPLETE)throw i.assertionError("Unknown operation type: "+n.type);u=this.listenComplete_(t,n.path,a,h)}var v=h.getChanges();return e.maybeAddValueEvent_(t,u,v),new p(u,v)},e.maybeAddValueEvent_=function(e,t,n){var r=t.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=e.getCompleteEventSnap();(n.length>
10||!e.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(a.Change.valueChange(t.getCompleteEventSnap()))}},e.prototype.generateEventCacheAfterServerEvent_=function(e,t,n,r,o){var a=e.getEventCache();if(null!=n.shadowingWrite(t))return e;var u=void 0,c=void 0;if(t.isEmpty())if(i.assert(e.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),e.getServerCache().isFiltered()){var h=e.getCompleteServerSnap(),l=h instanceof s.ChildrenNode?h:s.ChildrenNode.EMPTY_NODE,p=n.calcCompleteEventChildren(l);u=this.filter_.updateFullNode(e.getEventCache().getNode(),p,o)}else{var f=n.calcCompleteEventCache(e.getCompleteServerSnap());u=this.filter_.updateFullNode(e.getEventCache().getNode(),f,o)}else{var d=t.getFront();if(".priority"==d){i.assert(1==t.getLength(),"Can't have a priority with additional path components");var v=a.getNode();c=e.getServerCache().getNode();var _=n.calcEventCacheAfterServerOverwrite(t,v,c);u=null!=_?this.filter_.updatePriority(v,_):a.getNode()}else{var g=t.popFront(),y=void 0;if(a.isCompleteForChild(d)){c=e.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(t,a.getNode(),c);y=null!=m?a.getNode().getImmediateChild(d).updateChild(g,m):a.getNode().getImmediateChild(d)}else y=n.calcCompleteChild(d,e.getServerCache());u=null!=y?this.filter_.updateChild(a.getNode(),d,y,g,r,o):a.getNode()}}return e.updateEventSnap(u,a.isFullyInitialized()||t.isEmpty(),this.filter_.filtersNodes())},e.prototype.applyServerOverwrite_=function(e,t,n,r,i,o,a){var s,u=e.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(t.isEmpty())s=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var h=u.getNode().updateChild(t,n);s=c.updateFullNode(u.getNode(),h,null)}else{var p=t.getFront();if(!u.isCompleteForPath(t)&&t.getLength()>1)return e;var f=t.popFront(),d=u.getNode().getImmediateChild(p),v=d.updateChild(f,n);s=".priority"==p?c.updatePriority(u.getNode(),v):c.updateChild(u.getNode(),p,v,f,l.NO_COMPLETE_CHILD_SOURCE,null)}var _=e.updateServerSnap(s,u.isFullyInitialized()||t.isEmpty(),c.filtersNodes()),g=new l.WriteTreeCompleteChildSource(r,_,i);return this.generateEventCacheAfterServerEvent_(_,t,r,g,a)},e.prototype.applyUserOverwrite_=function(e,t,n,r,i,o){var a,u,c=e.getEventCache(),h=new l.WriteTreeCompleteChildSource(r,e,i);if(t.isEmpty())u=this.filter_.updateFullNode(e.getEventCache().getNode(),n,o),a=e.updateEventSnap(u,!0,this.filter_.filtersNodes());else{var p=t.getFront();if(".priority"===p)u=this.filter_.updatePriority(e.getEventCache().getNode(),n),a=e.updateEventSnap(u,c.isFullyInitialized(),c.isFiltered());else{var f=t.popFront(),d=c.getNode().getImmediateChild(p),v=void 0;if(f.isEmpty())v=n;else{var _=h.getCompleteChild(p);v=null!=_?".priority"===f.getBack()&&_.getChild(f.parent()).isEmpty()?_:_.updateChild(f,n):s.ChildrenNode.EMPTY_NODE}if(d.equals(v))a=e;else{var g=this.filter_.updateChild(c.getNode(),p,v,f,h,o);a=e.updateEventSnap(g,c.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},e.cacheHasChild_=function(e,t){return e.getEventCache().isCompleteForChild(t)},e.prototype.applyUserMerge_=function(t,n,r,i,o,a){var s=this,u=t;return r.foreach(function(r,c){var h=n.child(r);
1e.cacheHasChild_(t,h.getFront())&&(u=s.applyUserOverwrite_(u,h,c,i,o,a))}),r.foreach(function(r,c){var h=n.child(r);e.cacheHasChild_(t,h.getFront())||(u=s.applyUserOverwrite_(u,h,c,i,o,a))}),u},e.prototype.applyMerge_=function(e,t){return t.foreach(function(t,n){e=e.updateChild(t,n)}),e},e.prototype.applyServerMerge_=function(e,t,n,r,i,o,a){var s=this;if(e.getServerCache().getNode().isEmpty()&&!e.getServerCache().isFullyInitialized())return e;var u,l=e;u=t.isEmpty()?n:c.ImmutableTree.Empty.setTree(t,n);var p=e.getServerCache().getNode();return u.children.inorderTraversal(function(t,n){if(p.hasChild(t)){var u=e.getServerCache().getNode().getImmediateChild(t),c=s.applyMerge_(u,n);l=s.applyServerOverwrite_(l,new h.Path(t),c,r,i,o,a)}}),u.children.inorderTraversal(function(t,n){var u=!e.getServerCache().isCompleteForChild(t)&&null==n.value;if(!p.hasChild(t)&&!u){var c=e.getServerCache().getNode().getImmediateChild(t),f=s.applyMerge_(c,n);l=s.applyServerOverwrite_(l,new h.Path(t),f,r,i,o,a)}}),l},e.prototype.ackUserWrite_=function(e,t,n,r,i,o){if(null!=r.shadowingWrite(t))return e;var a=e.getServerCache().isFiltered(),s=e.getServerCache();if(null!=n.value){if(t.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(t))return this.applyServerOverwrite_(e,t,s.getNode().getChild(t),r,i,a,o);if(t.isEmpty()){var l=c.ImmutableTree.Empty;return s.getNode().forEachChild(u.KEY_INDEX,function(e,t){l=l.set(new h.Path(e),t)}),this.applyServerMerge_(e,t,l,r,i,a,o)}return e}var p=c.ImmutableTree.Empty;return n.foreach(function(e,n){var r=t.child(e);s.isCompleteForPath(r)&&(p=p.set(e,s.getNode().getChild(r)))}),this.applyServerMerge_(e,t,p,r,i,a,o)},e.prototype.listenComplete_=function(e,t,n,r){var i=e.getServerCache(),o=e.updateServerSnap(i.getNode(),i.isFullyInitialized()||t.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,t,n,l.NO_COMPLETE_CHILD_SOURCE,r)},e.prototype.revertUserWrite_=function(e,t,n,r,o){var a;if(null!=n.shadowingWrite(t))return e;var u=new l.WriteTreeCompleteChildSource(n,e,r),c=e.getEventCache().getNode(),p=void 0;if(t.isEmpty()||".priority"===t.getFront()){var f=void 0;if(e.getServerCache().isFullyInitialized())f=n.calcCompleteEventCache(e.getCompleteServerSnap());else{var d=e.getServerCache().getNode();i.assert(d instanceof s.ChildrenNode,"serverChildren would be complete if leaf node"),f=n.calcCompleteEventChildren(d)}f=f,p=this.filter_.updateFullNode(c,f,o)}else{var v=t.getFront(),_=n.calcCompleteChild(v,e.getServerCache());null==_&&e.getServerCache().isCompleteForChild(v)&&(_=c.getImmediateChild(v)),p=null!=_?this.filter_.updateChild(c,v,_,t.popFront(),u,o):e.getEventCache().getNode().hasChild(v)?this.filter_.updateChild(c,v,s.ChildrenNode.EMPTY_NODE,t.popFront(),u,o):c,p.isEmpty()&&e.getServerCache().isFullyInitialized()&&(a=n.calcCompleteEventCache(e.getCompleteServerSnap()),a.isLeafNode()&&(p=this.filter_.updateFullNode(p,a,o)))}return a=e.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(h.Path.Empty),e.updateEventSnap(p,a,this.filter_.filtersNodes())},e}();t.ViewProcessor=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(12),o=n(0),a=function(){function e(){this.changeMap_={}}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;o.assert(t==i.Change.CHILD_ADDED||t==i.Change.CHILD_CHANGED||t==i.Change.CHILD_REMOVED,"Only child changes supported for tracking"),o.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var a=r.safeGet(this.changeMap_,n);if(a){var s=a.type;if(t==i.Change.CHILD_ADDED&&s==i.Change.CHILD_REMOVED)this.changeMap_[n]=i.Change.childChangedChange(n,e.snapshotNode,a.snapshotNode);else if(t==i.Change.CHILD_REMOVED&&s==i.Change.CHILD_ADDED)delete this.changeMap_[n];else if(t==i.Change.CHILD_REMOVED&&s==i.Change.CHILD_CHANGED)this.changeMap_[n]=i.Change.childRemovedChange(n,a.oldSnap);else if(t==i.Change.CHILD_CHANGED&&s==i.Change.CHILD_ADDED)this.changeMap_[n]=i.Change.childAddedChange(n,e.snapshotNode);else{if(t!=i.Change.CHILD_CHANGED||s!=i.Change.CHILD_CHANGED)throw o.assertionError("Illegal combination of changes: "+e+" occurred after "+a);this.changeMap_[n]=i.Change.childChangedChange(n,e.snapshotNode,a.oldSnap)}}else this.changeMap_[n]=e},e.prototype.getChanges=function(){return r.getValues(this.changeMap_)},e}();t.ChildChangeAccumulator=a},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),i=function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}();t.NoCompleteChildSource_=i,t.NO_COMPLETE_CHILD_SOURCE=new i;var o=function(){function e(e,t,n){void 0===n&&(n=null),this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}return e.prototype.getCompleteChild=function(e){var t=this.viewCache_.getEventCache();if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.optCompleteServerCache_?new r.CacheNode(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(e,n)},e.prototype.getChildAfterChild=function(e,t,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,t,1,n,e);return 0===i.length?null:i[0]},e}();t.WriteTreeCompleteChildSource=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(12),o=n(0),a=function(){function e(e){this.query_=e,this.index_=this.query_.getQueryParams().getIndex()}return e.prototype.generateEventsForChanges=function(e,t,n){var r=this,o=[],a=[];return e.forEach(function(e){e.type===i.Change.CHILD_CHANGED&&r.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&a.push(i.Change.childMovedChange(e.childName,e.snapshotNode))}),this.generateEventsForType_(o,i.Change.CHILD_REMOVED,e,n,t),this.generateEventsForType_(o,i.Change.CHILD_ADDED,e,n,t),this.generateEventsForType_(o,i.Change.CHILD_MOVED,a,n,t),this.generateEventsForType_(o,i.Change.CHILD_CHANGED,e,n,t),this.generateEventsForType_(o,i.Change.VALUE,e,n,t),o},e.prototype.generateEventsForType_=function(e,t,n,r,i){var o=this,a=n.filter(function(e){return e.type===t});a.sort(this.compareChanges_.bind(this)),a.forEach(function(t){var n=o.materializeSingleChange_(t,i);r.forEach(function(r){r.respondsTo(t.type)&&e.push(r.createEvent(n,o.query_))})})},e.prototype.materializeSingleChange_=function(e,t){return"value"===e.type||"child_removed"===e.type?e:(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,this.index_),e)},e.prototype.compareChanges_=function(e,t){if(null==e.childName||null==t.childName)throw o.assertionError("Should only compare child_ events.");var n=new r.NamedNode(e.childName,e.snapshotNode),i=new r.NamedNode(t.childName,t.snapshotNode);return this.index_.compare(n,i)},e}();t.EventGenerator=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=n(2),a=n(121),s=n(3),u=n(4),c=function(){function e(){this.visibleWrites_=a.CompoundWrite.Empty,this.allWrites_=[],this.lastWriteId_=-1}return e.prototype.childWrites=function(e){return new h(e,this)},e.prototype.addOverwrite=function(e,t,n,r){i.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:e,snap:t,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(e,t)),this.lastWriteId_=n},e.prototype.addMerge=function(e,t,n){i.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:e,children:t,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(e,t),this.lastWriteId_=n},e.prototype.getWrite=function(e){for(var t=0;t<this.allWrites_.length;t++){var n=this.allWrites_[t];if(n.writeId===e)return n}return null},e.prototype.removeWrite=function(e){var t=this,n=this.allWrites_.findIndex(function(t){return t.writeId===e});i.assert(n>=0,"removeWrite called with nonexistent writeId.");var o=this.allWrites_[n];this.allWrites_.splice(n,1);for(var a=o.visible,s=!1,u=this.allWrites_.length-1;a&&u>=0;){var c=this.allWrites_[u];c.visible&&(u>=n&&this.recordContainsPath_(c,o.path)?a=!1:o.path.contains(c.path)&&(s=!0)),u--}if(a){if(s)return this.resetTree_(),!0;if(o.snap)this.visibleWrites_=this.visibleWrites_.removeWrite(o.path);else{var h=o.children;r.forEach(h,function(e){t.visibleWrites_=t.visibleWrites_.removeWrite(o.path.child(e))})}return!0}return!1},e.prototype.getCompleteWriteData=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcCompleteEventCache=function(t,n,r,i){if(r||i){var a=this.visibleWrites_.childCompoundWrite(t);if(!i&&a.isEmpty())return n;if(i||null!=n||a.hasCompleteWrite(o.Path.Empty)){var s=function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(e.path.contains(t)||t.contains(e.path))},c=e.layerTree_(this.allWrites_,s,t),h=n||u.ChildrenNode.EMPTY_NODE;return c.apply(h)}return null}var l=this.visibleWrites_.getCompleteNode(t);if(null!=l)return l;var p=this.visibleWrites_.childCompoundWrite(t);if(p.isEmpty())return n;if(null!=n||p.hasCompleteWrite(o.Path.Empty)){var h=n||u.ChildrenNode.EMPTY_NODE;return p.apply(h)}return null},e.prototype.calcCompleteEventChildren=function(e,t){var n=u.ChildrenNode.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(e);if(r)return r.isLeafNode()||r.forEachChild(s.PRIORITY_INDEX,function(e,t){n=n.updateImmediateChild(e,t)}),n;if(t){var i=this.visibleWrites_.childCompoundWrite(e);return t.forEachChild(s.PRIORITY_INDEX,function(e,t){var r=i.childCompoundWrite(new o.Path(e)).apply(t);n=n.updateImmediateChild(e,r)}
1),i.getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n}return this.visibleWrites_.childCompoundWrite(e).getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n,r){i.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var o=e.child(t);if(this.visibleWrites_.hasCompleteWrite(o))return null;var a=this.visibleWrites_.childCompoundWrite(o);return a.isEmpty()?r.getChild(t):a.apply(r.getChild(t))},e.prototype.calcCompleteChild=function(e,t,n){var r=e.child(t),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(t)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(t)):null},e.prototype.shadowingWrite=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcIndexedSlice=function(e,t,n,r,i,a){var s,u=this.visibleWrites_.childCompoundWrite(e),c=u.getCompleteNode(o.Path.Empty);if(null!=c)s=c;else{if(null==t)return[];s=u.apply(t)}if(s=s.withIndex(a),s.isEmpty()||s.isLeafNode())return[];for(var h=[],l=a.getCompare(),p=i?s.getReverseIteratorFrom(n,a):s.getIteratorFrom(n,a),f=p.getNext();f&&h.length<r;)0!==l(f,n)&&h.push(f),f=p.getNext();return h},e.prototype.recordContainsPath_=function(e,t){return e.snap?e.path.contains(t):!!r.findKey(e.children,function(n,r){return e.path.child(r).contains(t)})},e.prototype.resetTree_=function(){this.visibleWrites_=e.layerTree_(this.allWrites_,e.DefaultFilter_,o.Path.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},e.DefaultFilter_=function(e){return e.visible},e.layerTree_=function(e,t,n){for(var s=a.CompoundWrite.Empty,u=0;u<e.length;++u){var c=e[u];if(t(c)){var h=c.path,l=void 0;if(c.snap)n.contains(h)?(l=o.Path.relativePath(n,h),s=s.addWrite(l,c.snap)):h.contains(n)&&(l=o.Path.relativePath(h,n),s=s.addWrite(o.Path.Empty,c.snap.getChild(l)));else{if(!c.children)throw i.assertionError("WriteRecord should have .snap or .children");if(n.contains(h))l=o.Path.relativePath(n,h),s=s.addWrites(l,c.children);else if(h.contains(n))if(l=o.Path.relativePath(h,n),l.isEmpty())s=s.addWrites(o.Path.Empty,c.children);else{var p=r.safeGet(c.children,l.getFront());if(p){var f=p.getChild(l.popFront());s=s.addWrite(o.Path.Empty,f)}}}}}return s},e}();t.WriteTree=c;var h=function(){function e(e,t){this.treePath_=e,this.writeTree_=t}return e.prototype.calcCompleteEventCache=function(e,t,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,e,t,n)},e.prototype.calcCompleteEventChildren=function(e){return this.writeTree_.calcCompleteEventChildren(this.treePath_,e)},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,e,t,n)},e.prototype.shadowingWrite=function(e){return this.writeTree_.shadowingWrite(this.treePath_.child(e))},e.prototype.calcIndexedSlice=function(e,t,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,e,t,n,r,i)},e.prototype.calcCompleteChild=function(e,t){return this.writeTree_.calcCompleteChild(this.treePath_,e,t)},e.prototype.child=function(t){return new e(this.treePath_.child(t),this.writeTree_)},e}();t.WriteTreeRef=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32),i=n(2),o=n(0),a=n(5),s=n(3),u=n(0),c=function(){function e(e){this.writeTree_=e}return e.prototype.addWrite=function(t,n){if(t.isEmpty())return new e(new r.ImmutableTree(n));var o=this.writeTree_.findRootMostValueAndPath(t);if(null!=o){var a=o.path,s=o.value,u=i.Path.relativePath(a,t);return s=s.updateChild(u,n),new e(this.writeTree_.set(a,s))}var c=new r.ImmutableTree(n);return new e(this.writeTree_.setTree(t,c))},e.prototype.addWrites=function(e,t){var n=this;return o.forEach(t,function(t,r){n=n.addWrite(e.child(t),r)}),n},e.prototype.removeWrite=function(t){return t.isEmpty()?e.Empty:new e(this.writeTree_.setTree(t,r.ImmutableTree.Empty))},e.prototype.hasCompleteWrite=function(e){return null!=this.getCompleteNode(e)},e.prototype.getCompleteNode=function(e){var t=this.writeTree_.findRootMostValueAndPath(e);return null!=t?this.writeTree_.get(t.path).getChild(i.Path.relativePath(t.path,e)):null},e.prototype.getCompleteChildren=function(){var e=[],t=this.writeTree_.value;return null!=t?t.isLeafNode()||t.forEachChild(s.PRIORITY_INDEX,function(t,n){e.push(new a.NamedNode(t,n))}):this.writeTree_.children.inorderTraversal(function(t,n){null!=n.value&&e.push(new a.NamedNode(t,n.value))}),e},e.prototype.childCompoundWrite=function(t){if(t.isEmpty())return this;var n=this.getCompleteNode(t);return new e(null!=n?new r.ImmutableTree(n):this.writeTree_.subtree(t))},e.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},e.prototype.apply=function(t){return e.applySubtreeWrite_(i.Path.Empty,this.writeTree_,t)},e.Empty=new e(new r.ImmutableTree(null)),e.applySubtreeWrite_=function(t,n,r){if(null!=n.value)return r.updateChild(t,n.value);var i=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(u.assert(null!==o.value,"Priority writes must al
1ways be leaf nodes"),i=o.value):r=e.applySubtreeWrite_(t.child(n),o,r)}),r.getChild(t).isEmpty()||null===i||(r=r.updateChild(t.child(".priority"),i)),r},e}();t.CompoundWrite=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=function(){function e(){this.rootNode_=r.ChildrenNode.EMPTY_NODE}return e.prototype.getNode=function(e){return this.rootNode_.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)},e}();t.SnapshotHolder=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.app_=e}return e.prototype.getToken=function(e){return this.app_.INTERNAL.getToken(e).then(null,function(e){return e&&"auth/token-not-initialized"===e.code?(r.log("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})},e.prototype.addTokenChangeListener=function(e){this.app_.INTERNAL.addAuthTokenListener(e)},e.prototype.removeTokenChangeListener=function(e){this.app_.INTERNAL.removeAuthTokenListener(e)},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',r.warn(e)},e}();t.AuthTokenProvider=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(0),o=function(){function e(){this.counters_={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),i.contains(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t},e.prototype.get=function(){return r.deepCopy(this.counters_)},e}();t.StatsCollection=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(62),a=1e4,s=3e4,u=function(){function e(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new o.StatsListener(e);var n=a+(s-a)*Math.random();i.setTimeoutNonBlocking(this.reportStats_.bind(this),Math.floor(n))}return e.prototype.includeStat=function(e){this.statsToReport_[e]=!0},e.prototype.reportStats_=function(){var e=this,t=this.statsListener_.get(),n={},o=!1;r.forEach(t,function(t,i){i>0&&r.contains(e.statsToReport_,t)&&(n[t]=i,o=!0)}),o&&this.server_.reportStats(n),i.setTimeoutNonBlocking(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},e}();t.StatsReporter=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(){this.eventLists_=[],this.recursionDepth_=0}return e.prototype.queueEvents=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n],i=r.getPath();null===t||i.equals(t.getPath())||(this.eventLists_.push(t),t=null),null===t&&(t=new o(i)),t.add(r)}t&&this.eventLists_.push(t)},e.prototype.raiseEventsAtPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.equals(e)})},e.prototype.raiseEventsForChangedPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.contains(e)||e.contains(t)})},e.prototype.raiseQueuedEventsMatchingPredicate_=function(e){this.recursionDepth_++;for(var t=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];r&&(e(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):t=!1)}t&&(this.eventLists_=[]),this.recursionDepth_--},e}();t.EventQueue=i;var o=function(){function e(e){this.path_=e,this.events_=[]}return e.prototype.add=function(e){this.events_.push(e)},e.prototype.raise=function(){for(var e=0;e<this.events_.length;e++){var t=this.events_[e];if(null!==t){this.events_[e]=null;var n=t.getEventRunner();r.logger&&r.log("event: "+t.toString()),r.exceptionGuard(n)}}},e.prototype.getPath=function(){return this.path_},e}();t.EventList=o},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
1Object.defineProperty(t,"__esModule",{value:!0});var i=n(64),o=n(0),a=function(e){function t(){var t,n,r=e.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",t="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",t="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,function(){var e=!document[t];e!==r.visible_&&(r.visible_=e,r.trigger("visible",e))},!1),r}return r(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return o.assert("visible"===e,"Unknown event type: "+e),[this.visible_]},t}(i.EventEmitter);t.VisibilityMonitor=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(64),a=n(0),s=function(e){function t(){var t=e.call(this,["online"])||this;return t.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||a.isMobileCordova()||(window.addEventListener("online",function(){t.online_||(t.online_=!0,t.trigger("online",!0))},!1),window.addEventListener("offline",function(){t.online_&&(t.online_=!1,t.trigger("online",!1))},!1)),t}return r(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return i.assert("online"===e,"Unknown event type: "+e),[this.online_]},t.prototype.currentlyOnline=function(){return this.online_},t}(o.EventEmitter);t.OnlineMonitor=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66),i=n(67),o=n(1),a=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[r.BrowserPollConnection,i.WebSocketConnection]},enumerable:!0,configurable:!0}),e.prototype.initTransports_=function(t){var n=i.WebSocketConnection&&i.WebSocketConnection.isAvailable(),r=n&&!i.WebSocketConnection.previouslyFailed();if(t.webSocketOnly&&(n||o.warn("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.transports_=[i.WebSocketConnection];else{var a=this.transports_=[];o.each(e.ALL_TRANSPORTS,function(e,t){t&&t.isAvailable()&&a.push(t)})}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}();t.TransportManager=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},e.prototype.handleResponse=function(e,t){var n=this;this.pendingResponses[e]=t;for(var i=this;this.pendingResponses[this.currentResponseNum]&&"break"!==function(){var e=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var t=0;t<e.length;++t)!function(t){e[t]&&r.exceptionGuard(function(){n.onMessage_(e[t])})}(t);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++}(););},e}();t.PacketReceiver=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();
1Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),a=n(0),s=n(0),u=n(0),c=n(68),h=function(e){function t(t,n,r){var i=e.call(this)||this;return i.repoInfo_=t,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=o.logWrapper("p:rest:"),i.listens_={},i}return r(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:(i.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),e.path.toString())},t.prototype.listen=function(e,n,r,i){var o=this,a=e.path.toString();this.log_("Listen called for "+a+" "+e.queryIdentifier());var u=t.getListenId_(e,r),c={};this.listens_[u]=c;var h=e.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",h,function(e,t){var n=t;if(404===e&&(n=null,e=null),null===e&&o.onDataUpdate_(a,n,!1,r),s.safeGet(o.listens_,u)===c){var h;h=e?401==e?"permission_denied":"rest_error:"+e:"ok",i(h,null)}})},t.prototype.unlisten=function(e,n){var r=t.getListenId_(e,n);delete this.listens_[r]},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var r=this;void 0===t&&(t={}),t.format="export",this.authTokenProvider_.getToken(!1).then(function(i){var s=i&&i.accessToken;s&&(t.auth=s);var c=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+e+"?"+u.querystring(t);r.log_("Sending REST request for "+c);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(n&&4===h.readyState){r.log_("REST Response for "+c+" received. status:",h.status,"response:",h.responseText);var e=null;if(h.status>=200&&h.status<300){try{e=a.jsonEval(h.responseText)}catch(e){o.warn("Failed to parse JSON response for "+c+": "+h.responseText)}n(null,e)}else 401!==h.status&&404!==h.status&&o.warn("Got unsuccessful REST response for "+c+" Status: "+h.status),n(h.status);n=null}},h.open("GET",c,!0),h.send()})},t}(c.ServerActions);t.ReadonlyRestClient=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(14),a=n(3),s=n(51),u=n(55),c=n(33),h=n(133),l=n(69),p=n(0),f=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=a.PRIORITY_INDEX}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return r.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return r.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:i.MIN_NAME},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return r.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return r.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:i.MAX_NAME},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return r.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();
1return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.index_!==a.PRIORITY_INDEX&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_==a.PRIORITY_INDEX},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new c.IndexedFilter(this.getIndex()):this.hasLimit()?new h.LimitedFilter(this):new l.RangedFilter(this)},e.prototype.toRestQueryStringParameters=function(){var t=e.REST_QUERY_CONSTANTS_,n={};if(this.isDefault())return n;var i;return this.index_===a.PRIORITY_INDEX?i=t.PRIORITY_INDEX:this.index_===s.VALUE_INDEX?i=t.VALUE_INDEX:this.index_===o.KEY_INDEX?i=t.KEY_INDEX:(r.assert(this.index_ instanceof u.PathIndex,"Unrecognized index type!"),i=this.index_.toString()),n[t.ORDER_BY]=p.stringify(i),this.startSet_&&(n[t.START_AT]=p.stringify(this.indexStartValue_),this.startNameSet_&&(n[t.START_AT]+=","+p.stringify(this.indexStartName_))),this.endSet_&&(n[t.END_AT]=p.stringify(this.indexEndValue_),this.endNameSet_&&(n[t.END_AT]+=","+p.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?n[t.LIMIT_TO_FIRST]=this.limit_:n[t.LIMIT_TO_LAST]=this.limit_),n},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}();t.QueryParams=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(69),i=n(4),o=n(5),a=n(0),s=n(12),u=function(){function e(e){this.rangedFilter_=new r.RangedFilter(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,a,s){return this.rangedFilter_.matches(new o.NamedNode(t,n))||(n=i.ChildrenNode.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,a,s):this.fullLimitUpdateChild_(e,t,n,a,s)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=i.ChildrenNode.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){r=i.ChildrenNode.EMPTY_NODE.withIndex(this.index_);var o=void 0;o=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var a=0;o.hasNext()&&a<this.limit_;){var s=o.getNext(),u=void 0;if(!(u=this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),s)<=0:this.index_.compare(s,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(s.name,s.node),a++}}else{r=t.withIndex(this.index_),r=r.updatePriority(i.ChildrenNode.EMPTY_NODE);var c=void 0,h=void 0,l=void 0,o=void 0;if(this.reverse_){o=r.getReverseIterator(this.index_),c=this.rangedFilter_.getEndPost(),h=this.rangedFilter_.getStartPost();var p=this.index_.getCompare();l=function(e,t){return p(t,e)}}else o=r.getIterator(this.index_),c=this.rangedFilter_.getStartPost(),h=this.rangedFilter_.getEndPost(),l=this.index_.getCompare();for(var a=0,f=!1;o.hasNext();){var s=o.getNext();!f&&l(c,s)<=0&&(f=!0);var u=f&&a<this.limit_&&l(s,h)<=0;u?a++:r=r.updateImmediateChild(s.name,i.ChildrenNode.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_}
1,e.prototype.fullLimitUpdateChild_=function(e,t,n,r,u){var c;if(this.reverse_){var h=this.index_.getCompare();c=function(e,t){return h(t,e)}}else c=this.index_.getCompare();var l=e;a.assert(l.numChildren()==this.limit_,"");var p=new o.NamedNode(t,n),f=this.reverse_?l.getFirstChild(this.index_):l.getLastChild(this.index_),d=this.rangedFilter_.matches(p);if(l.hasChild(t)){for(var v=l.getImmediateChild(t),_=r.getChildAfterChild(this.index_,f,this.reverse_);null!=_&&(_.name==t||l.hasChild(_.name));)_=r.getChildAfterChild(this.index_,_,this.reverse_);var g=null==_?1:c(_,p);if(d&&!n.isEmpty()&&g>=0)return null!=u&&u.trackChildChange(s.Change.childChangedChange(t,n,v)),l.updateImmediateChild(t,n);null!=u&&u.trackChildChange(s.Change.childRemovedChange(t,v));var y=l.updateImmediateChild(t,i.ChildrenNode.EMPTY_NODE);return null!=_&&this.rangedFilter_.matches(_)?(null!=u&&u.trackChildChange(s.Change.childAddedChange(_.name,_.node)),y.updateImmediateChild(_.name,_.node)):y}return n.isEmpty()?e:d&&c(f,p)>=0?(null!=u&&(u.trackChildChange(s.Change.childRemovedChange(f.name,f.node)),u.trackChildChange(s.Change.childAddedChange(t,n))),l.updateImmediateChild(t,n).updateImmediateChild(f.name,i.ChildrenNode.EMPTY_NODE)):e},e}();t.LimitedFilter=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=n(30),a=n(31),s=n(2),u=n(135),c=n(3),h=n(1),l=n(56),p=n(9),f=n(0),d=n(15),v=n(4),_=n(23);!function(e){e[e.RUN=0]="RUN",e[e.SENT=1]="SENT",e[e.COMPLETED=2]="COMPLETED",e[e.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",e[e.NEEDS_ABORT=4]="NEEDS_ABORT"}(r=t.TransactionStatus||(t.TransactionStatus={})),_.Repo.MAX_TRANSACTION_RETRIES_=25,_.Repo.prototype.transactions_init_=function(){this.transactionQueueTree_=new u.Tree},_.Repo.prototype.startTransaction=function(e,t,n,s){this.log_("transaction on "+e);var u=function(){},_=new o.Reference(this,e);_.on("value",u);var g=function(){_.off("value",u)},y={path:e,update:t,onComplete:n,status:null,order:h.LUIDGenerator(),applyLocally:s,retryCount:0,unwatcher:g,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},m=this.getLatestState_(e);y.currentInputSnapshot=m;var b=y.update(m.val());if(void 0===b){if(y.unwatcher(),y.currentOutputSnapshotRaw=null,y.currentOutputSnapshotResolved=null,y.onComplete){var w=new a.DataSnapshot(y.currentInputSnapshot,new o.Reference(this,y.path),c.PRIORITY_INDEX);y.onComplete(null,!1,w)}}else{p.validateFirebaseData("transaction failed: Data returned ",b,y.path),y.status=r.RUN;var E=this.transactionQueueTree_.subTree(e),C=E.getValue()||[];C.push(y),E.setValue(C);var T=void 0;"object"==typeof b&&null!==b&&f.contains(b,".priority")?(T=f.safeGet(b,".priority"),i.assert(p.isValidPriority(T),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):T=(this.serverSyncTree_.calcCompleteEventCache(e)||v.ChildrenNode.EMPTY_NODE).getPriority().val(),T=T;var S=this.generateServerValues(),N=d.nodeFromJSON(b,T),I=l.resolveDeferredValueSnapshot(N,S);y.currentOutputSnapshotRaw=N,y.currentOutputSnapshotResolved=I,y.currentWriteId=this.getNextWriteId_();var O=this.serverSyncTree_.applyUserOverwrite(e,I,y.currentWriteId,y.applyLocally);this.eventQueue_.raiseEventsForChangedPath(e,O),this.sendReadyTransactions_()}},_.Repo.prototype.getLatestState_=function(e,t){return this.serverSyncTree_.calcCompleteEventCache(e,t)||v.ChildrenNode.EMPTY_NODE},_.Repo.prototype.sendReadyTransactions_=function(e){var t=this;if(void 0===e&&(e=this.transactionQueueTree_),e||this.pruneCompletedTransactionsBelowNode_(e),null!==e.getValue()){var n=this.buildTransactionQueue_(e);i.assert(n.length>0,"Sending zero length transaction queue"),n.every(function(e){return e.status===r.RUN})&&this.sendTransactionQueue_(e.path(),n)}else e.hasChildren()&&e.forEachChild(function(e){t.sendReadyTransactions_(e)})},_.Repo.prototype.sendTransactionQueue_=function(e,t){for(var n=this,u=t.map(function(e){return e.currentWriteId}),l=this.getLatestState_(e,u),p=l,f=l.hash(),d=0;d<t.length;d++){var v=t[d];i.assert(v.status===r.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),v.status=r.SENT,v.retryCount++;var _=s.Path.relativePath(e,v.path);p=p.updateChild(_,v.currentOutputSnapshotRaw)}var g=p.val(!0),y=e;this.server_.put(y.toString(),g,function(i){n.log_("transaction put response",{path:y.toString(),status:i});var s=[];if("ok"===i){for(var u=[],l=0;l<t.length;l++){if(t[l].status=r.COMPLETED,s=s.concat(n.serverSyncTree_.ackUserWrite(t[l].currentWriteId)),t[l].onComplete){var p=t[l].currentOutputSnapshotResolved,f=new o.Reference(n,t[l].path),d=new a.DataSnapshot(p,f,c.PRIORITY_INDEX);u.push(t[l].onComplete.bind(null,null,!0,d))}t[l].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(e)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(e,s);for(var l=0;l<u.length;l++)h.exceptionGuard(u[l])}else{if("datastale"===i)for(var l=0;l<t.length;l++)t[l].status===r.SENT_NEEDS_ABORT?t[l].status=r.NEEDS_ABORT:t[l].status=r.RUN;else{h.warn("transaction at "+y.toString()+" failed: "+i);for(var l=0;l<t.length;l++)t[l].status=r.NEEDS_ABORT,t[l].abortReason=i}n.rerunTransactions_(e)}},f)},_.Repo.prototype.rerunTransactions_=function(e){var t=this.getAncestorTransactionNode_(e),n=t.path(),r=this.buildTransactionQueue_(t);return this.rerunTransactionQueue_(r,n),n},_.Repo.prototype.rerunTransactionQueue_=function(e,t){if(0!==e.length){for(var n=[],u=[],v=e.filter(function(e){return e.status===r.RUN}),g=v.map(function(e){return e.currentWriteId}),y=0;y<e.length;y++){var m=e[y],b=s.Path.relativePath(t,m.path),w=!1,E=void 0;if(i.assert(null!==b,"rerunTransactionsUnderNode_: relativePath should not be null."),m.status===r.NEEDS_ABORT)w=!0,E=m.abortReason,u=u.concat(this.serverSyncTree_.ackUserWrite(m.currentWriteId,!0));else if(m.status===r.RUN)if(m.retryCount>=_.Repo.MAX_TRANSACTION_RETRIES_)w=!0,E="maxretry",u=u.concat(this.serverSyncTree_.ackUserWrite(m.currentWriteId,!0));else{var C=this.getLatestState_(m.path,g);m.currentInputSnapshot=C;var T=e[y].update(C.val());if(void 0!==T){p.validateFirebaseData("transaction failed: Data returned ",T,m.path);var S=d.nodeFromJSON(T),N="object"==typeof T&&null!=T&&f.contains(T,".priority");
1N||(S=S.updatePriority(C.getPriority()));var I=m.currentWriteId,O=this.generateServerValues(),P=l.resolveDeferredValueSnapshot(S,O);m.currentOutputSnapshotRaw=S,m.currentOutputSnapshotResolved=P,m.currentWriteId=this.getNextWriteId_(),g.splice(g.indexOf(I),1),u=u.concat(this.serverSyncTree_.applyUserOverwrite(m.path,P,m.currentWriteId,m.applyLocally)),u=u.concat(this.serverSyncTree_.ackUserWrite(I,!0))}else w=!0,E="nodata",u=u.concat(this.serverSyncTree_.ackUserWrite(m.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(t,u),u=[],w&&(e[y].status=r.COMPLETED,function(e){setTimeout(e,Math.floor(0))}(e[y].unwatcher),e[y].onComplete))if("nodata"===E){var R=new o.Reference(this,e[y].path),A=e[y].currentInputSnapshot,k=new a.DataSnapshot(A,R,c.PRIORITY_INDEX);n.push(e[y].onComplete.bind(null,null,!1,k))}else n.push(e[y].onComplete.bind(null,new Error(E),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(var y=0;y<n.length;y++)h.exceptionGuard(n[y]);this.sendReadyTransactions_()}},_.Repo.prototype.getAncestorTransactionNode_=function(e){for(var t,n=this.transactionQueueTree_;null!==(t=e.getFront())&&null===n.getValue();)n=n.subTree(t),e=e.popFront();return n},_.Repo.prototype.buildTransactionQueue_=function(e){var t=[];return this.aggregateTransactionQueuesForNode_(e,t),t.sort(function(e,t){return e.order-t.order}),t},_.Repo.prototype.aggregateTransactionQueuesForNode_=function(e,t){var n=this,r=e.getValue();if(null!==r)for(var i=0;i<r.length;i++)t.push(r[i]);e.forEachChild(function(e){n.aggregateTransactionQueuesForNode_(e,t)})},_.Repo.prototype.pruneCompletedTransactionsBelowNode_=function(e){var t=this,n=e.getValue();if(n){for(var i=0,o=0;o<n.length;o++)n[o].status!==r.COMPLETED&&(n[i]=n[o],i++);n.length=i,e.setValue(n.length>0?n:null)}e.forEachChild(function(e){t.pruneCompletedTransactionsBelowNode_(e)})},_.Repo.prototype.abortTransactions_=function(e){var t=this,n=this.getAncestorTransactionNode_(e).path(),r=this.transactionQueueTree_.subTree(e);return r.forEachAncestor(function(e){t.abortTransactionsOnNode_(e)}),this.abortTransactionsOnNode_(r),r.forEachDescendant(function(e){t.abortTransactionsOnNode_(e)}),n},_.Repo.prototype.abortTransactionsOnNode_=function(e){var t=e.getValue();if(null!==t){for(var n=[],o=[],a=-1,s=0;s<t.length;s++)t[s].status===r.SENT_NEEDS_ABORT||(t[s].status===r.SENT?(i.assert(a===s-1,"All SENT items should be at beginning of queue."),a=s,t[s].status=r.SENT_NEEDS_ABORT,t[s].abortReason="set"):(i.assert(t[s].status===r.RUN,"Unexpected transaction status in abort"),t[s].unwatcher(),o=o.concat(this.serverSyncTree_.ackUserWrite(t[s].currentWriteId,!0)),t[s].onComplete&&n.push(t[s].onComplete.bind(null,new Error("set"),!1,null))));-1===a?e.setValue(null):t.length=a+1,this.eventQueue_.raiseEventsForChangedPath(e.path(),o);for(var s=0;s<n.length;s++)h.exceptionGuard(n[s])}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(2),o=n(0),a=function(){function e(){this.children={},this.childCount=0,this.value=null}return e}();t.TreeNode=a;var s=function(){function e(e,t,n){void 0===e&&(e=""),void 0===t&&(t=null),void 0===n&&(n=new a),this.name_=e,this.parent_=t,this.node_=n}return e.prototype.subTree=function(t){for(var n,r=t instanceof i.Path?t:new i.Path(t),s=this;null!==(n=r.getFront());)s=new e(n,s,o.safeGet(s.node_.children,n)||new a),r=r.popFront();return s},e.prototype.getValue=function(){return this.node_.value},e.prototype.setValue=function(e){r.assert(void 0!==e,"Cannot set value to undefined"),this.node_.value=e,this.updateParents_()},e.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},e.prototype.hasChildren=function(){return this.node_.childCount>0},e.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},e.prototype.forEachChild=function(t){var n=this;o.forEach(this.node_.children,function(r,i){t(new e(r,n,i))})},e.prototype.forEachDescendant=function(e,t,n){t&&!n&&e(this),this.forEachChild(function(t){t.forEachDescendant(e,!0,n)}),t&&n&&e(this)},e.prototype.forEachAncestor=function(e,t){for(var n=t?this:this.parent();null!==n;){if(e(n))return!0;n=n.parent()}return!1},e.prototype.forEachImmediateDescendantWithValue=function(e){this.forEachChild(function(t){null!==t.getValue()?e(t):t.forEachImmediateDescendantWithValue(e)})},e.prototype.path=function(){return new i.Path(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},e.prototype.name=function(){return this.name_},e.prototype.parent=function(){return this.parent_},e.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},e.prototype.updateChild_=function(e,t){var n=t.isEmpty(),r=o.contains(this.node_.children,e);n&&r?(delete this.node_.children[e],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[e]=t.node_,this.node_.childCount++,this.updateParents_())},e}();t.Tree=s},function(e,t,n){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0});var r=n(67),i=n(66);t.forceLongPolling=function(){r.WebSocketConnection.forceDisallow(),i.BrowserPollConnection.forceAllow()},t.forceWebSockets=function(){i.BrowserPollConnection.forceDisallow()},t.isWebSocketsAvailable=function(){return r.WebSocketConnection.isAvailable()},t.setSecurityDebugCallback=function(e,t){e.repo.persistentConnection_.securityDebugCallback_=t},t.stats=function(e,t){e.repo.stats(t)},t.statsIncrementCounter=function(e,t){e.repo.statsIncrementCounter(t)},t.dataUpdateCount=function(e){return e.repo.dataUpdateCount},t.interceptServerData=function(e,t){return e.repo.interceptServerData_(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47),i=n(63),o=n(35),a=n(65);t.DataConnection=i.PersistentConnection,i.PersistentConnection.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},i.PersistentConnection.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)},t.RealTimeConnection=a.Connection,t.hijackHash=function(e){var t=i.PersistentConnection.prototype.put;return i.PersistentConnection.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){i.PersistentConnection.prototype.put=t}},t.ConnectionTarget=r.RepoInfo,t.queryIdentifier=function(e){return e.queryIdentifier()},t.listens=function(e){return e.repo.persistentConnection_.listens_},t.forceRestClient=function(e){o.RepoManager.getInstance().forceRestClient(e)}},function(e,t,n){n(139)},function(e,t,n){"use strict";function r(e){var t=function(e){return self&&"ServiceWorkerGlobalScope"in self?new o.a(e):new i.a(e)},n={Messaging:i.a};e.INTERNAL.registerService("messaging",t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.registerMessaging=r;var i=n(140),o=n(144);r(n(8).firebase)},function(e,t,n){"use strict";var r=n(70),i=n(25),o=n(73),a=n(143),s=n(72),u=n(0),c=(n.n(u),this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),h=function(e){function t(t){var n=e.call(this,t)||this;return n.messageObserver_=null,n.onMessage_=Object(u.createSubscribe)(function(e){n.messageObserver_=e}),n.tokenRefreshObserver_=null,n.onTokenRefresh_=Object(u.createSubscribe)(function(e){n.tokenRefreshObserver_=e}),n.setupSWMessageListener_(),n}return c(t,e),t.prototype.getToken=function(){var t=this;return this.isSupported_()?this.manifestCheck_().then(function(){return e.prototype.getToken.call(t)}):Promise.reject(this.errorFactory_.create(i.a.codes.UNSUPPORTED_BROWSER))},t.prototype.manifestCheck_=function(){var e=this;if(this.manifestCheckPromise_)return this.manifestCheckPromise_;var t=document.querySelector('link[rel="manifest"]');return this.manifestCheckPromise_=t?fetch(t.href).then(function(e){return e.json()}).catch(function(){return Promise.resolve()}).then(function(t){if(t&&t.gcm_sender_id&&"103953800507"!==t.gcm_sender_id)throw e.errorFactory_.create(i.a.codes.INCORRECT_GCM_SENDER_ID)}):Promise.resolve(),this.manifestCheckPromise_},t.prototype.requestPermission=function(){var e=this;return Notification.permission===s.a.granted?Promise.resolve():new Promise(function(t,n){var r=function(r){return r===s.a.granted?t():n(r===s.a.denied?e.errorFactory_.create(i.a.codes.PERMISSION_BLOCKED):e.errorFactory_.create(i.a.codes.PERMISSION_DEFAULT))},o=Notification.requestPermission(function(e){o||r(e)});o&&o.then(r)})},t.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw this.errorFactory_.create(i.a.codes.SW_REGISTRATION_EXPECTED);if(void 0!==this.registrationToUse_)throw this.errorFactory_.create(i.a.codes.USE_SW_BEFORE_GET_TOKEN);this.registrationToUse_=e},t.prototype.onMessage=function(e,t,n){return this.onMessage_(e,t,n)},t.prototype.onTokenRefresh=function(e,t,n){return this.onTokenRefresh_(e,t,n)},t.prototype.waitForRegistrationToActivate_=function(e){var t=this,n=e.installing||e.waiting||e.active;return new Promise(function(r,o){if(!n)return void o(t.errorFactory_.create(i.a.codes.NO_SW_IN_REG));if("activated"===n.state)return void r(e);if("redundant"===n.state)return void o(t.errorFactory_.create(i.a.codes.SW_REG_REDUNDANT));var a=function(){if("activated"===n.state)r(e);else{if("redundant"!==n.state)return;o(t.errorFactory_.create(i.a.codes.SW_REG_REDUNDANT))}n.removeEventListener("statechange",a)};n.addEventListener("statechange",a)})},t.prototype.getSWRegistration_=function(){var e=this;return this.registrationToUse_?this.waitForRegistrationToActivate_(this.registrationToUse_):(this.registrationToUse_=null,navigator.serviceWorker.register(a.a.path,{scope:a.a.scope}).catch(function(t){throw e.errorFactory_.create(i.a.codes.FAILED_DEFAULT_REGISTRATION,{browserErrorMessage:t.message})}).then(function(t){return e.waitForRegistrationToActivate_(t).then(function(){return e.registrationToUse_=t,t.update(
1),t})}))},t.prototype.setupSWMessageListener_=function(){var e=this;"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",function(t){if(t.data&&t.data[o.a.PARAMS.TYPE_OF_MSG]){var n=t.data;switch(n[o.a.PARAMS.TYPE_OF_MSG]){case o.a.TYPES_OF_MSG.PUSH_MSG_RECEIVED:case o.a.TYPES_OF_MSG.NOTIFICATION_CLICKED:var r=n[o.a.PARAMS.DATA];e.messageObserver_.next(r)}}},!1)},t.prototype.isSupported_=function(){return"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")},t}(r.a);t.a=h},function(e,t,n){"use strict";var r=n(0),i=(n.n(r),n(25)),o=n(142),a=n(71),s="fcm_token_object_Store",u=function(){function e(){this.errorFactory_=new r.ErrorFactory("messaging","Messaging",i.a.map),this.openDbPromise_=null}return e.prototype.openDatabase_=function(){return this.openDbPromise_?this.openDbPromise_:(this.openDbPromise_=new Promise(function(t,n){var r=indexedDB.open(e.DB_NAME,1);r.onerror=function(e){n(e.target.error)},r.onsuccess=function(e){t(e.target.result)},r.onupgradeneeded=function(e){var t=e.target.result,n=t.createObjectStore(s,{keyPath:"swScope"});n.createIndex("fcmSenderId","fcmSenderId",{unique:!1}),n.createIndex("fcmToken","fcmToken",{unique:!0})}}),this.openDbPromise_)},e.prototype.closeDatabase=function(){var e=this;return this.openDbPromise_?this.openDbPromise_.then(function(t){t.close(),e.openDbPromise_=null}):Promise.resolve()},e.prototype.getTokenDetailsFromToken=function(e){return this.openDatabase_().then(function(t){return new Promise(function(n,r){var i=t.transaction([s]),o=i.objectStore(s),a=o.index("fcmToken"),u=a.get(e);u.onerror=function(e){r(e.target.error)},u.onsuccess=function(e){n(e.target.result)}})})},e.prototype.getTokenDetailsFromSWScope_=function(e){return this.openDatabase_().then(function(t){return new Promise(function(n,r){var i=t.transaction([s]),o=i.objectStore(s),a=o.get(e);a.onerror=function(e){r(e.target.error)},a.onsuccess=function(e){n(e.target.result)}})})},e.prototype.getAllTokenDetailsForSenderId_=function(e){return this.openDatabase_().then(function(t){return new Promise(function(n,r){var i=t.transaction([s]),o=i.objectStore(s),a=[],u=o.openCursor();u.onerror=function(e){r(e.target.error)},u.onsuccess=function(t){var r=t.target.result;r?(r.value.fcmSenderId===e&&a.push(r.value),r.continue()):n(a)}})})},e.prototype.subscribeToFCM=function(e,t,n){var r=this,s=Object(o.a)(t.getKey("p256dh")),u=Object(o.a)(t.getKey("auth")),c="authorized_entity="+e+"&endpoint="+t.endpoint+"&encryption_key="+s+"&encryption_auth="+u;n&&(c+="&pushSet="+n);var h=new Headers;h.append("Content-Type","application/x-www-form-urlencoded");var l={method:"POST",headers:h,body:c};return fetch(a.a.ENDPOINT+"/fcm/connect/subscribe",l).then(function(e){return e.json()}).then(function(e){var t=e;if(t.error){var n=t.error.message;throw r.errorFactory_.create(i.a.codes.TOKEN_SUBSCRIBE_FAILED,{message:n})}if(!t.token)throw r.errorFactory_.create(i.a.codes.TOKEN_SUBSCRIBE_NO_TOKEN);if(!t.pushSet)throw r.errorFactory_.create(i.a.codes.TOKEN_SUBSCRIBE_NO_PUSH_SET);return{token:t.token,pushSet:t.pushSet}})},e.prototype.isSameSubscription_=function(e,t){return e.endpoint===t.endpoint&&Object(o.a)(e.getKey("auth"))===t.auth&&Object(o.a)(e.getKey("p256dh"))===t.p256dh},e.prototype.saveTokenDetails_=function(e,t,n,r,i){var a={swScope:t.scope,endpoint:n.endpoint,auth:Object(o.a)(n.getKey("auth")),p256dh:Object(o.a)(n.getKey("p256dh")),fcmToken:r,fcmPushSet:i,fcmSenderId:e};return this.openDatabase_().then(function(e){return new Promise(function(t,n){var r=e.transaction([s],"readwrite"),i=r.objectStore(s),o=i.put(a);o.onerror=function(e){n(e.target.error)},o.onsuccess=function(e){t()}})})},e.prototype.getSavedToken=function(e,t){var n=this;return t instanceof ServiceWorkerRegistration?"string"!=typeof e||0===e.length?Promise.reject(this.errorFactory_.create(i.a.codes.BAD_SENDER_ID)):this.getAllTokenDetailsForSenderId_(e).then(function(n){if(0!==n.length){var r=n.findIndex(function(n){return t.scope===n.swScope&&e===n.fcmSenderId});if(-1!==r)return n[r]}}).then(function(e){if(e)return t.pushManager.getSubscription().catch(function(e){throw n.errorFactory_.create(i.a.codes.GET_SUBSCRIPTION_FAILED)}).then(function(t){if(t&&n.isSameSubscription_(t,e))return e.fcmToken})}):Promise.reject(this.errorFactory_.create(i.a.codes.SW_REGISTRATION_EXPECTED))},e.prototype.createToken=function(e,t){var n=this;if("string"!=typeof e||0===e.length)return Promise.reject(this.errorFactory_.create(i.a.codes.BAD_SENDER_ID));if(!(t instanceof ServiceWorkerRegistration))return Promise.reject(this.errorFactory_.create(i.a.codes.SW_REGISTRATION_EXPECTED));var r,o;return t.pushManager.getSubscription().then(function(e){return e||t.pushManager.subscribe(a.a.SUBSCRIPTION_OPTIONS)}).then(function(t){return r=t,n.subscribeToFCM(e,r)}).then(function(i){return o=i,n.saveTokenDetails_(e,t,r,o.token,o.pushSet)}).then(function(){return o.token})},e.prototype.deleteToken=function(e){var t=this;return"string"!=typeof e||0===e.length?Promise.reject(this.errorFactory_.create(i.a.codes.INVALID_DELETE_TOKEN)):this.getTokenDetailsFromToken(e).then(function(e){if(!e)throw t.errorFactory_.create(i.a.codes.DELETE_TOKEN_NOT_FOUND);return t.openDatabase_().then(function(n){return new Promise(function(r,o){var a=n.transaction([s],"readwrite"),u=a.objectStore(s),c=u.delete(e.swScope);c.onerror=function(e){o(e.target.error)},c.onsuccess=function(n){if(0===n.target.result)return void o(t.errorFactory_.create(i.a.codes.FAILED_TO_DELETE_TOKEN));r(e)}})})})},e}();t.a=u},function(e,t,n){"use strict";function r(e){var t=new Uint8Array(e);return window.btoa(String.fromCharCode.apply(null,t))}t.a=function(e){return r(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}},function(e,t,n){"use strict";t.a={path:"/firebase-messaging-sw.js",scope:"/firebase-cloud-messaging-push-scope"}},function(e,t,n){"use strict";var r=n(70),i=n(25),o=n(73),a=n(71),s=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(e){function t(t){var n=e.call(this,t)||this;return self.addEventListener("push",function(e){return n.onPush_(e)},!1),self.addEventListener("pushsubscriptionchange",function(e){return n.onSubChange_(e)},!1),self.addEventListener("notificationclick",function(e){return n.onNotificationClick_(e)},!1),n.bgMessageHandler_=null,n}return s(t,e),t.prototype.onPush_=function(e){var t,n=this;try{t=e.data.json()}catch(e){return}var r=this.hasVisibleClients_().then(function(e){if(e){if(t.notification||n.bgMessageHandler_)return n.sendMessageToWindowClients_(t)}else{var r=n.getNotificationData_(t);if(r){var i=r.title||"";return self.registration.showNotification(i,r)}if(n.bgMessageHandler_)return n.bgMessageHandler_(t)}});e.waitUntil(r)},t.prototype.onSubChange_=function(e){var t=this,n=this.getToken().then(function(e){if(!e)throw t.errorFactory_.create(i.a.codes.NO_FCM_TOKEN_FOR_RESUBSCRIBE);var n=null,r=t.getTokenManager();return r.getTokenDetailsFromToken(e).then(function(e){if(!(n=e))throw t.errorFactory_.create(i.a.codes.INVALID_SAVED_TOKEN);return self.registration.pushManager.subscribe(a.a.SUBSCRIPTION_OPTIONS)}).then(function(e){return r.subscribeToFCM(n.fcmSenderId,e,n.fcmPushSet)}).catch(function(e){return r.deleteToken(n.fcmToken).then(function(){throw t.errorFactory_.create(i.a.codes.UNABLE_TO_RESUBSCRIBE,{message:e})})})});e.waitUntil(n)},t.prototype.onNotificationClick_=function(e){var t=this;if(e.notification&&e.notification.data&&e.notification.data.FCM_MSG){e.stopImmediatePropagation(),e.notification.close();var n=e.notification.data.FCM_MSG,r=n.notification.click_action;if(r){var i=this.getWindowClient_(r).then(function(e){return e||self.clients.openWindow(r)}).then(function(e){if(e){n.notification,delete n.notification;var r=o.a.createNewMsg(o.a.TYPES_OF_MSG.NOTIFICATION_CLICKED,n);return t.attemptToMessageClient_(e,r)}});e.waitUntil(i)}}},t.prototype.getNotificationData_=function(e){if(e&&"object"==typeof e.notification){var t=Object.assign({},e.notification);return t.data=(n={},n.FCM_MSG=e,n),t;var n}}
1,t.prototype.setBackgroundMessageHandler=function(e){if(e&&"function"!=typeof e)throw this.errorFactory_.create(i.a.codes.BG_HANDLER_FUNCTION_EXPECTED);this.bgMessageHandler_=e},t.prototype.getWindowClient_=function(e){var t=new URL(e).href;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){for(var n=null,r=0;r<e.length;r++)if(new URL(e[r].url).href===t){n=e[r];break}if(n)return n.focus(),n})},t.prototype.attemptToMessageClient_=function(e,t){var n=this;return new Promise(function(r,o){if(!e)return o(n.errorFactory_.create(i.a.codes.NO_WINDOW_CLIENT_TO_MSG));e.postMessage(t),r()})},t.prototype.hasVisibleClients_=function(){return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(e){return e.some(function(e){return"visible"===e.visibilityState})})},t.prototype.sendMessageToWindowClients_=function(e){var t=this;return self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(function(n){var r=o.a.createNewMsg(o.a.TYPES_OF_MSG.PUSH_MSG_RECEIVED,e);return Promise.all(n.map(function(e){return t.attemptToMessageClient_(e,r)}))})},t.prototype.getSWRegistration_=function(){return Promise.resolve(self.registration)},t}(r.a);t.a=u},function(e,t,n){n(146)},function(e,t,n){"use strict";function r(e,t,n){return new h.a(e,new u.a,n)}function i(e){var t={TaskState:s.c,TaskEvent:s.b,StringFormat:a.a,Storage:h.a,Reference:c.a};e.INTERNAL.registerService(l,r,t,void 0,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=i;var o=n(8),a=n(16),s=n(17),u=n(147),c=n(75),h=n(156),l="storage";i(o.default)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(148),i=function(){function e(){}return e.prototype.createXhrIo=function(){return new r.a},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u});var r=n(7),i=n(13),o=n(11),a=n(6),s=n(74),u=function(){function e(){var e=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=s.a.NO_ERROR,this.sendPromise_=o.a(function(t,n){e.xhr_.addEventListener("abort",function(n){e.errorCode_=s.a.ABORT,t(e)}),e.xhr_.addEventListener("error",function(n){e.errorCode_=s.a.NETWORK_ERROR,t(e)}),e.xhr_.addEventListener("load",function(n){t(e)})})}return e.prototype.send=function(e,t,n,o){var s=this;if(this.sent_)throw r.e("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),a.a(o)){var u=o;i.b(u,function(e,t){s.xhr_.setRequestHeader(e,t.toString())})}return a.a(n)?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},e.prototype.getErrorCode=function(){if(!this.sent_)throw r.e("cannot .getErrorCode() before sending");return this.errorCode_},e.prototype.getStatus=function(){if(!this.sent_)throw r.e("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}},e.prototype.getResponseText=function(){if(!this.sent_)throw r.e("cannot .getResponseText() before sending");return this.xhr_.responseText},e.prototype.abort=function(){this.xhr_.abort()},e.prototype.getResponseHeader=function(e){return this.xhr_.getResponseHeader(e)},e.prototype.addUploadProgressListener=function(e){a.a(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",e)},e.prototype.removeUploadProgressListener=function(e){a.a(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",e)},e}()},function(e,t,n){"use strict";function r(e){var t;try{t=JSON.parse(e)}catch(e){return null}return i.f(t)?t:null}t.a=r;var i=n(6)},function(e,t,n){"use strict";function r(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r();if(void 0!==n){for(var i=new n,o=0;o<e.length;o++)i.append(e[o]);return i.getBlob()}if(a.e())return new Blob(e);throw Error("This browser doesn't seem to support creating Blobs")}function o(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}t.a=i,t.b=o;var a=n(6)},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(e,t,n,r){this.url=e,this.method=t,this.handler=n,this.timeout=r,this.urlParam
1s={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return f});var r=n(17),i=n(153),o=n(154),a=n(36),s=n(39),u=n(155),c=n(7),h=n(11),l=n(78),p=n(6),f=function(){function e(e,t,n,i,o,a){void 0===a&&(a=null);var s=this;this.transferred_=0,this.needToFetchStatus_=!1,this.needToFetchMetadata_=!1,this.observers_=[],this.error_=null,this.uploadUrl_=null,this.request_=null,this.chunkMultiplier_=1,this.resolve_=null,this.reject_=null,this.ref_=e,this.authWrapper_=t,this.location_=n,this.blob_=o,this.metadata_=a,this.mappings_=i,this.resumable_=this.shouldDoResumable_(this.blob_),this.state_=r.a.RUNNING,this.errorHandler_=function(e){s.request_=null,s.chunkMultiplier_=1,e.codeEquals(c.a.CANCELED)?(s.needToFetchStatus_=!0,s.completeTransitions_()):(s.error_=e,s.transition_(r.a.ERROR))},this.metadataErrorHandler_=function(e){s.request_=null,e.codeEquals(c.a.CANCELED)?s.completeTransitions_():(s.error_=e,s.transition_(r.a.ERROR))},this.promise_=h.a(function(e,t){s.resolve_=e,s.reject_=t,s.start_()}),this.promise_.then(null,function(){})}return e.prototype.makeProgressCallback_=function(){var e=this,t=this.transferred_;return function(n,r){e.updateProgress_(t+n)}},e.prototype.shouldDoResumable_=function(e){return e.size()>262144},e.prototype.start_=function(){this.state_===r.a.RUNNING&&null===this.request_&&(this.resumable_?null===this.uploadUrl_?this.createResumable_():this.needToFetchStatus_?this.fetchStatus_():this.needToFetchMetadata_?this.fetchMetadata_():this.continueUpload_():this.oneShotUpload_())},e.prototype.resolveToken_=function(e){var t=this;this.authWrapper_.getAuthToken().then(function(n){switch(t.state_){case r.a.RUNNING:e(n);break;case r.a.CANCELING:t.transition_(r.a.CANCELED);break;case r.a.PAUSING:t.transition_(r.a.PAUSED)}})},e.prototype.createResumable_=function(){var e=this;this.resolveToken_(function(t){var n=l.c(e.authWrapper_,e.location_,e.mappings_,e.blob_,e.metadata_),r=e.authWrapper_.makeRequest(n,t);e.request_=r,r.getPromise().then(function(t){e.request_=null,e.uploadUrl_=t,e.needToFetchStatus_=!1,e.completeTransitions_()},e.errorHandler_)})},e.prototype.fetchStatus_=function(){var e=this,t=this.uploadUrl_;this.resolveToken_(function(n){var r=l.f(e.authWrapper_,e.location_,t,e.blob_),i=e.authWrapper_.makeRequest(r,n);e.request_=i,i.getPromise().then(function(t){t=t,e.request_=null,e.updateProgress_(t.current),e.needToFetchStatus_=!1,t.finalized&&(e.needToFetchMetadata_=!0),e.completeTransitions_()},e.errorHandler_)})},e.prototype.continueUpload_=function(){var e=this,t=l.h*this.chunkMultiplier_,n=new l.a(this.transferred_,this.blob_.size()),i=this.uploadUrl_;this.resolveToken_(function(o){var a;try{a=l.b(e.location_,e.authWrapper_,i,e.blob_,t,e.mappings_,n,e.makeProgressCallback_())}catch(t){return e.error_=t,void e.transition_(r.a.ERROR)}var s=e.authWrapper_.makeRequest(a,o);e.request_=s,s.getPromise().then(function(t){e.increaseMultiplier_(),e.request_=null,e.updateProgress_(t.current),t.finalized?(e.metadata_=t.metadata,e.transition_(r.a.SUCCESS)):e.completeTransitions_()},e.errorHandler_)})},e.prototype.increaseMultiplier_=function(){l.h*this.chunkMultiplier_<33554432&&(this.chunkMultiplier_*=2)},e.prototype.fetchMetadata_=function(){var e=this;this.resolveToken_(function(t){var n=l.e(e.authWrapper_,e.location_,e.mappings_),i=e.authWrapper_.makeRequest(n,t);e.request_=i,i.getPromise().then(function(t){e.request_=null,e.metadata_=t,e.transition_(r.a.SUCCESS)},e.metadataErrorHandler_)})},e.prototype.oneShotUpload_=function(){var e=this;this.resolveToken_(function(t){var n=l.g(e.authWrapper_,e.location_,e.mappings_,e.blob_,e.metadata_),i=e.authWrapper_.makeRequest(n,t);e.request_=i,i.getPromise().then(function(t){e.request_=null,e.metadata_=t,e.updateProgress_(e.blob_.size()),e.transition_(r.a.SUCCESS)},e.errorHandler_)})},e.prototype.updateProgress_=function(e){var t=this.transferred_;this.transferred_=e,this.transferred_!==t&&this.notifyObservers_()},e.prototype.transition_=function(e){if(this.state_!==e)switch(e){case r.a.CANCELING:case r.a.PAUSING:this.state_=e,null!==this.request_&&this.request_.cancel();break;case r.a.RUNNING:var t=this.state_===r.a.PAUSED;this.state_=e,t&&(this.notifyObservers_(),this.start_());break;case r.a.PAUSED:this.state_=e,this.notifyObservers_();break;case r.a.CANCELED:this.error_=c.c(),this.state_=e,this.notifyObservers_();break;case r.a.ERROR:case r.a.SUCCESS:this.state_=e,this.notifyObservers_()}},e.prototype.completeTransitions_=function(){switch(this.state_){case r.a.PAUSING:this.transition_(r.a.PAUSED);break;case r.a.CANCELING:this.transition_(r.a.CANCELED);break;case r.a.RUNNING:this.start_()}},Object.defineProperty(e.prototype,"snapshot",{get:function(){var e=r.d(this.state_);return new o.a(this.transferred_,this.blob_.size(),e,this.metadata_,this,this.ref_)},enumerable:!0,configurable:!0}),e.prototype.on=function(e,t,n,o){function s(t){if(e!==r.b.STATE_CHANGED)throw"Expected one of the event types: ["+r.b.STATE_CHANGED+"]."}function u(e){try{return void f(e)}catch(e){}try{if(d(e),!(p.c(e.next)||p.c(e.error)||p.c(e.complete)))throw"";return}catch(e){throw l}}function c(e){function t(t,n,r){null!==e&&a.g("on",e,arguments);var s=new i.a(t,n,o);return _.addObserver_(s),function(){_.removeObserver_(s)}}return t}function h(e){if(null===e)throw l;u(e)}void 0===t&&(t=void 0),void 0===n&&(n=void 0),void 0===o&&(o=void 0);var l="Expected a function or an Object with one of `next`, `error`, `complete` properties.",f=a.d(!0).validator,d=a.a(null,!0).validator,v=[a.e(s),a.a(u,!0),a.d(!0),a.d(!0)];a.g("on",v,arguments);var _=this,g=[a.a(h),a.d(!0),a.d(!0)];return p.c(t)||p.c(n)||p.c(o)?c(null)(t,n,o):c(g)},e.prototype.then=function(e,t){return this.promise_.then(e,t)},e.prototype.catch=function(e){return this.then(null,e)},e.prototype.addObserver_=function(e){this.observers_.push(e),this.notifyObserver_(e)},e.prototype.removeObserver_=function(e){s.c(this.observers_,e)},e.prototype.notifyObservers_=function(){var e=this;this.finishPromise_(),s.a(this.observers_).forEach(function(t){e.notifyObserver_(t)})},e.prototype.finishPromise_=function(){if(null!==this.resolve_){var e=!0;switch(r.d(this.state_)){case r.c.SUCCESS:Object(u.a)(this.resolve_.bind(null,this.snapshot))();break;case r.c.CANCELED:case r.c.ERROR:var t=this.reject_;Object(u.a)(t.bind(null,this.error_))();break;default:e=!1}e&&(this.resolve_=null,this.reject_=null)}},e.prototype.notifyObserver_=function(e){switch(r.d(this.state_)){case r.c.RUNNING:case r.c.PAUSED:null!==e.next&&Object(u.a)(e.next.bind(e,this.snapshot))();break;case r.c.SUCCESS:null!==e.complete&&Object(u.a)(e.complete.bind(e))();break;case r.c.CANCELED:case r.c.ERROR:null!==e.error&&Object(u.a)(e.error.bind(e,this.error_))();break;default:null!==e.error&&Object(u.a)(e.error.bind(e,this.error_))()}},e.prototype.resume=function(){a.g("resume",[],arguments);var e=this.state_===r.a.PAUSED||this.state_===r.a.PAUSING;return e&&this.transition_(r.a.RUNNING),e},e.prototype.pause=function(){a.g("pause",[],arguments);var e=this.state_===r.a.RUNNING;return e&&this.transition_(r.a.PAUSING),e},e.prototype.cancel=function(){a.g("cancel",[],arguments);var e=this.state_===r.a.RUNNING||this.state_===r.a.PAUSING;return e&&this.transition_(r.a.CANCELING),e},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(6),i=function(){function e(e,t,n){if(r.b(e)||r.a(t)||r.a(n))this.next=e,this.error=t||null,this.complete=n||null;else{var i=e;this.next=i.next||null,this.error=i.error||null,this.complete=i.complete||null}}return e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(e,t,n,r,i,o){this.bytesTransferred=e,this.totalBytes=t,this.state=n,this.metadata=r,this.task=i,this.ref=o}return Object.defineProperty(e.prototype,"downloadURL",{get:function(){if(null!==this.metadata){var e=this.metadata.downloadURLs;return null!=e&&null!=e[0]?e[0]:null}return null},enumerable:!0,configurable:!0}),e}()},function(e,t,n){"use strict";function r(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];i.c(!0).then(function(){e.apply(null,t)})}}t.a=r;var i=n(11)},function(e,t,n){"use strict";n.d(t,"a",function(){return c});var r=n(36),i=n(157),o=n(27),a=n(11),s=n(160),u=n(75),c=function(){function e(e,t,n){function r(e,t){return new u.a(e,t)}if(this.bucket_=null,this.authWrapper_=new i.a(e,r,s.a,this,t),this.app_=e,null!=n)this.bucket_=o.a.makeFromBucketSpec(n);else{var a=this.authWrapper_.bucket();null!=a&&(this.bucket_=new o.a(a,""))}this.internals_=new h(this)}return e.prototype.ref=function(e){function t(e){if(/^[A-Za-z]+:\/\//.test(e))throw"Expected child path but got a URL, use refFromURL instead."}if(r.g("ref",[r.e(t,!0)],arguments),null==this.bucket_)throw new Error("No Storage Bucket defined in Firebase Options.");var n=new u.a(this.authWrapper_,this.bucket_);return null!=e?n.child(e):n},e.prototype.refFromURL=function(e){function t(e){if(!/^[A-Za-z]+:\/\//.test(e))throw"Expected full URL but got a child path, use ref instead.";try{o.a.makeFromUrl(e)}
1catch(e){throw"Expected valid full URL but got an invalid one."}}return r.g("refFromURL",[r.e(t,!1)],arguments),new u.a(this.authWrapper_,e)},Object.defineProperty(e.prototype,"maxUploadRetryTime",{get:function(){return this.authWrapper_.maxUploadRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxUploadRetryTime=function(e){r.g("setMaxUploadRetryTime",[r.c()],arguments),this.authWrapper_.setMaxUploadRetryTime(e)},Object.defineProperty(e.prototype,"maxOperationRetryTime",{get:function(){return this.authWrapper_.maxOperationRetryTime()},enumerable:!0,configurable:!0}),e.prototype.setMaxOperationRetryTime=function(e){r.g("setMaxOperationRetryTime",[r.c()],arguments),this.authWrapper_.setMaxOperationRetryTime(e)},Object.defineProperty(e.prototype,"app",{get:function(){return this.app_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"INTERNAL",{get:function(){return this.internals_},enumerable:!0,configurable:!0}),e}(),h=function(){function e(e){this.service_=e}return e.prototype.delete=function(){return this.service_.authWrapper_.deleteApp(),a.c(void 0)},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return h});var r=n(26),i=n(7),o=n(158),a=n(27),s=n(11),u=n(159),c=n(6),h=function(){function e(t,n,i,o,a){if(this.bucket_=null,this.deleted_=!1,this.app_=t,null!==this.app_){var s=this.app_.options;c.a(s)&&(this.bucket_=e.extractBucket_(s))}this.storageRefMaker_=n,this.requestMaker_=i,this.pool_=a,this.service_=o,this.maxOperationRetryTime_=r.d,this.maxUploadRetryTime_=r.e,this.requestMap_=new u.a}return e.extractBucket_=function(e){var t=e[r.c]||null;return null==t?null:a.a.makeFromBucketSpec(t).bucket},e.prototype.getAuthToken=function(){return null!==this.app_&&c.a(this.app_.INTERNAL)&&c.a(this.app_.INTERNAL.getToken)?this.app_.INTERNAL.getToken().then(function(e){return null!==e?e.accessToken:null},function(e){return null}):s.c(null)},e.prototype.bucket=function(){if(this.deleted_)throw i.b();return this.bucket_},e.prototype.service=function(){return this.service_},e.prototype.makeStorageReference=function(e){return this.storageRefMaker_(this,e)},e.prototype.makeRequest=function(e,t){if(this.deleted_)return new o.a(i.b());var n=this.requestMaker_(e,t,this.pool_);return this.requestMap_.addRequest(n),n},e.prototype.deleteApp=function(){this.deleted_=!0,this.app_=null,this.requestMap_.clear()},e.prototype.maxUploadRetryTime=function(){return this.maxUploadRetryTime_},e.prototype.setMaxUploadRetryTime=function(e){this.maxUploadRetryTime_=e},e.prototype.maxOperationRetryTime=function(){return this.maxOperationRetryTime_},e.prototype.setMaxOperationRetryTime=function(e){this.maxOperationRetryTime_=e},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(11),i=function(){function e(e){this.promise_=r.b(e)}return e.prototype.getPromise=function(){return this.promise_},e.prototype.cancel=function(e){void 0===e&&(e=!1)},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(13),i=n(26),o=function(){function e(){this.map_={},this.id_=i.h}return e.prototype.addRequest=function(e){function t(){delete r.map_[n]}var n=this.id_;this.id_++,this.map_[n]=e;var r=this;e.getPromise().then(t,t)},e.prototype.clear=function(){r.b(this.map_,function(e,t){t&&t.cancel(!0)}),this.map_={}},e}()},function(e,t,n){"use strict";function r(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}function i(e){var t=void 0!==a.default?a.default.SDK_VERSION:"AppManager";e["X-Firebase-Storage-Version"]="webjs/"+t}function o(e,t,n){var o=f.c(e.urlParams),a=e.url+o,s=h.a(e.headers);return r(s,t),i(s),new v(a,e.method,s,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,n)}t.a=o;var a=n(8),s=n(39),u=n(161),c=n(7),h=n(13),l=n(11),p=n(6),f=n(38),d=n(74),v=function(){function e(e,t,n,r,i,o,a,s,u,c,h){this.pendingXhr_=null,this.backoffId_=null,this.resolve_=null,this.reject_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=a,this.errorCallback_=s,this.progressCallback_=c,this.timeout_=u,this.pool_=h;var p=this;this.promise_=l.a(function(e,t){p.resolve_=e,p.reject_=t,p.start_()})}return e.prototype.start_=function(){function e(e,t){function r(e){var t=e.loaded,r=e.lengthComputable?e.total:-1;null!==n.progressCallback_&&n.progressCallback_(t,r)}if(t)return void e(!1,new _(!1,null,!0));var i=n.pool_.createXhrIo();n.pendingXhr_=i,null!==n.progressCallback_&&i.addUploadProgressListener(r),i.send(n.url_,n.method_,n.body_,n.headers_).then(function(t){null!==n.progressCallback_&&t.removeUploadProgressListener(r),n.pendingXhr_=null,t=t;var i=t.getErrorCode()===d.a.NO_ERROR,o=t.getStatus();if(!i||n.isRetryStatusCode_(o)){var a=t.getErrorCode()===d.a.ABORT;return void e(!1,new _(!1,null,a))}var u=s.b(n.successCodes_,o);e(!0,new _(u,t))})}function t(e,t){var r=n.resolve_,i=n.reject_,o=t.xhr;if(t.wasSuccessCode)try{var a=n.callback_(o,o.getResponseText());p.c(a)?r(a):r()}catch(e){i(e)}else if(null!==o){var s=c.s();s.setServerResponseProp(o.getResponseText()),i(n.errorCallback_?n.errorCallback_(o,s):s)}else if(t.canceled){var s=n.appDelete_?c.b():c.c();i(s)}else{var s=c.o();i(s)}}var n=this;this.canceled_?t(!1,new _(!1,null,!0)):this.backoffId_=u.a(e,t,this.timeout_)},e.prototype.getPromise=function(){return this.promise_},e.prototype.cancel=function(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&u.b(this.backoffId_),null!==this.pendingXhr_&&this.pendingXhr_.abort()},e.prototype.isRetryStatusCode_=function(e){var t=e>=500&&e<600,n=[408,429],r=s.b(n,e),i=s.b(this.additionalRetryCodes_,e);return t||r||i},e}(),_=function(){function e(e,t,n){this.wasSuccessCode=e,this.xhr=t,this.canceled=!!n}return e}()},function(e,t,n){"use strict";function r(e,t,n){function r(){return 2===l}function i(){p||(p=!0,t.apply(null,arguments))}function o(t){c=setTimeout(function(){c=null,e(a,r())},t)}function a(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!p){if(e)return void i.apply(null,arguments);if(r()||h)return void i.apply(null,arguments);u<64&&(u*=2);var a;1===l?(l=2,a=0):a=1e3*(u+Math.random()),o(a)}}function s(e){f||(f=!0,p||(null!==c?(e||(l=2),clearTimeout(c),o(0)):e||(l=1)))}var u=1,c=null,h=!1,l=0,p=!1,f=!1;return o(0),setTimeout(function(){h=!0,s(!0)},n),s}function i(e){e(!1)}t.a=r,t.b=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}
1Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n(163);var o=function(){function e(t){var n=this;if(r(this,e),!t.firebase)return console.error("Konstruktor przyjmuje dwa parametry: pierwszy to instancja firebase, drugi to nazwa topicu do ktorego przypisane sa powiadomienia");if(!t.topic)return console.error("Konstruktor przyjmuje dwa parametry: pierwszy to instancja firebase, drugi to nazwa topicu do ktorego przypisane sa powiadomienia");var i={apiKey:"AIzaSyDE6Q7XtZ1Agyj8AiSPOVhd4LuDyF_nWwA",projectId:"antyradio-863d7",messagingSenderId:"433254874636"};this.marginTop=t.marginTop,this.background=t.background,this.firebase=t.firebase,this.topic=t.topic,this.development=!0,this.servAddress="https://webpush.eurozet.pl/api",this.notificationFileUrl="https://"+t.domain+"/"+t.serviceWorkerFile,this.initializeFirebase(i),this.navigatorRegister().then(function(e){n.useServiceWorker(e),n.getToken().then(function(e){n.checkToken(e)}).catch(function(e){})})}return i(e,[{key:"requestPermission",value:function(){try{return Notification.requestPermission().then(function(e){return"denied"===e?(console.log("Permission wasn't granted. Allow a retry."),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushBlock"}),!1):"default"===e?(console.log("The permission request was dismissed."),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushClose"}),!1):(window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushEnable"}),console.log("Notification permission granted."),!0)})}catch(e){if(!(e instanceof TypeError))throw e;Notification.requestPermission(function(){return"denied"===result?(console.log("Permission wasn't granted. Allow a retry."),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushBlock"}),!1):"default"===result?(console.log("The permission request was dismissed."),window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushClose"}),!1):(window.dataLayer=window.dataLayer||[],dataLayer.push({event:"Consent",Consent:"PushEnable"}),console.log("Notification permission granted."),!0)})}}},{key:"initializeFirebase",value:function(e){this.firebase.initializeApp(e),this.messaging=this.firebase.messaging()}},{key:"navigatorRegister",value:function(){return navigator.serviceWorker.register(this.notificationFileUrl)}},{key:"useServiceWorker",value:function(e){this.messaging.useServiceWorker(e),e.update()}},{key:"getToken",value:function(){return this.messaging.getToken()}},{key:"checkToken",value:function(e){return this.showLog("Get Token"),this.getLocalTokenId()!==e?e:(this.showLog("ID Token is valid"),!1)}},{key:"sendTokenToServer",value:function(e){var t=this;if(e){this.showLog("Sending token to server...");var n=new XMLHttpRequest;n.open("POST",this.servAddress,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onload=function(n){var r=JSON.parse(n.currentTarget.response);if(t.showLog(r),1===r.code){t.setTokenId(e);var i=document.querySelector(".notification__info"),o=document.querySelector(".btn-notif");i&&i.remove(),o&&o.remove()}},n.send("topic="+this.topic+"&token="+e)}else this.showLog("Token already sent to server so won't send it again unless it changes")}},{key:"getLocalTokenId",value:function(){return window.localStorage.getItem("web_iid")}},{key:"setTokenId",value:function(e){window.localStorage.setItem("web_iid",e)}},{key:"addNotificationButton",value:function(){var e=this,t=document.createElement("div");t.innerHTML='<div class="dzwonek" style="background: white;">\n <div class="bell"></div>\n </div>',t.classList.add("btn-notif"),t.addEventListener("click",function(){window.localStorage.getItem("info_notif")&&(navigator.userAgent.toLowerCase().indexOf("firefox")>-1?window.open("/var/notification/push_firefox.html","DescriptiveWindowName","resizable=no,scrollbars=no,status=yes,width=448 height=290, left=80, top=100"):window.open("/var/notification/push_chrome.html","DescriptiveWindowName","resizable=no,scrollbars=no,status=yes,width=448 height=290, left=80, top=100")),e.requestPermission().then(function(t){e.subscribe(t)})});var n=0,r=setInterval(function(){var e=document.querySelector("#wtgStickyScrollMobile"),i=document.querySelector(".live-shedule");if(n+=1,e&&"-200px"!=e.style.bottom){t.style.bottom="145px";var o=e.querySelector("#closeButton");clearInterval(r),o.addEventListener("click",function(){t.style.bottom="65px",clearInterval(r)},{once:!0})}else i?(t.style.bottom="65px",clearInterval(r)):t.style.bottom="65px";n>200&&clearInterval(r)},100);document.body.appendChild(t);var i=document.querySelector(".bell");setTimeout(function(){i.classList.toggle("active"),setInterval(function(){i.classList.toggle("active"),setTimeout(function(){i.classList.toggle("active")},3e3)},3e4)},5e3)}},{key:"createNotificationInfo",value:function(){var e=this,t=document.createElement("div");t.innerHTML='<div class="notif__info">\n <div class="notif__info__close"></div>\n <div class="notif__info__header">\n <div class="notif__info__header__domain">'+window.location.host+'</div>\n </div>\n <div class="notif__info__content">\n <img alt="dzwonek" src="/design/player/images/notification/notification.png"/>
1\n <span>WÅÄ
cz powiadomienia</span>\n </div>\n <div class="notif__info__footer">\n <button class="notif__info__button__no">Nie</button>\n <button class="notif__info__button__yes">Tak</button>\n </div>\n </div>',document.body.appendChild(t);var n=document.querySelector(".notif__info"),r=document.querySelector(".notif__info__button__yes"),i=document.querySelector(".notif__info__button__no"),o=document.querySelector(".notif__info__close");r.addEventListener("click",function(){n.remove(),e.requestPermission().then(function(t){e.subscribe(t)})}),i.addEventListener("click",function(){n.remove(),e.addNotificationButton(),e.setCookie("notifInfo","okey",7)}),o.addEventListener("click",function(){n.remove(),e.addNotificationButton(),e.setCookie("notifInfo","okey",7)})}},{key:"createNotificationInfoOLD",value:function(e){var t=this.getCookie("notifi"),n=document.createElement("div");n.innerHTML='<div class="notification__info active">\n <div class="notification__info__header">\n <div class="notification__info__header__logo">\n <img src="https://gfx.radiozet.pl/extension/radiozet-header/design/standard/images/logo.svg" alt="Radio ZET" height="35">\n </div>\n <div class="notification__info__header__close" id="notification-close">\n <span class="icon-close"></span>\n </div>\n </div>\n <div class="notification__info__bell">\n <img alt="dzwonek" src="/design/radiozet/images/notification/dzwoneczek_na_placicie.svg">\n </div>\n <div class="notification__info__description">\n <p>Chcesz byÄ zawsze na bieżÄ
co? Zadbamy o to, by nic CiÄ nie ominÄÅo!</p>\n </div>\n <div class="notification__info__button" id="notification-button">\n <p>WÅÄ
cz Powiadomienia</p>\n </div>\n </div>',document.body.appendChild(n);var r=document.querySelector(".notification__info");if(t)return void r.classList.toggle("active");this.detectMobile()&&r.classList.toggle("active")}},{key:"notificationInteraction",value:function(){var e=this,t=document.querySelector(".notification__info__header__close"),n=document.querySelector(".notification__info"),r=document.querySelector(".notification__info__button");t.addEventListener("click",function(){n.classList.toggle("active"),e.setCookie("notifi","ok",7)}),r.addEventListener("click",function(){window.localStorage.getItem("info_notif")&&(navigator.userAgent.toLowerCase().indexOf("firefox")>-1?window.open("/var/notification/push_firefox.html","DescriptiveWindowName","resizable=no,scrollbars=no,status=yes,width=448 height=290, left=80, top=100"):window.open("/var/notification/push_chrome.html","DescriptiveWindowName","resizable=no,scrollbars=no,status=yes,width=448 height=290, left=80, top=100")),e.requestPermission().then(function(t){e.subscribe(t)})})}},{key:"subscribe",value:function(e){var t=this;e?this.getToken().then(function(e){var n=t.checkToken(e);t.sendTokenToServer(n)}):window.localStorage.setItem("info_notif","ok")}},{key:"showLog",value:function(e){this.development&&console.log("[WEB] Info: ",e)}},{key:"setCookie",value:function(e,t,n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3);var i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/"}},{key:"getCookie",value:function(e){for(var t=e+"=",n=decodeURIComponent(document.cookie),r=n.split(";"),i=0;i<r.length;i++){for(var o=r[i];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}},{key:"detectMobile",value:function(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(function(e){return navigator.userAgent.match(e)})}}]),e}();t.default=o},function(e,t,n){var r=n(164);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0};i.transform=void 0,n(166)(r,i),r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(165)(!1),t.push([e.i,'*,:after,:before{box-sizing:border-box}.notif__info{width:321px;height:131px;padding:5px 5px 15px;border-radius:10px;border:1px solid #bbb;box-shadow:0 0 30px 0 rgba(0,0,0,.21);background-color:#fff;position:fixed;top:0;left:140px;z-index:1000}
1@media (max-width:768px){.notif__info{width:301px;height:122px;margin:auto;border-radius:5px;left:50%;top:0;transform:translate(-50%)}}.notif__info__close{position:absolute;top:2px;right:10px;cursor:pointer}@media (max-width:768px){.notif__info__close{top:0;right:8px}}.notif__info__close:after{display:inline-block;content:"\\D7";font-size:23px;font-weight:700;color:#606367}@media (max-width:768px){.notif__info__close:after{font-size:21px}}.notif__info__header{display:flex;justify-content:space-between;margin-top:11px;margin-left:13px;font-weight:700}.notif__info__header__domain{font-family:Roboto;font-size:16px;font-weight:500;color:#222}@media (max-width:768px){.notif__info__header__domain{font-size:15px}}.notif__info__content{margin-top:9px;margin-left:13px;display:flex;align-items:center}@media (max-width:768px){.notif__info__content{margin-top:8px;margin-left:13px}}.notif__info__content img{width:13.5px;height:16px}@media (max-width:768px){.notif__info__content img{width:12.5px;height:15px}}.notif__info__content span{font-size:12px;font-family:Roboto;color:#222;margin-left:14px}@media (max-width:768px){.notif__info__content span{font-size:11px}}.notif__info__footer{display:flex;margin-top:16px;margin-right:10px;justify-content:flex-end}@media (max-width:768px){.notif__info__footer{margin-right:9px}}.notif__info__footer button{color:#fff;background-color:#5993f1;border:1px solid #bbb;padding:7px 20px;border-radius:10px;cursor:pointer;font-family:Roboto;font-weight:500;font-size:14px}@media (max-width:768px){.notif__info__footer button{font-size:13px;border-radius:5px;padding:6px 19px}}.notif__info__footer button:first-child{margin-right:10px;color:#5f6267;background-color:#fff}.notif-info{width:385px;position:fixed;left:65px;top:20px;padding:10px;border:1px solid #e3e3e3;background:#fff;z-index:100001;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:0 0 15px rgba(0,0,0,.1);-webkit-box-shadow:0 0 15px rgba(0,0,0,.1);box-shadow:0 0 15px rgba(0,0,0,.1);font-family:Dosis,sans-serif}.notif-info:after{top:-10px;border-bottom:12px solid #fff}.notif-info:after,.notif-info:before{content:"";left:50px;width:0;height:0;border-left:15px solid transparent;border-right:15px solid transparent;position:absolute}.notif-info:before{top:-11px;border-bottom:12px solid rgba(0,0,0,.1)}.notif-info .container-text{width:calc(100% - 125px);margin:0 auto}.notif-info .icon-close{position:absolute;right:23px;top:23px;color:#e5396b;font-size:18px;cursor:pointer}.notif-info .dzwonek{width:40px;height:40px;background:#fff;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;position:absolute;left:23px;top:23px}.notif-info .icon-dzwonek{position:absolute;left:0;top:0;color:#fff;font-size:24px;padding:8px 0 0 8px;color:#e5396b}.notif-info .icon-dzwonek:before{position:relative;z-index:2}.notif-info h3.notif-title{margin:10px 0;font-size:18px}.notif-info p.notif-subtitle{font-size:11px;margin:0 0 10px;padding:0;line-height:normal}.notif-info ul{padding:0 0 15px;margin:0}.notif-info ul li{font-size:12px;list-style:inside;font-weight:700;margin-bottom:5px}.notif-info ul li span{position:relative}.notif-info ul li span.colorElement{color:#e5396b}.notif-info ul li span.move-left{position:relative;left:-5px}@media (max-width:768px){.notif-info{width:460px;left:10px}.notif-info:after,.notif-info:before{left:10px}.notif-info .container-text{width:calc(100% - 130px)}.notif-info .icon-close{font-size:25px}}@media (max-width:486px){.notif-info{width:calc(100% - 20px)}.notif-info .container-text{width:calc(100% - 90px)}.notif-info .icon-close{right:15px}.notif-info .dzwonek{left:10px}}.btn-notif{position:fixed;bottom:65px;left:67px;color:#fff;cursor:pointer;z-index:99}.btn-notif .dzwonek{width:60px;height:60px;background:#e5396b;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;-moz-box-shadow:0 0 13px rgba(0,0,0,.4);-webkit-box-shadow:0 0 13px rgba(0,0,0,.4);box-shadow:0 0 13px rgba(0,0,0,.4);position:relative}.btn-notif .dzwonek .bell{width:32px;height:32px;background-image:url(/design/player/images/notification/dzwoneczek_animacja_sprite.png);position:absolute;top:13px;left:13px}.btn-notif i{position:absolute;
1left:0;top:0;display:inline-block;padding:13px 0 0 14px;font-size:32px;color:#e5396b}.btn-notif i:before{position:relative;z-index:2}@media (max-width:486px){.btn-notif{right:25px;left:auto}}.notification__info{width:320px;height:400px;background-color:#d50134;position:fixed;left:52px;bottom:142px;border-radius:8px;display:none;z-index:100}.notification__info.active{display:block}.notification__info__header{width:100%;display:flex;justify-content:space-between;height:60px}.notification__info__header__close{margin:12px 21px 10px 0;font-size:26px;font-weight:700;color:#fff;cursor:pointer}.notification__info__header__close span{font-size:12px;color:#f7ccd5;font-weight:700}.notification__info__header__logo{margin:15px 0 0 19px}.notification__info__bell{text-align:center;margin:20px 0 0;height:126px}.notification__info__bell img{height:225px;position:relative;top:-57px}.notification__info__description{padding:0 55px;text-align:center;margin:18px 0;font-size:18px;color:#fff;font-weight:700;line-height:22px}.notification__info__button{background:#fff;color:#d40035;width:75%;text-align:center;margin:auto;border-radius:50px;text-transform:uppercase;padding:10px 0;cursor:pointer;margin-top:28px}.notification__info__button p{margin:0;font-size:16px;font-weight:700}.notification__info:after{content:"";position:absolute;left:11%;top:100%;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #d50134;clear:both}',""])},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){function r(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=d[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(h(r.parts[o],t))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(h(r.parts[o],t));d[r.id]={id:r.id,refs:1,parts:a}}}}function i(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=t.base?o[0]+t.base:o[0],s=o[1],u=o[2],c=o[3],h={css:s,media:u,sourceMap:c};r[a]?r[a].parts.push(h):n.push(r[a]={id:a,parts:[h]})}return n}function o(e,t){var n=_(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=m[m.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),m.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=_(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,i)}}function a(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=m.indexOf(e);t>=0&&m.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),o(e,t),t}function u(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),o(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function h(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var c=y++;n=g||(g=s(t)),r=l.bind(null,n,c,!1),i=l.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=f.bind(null,n,t),i=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=p.bind(null,n),i=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function l(e,t,n,r){var i=n?"":r.css;
1if(e.styleSheet)e.styleSheet.cssText=w(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function f(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=b(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var d={},v=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),_=function(e){var t={};return function(n){if(void 0===t[n]){var r=e.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[n]=r}return t[n]}}(function(e){return document.querySelector(e)}),g=null,y=0,m=[],b=n(167);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var o=[],a=0;a<n.length;a++){var s=n[a],u=d[s.id];u.refs--,o.push(u)}e&&r(i(e,t),t);for(var a=0;a<o.length;a++){var u=o[a];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete d[u.id]}}}};var w=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return e;var o;return o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")"})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.