import{__exports as r}from"../../../_virtual/es.string.match-all.mjs";import{__require as e}from"../internals/export.mjs";import{__require as t}from"../internals/function-call.mjs";import{__require as i}from"../internals/function-uncurry-this-clause.mjs";import{__require as n}from"../internals/iterator-create-constructor.mjs";import{__require as s}from"../internals/create-iter-result-object.mjs";import{__require as o}from"../internals/require-object-coercible.mjs";import{__require as a}from"../internals/to-length.mjs";import{__require as m}from"../internals/to-string.mjs";import{__require as l}from"../internals/an-object.mjs";import{__require as u}from"../internals/is-object.mjs";import{__require as _}from"../internals/classof-raw.mjs";import{__require as f}from"../internals/is-regexp.mjs";import{__require as p}from"../internals/regexp-get-flags.mjs";import{__require as c}from"../internals/get-method.mjs";import{__require as g}from"../internals/define-built-in.mjs";import{__require as j}from"../internals/fails.mjs";import{__require as q}from"../internals/well-known-symbol.mjs";import{__require as x}from"../internals/species-constructor.mjs";import{__require as d}from"../internals/advance-string-index.mjs";import{__require as h}from"../internals/regexp-exec-abstract.mjs";import{__require as b}from"../internals/internal-state.mjs";import{__require as v}from"../internals/is-pure.mjs";var w;function E(){if(w)return r;w=1;var E=e(),R=t(),y=i(),I=n(),A=s(),S=o(),k=a(),F=m(),O=l(),T=u(),z=_(),B=f(),C=p(),D=c(),G=g(),H=j(),J=q(),K=x(),L=d(),M=h(),N=b(),P=v(),Q=J("matchAll"),U="RegExp String",V=U+" Iterator",W=N.set,X=N.getterFor(V),Y=RegExp.prototype,Z=TypeError,$=y("".indexOf),rr=y("".matchAll),er=!!rr&&!H(function(){rr("a",/./)}),tr=I(function(r,e,t,i){W(this,{type:V,regexp:r,string:e,global:t,unicode:i,done:!1})},U,function(){var r=X(this);if(r.done)return A(void 0,!0);var e=r.regexp,t=r.string,i=M(e,t);return null===i?(r.done=!0,A(void 0,!0)):r.global?(""===F(i[0])&&(e.lastIndex=L(t,k(e.lastIndex),r.unicode)),A(i,!1)):(r.done=!0,A(i,!1))}),ir=function(r){var e,t,i,n=O(this),s=F(r),o=K(n,RegExp),a=F(C(n));return e=new o(o===RegExp?n.source:n,a),t=!!~$(a,"g"),i=!!~$(a,"u"),e.lastIndex=k(n.lastIndex),new tr(e,s,t,i)};return E({target:"String",proto:!0,forced:er},{matchAll:function(r){var e,t,i,n,s=S(this);if(T(r)){if(B(r)&&(e=F(S(C(r))),!~$(e,"g")))throw new Z("`.matchAll` does not allow non-global regexes");if(er)return rr(s,r);if(void 0===(i=D(r,Q))&&P&&"RegExp"===z(r)&&(i=ir),i)return R(i,r,s)}else if(er)return rr(s,r);return t=F(s),n=new RegExp(r,"g"),P?R(ir,n,t):n[Q](t)}}),P||Q in Y||G(Y,Q,ir),r}export{E as __require};