import{__exports as r}from"../../../_virtual/es.string.replace-all.mjs";import{__require as e}from"../internals/export.mjs";import{__require as i}from"../internals/function-call.mjs";import{__require as t}from"../internals/function-uncurry-this.mjs";import{__require as s}from"../internals/require-object-coercible.mjs";import{__require as n}from"../internals/is-callable.mjs";import{__require as o}from"../internals/is-object.mjs";import{__require as a}from"../internals/is-regexp.mjs";import{__require as m}from"../internals/to-string.mjs";import{__require as l}from"../internals/get-method.mjs";import{__require as _}from"../internals/regexp-get-flags.mjs";import{__require as u}from"../internals/get-substitution.mjs";import{__require as p}from"../internals/well-known-symbol.mjs";import{__require as f}from"../internals/is-pure.mjs";var c;function g(){if(c)return r;c=1;var g=e(),j=i(),q=t(),h=s(),x=n(),b=o(),v=a(),w=m(),d=l(),y=_(),A=u(),k=p(),E=f(),M=k("replace"),O=TypeError,S=q("".indexOf),T=q("".replace),z=q("".slice),B=Math.max;return g({target:"String",proto:!0},{replaceAll:function(r,e){var i,t,s,n,o,a,m,l,_,u,p=h(this),f=0,c="";if(b(r)){if((i=v(r))&&(t=w(h(y(r))),!~S(t,"g")))throw new O("`.replaceAll` does not allow non-global regexes");if(s=d(r,M))return j(s,r,p,e);if(E&&i)return T(w(p),r,e)}for(n=w(p),o=w(r),(a=x(e))||(e=w(e)),m=o.length,l=B(1,m),_=S(n,o);-1!==_;)u=a?w(e(o,_,n)):A(o,n,_,[],void 0,e),c+=z(n,f,_)+u,f=_+m,_=_+l>n.length?-1:S(n,o,_+l);return f<n.length&&(c+=z(n,f)),c}}),r}export{g as __require};