text: import toObject from'./to-object.js';const _ref={exports:{}};(function(module,exports){var floor=Math.floor,replace="".replace,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g;module.exports=function(matched,str,position,captures,namedCaptures,replacement){var tailPos=position+matched.length,m=captures.length,symbols=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==namedCaptures&&(namedCaptures=toObject(namedCaptures),symbols=SUBSTITUTION_SYMBOLS),replace.call(replacement,symbols,function(match,ch){var capture;switch(ch.charAt(0)){case"$":return "$";case"&":return matched;case"`":return str.slice(0,position);case"'":return str.slice(tailPos);case"<":capture=namedCaptures[ch.slice(1,-1)];break;default:var n=+ch;if(0==n)return match;if(n>m){var f=floor(n/10);return 0===f?match:f<=m?void 0===captures[f-1]?ch.charAt(1):captures[f-1]+ch.charAt(1):match}capture=captures[n-1];}return void 0===capture?"":capture})};})(_ref,_ref.exports);var getSubstitution = _ref.exports;export default getSubstitution;