firebase 9.12.1 → 9.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/app/dist/index.cjs.js +1 -1
  3. package/app/dist/index.esm.js +1 -1
  4. package/app/dist/index.mjs +1 -1
  5. package/compat/app/dist/index.cjs.js +1 -1
  6. package/compat/app/dist/index.esm.js +1 -1
  7. package/compat/app/dist/index.mjs +1 -1
  8. package/compat/dist/index.esm.js +2 -2
  9. package/compat/dist/index.node.cjs +2 -2
  10. package/compat/dist/index.rn.cjs.js +2 -2
  11. package/firebase-analytics-compat.js +1 -1
  12. package/firebase-analytics.js +1 -1
  13. package/firebase-app-check-compat.js +1 -1
  14. package/firebase-app-check.js +1 -1
  15. package/firebase-app-compat.js +2 -2
  16. package/firebase-app.js +5 -5
  17. package/firebase-auth-compat.js +1 -1
  18. package/firebase-auth-cordova.js +1 -1
  19. package/firebase-auth-react-native.js +1 -1
  20. package/firebase-auth.js +1 -1
  21. package/firebase-compat.js +3 -3
  22. package/firebase-compat.js.map +1 -1
  23. package/firebase-database-compat.js +1 -1
  24. package/firebase-database-compat.js.map +1 -1
  25. package/firebase-database.js +1 -1
  26. package/firebase-database.js.map +1 -1
  27. package/firebase-firestore-compat.js +1 -1
  28. package/firebase-firestore-compat.js.map +1 -1
  29. package/firebase-firestore-lite.js +1 -1
  30. package/firebase-firestore-lite.js.map +1 -1
  31. package/firebase-firestore.js +1 -1
  32. package/firebase-firestore.js.map +1 -1
  33. package/firebase-functions-compat.js +1 -1
  34. package/firebase-functions.js +1 -1
  35. package/firebase-installations-compat.js +1 -1
  36. package/firebase-installations.js +1 -1
  37. package/firebase-messaging-compat.js +1 -1
  38. package/firebase-messaging-compat.js.map +1 -1
  39. package/firebase-messaging-sw.js +1 -1
  40. package/firebase-messaging-sw.js.map +1 -1
  41. package/firebase-messaging.js +1 -1
  42. package/firebase-messaging.js.map +1 -1
  43. package/firebase-performance-compat.js +1 -1
  44. package/firebase-performance-standalone-compat.es2017.js +7 -7
  45. package/firebase-performance-standalone-compat.js +1 -1
  46. package/firebase-performance.js +1 -1
  47. package/firebase-remote-config-compat.js +1 -1
  48. package/firebase-remote-config.js +1 -1
  49. package/firebase-storage-compat.js +1 -1
  50. package/firebase-storage-compat.js.map +1 -1
  51. package/firebase-storage.js +1 -1
  52. package/firebase-storage.js.map +1 -1
  53. package/package.json +28 -28
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(yt,Et){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,n=e(yt);class o extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,o.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,a.prototype.create)}}class a{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var r,n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],i=i?(r=n,i.replace(s,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new o(a,i,n)}}const s=/\{\$([^}]+)}/g;class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}(Te=t=t||{})[Te.DEBUG=0]="DEBUG",Te[Te.VERBOSE=1]="VERBOSE",Te[Te.INFO=2]="INFO",Te[Te.WARN=3]="WARN",Te[Te.ERROR=4]="ERROR",Te[Te.SILENT=5]="SILENT";const c={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},l=t.INFO,u={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},d=(e,t,...n)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),a=u[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${r}] ${e.name}:`,...n)}};const p=(t,e)=>e.some(e=>t instanceof e);let f,g;const h=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap;let _={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return m.get(e);if("objectStoreNames"===t)return e.objectStoreNames||v.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return I(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function y(r){return r!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(g=g||[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]).includes(r)?function(...e){return r.apply(T(this),e),I(h.get(this))}:function(...e){return I(r.apply(T(this),e))}:function(e,...t){var n=r.call(T(this),e,...t);return v.set(n,e.sort?e.sort():[e]),I(n)}}function E(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&(i=e,m.has(i)||(t=new Promise((e,t)=>{const n=()=>{i.removeEventListener("complete",r),i.removeEventListener("error",a),i.removeEventListener("abort",a)},r=()=>{e(),n()},a=()=>{t(i.error||new DOMException("AbortError","AbortError")),n()};i.addEventListener("complete",r),i.addEventListener("error",a),i.addEventListener("abort",a)}),m.set(i,t))),p(e,f=f||[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])?new Proxy(e,_):e);var i,t}function I(e){if(e instanceof IDBRequest)return function(i){const e=new Promise((e,t)=>{const n=()=>{i.removeEventListener("success",r),i.removeEventListener("error",a)},r=()=>{e(I(i.result)),n()},a=()=>{t(i.error),n()};i.addEventListener("success",r),i.addEventListener("error",a)});return e.then(e=>{e instanceof IDBCursor&&h.set(e,i)}).catch(()=>{}),w.set(e,i),e}(e);if(b.has(e))return b.get(e);var t=E(e);return t!==e&&(b.set(e,t),w.set(t,e)),t}const T=e=>w.get(e);const S=["get","getKey","getAll","getAllKeys","count"],k=["put","add","delete","clear"],N=new Map;function C(e,t){if(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t){if(N.get(t))return N.get(t);const a=t.replace(/FromIndex$/,""),i=t!==a,o=k.includes(a);if(a in(i?IDBIndex:IDBObjectStore).prototype&&(o||S.includes(a))){var n=async function(e,...t){var n=this.transaction(e,o?"readwrite":"readonly");let r=n.store;return i&&(r=r.index(t.shift())),(await Promise.all([r[a](...t),o&&n.done]))[0]};return N.set(t,n),n}}}_={...r=_,get:(e,t,n)=>C(e,t)||r.get(e,t,n),has:(e,t)=>!!C(e,t)||r.has(e,t)};var R="@firebase/installations",A="0.5.15";const O=1e4,M=`w:${A}`,P="FIS_v2",L="https://firebaseinstallations.googleapis.com/v1",D=36e5;const B=new a("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function j(e){return e instanceof o&&e.code.includes("request-failed")}function $({projectId:e}){return`${L}/projects/${e}/installations`}function U(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}async function F(e,t){var n=(await t.json()).error;return B.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function q({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function H(e,{refreshToken:t}){const n=q(e);return n.append("Authorization",(t=t,`${P} ${t}`)),n}async function x(e){var t=await e();return 500<=t.status&&t.status<600?e():t}function V(t){return new Promise(e=>{setTimeout(e,t)})}const W=/^[cdef][\w-]{21}$/,K="";function z(){try{const t=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(t),t[0]=112+t[0]%16;var e=function(e){const t=function(e){const t=btoa(String.fromCharCode(...e));return t.replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(t);return W.test(e)?e:K}catch(e){return K}}function G(e){return`${e.appName}!${e.appId}`}const J=new Map;function Y(e,t){var n=G(e);Z(n,t),function(e,t){const n=function(){!Q&&"BroadcastChannel"in self&&(Q=new BroadcastChannel("[Firebase] FID Change"),Q.onmessage=e=>{Z(e.data.key,e.data.fid)});return Q}();n&&n.postMessage({key:e,fid:t});0===J.size&&Q&&(Q.close(),Q=null)}(n,t)}function Z(e,t){var n=J.get(e);if(n)for(const r of n)r(t)}let Q=null;const X="firebase-installations-store";let ee=null;function te(){return ee=ee||function(e,t,{blocked:n,upgrade:r,blocking:a,terminated:i}){const o=indexedDB.open(e,t),s=I(o);return r&&o.addEventListener("upgradeneeded",e=>{r(I(o.result),e.oldVersion,e.newVersion,I(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),s.then(e=>{i&&e.addEventListener("close",()=>i()),a&&e.addEventListener("versionchange",()=>a())}).catch(()=>{}),s}("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(X)}}),ee}async function ne(e,t){var n=G(e);const r=await te(),a=r.transaction(X,"readwrite"),i=a.objectStore(X);var o=await i.get(n);return await i.put(t,n),await a.done,o&&o.fid===t.fid||Y(e,t.fid),t}async function re(e){var t=G(e);const n=await te(),r=n.transaction(X,"readwrite");await r.objectStore(X).delete(t),await r.done}async function ae(e,t){var n=G(e);const r=await te(),a=r.transaction(X,"readwrite"),i=a.objectStore(X);var o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await a.done,!s||o&&o.fid===s.fid||Y(e,s.fid),s}async function ie(n){let r;var e=await ae(n.appConfig,e=>{var t=se(e||{fid:z(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:async function(e){let t=await oe(e.appConfig);for(;1===t.registrationStatus;)await V(100),t=await oe(e.appConfig);if(0!==t.registrationStatus)return t;{var{installationEntry:n,registrationPromise:r}=await ie(e);return r||n}}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(B.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(t,n){try{var e=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=$(e),a=q(e),i=t.getImmediate({optional:!0});!i||(o=await i.getHeartbeatsHeader())&&a.append("x-firebase-client",o);var o={fid:n,authVersion:P,appId:e.appId,sdkVersion:M};const s={method:"POST",headers:a,body:JSON.stringify(o)},c=await x(()=>fetch(r,s));if(c.ok){o=await c.json();return{fid:o.fid||n,registrationStatus:2,refreshToken:o.refreshToken,authToken:U(o.authToken)}}throw await F("Create Installation",c)}(t,n);return ne(t.appConfig,e)}catch(e){throw j(e)&&409===e.customData.serverCode?await re(t.appConfig):await ne(t.appConfig,{fid:n.fid,registrationStatus:0}),e}}(e,r);return{installationEntry:r,registrationPromise:n}}}(n,t);return r=t.registrationPromise,t.installationEntry});return e.fid===K?{installationEntry:await r}:{installationEntry:e,registrationPromise:r}}function oe(e){return ae(e,e=>{if(!e)throw B.create("installation-not-found");return se(e)})}function se(e){return 1===(t=e).registrationStatus&&t.registrationTime+O<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function ce({appConfig:e,heartbeatServiceProvider:t},n){const r=([a,i]=[e,n["fid"]],`${$(a)}/${i}/authTokens:generate`);var a,i;const o=H(e,n),s=t.getImmediate({optional:!0});!s||(c=await s.getHeartbeatsHeader())&&o.append("x-firebase-client",c);var c={installation:{sdkVersion:M,appId:e.appId}};const l={method:"POST",headers:o,body:JSON.stringify(c)},u=await x(()=>fetch(r,l));if(u.ok)return U(await u.json());throw await F("Generate Auth Token",u)}async function le(r,a=!1){let i;var e=await ae(r.appConfig,e=>{if(!de(e))throw B.create("not-registered");var t,n=e.authToken;if(a||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+D}(t)){if(1===n.requestStatus)return i=async function(e,t){let n=await ue(e.appConfig);for(;1===n.authToken.requestStatus;)await V(100),n=await ue(e.appConfig);var r=n.authToken;return 0===r.requestStatus?le(e,t):r}(r,a),e;if(!navigator.onLine)throw B.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},t),{authToken:n}));return i=async function(t,n){try{var r=await ce(t,n),e=Object.assign(Object.assign({},n),{authToken:r});return await ne(t.appConfig,e),r}catch(e){throw!j(e)||401!==e.customData.serverCode&&404!==e.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await ne(t.appConfig,r)):await re(t.appConfig),e}}(r,n),n}return e});return i?await i:e.authToken}function ue(e){return ae(e,e=>{if(!de(e))throw B.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+O<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}function de(e){return void 0!==e&&2===e.registrationStatus}async function pe(e,t=!1){var n,r=e;return await((n=(await ie(r)).registrationPromise)&&await n),(await le(r,t)).token}function fe(e){return B.create("missing-app-config-values",{valueName:e})}const ge="installations",he=e=>{var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){if(!e||!e.options)throw fe("App Configuration");if(!e.name)throw fe("App Name");for(const t of["projectId","apiKey","appId"])if(!e.options[t])throw fe(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),heartbeatServiceProvider:Et._getProvider(t,"heartbeat"),_delete:()=>Promise.resolve()}},me=e=>{var t=e.getProvider("app").getImmediate();const n=Et._getProvider(t,ge).getImmediate();return{getId:()=>async function(e){var t=e;const{installationEntry:n,registrationPromise:r}=await ie(t);return(r||le(t)).catch(console.error),n.fid}(n),getToken:e=>pe(n,e)}};Et._registerComponent(new i(ge,he,"PUBLIC")),Et._registerComponent(new i("installations-internal",me,"PRIVATE")),Et.registerVersion(R,A),Et.registerVersion(R,A,"esm2017");const ve="@firebase/performance",be="0.5.15",we=be,_e="FB-PERF-TRACE-MEASURE",ye="@firebase/performance/config",Ee="@firebase/performance/configexpire";var Ie,Te,Se,A="Performance";const ke=new a("performance",A,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."}),Ne=new class{constructor(e){this.name=e,this._logLevel=l,this._logHandler=d,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?c[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}(A);Ne.logLevel=t.INFO;let Ce,Re;class Ae{constructor(e){if(!(this.window=e))throw ke.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){this.performance&&this.performance.mark&&this.performance.mark(e)}measure(e,t,n){this.performance&&this.performance.measure&&this.performance.measure(e,t,n)}getEntriesByType(e){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(e):[]}getEntriesByName(e){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(e):[]}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(Ne.info("IndexedDB is not supported by current browswer"),!1):(Ne.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)}setupObserver(e,n){if(this.PerformanceObserver){const t=new this.PerformanceObserver(e=>{for(const t of e.getEntries())n(t)});t.observe({entryTypes:[e]})}}static getInstance(){return void 0===Ce&&(Ce=new Ae(Re)),Ce}}let Oe;function Me(e,t){var n=e.length-t.length;if(n<0||1<n)throw ke.create("invalid String merger input");const r=[];for(let a=0;a<e.length;a++)r.push(e.charAt(a)),t.length>a&&r.push(t.charAt(a));return r.join("")}let Pe;class Le{constructor(){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=Me("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Me("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return void 0===Pe&&(Pe=new Le),Pe}}(Te=Ie=Ie||{})[Te.UNKNOWN=0]="UNKNOWN",Te[Te.VISIBLE=1]="VISIBLE",Te[Te.HIDDEN=2]="HIDDEN";const De=["firebase_","google_","ga_"],Be=new RegExp("^[a-zA-Z]\\w*$");function je(){switch(Ae.getInstance().document.visibilityState){case"visible":return Ie.VISIBLE;case"hidden":return Ie.HIDDEN;default:return Ie.UNKNOWN}}function $e(e){var t=null===(t=e.options)||void 0===t?void 0:t.appId;if(!t)throw ke.create("no app id");return t}const Ue="0.0.1",Fe={loggingEnabled:!0},qe="FIREBASE_INSTALLATIONS_AUTH";function He(e,t){var r,a,n=function(){const e=Ae.getInstance().localStorage;if(e){var t=e.getItem(Ee);if(t&&function(e){return Number(e)>Date.now()}(t)){t=e.getItem(ye);if(t)try{return JSON.parse(t)}catch(e){return}}}}();return n?(Ve(n),Promise.resolve()):(a=t,function(e){const t=e.getToken();return t.then(e=>{}),t}((r=e).installations).then(e=>{var t=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.projectId;if(!t)throw ke.create("no project id");return t}(r.app),n=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.apiKey;if(!t)throw ke.create("no api key");return t}(r.app),n=new Request(`https://firebaseremoteconfig.googleapis.com/v1/projects/${t}/namespaces/fireperf:fetch?key=${n}`,{method:"POST",headers:{Authorization:`${qe} ${e}`},body:JSON.stringify({app_instance_id:a,app_instance_id_token:e,app_id:$e(r.app),app_version:we,sdk_version:Ue})});return fetch(n).then(e=>{if(e.ok)return e.json();throw ke.create("RC response not ok")})}).catch(()=>{Ne.info(xe)}).then(Ve).then(e=>function(e){const t=Ae.getInstance().localStorage;e&&t&&(t.setItem(ye,JSON.stringify(e)),t.setItem(Ee,String(Date.now()+60*Le.getInstance().configTimeToLive*60*1e3)))}(e),()=>{}))}const xe="Could not fetch config, will use default configs";function Ve(e){if(!e)return e;const t=Le.getInstance();var n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=Fe.loggingEnabled,n.fpr_log_source?t.logSource=Number(n.fpr_log_source):Fe.logSource&&(t.logSource=Fe.logSource),n.fpr_log_endpoint_url?t.logEndPointUrl=n.fpr_log_endpoint_url:Fe.logEndPointUrl&&(t.logEndPointUrl=Fe.logEndPointUrl),n.fpr_log_transport_key?t.transportKey=n.fpr_log_transport_key:Fe.transportKey&&(t.transportKey=Fe.transportKey),void 0!==n.fpr_vc_network_request_sampling_rate?t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate):void 0!==Fe.networkRequestsSamplingRate&&(t.networkRequestsSamplingRate=Fe.networkRequestsSamplingRate),void 0!==n.fpr_vc_trace_sampling_rate?t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate):void 0!==Fe.tracesSamplingRate&&(t.tracesSamplingRate=Fe.tracesSamplingRate),t.logTraceAfterSampling=We(t.tracesSamplingRate),t.logNetworkAfterSampling=We(t.networkRequestsSamplingRate),e}function We(e){return Math.random()<=e}let Ke=1,ze;function Ge(e){var t;return Ke=2,ze=ze||(t=e,function(){const n=Ae.getInstance().document;return new Promise(e=>{if(n&&"complete"!==n.readyState){const t=()=>{"complete"===n.readyState&&(n.removeEventListener("readystatechange",t),e())};n.addEventListener("readystatechange",t)}else e()})}().then(()=>function(e){const t=e.getId();return t.then(e=>{Oe=e}),t}(t.installations)).then(e=>He(t,e)).then(()=>Je(),()=>Je())),ze}function Je(){Ke=3}const Ye=1e4,Ze=3,Qe=1e3;let Xe=Ze,et=[],tt=!1;function nt(e){setTimeout(()=>{if(0!==Xe)return et.length?void function(){const e=et.splice(0,Qe),t=e.map(e=>({source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:Le.getInstance().logSource,log_event:t};!function(e,r){return function(e){var t=Le.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then(e=>(e.ok||Ne.info("Call to Firebase backend failed."),e.json())).then(e=>{var t=Number(e.nextRequestWaitMillis);let n=Ye;isNaN(t)||(n=Math.max(t,n));t=e.logResponseDetails;Array.isArray(t)&&0<t.length&&"RETRY_REQUEST_LATER"===t[0].responseAction&&(et=[...r,...et],Ne.info("Retry transport request later.")),Xe=Ze,nt(n)})}(n,e).catch(()=>{et=[...e,...et],Xe--,Ne.info(`Tries left: ${Xe}.`),nt(Ye)})}():nt(Ye)},e)}function rt(t){return(...e)=>{!function(e){if(!e.eventTime||!e.message)throw ke.create("invalid cc log");et=[...et,e]}({message:t(...e),eventTime:Date.now()})}}let at;function it(e,t){at=at||rt(ct),at(e,t)}function ot(e){var t=Le.getInstance();!t.instrumentationEnabled&&e.isAuto||(t.dataCollectionEnabled||e.isAuto)&&Ae.getInstance().requiredApisAvailable()&&(e.isAuto&&je()!==Ie.VISIBLE||(3===Ke?st(e):Ge(e.performanceController).then(()=>st(e),()=>st(e))))}function st(e){var t;!Oe||(t=Le.getInstance()).loggingEnabled&&t.logTraceAfterSampling&&setTimeout(()=>it(e,1),0)}function ct(e,t){return 0===t?(n={url:e.url,http_method:e.httpMethod||0,http_response_code:200,response_payload_bytes:e.responsePayloadBytes,client_start_time_us:e.startTimeUs,time_to_response_initiated_us:e.timeToResponseInitiatedUs,time_to_response_completed_us:e.timeToResponseCompletedUs},n={application_info:lt(e.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(e){const t={name:e.name,is_auto:e.isAuto,client_start_time_us:e.startTimeUs,duration_us:e.durationUs};0!==Object.keys(e.counters).length&&(t.counters=e.counters);var n=e.getAttributes();0!==Object.keys(n).length&&(t.custom_attributes=n);n={application_info:lt(e.performanceController.app),trace_metric:t};return JSON.stringify(n)}(e);var n}function lt(e){return{google_app_id:$e(e),app_instance_id:Oe,web_app_info:{sdk_version:we,page_url:Ae.getInstance().getUrl(),service_worker_status:"serviceWorker"in(t=Ae.getInstance().navigator)?t.serviceWorker.controller?2:3:1,visibility_state:je(),effective_connection_type:function(){var e=Ae.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}()},application_process_state:0};var t}const ut=["_fp","_fcp","_fid"];class dt{constructor(e,t,n=!1,r){this.performanceController=e,this.name=t,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Ae.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark=`FB-PERF-TRACE-START-${this.randomId}-${this.name}`,this.traceStopMark=`FB-PERF-TRACE-STOP-${this.randomId}-${this.name}`,this.traceMeasure=r||`${_e}-${this.randomId}-${this.name}`,r&&this.calculateTraceMetrics())}start(){if(1!==this.state)throw ke.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(2!==this.state)throw ke.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),ot(this)}record(e,t,n){if(e<=0)throw ke.create("nonpositive trace startTime",{traceName:this.name});if(t<=0)throw ke.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*t),this.startTimeUs=Math.floor(1e3*e),n&&n.attributes&&(this.customAttributes=Object.assign({},n.attributes)),n&&n.metrics)for(const r of Object.keys(n.metrics))isNaN(Number(n.metrics[r]))||(this.counters[r]=Math.floor(Number(n.metrics[r])));ot(this)}incrementMetric(e,t=1){void 0===this.counters[e]?this.putMetric(e,t):this.putMetric(e,this.counters[e]+t)}putMetric(e,t){if(r=e,a=this.name,0===r.length||100<r.length||!(a&&a.startsWith("_wt_")&&-1<ut.indexOf(r))&&r.startsWith("_"))throw ke.create("invalid custom metric name",{customMetricName:e});var n,r,a;this.counters[e]=(t=null!=t?t:0,(n=Math.floor(t))<t&&Ne.info(`Metric value should be an Integer, setting the value as : ${n}.`),n)}getMetric(e){return this.counters[e]||0}putAttribute(e,t){var n,r,a=!(0===(n=e).length||40<n.length)&&(!De.some(e=>n.startsWith(e))&&!!n.match(Be)),i=0!==(r=t).length&&r.length<=100;if(a&&i)this.customAttributes[e]=t;else{if(!a)throw ke.create("invalid attribute name",{attributeName:e});if(!i)throw ke.create("invalid attribute value",{attributeValue:t})}}getAttribute(e){return this.customAttributes[e]}removeAttribute(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(e){this.startTimeUs=e}setDuration(e){this.durationUs=e}calculateTraceMetrics(){var e=this.api.getEntriesByName(this.traceMeasure),e=e&&e[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))}static createOobTrace(e,t,n,r){var a=Ae.getInstance().getUrl();if(a){const i=new dt(e,"_wt_"+a,!0);a=Math.floor(1e3*Ae.getInstance().getTimeOrigin());i.setStartTime(a),t&&t[0]&&(i.setDuration(Math.floor(1e3*t[0].duration)),i.putMetric("domInteractive",Math.floor(1e3*t[0].domInteractive)),i.putMetric("domContentLoadedEventEnd",Math.floor(1e3*t[0].domContentLoadedEventEnd)),i.putMetric("loadEventEnd",Math.floor(1e3*t[0].loadEventEnd)));n&&((a=n.find(e=>"first-paint"===e.name))&&a.startTime&&i.putMetric("_fp",Math.floor(1e3*a.startTime)),(a=n.find(e=>"first-contentful-paint"===e.name))&&a.startTime&&i.putMetric("_fcp",Math.floor(1e3*a.startTime)),r&&i.putMetric("_fid",Math.floor(1e3*r))),ot(i)}}static createUserTimingTrace(e,t){ot(new dt(e,t,!1,t))}}function pt(e,t){const n=t;var r,a,i;n&&void 0!==n.responseStart&&(i=Ae.getInstance().getTimeOrigin(),r=Math.floor(1e3*(n.startTime+i)),a=n.responseStart?Math.floor(1e3*(n.responseStart-n.startTime)):void 0,i=Math.floor(1e3*(n.responseEnd-n.startTime)),function(e){const t=Le.getInstance();var n,r,a;t.instrumentationEnabled&&(n=e.url,r=t.logEndPointUrl.split("?")[0],a=t.flTransportEndpointUrl.split("?")[0],n!==r&&n!==a&&t.loggingEnabled&&t.logNetworkAfterSampling&&setTimeout(()=>it(e,0),0))}({performanceController:e,url:n.name&&n.name.split("?")[0],responsePayloadBytes:n.transferSize,startTimeUs:r,timeToResponseInitiatedUs:a,timeToResponseCompletedUs:i}))}const ft=5e3;function gt(e){Oe&&(setTimeout(()=>function(n){const e=Ae.getInstance(),r=e.getEntriesByType("navigation"),a=e.getEntriesByType("paint");if(e.onFirstInputDelay){let t=setTimeout(()=>{dt.createOobTrace(n,r,a),t=void 0},ft);e.onFirstInputDelay(e=>{t&&(clearTimeout(t),dt.createOobTrace(n,r,a,e))})}else dt.createOobTrace(n,r,a)}(e),0),setTimeout(()=>function(t){const e=Ae.getInstance(),n=e.getEntriesByType("resource");for(const r of n)pt(t,r);e.setupObserver("resource",e=>pt(t,e))}(e),0),setTimeout(()=>function(t){const e=Ae.getInstance(),n=e.getEntriesByType("measure");for(const r of n)ht(t,r);e.setupObserver("measure",e=>ht(t,e))}(e),0))}function ht(e,t){const n=t.name;n.substring(0,_e.length)!==_e&&dt.createUserTimingTrace(e,n)}class mt{constructor(e,t){this.app=e,this.installations=t,this.initialized=!1}_init(e){this.initialized||(void 0!==(null==e?void 0:e.dataCollectionEnabled)&&(this.dataCollectionEnabled=e.dataCollectionEnabled),void 0!==(null==e?void 0:e.instrumentationEnabled)&&(this.instrumentationEnabled=e.instrumentationEnabled),Ae.getInstance().requiredApisAvailable()?new Promise((t,n)=>{try{let e=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),e||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{e=!1},a.onerror=()=>{var e;n((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(e){n(e)}}).then(e=>{e&&(tt||(nt(5500),tt=!0),Ge(this).then(()=>gt(this),()=>gt(this)),this.initialized=!0)}).catch(e=>{Ne.info(`Environment doesn't support IndexedDB: ${e}`)}):Ne.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(e){Le.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return Le.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){Le.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return Le.getInstance().dataCollectionEnabled}}const vt="[DEFAULT]";const bt=(e,{options:t})=>{var n=e.getProvider("app").getImmediate(),r=e.getProvider("installations-internal").getImmediate();if(n.name!==vt)throw ke.create("FB not default");if("undefined"==typeof window)throw ke.create("no window");e=window,Re=e;const a=new mt(n,r);return a._init(t),a};Et._registerComponent(new i("performance",bt,"PUBLIC")),Et.registerVersion(ve,be),Et.registerVersion(ve,be,"esm2017");class wt{constructor(e,t){this.app=e,this._delegate=t}get instrumentationEnabled(){return this._delegate.instrumentationEnabled}set instrumentationEnabled(e){this._delegate.instrumentationEnabled=e}get dataCollectionEnabled(){return this._delegate.dataCollectionEnabled}set dataCollectionEnabled(e){this._delegate.dataCollectionEnabled=e}trace(e){return t=this._delegate,n=e,t=(e=t)&&e._delegate?e._delegate:e,new dt(t,n);var t,n}}function _t(e){var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("performance").getImmediate();return new wt(t,n)}(Se=n.default).INTERNAL.registerComponent(new i("performance-compat",_t,"PUBLIC")),Se.registerVersion("@firebase/performance-compat","0.1.15")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-performance-compat.js - be sure to load firebase-app.js first.")}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(yt,Et){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,n=e(yt);class o extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,o.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,a.prototype.create)}}class a{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var r,n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],i=i?(r=n,i.replace(s,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new o(a,i,n)}}const s=/\{\$([^}]+)}/g;class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}(Te=t=t||{})[Te.DEBUG=0]="DEBUG",Te[Te.VERBOSE=1]="VERBOSE",Te[Te.INFO=2]="INFO",Te[Te.WARN=3]="WARN",Te[Te.ERROR=4]="ERROR",Te[Te.SILENT=5]="SILENT";const c={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},l=t.INFO,u={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},d=(e,t,...n)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),a=u[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${r}] ${e.name}:`,...n)}};const p=(t,e)=>e.some(e=>t instanceof e);let f,g;const h=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap;let _={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return m.get(e);if("objectStoreNames"===t)return e.objectStoreNames||v.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return I(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function y(r){return r!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(g=g||[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]).includes(r)?function(...e){return r.apply(T(this),e),I(h.get(this))}:function(...e){return I(r.apply(T(this),e))}:function(e,...t){var n=r.call(T(this),e,...t);return v.set(n,e.sort?e.sort():[e]),I(n)}}function E(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&(i=e,m.has(i)||(t=new Promise((e,t)=>{const n=()=>{i.removeEventListener("complete",r),i.removeEventListener("error",a),i.removeEventListener("abort",a)},r=()=>{e(),n()},a=()=>{t(i.error||new DOMException("AbortError","AbortError")),n()};i.addEventListener("complete",r),i.addEventListener("error",a),i.addEventListener("abort",a)}),m.set(i,t))),p(e,f=f||[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])?new Proxy(e,_):e);var i,t}function I(e){if(e instanceof IDBRequest)return function(i){const e=new Promise((e,t)=>{const n=()=>{i.removeEventListener("success",r),i.removeEventListener("error",a)},r=()=>{e(I(i.result)),n()},a=()=>{t(i.error),n()};i.addEventListener("success",r),i.addEventListener("error",a)});return e.then(e=>{e instanceof IDBCursor&&h.set(e,i)}).catch(()=>{}),w.set(e,i),e}(e);if(b.has(e))return b.get(e);var t=E(e);return t!==e&&(b.set(e,t),w.set(t,e)),t}const T=e=>w.get(e);const S=["get","getKey","getAll","getAllKeys","count"],k=["put","add","delete","clear"],N=new Map;function C(e,t){if(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t){if(N.get(t))return N.get(t);const a=t.replace(/FromIndex$/,""),i=t!==a,o=k.includes(a);if(a in(i?IDBIndex:IDBObjectStore).prototype&&(o||S.includes(a))){var n=async function(e,...t){var n=this.transaction(e,o?"readwrite":"readonly");let r=n.store;return i&&(r=r.index(t.shift())),(await Promise.all([r[a](...t),o&&n.done]))[0]};return N.set(t,n),n}}}_={...r=_,get:(e,t,n)=>C(e,t)||r.get(e,t,n),has:(e,t)=>!!C(e,t)||r.has(e,t)};var R="@firebase/installations",A="0.5.16";const O=1e4,M=`w:${A}`,P="FIS_v2",L="https://firebaseinstallations.googleapis.com/v1",D=36e5;const B=new a("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function j(e){return e instanceof o&&e.code.includes("request-failed")}function $({projectId:e}){return`${L}/projects/${e}/installations`}function U(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}async function F(e,t){var n=(await t.json()).error;return B.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function q({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function H(e,{refreshToken:t}){const n=q(e);return n.append("Authorization",(t=t,`${P} ${t}`)),n}async function x(e){var t=await e();return 500<=t.status&&t.status<600?e():t}function V(t){return new Promise(e=>{setTimeout(e,t)})}const W=/^[cdef][\w-]{21}$/,K="";function z(){try{const t=new Uint8Array(17),n=self.crypto||self.msCrypto;n.getRandomValues(t),t[0]=112+t[0]%16;var e=function(e){const t=function(e){const t=btoa(String.fromCharCode(...e));return t.replace(/\+/g,"-").replace(/\//g,"_")}(e);return t.substr(0,22)}(t);return W.test(e)?e:K}catch(e){return K}}function G(e){return`${e.appName}!${e.appId}`}const J=new Map;function Y(e,t){var n=G(e);Z(n,t),function(e,t){const n=function(){!Q&&"BroadcastChannel"in self&&(Q=new BroadcastChannel("[Firebase] FID Change"),Q.onmessage=e=>{Z(e.data.key,e.data.fid)});return Q}();n&&n.postMessage({key:e,fid:t});0===J.size&&Q&&(Q.close(),Q=null)}(n,t)}function Z(e,t){var n=J.get(e);if(n)for(const r of n)r(t)}let Q=null;const X="firebase-installations-store";let ee=null;function te(){return ee=ee||function(e,t,{blocked:n,upgrade:r,blocking:a,terminated:i}){const o=indexedDB.open(e,t),s=I(o);return r&&o.addEventListener("upgradeneeded",e=>{r(I(o.result),e.oldVersion,e.newVersion,I(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),s.then(e=>{i&&e.addEventListener("close",()=>i()),a&&e.addEventListener("versionchange",()=>a())}).catch(()=>{}),s}("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(X)}}),ee}async function ne(e,t){var n=G(e);const r=await te(),a=r.transaction(X,"readwrite"),i=a.objectStore(X);var o=await i.get(n);return await i.put(t,n),await a.done,o&&o.fid===t.fid||Y(e,t.fid),t}async function re(e){var t=G(e);const n=await te(),r=n.transaction(X,"readwrite");await r.objectStore(X).delete(t),await r.done}async function ae(e,t){var n=G(e);const r=await te(),a=r.transaction(X,"readwrite"),i=a.objectStore(X);var o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await a.done,!s||o&&o.fid===s.fid||Y(e,s.fid),s}async function ie(n){let r;var e=await ae(n.appConfig,e=>{var t=se(e||{fid:z(),registrationStatus:0}),t=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:async function(e){let t=await oe(e.appConfig);for(;1===t.registrationStatus;)await V(100),t=await oe(e.appConfig);if(0!==t.registrationStatus)return t;{var{installationEntry:n,registrationPromise:r}=await ie(e);return r||n}}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(B.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},n=async function(t,n){try{var e=await async function({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=$(e),a=q(e),i=t.getImmediate({optional:!0});!i||(o=await i.getHeartbeatsHeader())&&a.append("x-firebase-client",o);var o={fid:n,authVersion:P,appId:e.appId,sdkVersion:M};const s={method:"POST",headers:a,body:JSON.stringify(o)},c=await x(()=>fetch(r,s));if(c.ok){o=await c.json();return{fid:o.fid||n,registrationStatus:2,refreshToken:o.refreshToken,authToken:U(o.authToken)}}throw await F("Create Installation",c)}(t,n);return ne(t.appConfig,e)}catch(e){throw j(e)&&409===e.customData.serverCode?await re(t.appConfig):await ne(t.appConfig,{fid:n.fid,registrationStatus:0}),e}}(e,r);return{installationEntry:r,registrationPromise:n}}}(n,t);return r=t.registrationPromise,t.installationEntry});return e.fid===K?{installationEntry:await r}:{installationEntry:e,registrationPromise:r}}function oe(e){return ae(e,e=>{if(!e)throw B.create("installation-not-found");return se(e)})}function se(e){return 1===(t=e).registrationStatus&&t.registrationTime+O<Date.now()?{fid:e.fid,registrationStatus:0}:e;var t}async function ce({appConfig:e,heartbeatServiceProvider:t},n){const r=([a,i]=[e,n["fid"]],`${$(a)}/${i}/authTokens:generate`);var a,i;const o=H(e,n),s=t.getImmediate({optional:!0});!s||(c=await s.getHeartbeatsHeader())&&o.append("x-firebase-client",c);var c={installation:{sdkVersion:M,appId:e.appId}};const l={method:"POST",headers:o,body:JSON.stringify(c)},u=await x(()=>fetch(r,l));if(u.ok)return U(await u.json());throw await F("Generate Auth Token",u)}async function le(r,a=!1){let i;var e=await ae(r.appConfig,e=>{if(!de(e))throw B.create("not-registered");var t,n=e.authToken;if(a||2!==(t=n).requestStatus||function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+D}(t)){if(1===n.requestStatus)return i=async function(e,t){let n=await ue(e.appConfig);for(;1===n.authToken.requestStatus;)await V(100),n=await ue(e.appConfig);var r=n.authToken;return 0===r.requestStatus?le(e,t):r}(r,a),e;if(!navigator.onLine)throw B.create("app-offline");n=(t=e,n={requestStatus:1,requestTime:Date.now()},Object.assign(Object.assign({},t),{authToken:n}));return i=async function(t,n){try{var r=await ce(t,n),e=Object.assign(Object.assign({},n),{authToken:r});return await ne(t.appConfig,e),r}catch(e){throw!j(e)||401!==e.customData.serverCode&&404!==e.customData.serverCode?(r=Object.assign(Object.assign({},n),{authToken:{requestStatus:0}}),await ne(t.appConfig,r)):await re(t.appConfig),e}}(r,n),n}return e});return i?await i:e.authToken}function ue(e){return ae(e,e=>{if(!de(e))throw B.create("not-registered");var t,n=e.authToken;return 1===(t=n).requestStatus&&t.requestTime+O<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}function de(e){return void 0!==e&&2===e.registrationStatus}async function pe(e,t=!1){var n,r=e;return await((n=(await ie(r)).registrationPromise)&&await n),(await le(r,t)).token}function fe(e){return B.create("missing-app-config-values",{valueName:e})}const ge="installations",he=e=>{var t=e.getProvider("app").getImmediate();return{app:t,appConfig:function(e){if(!e||!e.options)throw fe("App Configuration");if(!e.name)throw fe("App Name");for(const t of["projectId","apiKey","appId"])if(!e.options[t])throw fe(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),heartbeatServiceProvider:Et._getProvider(t,"heartbeat"),_delete:()=>Promise.resolve()}},me=e=>{var t=e.getProvider("app").getImmediate();const n=Et._getProvider(t,ge).getImmediate();return{getId:()=>async function(e){var t=e;const{installationEntry:n,registrationPromise:r}=await ie(t);return(r||le(t)).catch(console.error),n.fid}(n),getToken:e=>pe(n,e)}};Et._registerComponent(new i(ge,he,"PUBLIC")),Et._registerComponent(new i("installations-internal",me,"PRIVATE")),Et.registerVersion(R,A),Et.registerVersion(R,A,"esm2017");const ve="@firebase/performance",be="0.5.16",we=be,_e="FB-PERF-TRACE-MEASURE",ye="@firebase/performance/config",Ee="@firebase/performance/configexpire";var Ie,Te,Se,A="Performance";const ke=new a("performance",A,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."}),Ne=new class{constructor(e){this.name=e,this._logLevel=l,this._logHandler=d,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?c[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}(A);Ne.logLevel=t.INFO;let Ce,Re;class Ae{constructor(e){if(!(this.window=e))throw ke.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.navigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay)}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){this.performance&&this.performance.mark&&this.performance.mark(e)}measure(e,t,n){this.performance&&this.performance.measure&&this.performance.measure(e,t,n)}getEntriesByType(e){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(e):[]}getEntriesByName(e){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(e):[]}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return fetch&&Promise&&"undefined"!=typeof navigator&&navigator.cookieEnabled?"object"==typeof indexedDB||(Ne.info("IndexedDB is not supported by current browswer"),!1):(Ne.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)}setupObserver(e,n){if(this.PerformanceObserver){const t=new this.PerformanceObserver(e=>{for(const t of e.getEntries())n(t)});t.observe({entryTypes:[e]})}}static getInstance(){return void 0===Ce&&(Ce=new Ae(Re)),Ce}}let Oe;function Me(e,t){var n=e.length-t.length;if(n<0||1<n)throw ke.create("invalid String merger input");const r=[];for(let a=0;a<e.length;a++)r.push(e.charAt(a)),t.length>a&&r.push(t.charAt(a));return r.join("")}let Pe;class Le{constructor(){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=Me("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Me("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return void 0===Pe&&(Pe=new Le),Pe}}(Te=Ie=Ie||{})[Te.UNKNOWN=0]="UNKNOWN",Te[Te.VISIBLE=1]="VISIBLE",Te[Te.HIDDEN=2]="HIDDEN";const De=["firebase_","google_","ga_"],Be=new RegExp("^[a-zA-Z]\\w*$");function je(){switch(Ae.getInstance().document.visibilityState){case"visible":return Ie.VISIBLE;case"hidden":return Ie.HIDDEN;default:return Ie.UNKNOWN}}function $e(e){var t=null===(t=e.options)||void 0===t?void 0:t.appId;if(!t)throw ke.create("no app id");return t}const Ue="0.0.1",Fe={loggingEnabled:!0},qe="FIREBASE_INSTALLATIONS_AUTH";function He(e,t){var r,a,n=function(){const e=Ae.getInstance().localStorage;if(e){var t=e.getItem(Ee);if(t&&function(e){return Number(e)>Date.now()}(t)){t=e.getItem(ye);if(t)try{return JSON.parse(t)}catch(e){return}}}}();return n?(Ve(n),Promise.resolve()):(a=t,function(e){const t=e.getToken();return t.then(e=>{}),t}((r=e).installations).then(e=>{var t=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.projectId;if(!t)throw ke.create("no project id");return t}(r.app),n=function(e){var t=null===(t=e.options)||void 0===t?void 0:t.apiKey;if(!t)throw ke.create("no api key");return t}(r.app),n=new Request(`https://firebaseremoteconfig.googleapis.com/v1/projects/${t}/namespaces/fireperf:fetch?key=${n}`,{method:"POST",headers:{Authorization:`${qe} ${e}`},body:JSON.stringify({app_instance_id:a,app_instance_id_token:e,app_id:$e(r.app),app_version:we,sdk_version:Ue})});return fetch(n).then(e=>{if(e.ok)return e.json();throw ke.create("RC response not ok")})}).catch(()=>{Ne.info(xe)}).then(Ve).then(e=>function(e){const t=Ae.getInstance().localStorage;e&&t&&(t.setItem(ye,JSON.stringify(e)),t.setItem(Ee,String(Date.now()+60*Le.getInstance().configTimeToLive*60*1e3)))}(e),()=>{}))}const xe="Could not fetch config, will use default configs";function Ve(e){if(!e)return e;const t=Le.getInstance();var n=e.entries||{};return void 0!==n.fpr_enabled?t.loggingEnabled="true"===String(n.fpr_enabled):t.loggingEnabled=Fe.loggingEnabled,n.fpr_log_source?t.logSource=Number(n.fpr_log_source):Fe.logSource&&(t.logSource=Fe.logSource),n.fpr_log_endpoint_url?t.logEndPointUrl=n.fpr_log_endpoint_url:Fe.logEndPointUrl&&(t.logEndPointUrl=Fe.logEndPointUrl),n.fpr_log_transport_key?t.transportKey=n.fpr_log_transport_key:Fe.transportKey&&(t.transportKey=Fe.transportKey),void 0!==n.fpr_vc_network_request_sampling_rate?t.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate):void 0!==Fe.networkRequestsSamplingRate&&(t.networkRequestsSamplingRate=Fe.networkRequestsSamplingRate),void 0!==n.fpr_vc_trace_sampling_rate?t.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate):void 0!==Fe.tracesSamplingRate&&(t.tracesSamplingRate=Fe.tracesSamplingRate),t.logTraceAfterSampling=We(t.tracesSamplingRate),t.logNetworkAfterSampling=We(t.networkRequestsSamplingRate),e}function We(e){return Math.random()<=e}let Ke=1,ze;function Ge(e){var t;return Ke=2,ze=ze||(t=e,function(){const n=Ae.getInstance().document;return new Promise(e=>{if(n&&"complete"!==n.readyState){const t=()=>{"complete"===n.readyState&&(n.removeEventListener("readystatechange",t),e())};n.addEventListener("readystatechange",t)}else e()})}().then(()=>function(e){const t=e.getId();return t.then(e=>{Oe=e}),t}(t.installations)).then(e=>He(t,e)).then(()=>Je(),()=>Je())),ze}function Je(){Ke=3}const Ye=1e4,Ze=3,Qe=1e3;let Xe=Ze,et=[],tt=!1;function nt(e){setTimeout(()=>{if(0!==Xe)return et.length?void function(){const e=et.splice(0,Qe),t=e.map(e=>({source_extension_json_proto3:e.message,event_time_ms:String(e.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:Le.getInstance().logSource,log_event:t};!function(e,r){return function(e){var t=Le.getInstance().getFlTransportFullUrl();return fetch(t,{method:"POST",body:JSON.stringify(e)})}(e).then(e=>(e.ok||Ne.info("Call to Firebase backend failed."),e.json())).then(e=>{var t=Number(e.nextRequestWaitMillis);let n=Ye;isNaN(t)||(n=Math.max(t,n));t=e.logResponseDetails;Array.isArray(t)&&0<t.length&&"RETRY_REQUEST_LATER"===t[0].responseAction&&(et=[...r,...et],Ne.info("Retry transport request later.")),Xe=Ze,nt(n)})}(n,e).catch(()=>{et=[...e,...et],Xe--,Ne.info(`Tries left: ${Xe}.`),nt(Ye)})}():nt(Ye)},e)}function rt(t){return(...e)=>{!function(e){if(!e.eventTime||!e.message)throw ke.create("invalid cc log");et=[...et,e]}({message:t(...e),eventTime:Date.now()})}}let at;function it(e,t){at=at||rt(ct),at(e,t)}function ot(e){var t=Le.getInstance();!t.instrumentationEnabled&&e.isAuto||(t.dataCollectionEnabled||e.isAuto)&&Ae.getInstance().requiredApisAvailable()&&(e.isAuto&&je()!==Ie.VISIBLE||(3===Ke?st(e):Ge(e.performanceController).then(()=>st(e),()=>st(e))))}function st(e){var t;!Oe||(t=Le.getInstance()).loggingEnabled&&t.logTraceAfterSampling&&setTimeout(()=>it(e,1),0)}function ct(e,t){return 0===t?(n={url:e.url,http_method:e.httpMethod||0,http_response_code:200,response_payload_bytes:e.responsePayloadBytes,client_start_time_us:e.startTimeUs,time_to_response_initiated_us:e.timeToResponseInitiatedUs,time_to_response_completed_us:e.timeToResponseCompletedUs},n={application_info:lt(e.performanceController.app),network_request_metric:n},JSON.stringify(n)):function(e){const t={name:e.name,is_auto:e.isAuto,client_start_time_us:e.startTimeUs,duration_us:e.durationUs};0!==Object.keys(e.counters).length&&(t.counters=e.counters);var n=e.getAttributes();0!==Object.keys(n).length&&(t.custom_attributes=n);n={application_info:lt(e.performanceController.app),trace_metric:t};return JSON.stringify(n)}(e);var n}function lt(e){return{google_app_id:$e(e),app_instance_id:Oe,web_app_info:{sdk_version:we,page_url:Ae.getInstance().getUrl(),service_worker_status:"serviceWorker"in(t=Ae.getInstance().navigator)?t.serviceWorker.controller?2:3:1,visibility_state:je(),effective_connection_type:function(){var e=Ae.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}()},application_process_state:0};var t}const ut=["_fp","_fcp","_fid"];class dt{constructor(e,t,n=!1,r){this.performanceController=e,this.name=t,this.isAuto=n,this.state=1,this.customAttributes={},this.counters={},this.api=Ae.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark=`FB-PERF-TRACE-START-${this.randomId}-${this.name}`,this.traceStopMark=`FB-PERF-TRACE-STOP-${this.randomId}-${this.name}`,this.traceMeasure=r||`${_e}-${this.randomId}-${this.name}`,r&&this.calculateTraceMetrics())}start(){if(1!==this.state)throw ke.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(2!==this.state)throw ke.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),ot(this)}record(e,t,n){if(e<=0)throw ke.create("nonpositive trace startTime",{traceName:this.name});if(t<=0)throw ke.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*t),this.startTimeUs=Math.floor(1e3*e),n&&n.attributes&&(this.customAttributes=Object.assign({},n.attributes)),n&&n.metrics)for(const r of Object.keys(n.metrics))isNaN(Number(n.metrics[r]))||(this.counters[r]=Math.floor(Number(n.metrics[r])));ot(this)}incrementMetric(e,t=1){void 0===this.counters[e]?this.putMetric(e,t):this.putMetric(e,this.counters[e]+t)}putMetric(e,t){if(r=e,a=this.name,0===r.length||100<r.length||!(a&&a.startsWith("_wt_")&&-1<ut.indexOf(r))&&r.startsWith("_"))throw ke.create("invalid custom metric name",{customMetricName:e});var n,r,a;this.counters[e]=(t=null!=t?t:0,(n=Math.floor(t))<t&&Ne.info(`Metric value should be an Integer, setting the value as : ${n}.`),n)}getMetric(e){return this.counters[e]||0}putAttribute(e,t){var n,r,a=!(0===(n=e).length||40<n.length)&&(!De.some(e=>n.startsWith(e))&&!!n.match(Be)),i=0!==(r=t).length&&r.length<=100;if(a&&i)this.customAttributes[e]=t;else{if(!a)throw ke.create("invalid attribute name",{attributeName:e});if(!i)throw ke.create("invalid attribute value",{attributeValue:t})}}getAttribute(e){return this.customAttributes[e]}removeAttribute(e){void 0!==this.customAttributes[e]&&delete this.customAttributes[e]}getAttributes(){return Object.assign({},this.customAttributes)}setStartTime(e){this.startTimeUs=e}setDuration(e){this.durationUs=e}calculateTraceMetrics(){var e=this.api.getEntriesByName(this.traceMeasure),e=e&&e[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))}static createOobTrace(e,t,n,r){var a=Ae.getInstance().getUrl();if(a){const i=new dt(e,"_wt_"+a,!0);a=Math.floor(1e3*Ae.getInstance().getTimeOrigin());i.setStartTime(a),t&&t[0]&&(i.setDuration(Math.floor(1e3*t[0].duration)),i.putMetric("domInteractive",Math.floor(1e3*t[0].domInteractive)),i.putMetric("domContentLoadedEventEnd",Math.floor(1e3*t[0].domContentLoadedEventEnd)),i.putMetric("loadEventEnd",Math.floor(1e3*t[0].loadEventEnd)));n&&((a=n.find(e=>"first-paint"===e.name))&&a.startTime&&i.putMetric("_fp",Math.floor(1e3*a.startTime)),(a=n.find(e=>"first-contentful-paint"===e.name))&&a.startTime&&i.putMetric("_fcp",Math.floor(1e3*a.startTime)),r&&i.putMetric("_fid",Math.floor(1e3*r))),ot(i)}}static createUserTimingTrace(e,t){ot(new dt(e,t,!1,t))}}function pt(e,t){const n=t;var r,a,i;n&&void 0!==n.responseStart&&(i=Ae.getInstance().getTimeOrigin(),r=Math.floor(1e3*(n.startTime+i)),a=n.responseStart?Math.floor(1e3*(n.responseStart-n.startTime)):void 0,i=Math.floor(1e3*(n.responseEnd-n.startTime)),function(e){const t=Le.getInstance();var n,r,a;t.instrumentationEnabled&&(n=e.url,r=t.logEndPointUrl.split("?")[0],a=t.flTransportEndpointUrl.split("?")[0],n!==r&&n!==a&&t.loggingEnabled&&t.logNetworkAfterSampling&&setTimeout(()=>it(e,0),0))}({performanceController:e,url:n.name&&n.name.split("?")[0],responsePayloadBytes:n.transferSize,startTimeUs:r,timeToResponseInitiatedUs:a,timeToResponseCompletedUs:i}))}const ft=5e3;function gt(e){Oe&&(setTimeout(()=>function(n){const e=Ae.getInstance(),r=e.getEntriesByType("navigation"),a=e.getEntriesByType("paint");if(e.onFirstInputDelay){let t=setTimeout(()=>{dt.createOobTrace(n,r,a),t=void 0},ft);e.onFirstInputDelay(e=>{t&&(clearTimeout(t),dt.createOobTrace(n,r,a,e))})}else dt.createOobTrace(n,r,a)}(e),0),setTimeout(()=>function(t){const e=Ae.getInstance(),n=e.getEntriesByType("resource");for(const r of n)pt(t,r);e.setupObserver("resource",e=>pt(t,e))}(e),0),setTimeout(()=>function(t){const e=Ae.getInstance(),n=e.getEntriesByType("measure");for(const r of n)ht(t,r);e.setupObserver("measure",e=>ht(t,e))}(e),0))}function ht(e,t){const n=t.name;n.substring(0,_e.length)!==_e&&dt.createUserTimingTrace(e,n)}class mt{constructor(e,t){this.app=e,this.installations=t,this.initialized=!1}_init(e){this.initialized||(void 0!==(null==e?void 0:e.dataCollectionEnabled)&&(this.dataCollectionEnabled=e.dataCollectionEnabled),void 0!==(null==e?void 0:e.instrumentationEnabled)&&(this.instrumentationEnabled=e.instrumentationEnabled),Ae.getInstance().requiredApisAvailable()?new Promise((t,n)=>{try{let e=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),e||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{e=!1},a.onerror=()=>{var e;n((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(e){n(e)}}).then(e=>{e&&(tt||(nt(5500),tt=!0),Ge(this).then(()=>gt(this),()=>gt(this)),this.initialized=!0)}).catch(e=>{Ne.info(`Environment doesn't support IndexedDB: ${e}`)}):Ne.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(e){Le.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return Le.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){Le.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return Le.getInstance().dataCollectionEnabled}}const vt="[DEFAULT]";const bt=(e,{options:t})=>{var n=e.getProvider("app").getImmediate(),r=e.getProvider("installations-internal").getImmediate();if(n.name!==vt)throw ke.create("FB not default");if("undefined"==typeof window)throw ke.create("no window");e=window,Re=e;const a=new mt(n,r);return a._init(t),a};Et._registerComponent(new i("performance",bt,"PUBLIC")),Et.registerVersion(ve,be),Et.registerVersion(ve,be,"esm2017");class wt{constructor(e,t){this.app=e,this._delegate=t}get instrumentationEnabled(){return this._delegate.instrumentationEnabled}set instrumentationEnabled(e){this._delegate.instrumentationEnabled=e}get dataCollectionEnabled(){return this._delegate.dataCollectionEnabled}set dataCollectionEnabled(e){this._delegate.dataCollectionEnabled=e}trace(e){return t=this._delegate,n=e,t=(e=t)&&e._delegate?e._delegate:e,new dt(t,n);var t,n}}function _t(e){var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("performance").getImmediate();return new wt(t,n)}(Se=n.default).INTERNAL.registerComponent(new i("performance-compat",_t,"PUBLIC")),Se.registerVersion("@firebase/performance-compat","0.1.16")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-performance-compat.js - be sure to load firebase-app.js first.")}});
2
2
  //# sourceMappingURL=firebase-performance-compat.js.map
