{"version":3,"sources":["node_modules\\react-dom\\lib\\FallbackCompositionState.js"],"names":["_assign","require","PooledClass","getTextContentAccessor","FallbackCompositionState","root","_root","_startText","getText","_fallbackText","prototype","destructor","value","getData","start","startValue","startLength","length","end","endValue","endLength","minEnd","sliceTail","undefined","slice","addPoolingTo","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,SAAUC,QAAQ,eAAR,CAAd;;AAEA,GAAIC,aAAcD,QAAQ,eAAR,CAAlB;;AAEA,GAAIE,wBAAyBF,QAAQ,0BAAR,CAA7B;;;;;;;;;;;;;AAaA,QAASG,yBAAT,CAAkCC,IAAlC,CAAwC;AACtC,KAAKC,KAAL,CAAaD,IAAb;AACA,KAAKE,UAAL,CAAkB,KAAKC,OAAL,EAAlB;AACA,KAAKC,aAAL,CAAqB,IAArB;AACD;;AAEDT,QAAQI,yBAAyBM,SAAjC,CAA4C;AAC1CC,WAAY,qBAAY;AACtB,KAAKL,KAAL,CAAa,IAAb;AACA,KAAKC,UAAL,CAAkB,IAAlB;AACA,KAAKE,aAAL,CAAqB,IAArB;AACD,CALyC;;;;;;;AAY1CD,QAAS,kBAAY;AACnB,GAAI,SAAW,MAAKF,KAApB,CAA2B;AACzB,MAAO,MAAKA,KAAL,CAAWM,KAAlB;AACD;AACD,MAAO,MAAKN,KAAL,CAAWH,wBAAX,CAAP;AACD,CAjByC;;;;;;;;AAyB1CU,QAAS,kBAAY;AACnB,GAAI,KAAKJ,aAAT,CAAwB;AACtB,MAAO,MAAKA,aAAZ;AACD;;AAED,GAAIK,MAAJ;AACA,GAAIC,YAAa,KAAKR,UAAtB;AACA,GAAIS,aAAcD,WAAWE,MAA7B;AACA,GAAIC,IAAJ;AACA,GAAIC,UAAW,KAAKX,OAAL,EAAf;AACA,GAAIY,WAAYD,SAASF,MAAzB;;AAEA,IAAKH,MAAQ,CAAb,CAAgBA,MAAQE,WAAxB,CAAqCF,OAArC,CAA8C;AAC5C,GAAIC,WAAWD,KAAX,IAAsBK,SAASL,KAAT,CAA1B,CAA2C;AACzC;AACD;AACF;;AAED,GAAIO,QAASL,YAAcF,KAA3B;AACA,IAAKI,IAAM,CAAX,CAAcA,KAAOG,MAArB,CAA6BH,KAA7B,CAAoC;AAClC,GAAIH,WAAWC,YAAcE,GAAzB,IAAkCC,SAASC,UAAYF,GAArB,CAAtC,CAAiE;AAC/D;AACD;AACF;;AAED,GAAII,WAAYJ,IAAM,CAAN,CAAU,EAAIA,GAAd,CAAoBK,SAApC;AACA,KAAKd,aAAL,CAAqBU,SAASK,KAAT,CAAeV,KAAf,CAAsBQ,SAAtB,CAArB;AACA,MAAO,MAAKb,aAAZ;AACD,CArDyC,CAA5C;;;AAwDAP,YAAYuB,YAAZ,CAAyBrB,wBAAzB;;AAEAsB,OAAOC,OAAP,CAAiBvB,wBAAjB","file":"FallbackCompositionState.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 _assign = require('object-assign');\n\nvar PooledClass = require('./PooledClass');\n\nvar getTextContentAccessor = require('./getTextContentAccessor');\n\n/**\n * This helper class stores information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n * @param {DOMEventTarget} root\n */\nfunction FallbackCompositionState(root) {\n  this._root = root;\n  this._startText = this.getText();\n  this._fallbackText = null;\n}\n\n_assign(FallbackCompositionState.prototype, {\n  destructor: function () {\n    this._root = null;\n    this._startText = null;\n    this._fallbackText = null;\n  },\n\n  /**\n   * Get current text of input.\n   *\n   * @return {string}\n   */\n  getText: function () {\n    if ('value' in this._root) {\n      return this._root.value;\n    }\n    return this._root[getTextContentAccessor()];\n  },\n\n  /**\n   * Determine the differing substring between the initially stored\n   * text content and the current content.\n   *\n   * @return {string}\n   */\n  getData: function () {\n    if (this._fallbackText) {\n      return this._fallbackText;\n    }\n\n    var start;\n    var startValue = this._startText;\n    var startLength = startValue.length;\n    var end;\n    var endValue = this.getText();\n    var endLength = endValue.length;\n\n    for (start = 0; start < startLength; start++) {\n      if (startValue[start] !== endValue[start]) {\n        break;\n      }\n    }\n\n    var minEnd = startLength - start;\n    for (end = 1; end <= minEnd; end++) {\n      if (startValue[startLength - end] !== endValue[endLength - end]) {\n        break;\n      }\n    }\n\n    var sliceTail = end > 1 ? 1 - end : undefined;\n    this._fallbackText = endValue.slice(start, sliceTail);\n    return this._fallbackText;\n  }\n});\n\nPooledClass.addPoolingTo(FallbackCompositionState);\n\nmodule.exports = FallbackCompositionState;"]}