{"version":3,"sources":["webpack:///./node_modules/@firebase/component/dist/index.cjs.js","webpack:///./node_modules/@firebase/logger/dist/index.esm.js","webpack:///./node_modules/@firebase/functions/dist/index.cjs.js"],"names":["Object","defineProperty","exports","value","tslib","util","Component","name","instanceFactory","type","this","multipleInstances","serviceProps","instantiationMode","prototype","setInstantiationMode","mode","setMultipleInstances","setServiceProps","props","DEFAULT_ENTRY_NAME","Provider","container","component","instances","Map","instancesDeferred","get","identifier","normalizedIdentifier","normalizeInstanceIdentifier","has","deferred","Deferred","set","instance","getOrInitializeService","resolve","e","promise","getImmediate","options","_a","__assign","optional","Error","getComponent","setComponent","e_1","isComponentEager","_b","__values","entries","_c","next","done","_d","__read","instanceIdentifier","instanceDeferred","e_1_1","error","return","call","clearInstance","delete","__awaiter","services","__generator","label","Array","from","values","Promise","all","filter","service","map","INTERNAL","sent","isComponentSet","undefined","normalizeIdentifierForFactory","ComponentContainer","providers","addComponent","provider","getProvider","addOrOverwriteComponent","getProviders","__spreadArrays","s","i","il","arguments","length","r","k","a","j","jl","LogLevel","defaultLogLevel","INFO","defaultLogHandler","logType","args","_i","logLevel","now","Date","toISOString","DEBUG","VERBOSE","console","log","apply","info","WARN","warn","ERROR","Logger","_logLevel","_logHandler","push","val","TypeError","enumerable","configurable","debug","setLogLevel","level","forEach","inst","ex","firebase","errorCodeMap","OK","CANCELLED","UNKNOWN","INVALID_ARGUMENT","DEADLINE_EXCEEDED","NOT_FOUND","ALREADY_EXISTS","PERMISSION_DENIED","UNAUTHENTICATED","RESOURCE_EXHAUSTED","FAILED_PRECONDITION","ABORTED","OUT_OF_RANGE","UNIMPLEMENTED","UNAVAILABLE","DATA_LOSS","HttpsErrorImpl","_super","code","message","details","_this","setPrototypeOf","__extends","ContextProvider","authProvider","messagingProvider","auth","messaging","then","getAuthToken","token","trys","getToken","accessToken","getInstanceIdToken","self","Notification","permission","getContext","authToken","instanceIdToken","mapValues","o","f","result","key","hasOwnProperty","Serializer","encode","data","Number","valueOf","isFinite","toString","isArray","x","decode","json","isNaN","Service","app_","region_","serializer","emulatorOrigin","deleteService","contextProvider","cancelAllRequests","_url","projectId","region","useFunctionsEmulator","origin","httpsCallable","postJSON","url","body","headers","response","append","fetch","method","JSON","stringify","status","context","timeout","responseData","Headers","race","millis","_","reject","setTimeout","bodyJSON","codeForHTTPStatus","description","errorJSON","status_1","_errorForResponse","FUNCTIONS_TYPE","factory","app","namespaceExports","Functions","registerComponent","registerVersion"],"mappings":"4FAEAA,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IAEtD,IAAIC,EAAQ,EAAQ,GAChBC,EAAO,EAAQ,KAKfC,EAA2B,WAO3B,SAASA,EAAUC,EAAMC,EAAiBC,GACtCC,KAAKH,KAAOA,EACZG,KAAKF,gBAAkBA,EACvBE,KAAKD,KAAOA,EACZC,KAAKC,mBAAoB,EAIzBD,KAAKE,aAAe,GACpBF,KAAKG,kBAAoB,OAc7B,OAZAP,EAAUQ,UAAUC,qBAAuB,SAAUC,GAEjD,OADAN,KAAKG,kBAAoBG,EAClBN,MAEXJ,EAAUQ,UAAUG,qBAAuB,SAAUN,GAEjD,OADAD,KAAKC,kBAAoBA,EAClBD,MAEXJ,EAAUQ,UAAUI,gBAAkB,SAAUC,GAE5C,OADAT,KAAKE,aAAeO,EACbT,MAEJJ,EA9BmB,GAiD1Bc,EAAqB,YAsBrBC,EAA0B,WAC1B,SAASA,EAASd,EAAMe,GACpBZ,KAAKH,KAAOA,EACZG,KAAKY,UAAYA,EACjBZ,KAAKa,UAAY,KACjBb,KAAKc,UAAY,IAAIC,IACrBf,KAAKgB,kBAAoB,IAAID,IAgJjC,OA1IAJ,EAASP,UAAUa,IAAM,SAAUC,QACZ,IAAfA,IAAyBA,EAAaR,GAE1C,IAAIS,EAAuBnB,KAAKoB,4BAA4BF,GAC5D,IAAKlB,KAAKgB,kBAAkBK,IAAIF,GAAuB,CACnD,IAAIG,EAAW,IAAI3B,EAAK4B,SACxBvB,KAAKgB,kBAAkBQ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EAAWN,OAAOrC,WAIxC,MAAOvH,IAGP,MAAa,OAATqH,KAIO,KAEJ,IAAIF,EAAeE,KAAM8E,EAAa5E,SAiYjB+E,CAAkBrB,EAASM,OAAQN,EAASpB,KAAMzL,KAAK8L,YAE3D,MAAM3I,EAEV,IAAK0J,EAASpB,KACV,MAAM,IAAI1C,EAAe,WAAY,sCAQzC,QAH4B,KAH5BuE,EAAeT,EAASpB,KAAKR,QAIzBqC,EAAeT,EAASpB,KAAKb,aAEL,IAAjB0C,EAEP,MAAM,IAAIvE,EAAe,WAAY,mCAGzC,MAAO,CAAC,EAAc,CAAEkC,KADVjL,KAAK8L,WAAWN,OAAO8B,KAzL7D,IAAmBG,SA+LR9B,EArLiB,GA2MxBwC,EAAiB,YACrB,SAASC,EAAQxN,EAAWyL,GAExB,IAAIgC,EAAMzN,EAAUiE,YAAY,OAAO/C,eACnC0H,EAAe5I,EAAUiE,YAAY,iBACrC4E,EAAoB7I,EAAUiE,YAAY,aAE9C,OAAO,IAAI8G,EAAQ0C,EAAK7E,EAAcC,EAAmB4C,GAY7D,IATQiC,IAAmB,CAEnBC,UAAW5C,GA0BD9D,EAxBLzD,SAASoK,kBAAkB,IAAI3N,UAAUjB,UAAUuO,EAAgBC,EAAS,UAChF5N,gBAAgB8N,GAChB/N,sBAAqB,IAuB9BsH,EAAS4G,gBApBE,sBACG","file":"vendors~app~1fb195ae.js","sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = require('tslib');\nvar util = require('@firebase/util');\n\n/**\r\n * Component for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar Component = /** @class */ (function () {\r\n /**\r\n *\r\n * @param name The public service name, e.g. app, auth, firestore, database\r\n * @param instanceFactory Service factory responsible for creating the public interface\r\n * @param type whether the service provided by the component is public or private\r\n */\r\n function Component(name, instanceFactory, type) {\r\n this.name = name;\r\n this.instanceFactory = instanceFactory;\r\n this.type = type;\r\n this.multipleInstances = false;\r\n /**\r\n * Properties to be added to the service namespace\r\n */\r\n this.serviceProps = {};\r\n this.instantiationMode = \"LAZY\" /* LAZY */;\r\n }\r\n Component.prototype.setInstantiationMode = function (mode) {\r\n this.instantiationMode = mode;\r\n return this;\r\n };\r\n Component.prototype.setMultipleInstances = function (multipleInstances) {\r\n this.multipleInstances = multipleInstances;\r\n return this;\r\n };\r\n Component.prototype.setServiceProps = function (props) {\r\n this.serviceProps = props;\r\n return this;\r\n };\r\n return Component;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar DEFAULT_ENTRY_NAME = '[DEFAULT]';\n\n/**\r\n * @license\r\n * Copyright 2019 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Provider for instance for service name T, e.g. 'auth', 'auth-internal'\r\n * NameServiceMapping[T] is an alias for the type of the instance\r\n */\r\nvar Provider = /** @class */ (function () {\r\n function Provider(name, container) {\r\n this.name = name;\r\n this.container = container;\r\n this.component = null;\r\n this.instances = new Map();\r\n this.instancesDeferred = new Map();\r\n }\r\n /**\r\n * @param identifier A provider can provide mulitple instances of a service\r\n * if this.component.multipleInstances is true.\r\n */\r\n Provider.prototype.get = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n if (!this.instancesDeferred.has(normalizedIdentifier)) {\r\n var deferred = new util.Deferred();\r\n this.instancesDeferred.set(normalizedIdentifier, deferred);\r\n // If the service instance is available, resolve the promise with it immediately\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (instance) {\r\n deferred.resolve(instance);\r\n }\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception during get(), it should not cause\r\n // a fatal error. We just return the unresolved promise in this case.\r\n }\r\n }\r\n return this.instancesDeferred.get(normalizedIdentifier).promise;\r\n };\r\n Provider.prototype.getImmediate = function (options) {\r\n var _a = tslib.__assign({ identifier: DEFAULT_ENTRY_NAME, optional: false }, options), identifier = _a.identifier, optional = _a.optional;\r\n // if multipleInstances is not supported, use the default name\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(identifier);\r\n try {\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n if (!instance) {\r\n if (optional) {\r\n return null;\r\n }\r\n throw Error(\"Service \" + this.name + \" is not available\");\r\n }\r\n return instance;\r\n }\r\n catch (e) {\r\n if (optional) {\r\n return null;\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n };\r\n Provider.prototype.getComponent = function () {\r\n return this.component;\r\n };\r\n Provider.prototype.setComponent = function (component) {\r\n var e_1, _a;\r\n if (component.name !== this.name) {\r\n throw Error(\"Mismatching Component \" + component.name + \" for Provider \" + this.name + \".\");\r\n }\r\n if (this.component) {\r\n throw Error(\"Component for \" + this.name + \" has already been provided\");\r\n }\r\n this.component = component;\r\n // if the service is eager, initialize the default instance\r\n if (isComponentEager(component)) {\r\n try {\r\n this.getOrInitializeService(DEFAULT_ENTRY_NAME);\r\n }\r\n catch (e) {\r\n // when the instance factory for an eager Component throws an exception during the eager\r\n // initialization, it should not cause a fatal error.\r\n // TODO: Investigate if we need to make it configurable, because some component may want to cause\r\n // a fatal error in this case?\r\n }\r\n }\r\n try {\r\n // Create service instances for the pending promises and resolve them\r\n // NOTE: if this.multipleInstances is false, only the default instance will be created\r\n // and all promises with resolve with it regardless of the identifier.\r\n for (var _b = tslib.__values(this.instancesDeferred.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var _d = tslib.__read(_c.value, 2), instanceIdentifier = _d[0], instanceDeferred = _d[1];\r\n var normalizedIdentifier = this.normalizeInstanceIdentifier(instanceIdentifier);\r\n try {\r\n // `getOrInitializeService()` should always return a valid instance since a component is guaranteed. use ! to make typescript happy.\r\n var instance = this.getOrInitializeService(normalizedIdentifier);\r\n instanceDeferred.resolve(instance);\r\n }\r\n catch (e) {\r\n // when the instance factory throws an exception, it should not cause\r\n // a fatal error. We just leave the promise unresolved.\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n };\r\n Provider.prototype.clearInstance = function (identifier) {\r\n if (identifier === void 0) { identifier = DEFAULT_ENTRY_NAME; }\r\n this.instancesDeferred.delete(identifier);\r\n this.instances.delete(identifier);\r\n };\r\n // app.delete() will call this method on every provider to delete the services\r\n // TODO: should we mark the provider as deleted?\r\n Provider.prototype.delete = function () {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var services;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n services = Array.from(this.instances.values());\r\n return [4 /*yield*/, Promise.all(services\r\n .filter(function (service) { return 'INTERNAL' in service; })\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map(function (service) { return service.INTERNAL.delete(); }))];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Provider.prototype.isComponentSet = function () {\r\n return this.component != null;\r\n };\r\n Provider.prototype.getOrInitializeService = function (identifier) {\r\n var instance = this.instances.get(identifier);\r\n if (!instance && this.component) {\r\n instance = this.component.instanceFactory(this.container, normalizeIdentifierForFactory(identifier));\r\n this.instances.set(identifier, instance);\r\n }\r\n return instance || null;\r\n };\r\n Provider.prototype.normalizeInstanceIdentifier = function (identifier) {\r\n if (this.component) {\r\n return this.component.multipleInstances ? identifier : DEFAULT_ENTRY_NAME;\r\n }\r\n else {\r\n return identifier; // assume multiple instances are supported before the component is provided.\r\n }\r\n };\r\n return Provider;\r\n}());\r\n// undefined should be passed to the service factory for the default instance\r\nfunction normalizeIdentifierForFactory(identifier) {\r\n return identifier === DEFAULT_ENTRY_NAME ? undefined : identifier;\r\n}\r\nfunction isComponentEager(component) {\r\n return component.instantiationMode === \"EAGER\" /* EAGER */;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2019 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * ComponentContainer that provides Providers for service name T, e.g. `auth`, `auth-internal`\r\n */\r\nvar ComponentContainer = /** @class */ (function () {\r\n function ComponentContainer(name) {\r\n this.name = name;\r\n this.providers = new Map();\r\n }\r\n /**\r\n *\r\n * @param component Component being added\r\n * @param overwrite When a component with the same name has already been registered,\r\n * if overwrite is true: overwrite the existing component with the new component and create a new\r\n * provider with the new component. It can be useful in tests where you want to use different mocks\r\n * for different tests.\r\n * if overwrite is false: throw an exception\r\n */\r\n ComponentContainer.prototype.addComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n throw new Error(\"Component \" + component.name + \" has already been registered with \" + this.name);\r\n }\r\n provider.setComponent(component);\r\n };\r\n ComponentContainer.prototype.addOrOverwriteComponent = function (component) {\r\n var provider = this.getProvider(component.name);\r\n if (provider.isComponentSet()) {\r\n // delete the existing provider from the container, so we can register the new component\r\n this.providers.delete(component.name);\r\n }\r\n this.addComponent(component);\r\n };\r\n /**\r\n * getProvider provides a type safe interface where it can only be called with a field name\r\n * present in NameServiceMapping interface.\r\n *\r\n * Firebase SDKs providing services should extend NameServiceMapping interface to register\r\n * themselves.\r\n */\r\n ComponentContainer.prototype.getProvider = function (name) {\r\n if (this.providers.has(name)) {\r\n return this.providers.get(name);\r\n }\r\n // create a Provider for a service that hasn't registered with Firebase\r\n var provider = new Provider(name, this);\r\n this.providers.set(name, provider);\r\n return provider;\r\n };\r\n ComponentContainer.prototype.getProviders = function () {\r\n return Array.from(this.providers.values());\r\n };\r\n return ComponentContainer;\r\n}());\n\nexports.Component = Component;\nexports.ComponentContainer = ComponentContainer;\nexports.Provider = Provider;\n//# sourceMappingURL=index.cjs.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * A container for all of the Logger instances\r\n */\r\nvar instances = [];\r\n/**\r\n * The JS SDK supports 5 log levels and also allows a user the ability to\r\n * silence the logs altogether.\r\n *\r\n * The order is a follows:\r\n * DEBUG < VERBOSE < INFO < WARN < ERROR\r\n *\r\n * All of the log types above the current log level will be captured (i.e. if\r\n * you set the log level to `INFO`, errors will still be logged, but `DEBUG` and\r\n * `VERBOSE` logs will not)\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"DEBUG\"] = 0] = \"DEBUG\";\r\n LogLevel[LogLevel[\"VERBOSE\"] = 1] = \"VERBOSE\";\r\n LogLevel[LogLevel[\"INFO\"] = 2] = \"INFO\";\r\n LogLevel[LogLevel[\"WARN\"] = 3] = \"WARN\";\r\n LogLevel[LogLevel[\"ERROR\"] = 4] = \"ERROR\";\r\n LogLevel[LogLevel[\"SILENT\"] = 5] = \"SILENT\";\r\n})(LogLevel || (LogLevel = {}));\r\n/**\r\n * The default log level\r\n */\r\nvar defaultLogLevel = LogLevel.INFO;\r\n/**\r\n * The default log handler will forward DEBUG, VERBOSE, INFO, WARN, and ERROR\r\n * messages on to their corresponding console counterparts (if the log method\r\n * is supported by the current log level)\r\n */\r\nvar defaultLogHandler = function (instance, logType) {\r\n var args = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n args[_i - 2] = arguments[_i];\r\n }\r\n if (logType < instance.logLevel) {\r\n return;\r\n }\r\n var now = new Date().toISOString();\r\n switch (logType) {\r\n /**\r\n * By default, `console.debug` is not displayed in the developer console (in\r\n * chrome). To avoid forcing users to have to opt-in to these logs twice\r\n * (i.e. once for firebase, and once in the console), we are sending `DEBUG`\r\n * logs to the `console.log` function.\r\n */\r\n case LogLevel.DEBUG:\r\n console.log.apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n break;\r\n case LogLevel.VERBOSE:\r\n console.log.apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n break;\r\n case LogLevel.INFO:\r\n console.info.apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n break;\r\n case LogLevel.WARN:\r\n console.warn.apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n break;\r\n case LogLevel.ERROR:\r\n console.error.apply(console, __spreadArrays([\"[\" + now + \"] \" + instance.name + \":\"], args));\r\n break;\r\n default:\r\n throw new Error(\"Attempted to log a message with an invalid logType (value: \" + logType + \")\");\r\n }\r\n};\r\nvar Logger = /** @class */ (function () {\r\n /**\r\n * Gives you an instance of a Logger to capture messages according to\r\n * Firebase's logging scheme.\r\n *\r\n * @param name The name that the logs will be associated with\r\n */\r\n function Logger(name) {\r\n this.name = name;\r\n /**\r\n * The log level of the given Logger instance.\r\n */\r\n this._logLevel = defaultLogLevel;\r\n /**\r\n * The log handler for the Logger instance.\r\n */\r\n this._logHandler = defaultLogHandler;\r\n /**\r\n * Capture the current instance for later use\r\n */\r\n instances.push(this);\r\n }\r\n Object.defineProperty(Logger.prototype, \"logLevel\", {\r\n get: function () {\r\n return this._logLevel;\r\n },\r\n set: function (val) {\r\n if (!(val in LogLevel)) {\r\n throw new TypeError('Invalid value assigned to `logLevel`');\r\n }\r\n this._logLevel = val;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Logger.prototype, \"logHandler\", {\r\n get: function () {\r\n return this._logHandler;\r\n },\r\n set: function (val) {\r\n if (typeof val !== 'function') {\r\n throw new TypeError('Value assigned to `logHandler` must be a function');\r\n }\r\n this._logHandler = val;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * The functions below are all based on the `console` interface\r\n */\r\n Logger.prototype.debug = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.DEBUG], args));\r\n };\r\n Logger.prototype.log = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.VERBOSE], args));\r\n };\r\n Logger.prototype.info = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.INFO], args));\r\n };\r\n Logger.prototype.warn = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.WARN], args));\r\n };\r\n Logger.prototype.error = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this._logHandler.apply(this, __spreadArrays([this, LogLevel.ERROR], args));\r\n };\r\n return Logger;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nfunction setLogLevel(level) {\r\n instances.forEach(function (inst) {\r\n inst.logLevel = level;\r\n });\r\n}\n\nexport { LogLevel, Logger, setLogLevel };\n//# sourceMappingURL=index.esm.js.map\n","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar firebase = _interopDefault(require('@firebase/app'));\nvar tslib = require('tslib');\nvar component = require('@firebase/component');\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Standard error codes for different ways a request can fail, as defined by:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * This map is used primarily to convert from a backend error code string to\r\n * a client SDK error code string, and make sure it's in the supported set.\r\n */\r\nvar errorCodeMap = {\r\n OK: 'ok',\r\n CANCELLED: 'cancelled',\r\n UNKNOWN: 'unknown',\r\n INVALID_ARGUMENT: 'invalid-argument',\r\n DEADLINE_EXCEEDED: 'deadline-exceeded',\r\n NOT_FOUND: 'not-found',\r\n ALREADY_EXISTS: 'already-exists',\r\n PERMISSION_DENIED: 'permission-denied',\r\n UNAUTHENTICATED: 'unauthenticated',\r\n RESOURCE_EXHAUSTED: 'resource-exhausted',\r\n FAILED_PRECONDITION: 'failed-precondition',\r\n ABORTED: 'aborted',\r\n OUT_OF_RANGE: 'out-of-range',\r\n UNIMPLEMENTED: 'unimplemented',\r\n INTERNAL: 'internal',\r\n UNAVAILABLE: 'unavailable',\r\n DATA_LOSS: 'data-loss'\r\n};\r\n/**\r\n * An explicit error that can be thrown from a handler to send an error to the\r\n * client that called the function.\r\n */\r\nvar HttpsErrorImpl = /** @class */ (function (_super) {\r\n tslib.__extends(HttpsErrorImpl, _super);\r\n function HttpsErrorImpl(code, message, details) {\r\n var _this = _super.call(this, message) || this;\r\n // This is a workaround for a bug in TypeScript when extending Error:\r\n // tslint:disable-next-line\r\n // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\r\n Object.setPrototypeOf(_this, HttpsErrorImpl.prototype);\r\n _this.code = code;\r\n _this.details = details;\r\n return _this;\r\n }\r\n return HttpsErrorImpl;\r\n}(Error));\r\n/**\r\n * Takes an HTTP status code and returns the corresponding ErrorCode.\r\n * This is the standard HTTP status code -> error mapping defined in:\r\n * https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto\r\n *\r\n * @param status An HTTP status code.\r\n * @return The corresponding ErrorCode, or ErrorCode.UNKNOWN if none.\r\n */\r\nfunction codeForHTTPStatus(status) {\r\n // Make sure any successful status is OK.\r\n if (status >= 200 && status < 300) {\r\n return 'ok';\r\n }\r\n switch (status) {\r\n case 0:\r\n // This can happen if the server returns 500.\r\n return 'internal';\r\n case 400:\r\n return 'invalid-argument';\r\n case 401:\r\n return 'unauthenticated';\r\n case 403:\r\n return 'permission-denied';\r\n case 404:\r\n return 'not-found';\r\n case 409:\r\n return 'aborted';\r\n case 429:\r\n return 'resource-exhausted';\r\n case 499:\r\n return 'cancelled';\r\n case 500:\r\n return 'internal';\r\n case 501:\r\n return 'unimplemented';\r\n case 503:\r\n return 'unavailable';\r\n case 504:\r\n return 'deadline-exceeded';\r\n }\r\n return 'unknown';\r\n}\r\n/**\r\n * Takes an HTTP response and returns the corresponding Error, if any.\r\n */\r\nfunction _errorForResponse(status, bodyJSON, serializer) {\r\n var code = codeForHTTPStatus(status);\r\n // Start with reasonable defaults from the status code.\r\n var description = code;\r\n var details = undefined;\r\n // Then look through the body for explicit details.\r\n try {\r\n var errorJSON = bodyJSON && bodyJSON.error;\r\n if (errorJSON) {\r\n var status_1 = errorJSON.status;\r\n if (typeof status_1 === 'string') {\r\n if (!errorCodeMap[status_1]) {\r\n // They must've included an unknown error code in the body.\r\n return new HttpsErrorImpl('internal', 'internal');\r\n }\r\n code = errorCodeMap[status_1];\r\n // TODO(klimt): Add better default descriptions for error enums.\r\n // The default description needs to be updated for the new code.\r\n description = status_1;\r\n }\r\n var message = errorJSON.message;\r\n if (typeof message === 'string') {\r\n description = message;\r\n }\r\n details = errorJSON.details;\r\n if (details !== undefined) {\r\n details = serializer.decode(details);\r\n }\r\n }\r\n }\r\n catch (e) {\r\n // If we couldn't parse explicit error data, that's fine.\r\n }\r\n if (code === 'ok') {\r\n // Technically, there's an edge case where a developer could explicitly\r\n // return an error code of OK, and we will treat it as success, but that\r\n // seems reasonable.\r\n return null;\r\n }\r\n return new HttpsErrorImpl(code, description, details);\r\n}\n\n/**\r\n * Helper class to get metadata that should be included with a function call.\r\n */\r\nvar ContextProvider = /** @class */ (function () {\r\n function ContextProvider(authProvider, messagingProvider) {\r\n var _this = this;\r\n this.auth = null;\r\n this.messaging = null;\r\n this.auth = authProvider.getImmediate({ optional: true });\r\n this.messaging = messagingProvider.getImmediate({\r\n optional: true\r\n });\r\n if (!this.auth) {\r\n authProvider.get().then(function (auth) { return (_this.auth = auth); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n if (!this.messaging) {\r\n messagingProvider.get().then(function (messaging) { return (_this.messaging = messaging); }, function () {\r\n /* get() never rejects */\r\n });\r\n }\r\n }\r\n ContextProvider.prototype.getAuthToken = function () {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var token, e_1;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.auth) {\r\n return [2 /*return*/, undefined];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.auth.getToken()];\r\n case 2:\r\n token = _a.sent();\r\n if (!token) {\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/, token.accessToken];\r\n case 3:\r\n e_1 = _a.sent();\r\n // If there's any error when trying to get the auth token, leave it off.\r\n return [2 /*return*/, undefined];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getInstanceIdToken = function () {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n return tslib.__generator(this, function (_a) {\r\n if (!this.messaging ||\r\n !('Notification' in self) ||\r\n Notification.permission !== 'granted') {\r\n return [2 /*return*/, undefined];\r\n }\r\n try {\r\n return [2 /*return*/, this.messaging.getToken()];\r\n }\r\n catch (e) {\r\n // We don't warn on this, because it usually means messaging isn't set up.\r\n // console.warn('Failed to retrieve instance id token.', e);\r\n // If there's any error when trying to get the token, leave it off.\r\n return [2 /*return*/, undefined];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n ContextProvider.prototype.getContext = function () {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var authToken, instanceIdToken;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.getAuthToken()];\r\n case 1:\r\n authToken = _a.sent();\r\n return [4 /*yield*/, this.getInstanceIdToken()];\r\n case 2:\r\n instanceIdToken = _a.sent();\r\n return [2 /*return*/, { authToken: authToken, instanceIdToken: instanceIdToken }];\r\n }\r\n });\r\n });\r\n };\r\n return ContextProvider;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nvar LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value';\r\nvar UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value';\r\nfunction mapValues(\r\n// { [k: string]: unknown } is no longer a wildcard assignment target after typescript 3.5\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\no, f) {\r\n var result = {};\r\n for (var key in o) {\r\n if (o.hasOwnProperty(key)) {\r\n result[key] = f(o[key]);\r\n }\r\n }\r\n return result;\r\n}\r\nvar Serializer = /** @class */ (function () {\r\n function Serializer() {\r\n }\r\n // Takes data and encodes it in a JSON-friendly way, such that types such as\r\n // Date are preserved.\r\n Serializer.prototype.encode = function (data) {\r\n var _this = this;\r\n if (data == null) {\r\n return null;\r\n }\r\n if (data instanceof Number) {\r\n data = data.valueOf();\r\n }\r\n if (typeof data === 'number' && isFinite(data)) {\r\n // Any number in JS is safe to put directly in JSON and parse as a double\r\n // without any loss of precision.\r\n return data;\r\n }\r\n if (data === true || data === false) {\r\n return data;\r\n }\r\n if (Object.prototype.toString.call(data) === '[object String]') {\r\n return data;\r\n }\r\n if (Array.isArray(data)) {\r\n return data.map(function (x) { return _this.encode(x); });\r\n }\r\n if (typeof data === 'function' || typeof data === 'object') {\r\n return mapValues(data, function (x) { return _this.encode(x); });\r\n }\r\n // If we got this far, the data is not encodable.\r\n throw new Error('Data cannot be encoded in JSON: ' + data);\r\n };\r\n // Takes data that's been encoded in a JSON-friendly form and returns a form\r\n // with richer datatypes, such as Dates, etc.\r\n Serializer.prototype.decode = function (json) {\r\n var _this = this;\r\n if (json == null) {\r\n return json;\r\n }\r\n if (json['@type']) {\r\n switch (json['@type']) {\r\n case LONG_TYPE:\r\n // Fall through and handle this the same as unsigned.\r\n case UNSIGNED_LONG_TYPE: {\r\n // Technically, this could work return a valid number for malformed\r\n // data if there was a number followed by garbage. But it's just not\r\n // worth all the extra code to detect that case.\r\n var value = Number(json['value']);\r\n if (isNaN(value)) {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n return value;\r\n }\r\n default: {\r\n throw new Error('Data cannot be decoded from JSON: ' + json);\r\n }\r\n }\r\n }\r\n if (Array.isArray(json)) {\r\n return json.map(function (x) { return _this.decode(x); });\r\n }\r\n if (typeof json === 'function' || typeof json === 'object') {\r\n return mapValues(json, function (x) { return _this.decode(x); });\r\n }\r\n // Anything else is safe to return.\r\n return json;\r\n };\r\n return Serializer;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Returns a Promise that will be rejected after the given duration.\r\n * The error will be of type HttpsErrorImpl.\r\n *\r\n * @param millis Number of milliseconds to wait before rejecting.\r\n */\r\nfunction failAfter(millis) {\r\n return new Promise(function (_, reject) {\r\n setTimeout(function () {\r\n reject(new HttpsErrorImpl('deadline-exceeded', 'deadline-exceeded'));\r\n }, millis);\r\n });\r\n}\r\n/**\r\n * The main class for the Firebase Functions SDK.\r\n */\r\nvar Service = /** @class */ (function () {\r\n /**\r\n * Creates a new Functions service for the given app and (optional) region.\r\n * @param app_ The FirebaseApp to use.\r\n * @param region_ The region to call functions in.\r\n */\r\n function Service(app_, authProvider, messagingProvider, region_) {\r\n var _this = this;\r\n if (region_ === void 0) { region_ = 'us-central1'; }\r\n this.app_ = app_;\r\n this.region_ = region_;\r\n this.serializer = new Serializer();\r\n this.emulatorOrigin = null;\r\n this.INTERNAL = {\r\n delete: function () {\r\n return _this.deleteService();\r\n }\r\n };\r\n this.contextProvider = new ContextProvider(authProvider, messagingProvider);\r\n // Cancels all ongoing requests when resolved.\r\n this.cancelAllRequests = new Promise(function (resolve) {\r\n _this.deleteService = function () {\r\n return resolve();\r\n };\r\n });\r\n }\r\n Object.defineProperty(Service.prototype, \"app\", {\r\n get: function () {\r\n return this.app_;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the URL for a callable with the given name.\r\n * @param name The name of the callable.\r\n */\r\n Service.prototype._url = function (name) {\r\n var projectId = this.app_.options.projectId;\r\n var region = this.region_;\r\n if (this.emulatorOrigin !== null) {\r\n var origin_1 = this.emulatorOrigin;\r\n return origin_1 + \"/\" + projectId + \"/\" + region + \"/\" + name;\r\n }\r\n return \"https://\" + region + \"-\" + projectId + \".cloudfunctions.net/\" + name;\r\n };\r\n /**\r\n * Changes this instance to point to a Cloud Functions emulator running\r\n * locally. See https://firebase.google.com/docs/functions/local-emulator\r\n *\r\n * @param origin The origin of the local emulator, such as\r\n * \"http://localhost:5005\".\r\n */\r\n Service.prototype.useFunctionsEmulator = function (origin) {\r\n this.emulatorOrigin = origin;\r\n };\r\n /**\r\n * Returns a reference to the callable https trigger with the given name.\r\n * @param name The name of the trigger.\r\n */\r\n Service.prototype.httpsCallable = function (name, options) {\r\n var _this = this;\r\n return function (data) {\r\n return _this.call(name, data, options || {});\r\n };\r\n };\r\n /**\r\n * Does an HTTP POST and returns the completed response.\r\n * @param url The url to post to.\r\n * @param body The JSON body of the post.\r\n * @param headers The HTTP headers to include in the request.\r\n * @return A Promise that will succeed when the request finishes.\r\n */\r\n Service.prototype.postJSON = function (url, body, headers) {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var response, e_1, json, e_2;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n headers.append('Content-Type', 'application/json');\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, fetch(url, {\r\n method: 'POST',\r\n body: JSON.stringify(body),\r\n headers: headers\r\n })];\r\n case 2:\r\n response = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n // This could be an unhandled error on the backend, or it could be a\r\n // network error. There's no way to know, since an unhandled error on the\r\n // backend will fail to set the proper CORS header, and thus will be\r\n // treated as a network error by fetch.\r\n return [2 /*return*/, {\r\n status: 0,\r\n json: null\r\n }];\r\n case 4:\r\n json = null;\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, response.json()];\r\n case 6:\r\n json = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n e_2 = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 8: return [2 /*return*/, {\r\n status: response.status,\r\n json: json\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Calls a callable function asynchronously and returns the result.\r\n * @param name The name of the callable trigger.\r\n * @param data The data to pass as params to the function.s\r\n */\r\n Service.prototype.call = function (name, data, options) {\r\n return tslib.__awaiter(this, void 0, void 0, function () {\r\n var url, body, headers, context, timeout, response, error, responseData, decodedData;\r\n return tslib.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n url = this._url(name);\r\n // Encode any special types, such as dates, in the input data.\r\n data = this.serializer.encode(data);\r\n body = { data: data };\r\n headers = new Headers();\r\n return [4 /*yield*/, this.contextProvider.getContext()];\r\n case 1:\r\n context = _a.sent();\r\n if (context.authToken) {\r\n headers.append('Authorization', 'Bearer ' + context.authToken);\r\n }\r\n if (context.instanceIdToken) {\r\n headers.append('Firebase-Instance-ID-Token', context.instanceIdToken);\r\n }\r\n timeout = options.timeout || 70000;\r\n return [4 /*yield*/, Promise.race([\r\n this.postJSON(url, body, headers),\r\n failAfter(timeout),\r\n this.cancelAllRequests\r\n ])];\r\n case 2:\r\n response = _a.sent();\r\n // If service was deleted, interrupted response throws an error.\r\n if (!response) {\r\n throw new HttpsErrorImpl('cancelled', 'Firebase Functions instance was deleted.');\r\n }\r\n error = _errorForResponse(response.status, response.json, this.serializer);\r\n if (error) {\r\n throw error;\r\n }\r\n if (!response.json) {\r\n throw new HttpsErrorImpl('internal', 'Response is not valid JSON object.');\r\n }\r\n responseData = response.json.data;\r\n // TODO(klimt): For right now, allow \"result\" instead of \"data\", for\r\n // backwards compatibility.\r\n if (typeof responseData === 'undefined') {\r\n responseData = response.json.result;\r\n }\r\n if (typeof responseData === 'undefined') {\r\n // Consider the response malformed.\r\n throw new HttpsErrorImpl('internal', 'Response is missing data field.');\r\n }\r\n decodedData = this.serializer.decode(responseData);\r\n return [2 /*return*/, { data: decodedData }];\r\n }\r\n });\r\n });\r\n };\r\n return Service;\r\n}());\n\n/**\r\n * @license\r\n * Copyright 2019 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * Type constant for Firebase Functions.\r\n */\r\nvar FUNCTIONS_TYPE = 'functions';\r\nfunction factory(container, region) {\r\n // Dependencies\r\n var app = container.getProvider('app').getImmediate();\r\n var authProvider = container.getProvider('auth-internal');\r\n var messagingProvider = container.getProvider('messaging');\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n return new Service(app, authProvider, messagingProvider, region);\r\n}\r\nfunction registerFunctions(instance) {\r\n var namespaceExports = {\r\n // no-inline\r\n Functions: Service\r\n };\r\n instance.INTERNAL.registerComponent(new component.Component(FUNCTIONS_TYPE, factory, \"PUBLIC\" /* PUBLIC */)\r\n .setServiceProps(namespaceExports)\r\n .setMultipleInstances(true));\r\n}\n\nvar name = \"@firebase/functions\";\nvar version = \"0.4.32\";\n\n/**\r\n * @license\r\n * Copyright 2017 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nregisterFunctions(firebase);\r\nfirebase.registerVersion(name, version);\n//# sourceMappingURL=index.cjs.js.map\n"],"sourceRoot":""}