!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).firebase=t()}(this,function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;na[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0"})):"Error",c=this.serviceName+": "+s+" ("+o+").",u=new m(o,c),f=0,l=Object.keys(i);f=(null!=o?o:e.logLevel)&&a({level:k[t].toLowerCase(),message:i,args:n,type:e.name})}},n=0,r=C;ni&&r.push(t.charAt(i));return r.join("")}var wt,It,Et,St=(Tt.prototype.getAppId=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!e)throw mt.create("no app id");return e},Tt.prototype.getProjectId=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!e)throw mt.create("no project id");return e},Tt.prototype.getApiKey=function(){var e=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!e)throw mt.create("no api key");return e},Tt.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},Tt.getInstance=function(){return void 0===ft&&(ft=new Tt),ft},Tt);function Tt(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=_t("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=_t("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}function At(){return wt}(Et=It=It||{})[Et.UNKNOWN=0]="UNKNOWN",Et[Et.VISIBLE=1]="VISIBLE",Et[Et.HIDDEN=2]="HIDDEN";var Nt=["firebase_","google_","ga_"],Ot=new RegExp("^[a-zA-Z]\\w*$");function kt(){switch(yt.getInstance().document.visibilityState){case"visible":return It.VISIBLE;case"hidden":return It.HIDDEN;default:return It.UNKNOWN}}var Pt=new B(gt);Pt.logLevel=k.INFO;var Ct="0.0.1",Rt={loggingEnabled:!0},jt="FIREBASE_INSTALLATIONS_AUTH";function Dt(e){var r,t=function(){var e=yt.getInstance().localStorage;if(!e)return;var t=e.getItem(dt);if(!t||!function(e){return Number(e)>Date.now()}(t))return;var n=e.getItem(ht);if(!n)return;try{return JSON.parse(n)}catch(e){return}}();return t?(Mt(t),Promise.resolve()):(r=e,function(){var e=St.getInstance().installationsService.getToken();return e.then(function(e){}),e}().then(function(e){var t="https://firebaseremoteconfig.googleapis.com/v1/projects/"+St.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+St.getInstance().getApiKey(),n=new Request(t,{method:"POST",headers:{Authorization:jt+" "+e},body:JSON.stringify({app_instance_id:r,app_instance_id_token:e,app_id:St.getInstance().getAppId(),app_version:lt,sdk_version:Ct})});return fetch(n).then(function(e){if(e.ok)return e.json();throw mt.create("RC response not ok")})}).catch(function(){Pt.info(Lt)}).then(Mt).then(function(e){return function(e){var t=yt.getInstance().localStorage;if(!e||!t)return;t.setItem(ht,JSON.stringify(e)),t.setItem(dt,String(Date.now()+60*St.getInstance().configTimeToLive*60*1e3))}(e)},function(){}))}var Lt="Could not fetch config, will use default configs";function Mt(e){if(!e)return e;var t=St.getInstance(),n=e.entries||{};return t.loggingEnabled=void 0!==n.fpr_enabled?"true"===String(n.fpr_enabled):Rt.loggingEnabled,n.fpr_log_source&&(t.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(t.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(t.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),t.logTraceAfterSampling=Bt(t.tracesSamplingRate),t.logNetworkAfterSampling=Bt(t.networkRequestsSamplingRate),e}function Bt(e){return Math.random()<=e}var xt,Ut=1;function Ft(){return Ut=2,xt=xt||function(){var n=yt.getInstance().document;return new Promise(function(e){if(n&&"complete"!==n.readyState){var t=function(){"complete"===n.readyState&&(n.removeEventListener("readystatechange",t),e())};n.addEventListener("readystatechange",t)}else e()})}().then(function(){return(e=St.getInstance().installationsService.getId()).then(function(e){wt=e}),e;var e}).then(function(e){return Dt(e)}).then(function(){return qt()},function(){return qt()})}function qt(){Ut=3}var Vt,Ht=1e4,Kt=5500,zt=3,$t=zt,Wt=[],Gt=!1;function Jt(e){setTimeout(function(){if(0!==$t)return Wt.length?void function(){var e=o(Wt);Wt=[];var t=e.map(function(e){return{source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)}});(function(e,i){return function(e){var t=St.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then(function(e){return e.ok||Pt.info("Call to Firebase backend failed."),e.json()}).then(function(e){var t=Number(e.nextRequestWaitMillis),n=Ht;isNaN(t)||(n=Math.max(t,n));var r=e.logResponseDetails;Array.isArray(r)&&0