{"version":3,"sources":["node_modules\\react\\lib\\ReactChildren.js"],"names":["PooledClass","require","ReactElement","emptyFunction","traverseAllChildren","twoArgumentPooler","fourArgumentPooler","userProvidedKeyEscapeRegex","escapeUserProvidedKey","text","replace","ForEachBookKeeping","forEachFunction","forEachContext","func","context","count","prototype","destructor","addPoolingTo","forEachSingleChild","bookKeeping","child","name","call","forEachChildren","children","forEachFunc","traverseContext","getPooled","release","MapBookKeeping","mapResult","keyPrefix","mapFunction","mapContext","result","mapSingleChildIntoContext","childKey","mappedChild","Array","isArray","mapIntoWithKeyPrefixInternal","thatReturnsArgument","isValidElement","cloneAndReplaceKey","key","push","array","prefix","escapedPrefix","mapChildren","forEachSingleChildDummy","countChildren","toArray","ReactChildren","forEach","map","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,aAAcC,QAAQ,eAAR,CAAlB;AACA,GAAIC,cAAeD,QAAQ,gBAAR,CAAnB;;AAEA,GAAIE,eAAgBF,QAAQ,wBAAR,CAApB;AACA,GAAIG,qBAAsBH,QAAQ,uBAAR,CAA1B;;AAEA,GAAII,mBAAoBL,YAAYK,iBAApC;AACA,GAAIC,oBAAqBN,YAAYM,kBAArC;;AAEA,GAAIC,4BAA6B,MAAjC;AACA,QAASC,sBAAT,CAA+BC,IAA/B,CAAqC;AACnC,MAAO,CAAC,GAAKA,IAAN,EAAYC,OAAZ,CAAoBH,0BAApB,CAAgD,KAAhD,CAAP;AACD;;;;;;;;;;AAUD,QAASI,mBAAT,CAA4BC,eAA5B,CAA6CC,cAA7C,CAA6D;AAC3D,KAAKC,IAAL,CAAYF,eAAZ;AACA,KAAKG,OAAL,CAAeF,cAAf;AACA,KAAKG,KAAL,CAAa,CAAb;AACD;AACDL,mBAAmBM,SAAnB,CAA6BC,UAA7B,CAA0C,UAAY;AACpD,KAAKJ,IAAL,CAAY,IAAZ;AACA,KAAKC,OAAL,CAAe,IAAf;AACA,KAAKC,KAAL,CAAa,CAAb;AACD,CAJD;AAKAhB,Y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OAArC,CAA8C;AAC5C,GAAIW,UAAY,IAAhB,CAAsB;AACpB,MAAOA,SAAP;AACD;AACD,GAAIU,QAAS,EAAb;AACAM,6BAA6BhB,QAA7B,CAAuCU,MAAvC,CAA+C,IAA/C,CAAqDtB,IAArD,CAA2DC,OAA3D;AACA,MAAOqB,OAAP;AACD;;AAED,QAASgB,wBAAT,CAAiCxB,eAAjC,CAAkDN,KAAlD,CAAyDC,IAAzD,CAA+D;AAC7D,MAAO,KAAP;AACD;;;;;;;;;;;AAWD,QAAS8B,cAAT,CAAuB3B,QAAvB,CAAiCX,OAAjC,CAA0C;AACxC,MAAOX,qBAAoBsB,QAApB,CAA8B0B,uBAA9B,CAAuD,IAAvD,CAAP;AACD;;;;;;;;AAQD,QAASE,QAAT,CAAiB5B,QAAjB,CAA2B;AACzB,GAAIU,QAAS,EAAb;AACAM,6BAA6BhB,QAA7B,CAAuCU,MAAvC,CAA+C,IAA/C,CAAqDjC,cAAcwC,mBAAnE;AACA,MAAOP,OAAP;AACD;;AAED,GAAImB,eAAgB;AAClBC,QAAS/B,eADS;AAElBgC,IAAKN,WAFa;AAGlBT,6BAA8BA,4BAHZ;AAIlB1B,MAAOqC,aAJW;AAKlBC,QAASA,OALS,CAApB;;;AAQAI,OAAOC,OAAP,CAAiBJ,aAAjB","file":"ReactChildren.js","sourceRoot":"D:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar PooledClass = require('./PooledClass');\nvar ReactElement = require('./ReactElement');\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar traverseAllChildren = require('./traverseAllChildren');\n\nvar twoArgumentPooler = PooledClass.twoArgumentPooler;\nvar fourArgumentPooler = PooledClass.fourArgumentPooler;\n\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction escapeUserProvidedKey(text) {\n  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n}\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * traversal. Allows avoiding binding callbacks.\n *\n * @constructor ForEachBookKeeping\n * @param {!function} forEachFunction Function to perform traversal with.\n * @param {?*} forEachContext Context to perform context with.\n */\nfunction ForEachBookKeeping(forEachFunction, forEachContext) {\n  this.func = forEachFunction;\n  this.context = forEachContext;\n  this.count = 0;\n}\nForEachBookKeeping.prototype.destructor = function () {\n  this.func = null;\n  this.context = null;\n  this.count = 0;\n};\nPooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);\n\nfunction forEachSingleChild(bookKeeping, child, name) {\n  var func = bookKeeping.func,\n      context = bookKeeping.context;\n\n  func.call(context, child, bookKeeping.count++);\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n  if (children == null) {\n    return children;\n  }\n  var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);\n  traverseAllChildren(children, forEachSingleChild, traverseContext);\n  ForEachBookKeeping.release(traverseContext);\n}\n\n/**\n * PooledClass representing the bookkeeping associated with performing a child\n * mapping. Allows avoiding binding callbacks.\n *\n * @constructor MapBookKeeping\n * @param {!*} mapResult Object containing the ordered map of results.\n * @param {!function} mapFunction Function to perform mapping with.\n * @param {?*} mapContext Context to perform mapping with.\n */\nfunction MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {\n  this.result = mapResult;\n  this.keyPrefix = keyPrefix;\n  this.func = mapFunction;\n  this.context = mapContext;\n  this.count = 0;\n}\nMapBookKeeping.prototype.destructor = function () {\n  this.result = null;\n  this.keyPrefix = null;\n  this.func = null;\n  this.context = null;\n  this.count = 0;\n};\nPooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);\n\nfunction mapSingleChildIntoContext(bookKeeping, child, childKey) {\n  var result = bookKeeping.result,\n      keyPrefix = bookKeeping.keyPrefix,\n      func = bookKeeping.func,\n      context = bookKeeping.context;\n\n\n  var mappedChild = func.call(context, child, bookKeeping.count++);\n  if (Array.isArray(mappedChild)) {\n    mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);\n  } else if (mappedChild != null) {\n    if (ReactElement.isValidElement(mappedChild)) {\n      mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,\n      // Keep both the (mapped) and old keys if they differ, just as\n      // traverseAllChildren used to do for objects as children\n      keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);\n    }\n    result.push(mappedChild);\n  }\n}\n\nfunction mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n  var escapedPrefix = '';\n  if (prefix != null) {\n    escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n  }\n  var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);\n  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n  MapBookKeeping.release(traverseContext);\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map\n *\n * The provided mapFunction(child, key, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n  if (children == null) {\n    return children;\n  }\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n  return result;\n}\n\nfunction forEachSingleChildDummy(traverseContext, child, name) {\n  return null;\n}\n\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\nfunction countChildren(children, context) {\n  return traverseAllChildren(children, forEachSingleChildDummy, null);\n}\n\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray\n */\nfunction toArray(children) {\n  var result = [];\n  mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n  return result;\n}\n\nvar ReactChildren = {\n  forEach: forEachChildren,\n  map: mapChildren,\n  mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,\n  count: countChildren,\n  toArray: toArray\n};\n\nmodule.exports = ReactChildren;"]}