shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$text$canvas$utils$parseTaggedText = function(global, require, module, exports) {
  function hasTagStyles(style) {
    return !!style.tagStyles && 0 < Object.keys(style.tagStyles).length;
  }
  function hasTagMarkup(text) {
    return text.includes("\x3c");
  }
  function parseTaggedText(text, style) {
    const runs = [], tagStyles = style.tagStyles;
    if (!hasTagStyles(style) || !hasTagMarkup(text)) {
      return runs.push({text, style}), runs;
    }
    style = [style];
    const tagStack = [];
    let currentText = "";
    for (var i = 0; i < text.length;) {
      var char = text[i];
      if ("\x3c" === char) {
        const closeIndex = text.indexOf("\x3e", i);
        if (-1 === closeIndex) {
          currentText += char;
          i++;
          continue;
        }
        const nextOpenIndex = text.indexOf("\x3c", i + 1);
        -1 !== nextOpenIndex && nextOpenIndex < closeIndex ? (currentText += char, i++) : (char = text.slice(i + 1, closeIndex), char.startsWith("/") ? (char = char.slice(1).trim(), 0 < tagStack.length && tagStack[tagStack.length - 1] === char ? (0 < currentText.length && (runs.push({text:currentText, style:style[style.length - 1]}), currentText = ""), style.pop(), tagStack.pop()) : currentText += text.slice(i, closeIndex + 1)) : (char = char.trim(), tagStyles[char] ? (0 < currentText.length && (runs.push({text:currentText, 
        style:style[style.length - 1]}), currentText = ""), i = tagStyles[char], i = style[style.length - 1].clone().assign(i), style.push(i), tagStack.push(char)) : currentText += text.slice(i, closeIndex + 1)), i = closeIndex + 1);
      } else {
        currentText += char, i++;
      }
    }
    0 < currentText.length && runs.push({text:currentText, style:style[style.length - 1]});
    return runs;
  }
  exports.getPlainText = function(text, style) {
    return hasTagStyles(style) && hasTagMarkup(text) ? parseTaggedText(text, style).map(run => run.text).join("") : text;
  };
  exports.hasTagMarkup = hasTagMarkup;
  exports.hasTagStyles = hasTagStyles;
  exports.parseTaggedText = parseTaggedText;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$text$canvas$utils$parseTaggedText.js.map
