text: "use strict";exports.__esModule=!0,exports.default=getTextDimension;var _updateTextNode=_interopRequireDefault(require("./svg/updateTextNode")),_getBBoxCeil=_interopRequireDefault(require("./svg/getBBoxCeil")),_factories=require("./svg/factories");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function getTextDimension(a,b){var c=a.text,d=a.className,e=a.style,f=a.container;// Empty string
  if(0===c.length)return{height:0,width:0};var g=_factories.hiddenSvgFactory.createInContainer(f),h=_factories.textFactory.createInContainer(g);(0,_updateTextNode.default)(h,{className:d,style:e,text:c});var i=(0,_getBBoxCeil.default)(h,b);// The nodes are added to the DOM briefly only to make getBBox works.
  // (If not added to DOM getBBox will always return 0x0.)
  // After that the svg nodes are not needed.
  // We delay its removal in case there are subsequent calls to this function
  // that can reuse the svg nodes.
  // Experiments have shown that reusing existing nodes
  // instead of deleting and adding new ones can save lot of time.
  return setTimeout(function(){_factories.textFactory.removeFromContainer(g),_factories.hiddenSvgFactory.removeFromContainer(f)},500),i}