@@ -193,7 +193,7 @@ class l{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Pr
193
193
  * See the License for the specific language governing permissions and
194
194
  * limitations under the License.
195
195
  */
196
- class z{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const q="@firebase/app",W="0.8.2",K=new C("@firebase/app"),J="[DEFAULT]",G={[q]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},Y=new Map,X=new Map;function Z(e,t){try{e.container.addComponent(t)}catch(n){K.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Q(e){const t=e.name;if(X.has(t))return K.debug(`There were multiple attempts to register component ${t}.`),!1;X.set(t,e);for(const t of Y.values())Z(t,e);return!0}function ee(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}
196
+ class z{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const q="@firebase/app",W="0.8.3",K=new C("@firebase/app"),J="[DEFAULT]",G={[q]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},Y=new Map,X=new Map;function Z(e,t){try{e.container.addComponent(t)}catch(n){K.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Q(e){const t=e.name;if(X.has(t))return K.debug(`There were multiple attempts to register component ${t}.`),!1;X.set(t,e);for(const t of Y.values())Z(t,e);return!0}function ee(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}
197
197
  /**
198
198
  * @license
199
199
  * Copyright 2019 Google LLC
@@ -243,7 +243,7 @@ class ne{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e)
243
243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244
244
  * See the License for the specific language governing permissions and
245
245
  * limitations under the License.
246
- */const re="9.12.1";function ie(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const r=Object.assign({name:J,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!=typeof i||!i)throw te.create("bad-app-name",{appName:String(i)});var a;if(n||(n=null===(a=c())||void 0===a?void 0:a.config),!n)throw te.create("no-options");const o=Y.get(i);if(o){if(d(n,o.options)&&d(r,o.config))return o;throw te.create("duplicate-app",{appName:i})}const s=new _(i);for(const e of X.values())s.addComponent(e);const l=new ne(n,r,s);return Y.set(i,l),l}async function ae(e){const t=e.name;Y.has(t)&&(Y.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function oe(e,t,n){var r;let i=null!==(r=G[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){const e=[`Unable to register library "${i}" with version "${t}":`];return a&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),a&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void K.warn(e.join(" "))}Q(new m(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function se(e,t){if(null!==e&&"function"!=typeof e)throw te.create("invalid-log-argument");!function(e,t){for(const n of w){let r=null;t&&t.level&&(r=y[t.level]),n.userLogHandler=null===e?null:(t,n,...i)=>{const a=i.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:E[n].toLowerCase(),message:a,args:i,type:t.name})}}}(e,t)}function ce(e){var t;t=e,w.forEach((e=>{e.setLogLevel(t)}))}
246
+ */const re="9.13.0";function ie(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const r=Object.assign({name:J,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!=typeof i||!i)throw te.create("bad-app-name",{appName:String(i)});var a;if(n||(n=null===(a=c())||void 0===a?void 0:a.config),!n)throw te.create("no-options");const o=Y.get(i);if(o){if(d(n,o.options)&&d(r,o.config))return o;throw te.create("duplicate-app",{appName:i})}const s=new _(i);for(const e of X.values())s.addComponent(e);const l=new ne(n,r,s);return Y.set(i,l),l}async function ae(e){const t=e.name;Y.has(t)&&(Y.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function oe(e,t,n){var r;let i=null!==(r=G[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const a=i.match(/\s|\//),o=t.match(/\s|\//);if(a||o){const e=[`Unable to register library "${i}" with version "${t}":`];return a&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),a&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void K.warn(e.join(" "))}Q(new m(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function se(e,t){if(null!==e&&"function"!=typeof e)throw te.create("invalid-log-argument");!function(e,t){for(const n of w){let r=null;t&&t.level&&(r=y[t.level]),n.userLogHandler=null===e?null:(t,n,...i)=>{const a=i.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:E[n].toLowerCase(),message:a,args:i,type:t.name})}}}(e,t)}function ce(e){var t;t=e,w.forEach((e=>{e.setLogLevel(t)}))}
247
247
  /**
248
248
  * @license
249
249
  * Copyright 2021 Google LLC
@@ -390,7 +390,7 @@ const Ie=function(){const e=ye(we);e.SDK_VERSION=`${e.SDK_VERSION}_LITE`;const t
390
390
  * See the License for the specific language governing permissions and
391
391
  * limitations under the License.
392
392
  */
393
- function(e){oe("@firebase/app-compat","0.1.37",e)}("lite");
393
+ function(e){oe("@firebase/app-compat","0.1.38",e)}("lite");
394
394
  /**
395
395
  * @license
396
396
  * Copyright 2020 Google LLC
@@ -407,7 +407,7 @@ function(e){oe("@firebase/app-compat","0.1.37",e)}("lite");
407
407
  * See the License for the specific language governing permissions and
408
408
  * limitations under the License.
409
409
  */
410
- Ie.registerVersion("firebase","9.12.1","app-compat");const Se="@firebase/installations",Te="0.5.15",Ce=1e4,Ae="w:0.5.15",De="FIS_v2",Ne=36e5,Oe=new p("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function ke(e){return e instanceof u&&e.code.includes("request-failed")}
410
+ Ie.registerVersion("firebase","9.13.0","app-compat");const Se="@firebase/installations",Te="0.5.16",Ce=1e4,Ae="w:0.5.16",De="FIS_v2",Ne=36e5,Oe=new p("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function ke(e){return e instanceof u&&e.code.includes("request-failed")}
411
411
  /**
412
412
  * @license
413
413
  * Copyright 2019 Google LLC
@@ -651,7 +651,7 @@ async function ot(e,t=!1){const n=e;await async function(e){const{registrationPr
651
651
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
652
652
  * See the License for the specific language governing permissions and
653
653
  * limitations under the License.
654
- */const ct="installations",lt=e=>{const t=ee(e.getProvider("app").getImmediate(),ct).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Ze(t);return r?r.catch(console.error):rt(t).catch(console.error),n.fid}(t),getToken:e=>ot(t,e)}};Q(new m(ct,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw st("App Configuration");if(!e.name)throw st("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw st(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ee(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),Q(new m("installations-internal",lt,"PRIVATE")),oe(Se,Te),oe(Se,Te,"esm2017");const ut="@firebase/performance",pt="0.5.15",ht=pt,ft="FB-PERF-TRACE-MEASURE",dt="_wt_",gt="_fcp",mt="_fid",bt="@firebase/performance/config",vt="@firebase/performance/configexpire",_t="Performance",wt=new p("performance",_t,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."}),Et=new C(_t);
654
+ */const ct="installations",lt=e=>{const t=ee(e.getProvider("app").getImmediate(),ct).getImmediate();return{getId:()=>async function(e){const t=e,{installationEntry:n,registrationPromise:r}=await Ze(t);return r?r.catch(console.error):rt(t).catch(console.error),n.fid}(t),getToken:e=>ot(t,e)}};Q(new m(ct,(e=>{const t=e.getProvider("app").getImmediate(),n=function(e){if(!e||!e.options)throw st("App Configuration");if(!e.name)throw st("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw st(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t);return{app:t,appConfig:n,heartbeatServiceProvider:ee(t,"heartbeat"),_delete:()=>Promise.resolve()}}),"PUBLIC")),Q(new m("installations-internal",lt,"PRIVATE")),oe(Se,Te),oe(Se,Te,"esm2017");const ut="@firebase/performance",pt="0.5.16",ht=pt,ft="FB-PERF-TRACE-MEASURE",dt="_wt_",gt="_fcp",mt="_fid",bt="@firebase/performance/config",vt="@firebase/performance/configexpire",_t="Performance",wt=new p("performance",_t,{"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."}),Et=new C(_t);
655
655
  /**
656
656
  * @license
657
657
  * Copyright 2020 Google LLC
@@ -930,7 +930,7 @@ class fn{constructor(e,t){this.app=e,this._delegate=t}get instrumentationEnabled
930
930
  * See the License for the specific language governing permissions and
931
931
  * limitations under the License.
932
932
  */
933
- var gn;(gn=Ie).INTERNAL.registerComponent(new m("performance-compat",dn,"PUBLIC")),gn.registerVersion("@firebase/performance-compat","0.1.15");
933
+ var gn;(gn=Ie).INTERNAL.registerComponent(new m("performance-compat",dn,"PUBLIC")),gn.registerVersion("@firebase/performance-compat","0.1.16");
934
934
  /**
935
935
  * @license
936
936
  * Copyright 2019 Google LLC
@@ -947,5 +947,5 @@ var gn;(gn=Ie).INTERNAL.registerComponent(new m("performance-compat",dn,"PUBLIC"
947
947
  * See the License for the specific language governing permissions and
948
948
  * limitations under the License.
949
949
  */
950
- return Ie.registerVersion("firebase","9.12.1","compat-lite"),Ie}));
950
+ return Ie.registerVersion("firebase","9.13.0","compat-lite"),Ie}));
951
951
  //# sourceMappingURL=firebase-performance-standalone-compat.es2017.js.map