import s from "./index.es151.js";
import m from "./index.es44.js";
import "./index.es52.js";
var u = /(.)^/, b = {
  "'": "'",
  "\\": "\\",
  "\r": "r",
  "\n": "n",
  "\u2028": "u2028",
  "\u2029": "u2029"
}, j = /\\|'|\r|\n|\u2028|\u2029/g;
function w(t) {
  return "\\" + b[t];
}
var d = /^\s*(\w|\$)+\s*$/;
function $(t, e, o) {
  !e && o && (e = o), e = s({}, e, m.templateSettings);
  var h = RegExp([
    (e.escape || u).source,
    (e.interpolate || u).source,
    (e.evaluate || u).source
  ].join("|") + "|$", "g"), _ = 0, r = "__p+='";
  t.replace(h, function(n, p, l, f, v) {
    return r += t.slice(_, v).replace(j, w), _ = v + n.length, p ? r += `'+
((__t=(` + p + `))==null?'':_.escape(__t))+
'` : l ? r += `'+
((__t=(` + l + `))==null?'':__t)+
'` : f && (r += `';
` + f + `
__p+='`), n;
  }), r += `';
`;
  var a = e.variable;
  if (a) {
    if (!d.test(a)) throw new Error(
      "variable is not a bare identifier: " + a
    );
  } else
    r = `with(obj||{}){
` + r + `}
`, a = "obj";
  r = `var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
` + r + `return __p;
`;
  var c;
  try {
    c = new Function(a, "_", r);
  } catch (n) {
    throw n.source = r, n;
  }
  var i = function(n) {
    return c.call(this, n, m);
  };
  return i.source = "function(" + a + `){
` + r + "}", i;
}
export {
  $ as default
};
//# sourceMappingURL=index.es167.js.map
