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AQ,MAAM,GACd,EAAO,SAAS,CAAE,kBAAkB,GACtC,CAEA,MAAO,CACL,KAAM,EACN,YAAa,WACX,OAAO,GACT,EAEJ,IAEA,KAAK,UAAY,SAAS,CAAC,EAAG,KAAK,UAAW,EAxD9C,CAyDF,GACC,CACD,IAAK,cACL,MAAO,SAAqB,GAC1B,IAAI,EAAS,KAEb,KAAI,OAAO,KAAK,GAAe,OAAS,GAAxC,CAIA,IAAI,EAAgB,SAAS,CAAC,EAAG,KAAK,WAClC,EAAyB,SAAS,CAAC,EAAG,KAAK,MAAM,oBAErD,OAAO,KAAK,GAAe,SAAQ,SAAU,GACxB,EAAO,UAAU,GACvB,qBAEN,EAAc,UACd,EAAuB,EAChC,IAEA,KAAK,UAAY,EACjB,KAAK,SAAS,CAAE,mBAAoB,GAdpC,CAeF,GACC,CACD,IAAK,SACL,MAAO,WACL,IAAI,EAAgB,EAAY,KAAK,MAAO,KAAK,IAAK,KAAK,WACvD,EAAc,OAAO,GAAe,SAAU,GAChD,MAAuB,mBAAT,CAChB,IACI,EAAoB,KAAK,MAAM,mBAC/B,EAAQ,EAAW,KAAK,MAAO,SAAS,CAAC,EAAG,EAAa,IAE7D,OAAO,KAAK,MAAM,iBAAmB,MAAM,cAAc,EAAkB,GAAS,eAAe,cACjG,MACA,KACA,IACA,gEACA,IAEJ,KAEK,CACT,CApKsB,CAoKpB,MAAM,WAWR,OATA,EAAgB,iBAAmB,EACnC,EAAgB,aAAe,MAAM,UAAU,aAC/C,EAAgB,YAAc,mBAAqB,eAAe,GAAoB,IAO/E,CACT,CACD,EAEG,aAAe,SAAsB,GACvC,OAAO,EAAK,MAAM,KAAK,QAAO,SAAU,GACtC,OAAO,CACT,IAAG,OAAS,CACd,EAEA,QAAQ,QAAU,QAClB,QAAQ,SAAW","file":"/npm/react-firebase-firestore@0.0.3/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-firebase-firestore@0.0.3/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar PropTypes = _interopDefault(require('prop-types'));\nvar React = require('react');\nvar React__default = _interopDefault(React);\nvar firebase = _interopDefault(require('firebase/app'));\nrequire('firebase/database');\nvar shallowEqual = _interopDefault(require('shallowequal'));\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n  return typeof obj;\n} : function (obj) {\n  return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\nvar createClass = function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if (\"value\" in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n\n    for (var key in source) {\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n\n  return target;\n};\n\n\n\nvar inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\nvar objectWithoutProperties = function (obj, keys) {\n  var target = {};\n\n  for (var i in obj) {\n    if (keys.indexOf(i) >= 0) continue;\n    if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n    target[i] = obj[i];\n  }\n\n  return target;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n  if (Array.isArray(arr)) {\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n    return arr2;\n  } else {\n    return Array.from(arr);\n  }\n};\n\nvar Provider = function (_Component) {\n  inherits(Provider, _Component);\n\n  function Provider() {\n    classCallCheck(this, Provider);\n    return possibleConstructorReturn(this, (Provider.__proto__ || Object.getPrototypeOf(Provider)).apply(this, arguments));\n  }\n\n  createClass(Provider, [{\n    key: \"getChildContext\",\n    value: function getChildContext() {\n      return {\n        firebaseApp: this.props.firebaseApp,\n        firestore: this.props.firestore\n      };\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return React.Children.only(this.props.children);\n    }\n  }]);\n  return Provider;\n}(React.Component);\n\nProvider.propTypes = {\n  firebaseApp: PropTypes.object.isRequired,\n  firestore: PropTypes.object.isRequired,\n  children: PropTypes.element.isRequired\n};\nProvider.childContextTypes = {\n  firebaseApp: PropTypes.object,\n  firestore: PropTypes.object\n};\n\nvar mapValues = function mapValues(object, iteratee) {\n  var result = {};\n\n  Object.keys(object).forEach(function (key) {\n    return result[key] = iteratee(object[key], key, object);\n  });\n\n  return result;\n};\n\nvar pickBy = function pickBy(object, predicate) {\n  var result = {};\n\n  Object.keys(object).forEach(function (key) {\n    var value = object[key];\n\n    if (predicate(value, key)) {\n      result[key] = value;\n    }\n  });\n\n  return result;\n};\n\nvar createQueryRef = function createQueryRef(ref, query) {\n  return Object.keys(query).reduce(function (queryRef, key) {\n    var value = query[key];\n    var args = Array.isArray(value) ? value : [value];\n\n    return queryRef[key].apply(queryRef, toConsumableArray(args));\n  }, ref);\n};\n\nvar getDisplayName = function getDisplayName(Component$$1) {\n  return Component$$1.displayName || Component$$1.name || \"Component\";\n};\n\nvar mapSnapshotToValue = function mapSnapshotToValue(snapshot) {\n  var result = {};\n\n  snapshot.forEach(function (child) {\n    result[child.key] = child.data();\n  });\n\n  return result;\n};\n\n// this is react-firebase.connect adapted for firestore\n\n// import PropTypes from \"prop-types\";\nvar defaultMergeProps = function defaultMergeProps(ownProps, firebaseProps) {\n  return _extends({}, ownProps, firebaseProps);\n};\n\nvar mapSubscriptionsToQueries = function mapSubscriptionsToQueries(subscriptions) {\n  return mapValues(subscriptions, function (value) {\n    return typeof value === \"string\" ? { path: value } : value;\n  });\n};\n\nvar defaultMapFirebaseToProps = function defaultMapFirebaseToProps(props, ref, firestore) {\n  return {\n    firestore: firestore\n  };\n};\n\nvar connect = (function () {\n  var mapFirebaseToProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultMapFirebaseToProps;\n  var mergeProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultMergeProps;\n\n  var mapFirebase = function mapFirebase() {\n    if (typeof mapFirebaseToProps !== \"function\") {\n      return mapFirebaseToProps;\n    }\n\n    var firebaseProps = mapFirebaseToProps.apply(undefined, arguments);\n\n    if (firebaseProps === null || (typeof firebaseProps === \"undefined\" ? \"undefined\" : _typeof(firebaseProps)) !== \"object\") {\n      throw new Error(\"react-firebase: mapFirebaseToProps must return an object. Instead received \" + firebaseProps + \".\");\n    }\n\n    return firebaseProps;\n  };\n\n  var computeSubscriptions = function computeSubscriptions(props, ref, firestore) {\n    var firebaseProps = mapFirebase(props, ref, firestore);\n    return pickBy(firebaseProps, function (prop) {\n      return typeof prop === \"string\" || prop && prop.path;\n    });\n  };\n\n  return function (WrappedComponent) {\n    var FirebaseConnect = function (_Component) {\n      inherits(FirebaseConnect, _Component);\n\n      function FirebaseConnect(props, context) {\n        classCallCheck(this, FirebaseConnect);\n\n        var _this = possibleConstructorReturn(this, (FirebaseConnect.__proto__ || Object.getPrototypeOf(FirebaseConnect)).call(this, props, context));\n\n        _this.firestore = props.firestore || context.firestore || firebase.firestore();\n\n        // polymorph based on number of /'s in path\n        _this.ref = function (path) {\n          return isCollection(path) ? _this.firestore.collection(path) : _this.firestore.doc(path);\n        };\n        _this.state = {\n          subscriptionsState: null,\n          subscribeSuccess: true\n        };\n        return _this;\n      }\n\n      createClass(FirebaseConnect, [{\n        key: \"componentDidMount\",\n        value: function componentDidMount() {\n          var subscriptions = computeSubscriptions(this.props, this.ref, this.firestore);\n\n          this.mounted = true;\n          this.subscribe(subscriptions);\n        }\n      }, {\n        key: \"componentWillReceiveProps\",\n        value: function componentWillReceiveProps(nextProps) {\n          var subscriptions = computeSubscriptions(this.props, this.ref, this.firestore);\n          var nextSubscriptions = computeSubscriptions(nextProps, this.ref, this.firestore);\n          var addedSubscriptions = pickBy(nextSubscriptions, function (path, key) {\n            return !subscriptions[key];\n          });\n          var removedSubscriptions = pickBy(subscriptions, function (path, key) {\n            return !nextSubscriptions[key];\n          });\n          var changedSubscriptions = pickBy(nextSubscriptions, function (path, key) {\n            return subscriptions[key] && !shallowEqual(subscriptions[key], path);\n          });\n\n          this.unsubscribe(_extends({}, removedSubscriptions, changedSubscriptions));\n          this.subscribe(_extends({}, addedSubscriptions, changedSubscriptions));\n        }\n      }, {\n        key: \"componentWillUnmount\",\n        value: function componentWillUnmount() {\n          this.mounted = false;\n\n          if (this.listeners) {\n            this.unsubscribe(this.listeners);\n          }\n        }\n      }, {\n        key: \"subscribe\",\n        value: function subscribe(subscriptions) {\n          var _this2 = this;\n\n          if (Object.keys(subscriptions).length < 1) {\n            return;\n          }\n\n          var queries = mapSubscriptionsToQueries(subscriptions);\n          var nextListeners = mapValues(queries, function (_ref, key) {\n            var path = _ref.path,\n                query = objectWithoutProperties(_ref, [\"path\"]);\n\n            var containsOrderBy = Object.keys(query).some(function (queryKey) {\n              return queryKey.startsWith(\"orderBy\");\n            });\n            var subscriptionRef = createQueryRef(_this2.ref(path), //.doc(path),\n            query);\n            var update = function update(querySnapshot) {\n              if (_this2.mounted) {\n                if (isCollection(path)) {\n                  // its a collection\n                  var allstuff = [];\n                  querySnapshot.forEach(function (snapshot) {\n                    var value = containsOrderBy ? mapSnapshotToValue(snapshot) : snapshot.data();\n                    value._id = snapshot.id;\n                    allstuff.push(value);\n                  });\n                  _this2.setState(function (prevState) {\n                    return {\n                      subscriptionsState: _extends({}, prevState.subscriptionsState, defineProperty({}, key, allstuff))\n                    };\n                  });\n                } else {\n                  // its a document\n                  var value = containsOrderBy ? mapSnapshotToValue(querySnapshot) : querySnapshot.data();\n\n                  _this2.setState(function (prevState) {\n                    return {\n                      subscriptionsState: _extends({}, prevState.subscriptionsState, defineProperty({}, key, value))\n                    };\n                  });\n                }\n              }\n            };\n            var _unsubscribe = void 0;\n            try {\n              _unsubscribe = subscriptionRef.onSnapshot(update);\n            } catch (err) {\n              console.log(\"FirePup: Error occured while querying your Firestore. If this is your first time running this, you might need to enable firestore permissioning. See INSERT_CLEVER_BEAGLE_DOCS_LINK.\");\n              console.error(err);\n              _this2.setState({ subscribeSuccess: false });\n            }\n\n            return {\n              path: path,\n              unsubscribe: function unsubscribe() {\n                return _unsubscribe();\n              }\n            };\n          });\n\n          this.listeners = _extends({}, this.listeners, nextListeners);\n        }\n      }, {\n        key: \"unsubscribe\",\n        value: function unsubscribe(subscriptions) {\n          var _this3 = this;\n\n          if (Object.keys(subscriptions).length < 1) {\n            return;\n          }\n\n          var nextListeners = _extends({}, this.listeners);\n          var nextSubscriptionsState = _extends({}, this.state.subscriptionsState);\n\n          Object.keys(subscriptions).forEach(function (key) {\n            var subscription = _this3.listeners[key];\n            subscription.unsubscribe();\n\n            delete nextListeners[key];\n            delete nextSubscriptionsState[key];\n          });\n\n          this.listeners = nextListeners;\n          this.setState({ subscriptionsState: nextSubscriptionsState });\n        }\n      }, {\n        key: \"render\",\n        value: function render() {\n          var firebaseProps = mapFirebase(this.props, this.ref, this.firestore);\n          var actionProps = pickBy(firebaseProps, function (prop) {\n            return typeof prop === \"function\";\n          });\n          var subscriptionProps = this.state.subscriptionsState;\n          var props = mergeProps(this.props, _extends({}, actionProps, subscriptionProps));\n\n          return this.state.subscribeSuccess ? React.createElement(WrappedComponent, props) : React__default.createElement(\n            \"div\",\n            null,\n            \" \",\n            \"Failed to load data from Firestore (see console for details).\",\n            \" \"\n          );\n        }\n      }]);\n      return FirebaseConnect;\n    }(React.Component);\n\n    FirebaseConnect.WrappedComponent = WrappedComponent;\n    FirebaseConnect.defaultProps = React.Component.defaultProps;\n    FirebaseConnect.displayName = \"FirebaseConnect(\" + getDisplayName(WrappedComponent) + \")\";\n    // FirebaseConnect.contextTypes = FirebaseConnect.propTypes = {\n    //   firebaseApp: PropTypes.shape({\n    //     database: PropTypes.func.isRequired // eslint-disable-line react/no-unused-prop-types\n    //   })\n    // };\n\n    return FirebaseConnect;\n  };\n});\n\nvar isCollection = function isCollection(path) {\n  return path.split(\"/\").filter(function (x) {\n    return x;\n  }).length % 2;\n};\n\nexports.connect = connect;\nexports.Provider = Provider;\n"]}