{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport invariant from 'fbjs/lib/invariant';\nimport canUseDOM from \"../../modules/canUseDom\";\nvar dimensions = {\n  window: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  },\n  screen: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  }\n};\nvar listeners = {};\nvar shouldInit = canUseDOM;\nfunction update() {\n  if (!canUseDOM) {\n    return;\n  }\n  var win = window;\n  var height;\n  var width;\n  if (win.visualViewport) {\n    var visualViewport = win.visualViewport;\n    height = Math.round(visualViewport.height * visualViewport.scale);\n    width = Math.round(visualViewport.width * visualViewport.scale);\n  } else {\n    var docEl = win.document.documentElement;\n    height = docEl.clientHeight;\n    width = docEl.clientWidth;\n  }\n  dimensions.window = {\n    fontScale: 1,\n    height: height,\n    scale: win.devicePixelRatio || 1,\n    width: width\n  };\n  dimensions.screen = {\n    fontScale: 1,\n    height: win.screen.height,\n    scale: win.devicePixelRatio || 1,\n    width: win.screen.width\n  };\n}\nfunction handleResize() {\n  update();\n  if (Array.isArray(listeners['change'])) {\n    listeners['change'].forEach(function (handler) {\n      return handler(dimensions);\n    });\n  }\n}\nvar Dimensions = function () {\n  function Dimensions() {\n    _classCallCheck(this, Dimensions);\n  }\n  _createClass(Dimensions, null, [{\n    key: \"get\",\n    value: function get(dimension) {\n      if (shouldInit) {\n        shouldInit = false;\n        update();\n      }\n      invariant(dimensions[dimension], \"No dimension set for key \" + dimension);\n      return dimensions[dimension];\n    }\n  }, {\n    key: \"set\",\n    value: function set(initialDimensions) {\n      if (initialDimensions) {\n        if (canUseDOM) {\n          invariant(false, 'Dimensions cannot be set in the browser');\n        } else {\n          if (initialDimensions.screen != null) {\n            dimensions.screen = initialDimensions.screen;\n          }\n          if (initialDimensions.window != null) {\n            dimensions.window = initialDimensions.window;\n          }\n        }\n      }\n    }\n  }, {\n    key: \"addEventListener\",\n    value: function addEventListener(type, handler) {\n      var _this = this;\n      listeners[type] = listeners[type] || [];\n      listeners[type].push(handler);\n      return {\n        remove: function remove() {\n          _this.removeEventListener(type, handler);\n        }\n      };\n    }\n  }, {\n    key: \"removeEventListener\",\n    value: function removeEventListener(type, handler) {\n      if (Array.isArray(listeners[type])) {\n        listeners[type] = listeners[type].filter(function (_handler) {\n          return _handler !== handler;\n        });\n      }\n    }\n  }]);\n  return Dimensions;\n}();\nexport { Dimensions as default };\nif (canUseDOM) {\n  if (window.visualViewport) {\n    window.visualViewport.addEventListener('resize', handleResize, false);\n  } else {\n    window.addEventListener('resize', handleResize, false);\n  }\n}","map":{"version":3,"names":["invariant","canUseDOM","dimensions","window","fontScale","height","scale","width","screen","listeners","shouldInit","update","win","visualViewport","Math","round","docEl","document","documentElement","clientHeight","clientWidth","devicePixelRatio","handleResize","Array","isArray","forEach","handler","Dimensions","_classCallCheck","_createClass","key","value","get","dimension","set","initialDimensions","addEventListener","type","_this","push","remove","removeEventListener","filter","_handler","default"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/react-native-web/dist/exports/Dimensions/index.js"],"sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and 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 */\n\nimport invariant from 'fbjs/lib/invariant';\nimport canUseDOM from '../../modules/canUseDom';\nvar dimensions = {\n  window: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  },\n  screen: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  }\n};\nvar listeners = {};\nvar shouldInit = canUseDOM;\nfunction update() {\n  if (!canUseDOM) {\n    return;\n  }\n  var win = window;\n  var height;\n  var width;\n\n  /**\n   * iOS does not update viewport dimensions on keyboard open/close.\n   * window.visualViewport(https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport)\n   * is used instead of document.documentElement.clientHeight (which remains as a fallback)\n   */\n  if (win.visualViewport) {\n    var visualViewport = win.visualViewport;\n    /**\n     * We are multiplying by scale because height and width from visual viewport\n     * also react to pinch zoom, and become smaller when zoomed. But it is not desired\n     * behaviour, since originally documentElement client height and width were used,\n     * and they do not react to pinch zoom.\n     */\n    height = Math.round(visualViewport.height * visualViewport.scale);\n    width = Math.round(visualViewport.width * visualViewport.scale);\n  } else {\n    var docEl = win.document.documentElement;\n    height = docEl.clientHeight;\n    width = docEl.clientWidth;\n  }\n  dimensions.window = {\n    fontScale: 1,\n    height,\n    scale: win.devicePixelRatio || 1,\n    width\n  };\n  dimensions.screen = {\n    fontScale: 1,\n    height: win.screen.height,\n    scale: win.devicePixelRatio || 1,\n    width: win.screen.width\n  };\n}\nfunction handleResize() {\n  update();\n  if (Array.isArray(listeners['change'])) {\n    listeners['change'].forEach(handler => handler(dimensions));\n  }\n}\nexport default class Dimensions {\n  static get(dimension) {\n    if (shouldInit) {\n      shouldInit = false;\n      update();\n    }\n    invariant(dimensions[dimension], \"No dimension set for key \" + dimension);\n    return dimensions[dimension];\n  }\n  static set(initialDimensions) {\n    if (initialDimensions) {\n      if (canUseDOM) {\n        invariant(false, 'Dimensions cannot be set in the browser');\n      } else {\n        if (initialDimensions.screen != null) {\n          dimensions.screen = initialDimensions.screen;\n        }\n        if (initialDimensions.window != null) {\n          dimensions.window = initialDimensions.window;\n        }\n      }\n    }\n  }\n  static addEventListener(type, handler) {\n    listeners[type] = listeners[type] || [];\n    listeners[type].push(handler);\n    return {\n      remove: () => {\n        this.removeEventListener(type, handler);\n      }\n    };\n  }\n  static removeEventListener(type, handler) {\n    if (Array.isArray(listeners[type])) {\n      listeners[type] = listeners[type].filter(_handler => _handler !== handler);\n    }\n  }\n}\nif (canUseDOM) {\n  if (window.visualViewport) {\n    window.visualViewport.addEventListener('resize', handleResize, false);\n  } else {\n    window.addEventListener('resize', handleResize, false);\n  }\n}"],"mappings":";;AAUA,OAAOA,SAA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