{"ast":null,"code":"'use strict';\n\nimport Platform from \"../../../exports/Platform\";\nimport RCTDeviceEventEmitter from \"./RCTDeviceEventEmitter\";\nimport invariant from 'fbjs/lib/invariant';\n\nvar NativeEventEmitter = function () {\n  function NativeEventEmitter(nativeModule) {\n    if (Platform.OS === 'ios') {\n      invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n      this._nativeModule = nativeModule;\n    }\n  }\n\n  var _proto = NativeEventEmitter.prototype;\n\n  _proto.addListener = function addListener(eventType, listener, context) {\n    var _this$_nativeModule,\n        _this = this;\n\n    (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n    var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n    return {\n      remove: function remove() {\n        if (subscription != null) {\n          var _this$_nativeModule2;\n\n          (_this$_nativeModule2 = _this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);\n          subscription.remove();\n          subscription = null;\n        }\n      }\n    };\n  };\n\n  _proto.removeListener = function removeListener(eventType, listener) {\n    var _this$_nativeModule3;\n\n    (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);\n    RCTDeviceEventEmitter.removeListener(eventType, listener);\n  };\n\n  _proto.emit = function emit(eventType) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    RCTDeviceEventEmitter.emit.apply(RCTDeviceEventEmitter, [eventType].concat(args));\n  };\n\n  _proto.removeAllListeners = function removeAllListeners(eventType) {\n    var _this$_nativeModule4;\n\n    invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n    (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n    RCTDeviceEventEmitter.removeAllListeners(eventType);\n  };\n\n  _proto.listenerCount = function listenerCount(eventType) {\n    return RCTDeviceEventEmitter.listenerCount(eventType);\n  };\n\n  return NativeEventEmitter;\n}();\n\nexport { NativeEventEmitter as default };","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-web/dist/vendor/react-native/NativeEventEmitter/index.js"],"names":["Platform","RCTDeviceEventEmitter","invariant","NativeEventEmitter","nativeModule","OS","_nativeModule","_proto","prototype","addListener","eventType","listener","context","_this$_nativeModule","_this","subscription","remove","_this$_nativeModule2","removeListeners","removeListener","_this$_nativeModule3","emit","_len","arguments","length","args","Array","_key","apply","concat","removeAllListeners","_this$_nativeModule4","listenerCount","default"],"mappings":"AASA;;AAEA,OAAOA,QAAP;AACA,OAAOC,qBAAP;AACA,OAAOC,SAAP,MAAsB,oBAAtB;;AAYA,IAAIC,kBAAkB,GAAgB,YAAY;AAChD,WAASA,kBAAT,CAA4BC,YAA5B,EAA0C;AACxC,QAAIJ,QAAQ,CAACK,EAAT,KAAgB,KAApB,EAA2B;AACzBH,MAAAA,SAAS,CAACE,YAAY,IAAI,IAAjB,EAAuB,0DAAvB,CAAT;AACA,WAAKE,aAAL,GAAqBF,YAArB;AACD;AACF;;AAED,MAAIG,MAAM,GAAGJ,kBAAkB,CAACK,SAAhC;;AAEAD,EAAAA,MAAM,CAACE,WAAP,GAAqB,SAASA,WAAT,CAAqBC,SAArB,EAAgCC,QAAhC,EAA0CC,OAA1C,EAAmD;AACtE,QAAIC,mBAAJ;AAAA,QACIC,KAAK,GAAG,IADZ;;AAGA,KAACD,mBAAmB,GAAG,KAAKP,aAA5B,KAA8C,IAA9C,GAAqD,KAAK,CAA1D,GAA8DO,mBAAmB,CAACJ,WAApB,CAAgCC,SAAhC,CAA9D;AACA,QAAIK,YAAY,GAAGd,qBAAqB,CAACQ,WAAtB,CAAkCC,SAAlC,EAA6CC,QAA7C,EAAuDC,OAAvD,CAAnB;AACA,WAAO;AACLI,MAAAA,MAAM,EAAE,SAASA,MAAT,GAAkB;AACxB,YAAID,YAAY,IAAI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,oBAAJ;;AAEA7B,IAAAA,SAAS,CAACQ,SAAS,IAAI,IAAd,EAAoB,wEAApB,CAAT;AACA,KAACqB,oBAAoB,GAAG,KAAKzB,aAA7B,KAA+C,IAA/C,GAAsD,KAAK,CAA3D,GAA+DyB,oBAAoB,CAACb,eAArB,CAAqC,KAAKc,aAAL,CAAmBtB,SAAnB,CAArC,CAA/D;AACAT,IAAAA,qBAAqB,CAAC6B,kBAAtB,CAAyCpB,SAAzC;AACD,GAND;;AAQAH,EAAAA,MAAM,CAACyB,aAAP,GAAuB,SAASA,aAAT,CAAuBtB,SAAvB,EAAkC;AACvD,WAAOT,qBAAqB,CAAC+B,aAAtB,CAAoCtB,SAApC,CAAP;AACD,GAFD;;AAIA,SAAOP,kBAAP;AACD,CAlEqC,EAAtC;;AAoEA,SAASA,kBAAkB,IAAI8B,OAA/B","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\nimport invariant from 'fbjs/lib/invariant';\n\n/**\n * `NativeEventEmitter` is intended for use by Native Modules to emit events to\n * JavaScript listeners. If a `NativeModule` is supplied to the constructor, it\n * will be notified (via `addListener` and `removeListeners`) when the listener\n * count changes to manage \"native memory\".\n *\n * Currently, all native events are fired via a global `RCTDeviceEventEmitter`.\n * This means event names must be globally unique, and it means that call sites\n * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).\n */\nvar NativeEventEmitter = /*#__PURE__*/function () {\n  function NativeEventEmitter(nativeModule) {\n    if (Platform.OS === 'ios') {\n      invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n      this._nativeModule = nativeModule;\n    }\n  }\n\n  var _proto = NativeEventEmitter.prototype;\n\n  _proto.addListener = function addListener(eventType, listener, context) {\n    var _this$_nativeModule,\n        _this = this;\n\n    (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n    var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n    return {\n      remove: function remove() {\n        if (subscription != null) {\n          var _this$_nativeModule2;\n\n          (_this$_nativeModule2 = _this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1); // $FlowFixMe[incompatible-use]\n\n          subscription.remove();\n          subscription = null;\n        }\n      }\n    };\n  }\n  /**\n   * @deprecated Use `remove` on the EventSubscription from `addListener`.\n   */\n  ;\n\n  _proto.removeListener = function removeListener(eventType, listener) {\n    var _this$_nativeModule3;\n\n    (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1); // NOTE: This will report a deprecation notice via `console.error`.\n    // $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.\n\n    RCTDeviceEventEmitter.removeListener(eventType, listener);\n  };\n\n  _proto.emit = function emit(eventType) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n\n    // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is\n    // included for completeness.\n    RCTDeviceEventEmitter.emit.apply(RCTDeviceEventEmitter, [eventType].concat(args));\n  };\n\n  _proto.removeAllListeners = function removeAllListeners(eventType) {\n    var _this$_nativeModule4;\n\n    invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n    (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n    RCTDeviceEventEmitter.removeAllListeners(eventType);\n  };\n\n  _proto.listenerCount = function listenerCount(eventType) {\n    return RCTDeviceEventEmitter.listenerCount(eventType);\n  };\n\n  return NativeEventEmitter;\n}();\n\nexport { NativeEventEmitter as default };"]},"metadata":{},"sourceType":"module"}