Socket
Socket
Sign inDemoInstall

@pollyjs/core

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pollyjs/core - npm Package Compare versions

Comparing version 6.0.2 to 6.0.3

2

dist/es/pollyjs-core.min.js

@@ -1,2 +0,2 @@

import{ACTIONS as t,assert as e,timeout as r,MODES as n,EXPIRY_STRATEGIES as i,URL as o,HTTP_STATUS_CODES as s,timestamp as u,buildUrl as c,HTTP_METHODS as a,PollyError as f}from"@pollyjs/utils";import h from"loglevel";import l from"blueimp-md5";import p from"fast-json-stable-stringify";import d from"is-absolute-url";import v from"@sindresorhus/fnv1a";import g from"slugify";import y from"route-recognizer";function m(t,e){return t(e={exports:{}},e.exports),e.exports}var _=m((function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)})),b={}.hasOwnProperty,w=function(t,e){return b.call(t,e)},O=function(t){try{return!!t()}catch(t){return!0}},j=!O((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),S=m((function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)})),E=(S.version,function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}),P=function(t,e,r){if(E(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},A=function(t){if(!x(t))throw TypeError(t+" is not an object!");return t},T=_.document,R=x(T)&&x(T.createElement),k=function(t){return R?T.createElement(t):{}},I=!j&&!O((function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a})),N=function(t,e){if(!x(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!x(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!x(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!x(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},L=Object.defineProperty,F={f:j?Object.defineProperty:function(t,e,r){if(A(t),e=N(e,!0),A(r),I)try{return L(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},M=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=j?function(t,e,r){return F.f(t,e,M(1,r))}:function(t,e,r){return t[e]=r,t},C=function(t,e,r){var n,i,o,s=t&C.F,u=t&C.G,c=t&C.S,a=t&C.P,f=t&C.B,h=t&C.W,l=u?S:S[e]||(S[e]={}),p=l.prototype,d=u?_:c?_[e]:(_[e]||{}).prototype;for(n in u&&(r=e),r)(i=!s&&d&&void 0!==d[n])&&w(l,n)||(o=i?d[n]:r[n],l[n]=u&&"function"!=typeof d[n]?r[n]:f&&i?P(o,_):h&&d[n]==o?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(o):a&&"function"==typeof o?P(Function.call,o):o,a&&((l.virtual||(l.virtual={}))[n]=o,t&C.R&&p&&!p[n]&&q(p,n,o)))};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128;var $,z=C,D=q,H=0,U=Math.random(),W=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++H+U).toString(36))},B=m((function(t){var e=W("meta"),r=F.f,n=0,i=Object.isExtensible||function(){return!0},o=!O((function(){return i(Object.preventExtensions({}))})),s=function(t){r(t,e,{value:{i:"O"+ ++n,w:{}}})},u=t.exports={KEY:e,NEED:!1,fastKey:function(t,r){if(!x(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!w(t,e)){if(!i(t))return"F";if(!r)return"E";s(t)}return t[e].i},getWeak:function(t,r){if(!w(t,e)){if(!i(t))return!0;if(!r)return!1;s(t)}return t[e].w},onFreeze:function(t){return o&&u.NEED&&i(t)&&!w(t,e)&&s(t),t}}})),G=(B.KEY,B.NEED,B.fastKey,B.getWeak,B.onFreeze,m((function(t){var e=_["__core-js_shared__"]||(_["__core-js_shared__"]={});(t.exports=function(t,r){return e[t]||(e[t]=void 0!==r?r:{})})("versions",[]).push({version:S.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}))),J=m((function(t){var e=G("wks"),r=_.Symbol,n="function"==typeof r;(t.exports=function(t){return e[t]||(e[t]=n&&r[t]||(n?r:W)("Symbol."+t))}).store=e})),K=F.f,V=J("toStringTag"),Y=function(t,e,r){t&&!w(t=r?t:t.prototype,V)&&K(t,V,{configurable:!0,value:e})},X={f:J},Q=F.f,Z=function(t){var e=S.Symbol||(S.Symbol={});"_"==t.charAt(0)||t in e||Q(e,t,{value:X.f(t)})},tt={}.toString,et=function(t){return tt.call(t).slice(8,-1)},rt=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==et(t)?t.split(""):Object(t)},nt=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},it=function(t){return rt(nt(t))},ot=Math.ceil,st=Math.floor,ut=function(t){return isNaN(t=+t)?0:(t>0?st:ot)(t)},ct=Math.min,at=function(t){return t>0?ct(ut(t),9007199254740991):0},ft=Math.max,ht=Math.min,lt=G("keys"),pt=function(t){return lt[t]||(lt[t]=W(t))},dt=($=!1,function(t,e,r){var n,i=it(t),o=at(i.length),s=function(t,e){return(t=ut(t))<0?ft(t+e,0):ht(t,e)}(r,o);if($&&e!=e){for(;o>s;)if((n=i[s++])!=n)return!0}else for(;o>s;s++)if(($||s in i)&&i[s]===e)return $||s||0;return!$&&-1}),vt=pt("IE_PROTO"),gt=function(t,e){var r,n=it(t),i=0,o=[];for(r in n)r!=vt&&w(n,r)&&o.push(r);for(;e.length>i;)w(n,r=e[i++])&&(~dt(o,r)||o.push(r));return o},yt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),mt=Object.keys||function(t){return gt(t,yt)},_t={f:Object.getOwnPropertySymbols},bt={f:{}.propertyIsEnumerable},wt=Array.isArray||function(t){return"Array"==et(t)},Ot=function(t){return Object(nt(t))},jt=j?Object.defineProperties:function(t,e){A(t);for(var r,n=mt(e),i=n.length,o=0;i>o;)F.f(t,r=n[o++],e[r]);return t},St=_.document,Et=St&&St.documentElement,Pt=pt("IE_PROTO"),xt=function(){},At=function(){var t,e=k("iframe"),r=yt.length;for(e.style.display="none",Et.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),At=t.F;r--;)delete At.prototype[yt[r]];return At()},Tt=Object.create||function(t,e){var r;return null!==t?(xt.prototype=A(t),r=new xt,xt.prototype=null,r[Pt]=t):r=At(),void 0===e?r:jt(r,e)},Rt=yt.concat("length","prototype"),kt={f:Object.getOwnPropertyNames||function(t){return gt(t,Rt)}},It=kt.f,Nt={}.toString,Lt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ft={f:function(t){return Lt&&"[object Window]"==Nt.call(t)?function(t){try{return It(t)}catch(t){return Lt.slice()}}(t):It(it(t))}},Mt=Object.getOwnPropertyDescriptor,qt={f:j?Mt:function(t,e){if(t=it(t),e=N(e,!0),I)try{return Mt(t,e)}catch(t){}if(w(t,e))return M(!bt.f.call(t,e),t[e])}},Ct=B.KEY,$t=qt.f,zt=F.f,Dt=Ft.f,Ht=_.Symbol,Ut=_.JSON,Wt=Ut&&Ut.stringify,Bt=J("_hidden"),Gt=J("toPrimitive"),Jt={}.propertyIsEnumerable,Kt=G("symbol-registry"),Vt=G("symbols"),Yt=G("op-symbols"),Xt=Object.prototype,Qt="function"==typeof Ht&&!!_t.f,Zt=_.QObject,te=!Zt||!Zt.prototype||!Zt.prototype.findChild,ee=j&&O((function(){return 7!=Tt(zt({},"a",{get:function(){return zt(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=$t(Xt,e);n&&delete Xt[e],zt(t,e,r),n&&t!==Xt&&zt(Xt,e,n)}:zt,re=function(t){var e=Vt[t]=Tt(Ht.prototype);return e._k=t,e},ne=Qt&&"symbol"==typeof Ht.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Ht},ie=function(t,e,r){return t===Xt&&ie(Yt,e,r),A(t),e=N(e,!0),A(r),w(Vt,e)?(r.enumerable?(w(t,Bt)&&t[Bt][e]&&(t[Bt][e]=!1),r=Tt(r,{enumerable:M(0,!1)})):(w(t,Bt)||zt(t,Bt,M(1,{})),t[Bt][e]=!0),ee(t,e,r)):zt(t,e,r)},oe=function(t,e){A(t);for(var r,n=function(t){var e=mt(t),r=_t.f;if(r)for(var n,i=r(t),o=bt.f,s=0;i.length>s;)o.call(t,n=i[s++])&&e.push(n);return e}(e=it(e)),i=0,o=n.length;o>i;)ie(t,r=n[i++],e[r]);return t},se=function(t){var e=Jt.call(this,t=N(t,!0));return!(this===Xt&&w(Vt,t)&&!w(Yt,t))&&(!(e||!w(this,t)||!w(Vt,t)||w(this,Bt)&&this[Bt][t])||e)},ue=function(t,e){if(t=it(t),e=N(e,!0),t!==Xt||!w(Vt,e)||w(Yt,e)){var r=$t(t,e);return!r||!w(Vt,e)||w(t,Bt)&&t[Bt][e]||(r.enumerable=!0),r}},ce=function(t){for(var e,r=Dt(it(t)),n=[],i=0;r.length>i;)w(Vt,e=r[i++])||e==Bt||e==Ct||n.push(e);return n},ae=function(t){for(var e,r=t===Xt,n=Dt(r?Yt:it(t)),i=[],o=0;n.length>o;)!w(Vt,e=n[o++])||r&&!w(Xt,e)||i.push(Vt[e]);return i};Qt||(D((Ht=function(){if(this instanceof Ht)throw TypeError("Symbol is not a constructor!");var t=W(arguments.length>0?arguments[0]:void 0),e=function(r){this===Xt&&e.call(Yt,r),w(this,Bt)&&w(this[Bt],t)&&(this[Bt][t]=!1),ee(this,t,M(1,r))};return j&&te&&ee(Xt,t,{configurable:!0,set:e}),re(t)}).prototype,"toString",(function(){return this._k})),qt.f=ue,F.f=ie,kt.f=Ft.f=ce,bt.f=se,_t.f=ae,X.f=function(t){return re(J(t))}),z(z.G+z.W+z.F*!Qt,{Symbol:Ht});for(var fe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),he=0;fe.length>he;)J(fe[he++]);for(var le=mt(J.store),pe=0;le.length>pe;)Z(le[pe++]);z(z.S+z.F*!Qt,"Symbol",{for:function(t){return w(Kt,t+="")?Kt[t]:Kt[t]=Ht(t)},keyFor:function(t){if(!ne(t))throw TypeError(t+" is not a symbol!");for(var e in Kt)if(Kt[e]===t)return e},useSetter:function(){te=!0},useSimple:function(){te=!1}}),z(z.S+z.F*!Qt,"Object",{create:function(t,e){return void 0===e?Tt(t):oe(Tt(t),e)},defineProperty:ie,defineProperties:oe,getOwnPropertyDescriptor:ue,getOwnPropertyNames:ce,getOwnPropertySymbols:ae});var de=O((function(){_t.f(1)}));z(z.S+z.F*de,"Object",{getOwnPropertySymbols:function(t){return _t.f(Ot(t))}}),Ut&&z(z.S+z.F*(!Qt||O((function(){var t=Ht();return"[null]"!=Wt([t])||"{}"!=Wt({a:t})||"{}"!=Wt(Object(t))}))),"JSON",{stringify:function(t){for(var e,r,n=[t],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=e=n[1],(x(e)||void 0!==t)&&!ne(t))return wt(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!ne(e))return e}),n[1]=e,Wt.apply(Ut,n)}}),Ht.prototype[Gt]||q(Ht.prototype,Gt,Ht.prototype.valueOf),Y(Ht,"Symbol"),Y(Math,"Math",!0),Y(_.JSON,"JSON",!0),Z("asyncIterator"),Z("observable");var ve=S.Symbol,ge=function(t,e){return{value:e,done:!!t}},ye={},me={};q(me,J("iterator"),(function(){return this}));var _e=function(t,e,r){t.prototype=Tt(me,{next:M(1,r)}),Y(t,e+" Iterator")},be=pt("IE_PROTO"),we=Object.prototype,Oe=Object.getPrototypeOf||function(t){return t=Ot(t),w(t,be)?t[be]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?we:null},je=J("iterator"),Se=!([].keys&&"next"in[].keys()),Ee=function(){return this},Pe=function(t,e,r,n,i,o,s){_e(r,e,n);var u,c,a,f=function(t){if(!Se&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},h=e+" Iterator",l="values"==i,p=!1,d=t.prototype,v=d[je]||d["@@iterator"]||i&&d[i],g=v||f(i),y=i?l?f("entries"):g:void 0,m="Array"==e&&d.entries||v;if(m&&(a=Oe(m.call(new t)))!==Object.prototype&&a.next&&Y(a,h,!0),l&&v&&"values"!==v.name&&(p=!0,g=function(){return v.call(this)}),s&&(Se||p||!d[je])&&q(d,je,g),ye[e]=g,ye[h]=Ee,i)if(u={values:l?g:f("values"),keys:o?g:f("keys"),entries:y},s)for(c in u)c in d||D(d,c,u[c]);else z(z.P+z.F*(Se||p),e,u);return u};Pe(Array,"Array",(function(t,e){this._t=it(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,ge(1)):ge(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values");ye.Arguments=ye.Array;for(var xe=J("toStringTag"),Ae="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Te=0;Te<Ae.length;Te++){var Re=Ae[Te],ke=_[Re],Ie=ke&&ke.prototype;Ie&&!Ie[xe]&&q(Ie,xe,Re),ye[Re]=ye.Array}var Ne=J("species"),Le=function(t,e){return new(function(t){var e;return wt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!wt(e.prototype)||(e=void 0),x(e)&&null===(e=e[Ne])&&(e=void 0)),void 0===e?Array:e}(t))(e)},Fe=function(t,e){var r=1==t,n=2==t,i=3==t,o=4==t,s=6==t,u=5==t||s,c=e||Le;return function(e,a,f){for(var h,l,p=Ot(e),d=rt(p),v=P(a,f,3),g=at(d.length),y=0,m=r?c(e,g):n?c(e,0):void 0;g>y;y++)if((u||y in d)&&(l=v(h=d[y],y,p),t))if(r)m[y]=l;else if(l)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:m.push(h)}else if(o)return!1;return s?-1:i||o?o:m}},Me=Object.assign,qe=!Me||O((function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Me({},t)[r]||Object.keys(Me({},e)).join("")!=n}))?function(t,e){for(var r=Ot(t),n=arguments.length,i=1,o=_t.f,s=bt.f;n>i;)for(var u,c=rt(arguments[i++]),a=o?mt(c).concat(o(c)):mt(c),f=a.length,h=0;f>h;)u=a[h++],j&&!s.call(c,u)||(r[u]=c[u]);return r}:Me,Ce=function(t,e,r){for(var n in e)r&&t[n]?t[n]=e[n]:q(t,n,e[n]);return t},$e=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t},ze=function(t,e,r,n){try{return n?e(A(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&A(i.call(t)),e}},De=J("iterator"),He=Array.prototype,Ue=J("toStringTag"),We="Arguments"==et(function(){return arguments}()),Be=function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ue))?r:We?et(e):"Object"==(n=et(e))&&"function"==typeof e.callee?"Arguments":n},Ge=J("iterator"),Je=S.getIteratorMethod=function(t){if(null!=t)return t[Ge]||t["@@iterator"]||ye[Be(t)]},Ke=m((function(t){var e={},r={},n=t.exports=function(t,n,i,o,s){var u,c,a,f,h,l=s?function(){return t}:Je(t),p=P(i,o,n?2:1),d=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(void 0===(h=l)||ye.Array!==h&&He[De]!==h){for(a=l.call(t);!(c=a.next()).done;)if((f=ze(a,p,c.value,n))===e||f===r)return f}else for(u=at(t.length);u>d;d++)if((f=n?p(A(c=t[d])[0],c[1]):p(t[d]))===e||f===r)return f};n.BREAK=e,n.RETURN=r})),Ve=function(t,e){if(!x(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},Ye=B.getWeak,Xe=Fe(5),Qe=Fe(6),Ze=0,tr=function(t){return t._l||(t._l=new er)},er=function(){this.a=[]},rr=function(t,e){return Xe(t.a,(function(t){return t[0]===e}))};er.prototype={get:function(t){var e=rr(this,t);if(e)return e[1]},has:function(t){return!!rr(this,t)},set:function(t,e){var r=rr(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=Qe(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}};var nr={getConstructor:function(t,e,r,n){var i=t((function(t,o){$e(t,i,e,"_i"),t._t=e,t._i=Ze++,t._l=void 0,null!=o&&Ke(o,r,t[n],t)}));return Ce(i.prototype,{delete:function(t){if(!x(t))return!1;var r=Ye(t);return!0===r?tr(Ve(this,e)).delete(t):r&&w(r,this._i)&&delete r[this._i]},has:function(t){if(!x(t))return!1;var r=Ye(t);return!0===r?tr(Ve(this,e)).has(t):r&&w(r,this._i)}}),i},def:function(t,e,r){var n=Ye(A(e),!0);return!0===n?tr(t).set(e,r):n[t._i]=r,t},ufstore:tr},ir=F.f,or=Fe(0),sr=function(t,e,r,n,i,o){var s=_[t],u=s,c=i?"set":"add",a=u&&u.prototype,f={};return j&&"function"==typeof u&&(o||a.forEach&&!O((function(){(new u).entries().next()})))?(u=e((function(e,r){$e(e,u,t,"_c"),e._c=new s,null!=r&&Ke(r,i,e[c],e)})),or("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),(function(t){var e="add"==t||"set"==t;!(t in a)||o&&"clear"==t||q(u.prototype,t,(function(r,n){if($e(this,u,t),!e&&o&&!x(r))return"get"==t&&void 0;var i=this._c[t](0===r?0:r,n);return e?this:i}))})),o||ir(u.prototype,"size",{get:function(){return this._c.size}})):(u=n.getConstructor(e,t,i,c),Ce(u.prototype,r),B.NEED=!0),Y(u,t),f[t]=u,z(z.G+z.W+z.F,f),o||n.setStrong(u,t,i),u},ur=(m((function(t){var e,r=Fe(0),n=Ve,i=!_.ActiveXObject&&"ActiveXObject"in _,o=B.getWeak,s=Object.isExtensible,u=nr.ufstore,c=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},a={get:function(t){if(x(t)){var e=o(t);return!0===e?u(Ve(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return nr.def(Ve(this,"WeakMap"),t,e)}},f=t.exports=sr("WeakMap",c,a,nr,!0,!0);n&&i&&(e=nr.getConstructor(c,"WeakMap"),qe(e.prototype,a),B.NEED=!0,r(["delete","has","get","set"],(function(t){var r=f.prototype,n=r[t];D(r,t,(function(r,i){if(x(r)&&!s(r)){this._f||(this._f=new e);var o=this._f[t](r,i);return"set"==t?this:o}return n.call(this,r,i)}))})))})),function(t){z(z.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})});ur("WeakMap");var cr=function(t){z(z.S,t,{from:function(t){var e,r,n,i,o=arguments[1];return E(this),(e=void 0!==o)&&E(o),null==t?new this:(r=[],e?(n=0,i=P(o,arguments[2],2),Ke(t,!1,(function(t){r.push(i(t,n++))}))):Ke(t,!1,r.push,r),new this(r))}})};cr("WeakMap");var ar,fr=S.WeakMap,hr=(ar=!0,function(t,e){var r,n,i=String(nt(t)),o=ut(e),s=i.length;return o<0||o>=s?ar?"":void 0:(r=i.charCodeAt(o))<55296||r>56319||o+1===s||(n=i.charCodeAt(o+1))<56320||n>57343?ar?i.charAt(o):r:ar?i.slice(o,o+2):n-56320+(r-55296<<10)+65536});Pe(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=hr(e,r),this._i+=t.length,{value:t,done:!1})}));var lr=J("species"),pr=function(t){var e="function"==typeof S[t]?S[t]:_[t];j&&e&&!e[lr]&&F.f(e,lr,{configurable:!0,get:function(){return this}})},dr=F.f,vr=B.fastKey,gr=j?"_s":"size",yr=function(t,e){var r,n=vr(e);if("F"!==n)return t._i[n];for(r=t._f;r;r=r.n)if(r.k==e)return r},mr={getConstructor:function(t,e,r,n){var i=t((function(t,o){$e(t,i,e,"_i"),t._t=e,t._i=Tt(null),t._f=void 0,t._l=void 0,t[gr]=0,null!=o&&Ke(o,r,t[n],t)}));return Ce(i.prototype,{clear:function(){for(var t=Ve(this,e),r=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];t._f=t._l=void 0,t[gr]=0},delete:function(t){var r=Ve(this,e),n=yr(r,t);if(n){var i=n.n,o=n.p;delete r._i[n.i],n.r=!0,o&&(o.n=i),i&&(i.p=o),r._f==n&&(r._f=i),r._l==n&&(r._l=o),r[gr]--}return!!n},forEach:function(t){Ve(this,e);for(var r,n=P(t,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(t){return!!yr(Ve(this,e),t)}}),j&&dr(i.prototype,"size",{get:function(){return Ve(this,e)[gr]}}),i},def:function(t,e,r){var n,i,o=yr(t,e);return o?o.v=r:(t._l=o={i:i=vr(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[gr]++,"F"!==i&&(t._i[i]=o)),t},getEntry:yr,setStrong:function(t,e,r){Pe(t,e,(function(t,r){this._t=Ve(t,e),this._k=r,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?ge(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,ge(1))}),r?"entries":"values",!r,!0),pr(e)}},_r=(sr("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=mr.getEntry(Ve(this,"Map"),t);return e&&e.v},set:function(t,e){return mr.def(Ve(this,"Map"),0===t?0:t,e)}},mr,!0),function(t){return function(){if(Be(this)!=t)throw TypeError(t+"#toJSON isn't generic");return function(t,e){var r=[];return Ke(t,!1,r.push,r,e),r}(this)}});z(z.P+z.R,"Map",{toJSON:_r("Map")}),ur("Map"),cr("Map");var br,wr=S.Map,Or=bt.f,jr=(br=!1,function(t){for(var e,r=it(t),n=mt(r),i=n.length,o=0,s=[];i>o;)e=n[o++],j&&!Or.call(r,e)||s.push(br?[e,r[e]]:r[e]);return s});z(z.S,"Object",{values:function(t){return jr(t)}});var Sr,Er,Pr,xr=S.Object.values,Ar=J("species"),Tr=function(t,e){var r,n=A(t).constructor;return void 0===n||null==(r=A(n)[Ar])?e:E(r)},Rr=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)},kr=_.process,Ir=_.setImmediate,Nr=_.clearImmediate,Lr=_.MessageChannel,Fr=_.Dispatch,Mr=0,qr={},Cr=function(){var t=+this;if(qr.hasOwnProperty(t)){var e=qr[t];delete qr[t],e()}},$r=function(t){Cr.call(t.data)};Ir&&Nr||(Ir=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return qr[++Mr]=function(){Rr("function"==typeof t?t:Function(t),e)},Sr(Mr),Mr},Nr=function(t){delete qr[t]},"process"==et(kr)?Sr=function(t){kr.nextTick(P(Cr,t,1))}:Fr&&Fr.now?Sr=function(t){Fr.now(P(Cr,t,1))}:Lr?(Pr=(Er=new Lr).port2,Er.port1.onmessage=$r,Sr=P(Pr.postMessage,Pr,1)):_.addEventListener&&"function"==typeof postMessage&&!_.importScripts?(Sr=function(t){_.postMessage(t+"","*")},_.addEventListener("message",$r,!1)):Sr="onreadystatechange"in k("script")?function(t){Et.appendChild(k("script")).onreadystatechange=function(){Et.removeChild(this),Cr.call(t)}}:function(t){setTimeout(P(Cr,t,1),0)});var zr={set:Ir,clear:Nr},Dr=zr.set,Hr=_.MutationObserver||_.WebKitMutationObserver,Ur=_.process,Wr=_.Promise,Br="process"==et(Ur);function Gr(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=E(e),this.reject=E(r)}var Jr={f:function(t){return new Gr(t)}},Kr=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Vr=_.navigator,Yr=Vr&&Vr.userAgent||"",Xr=function(t,e){if(A(t),x(e)&&e.constructor===t)return e;var r=Jr.f(t);return(0,r.resolve)(e),r.promise},Qr=J("iterator"),Zr=!1;try{var tn=[7][Qr]();tn.return=function(){Zr=!0},Array.from(tn,(function(){throw 2}))}catch(t){}var en,rn,nn,on,sn=zr.set,un=function(){var t,e,r,n=function(){var n,i;for(Br&&(n=Ur.domain)&&n.exit();t;){i=t.fn,t=t.next;try{i()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(Br)r=function(){Ur.nextTick(n)};else if(!Hr||_.navigator&&_.navigator.standalone)if(Wr&&Wr.resolve){var i=Wr.resolve(void 0);r=function(){i.then(n)}}else r=function(){Dr.call(_,n)};else{var o=!0,s=document.createTextNode("");new Hr(n).observe(s,{characterData:!0}),r=function(){s.data=o=!o}}return function(n){var i={fn:n,next:void 0};e&&(e.next=i),t||(t=i,r()),e=i}}(),cn=_.TypeError,an=_.process,fn=an&&an.versions,hn=fn&&fn.v8||"",ln=_.Promise,pn="process"==Be(an),dn=function(){},vn=rn=Jr.f,gn=!!function(){try{var t=ln.resolve(1),e=(t.constructor={})[J("species")]=function(t){t(dn,dn)};return(pn||"function"==typeof PromiseRejectionEvent)&&t.then(dn)instanceof e&&0!==hn.indexOf("6.6")&&-1===Yr.indexOf("Chrome/66")}catch(t){}}(),yn=function(t){var e;return!(!x(t)||"function"!=typeof(e=t.then))&&e},mn=function(t,e){if(!t._n){t._n=!0;var r=t._c;un((function(){for(var n=t._v,i=1==t._s,o=0,s=function(e){var r,o,s,u=i?e.ok:e.fail,c=e.resolve,a=e.reject,f=e.domain;try{u?(i||(2==t._h&&wn(t),t._h=1),!0===u?r=n:(f&&f.enter(),r=u(n),f&&(f.exit(),s=!0)),r===e.promise?a(cn("Promise-chain cycle")):(o=yn(r))?o.call(r,c,a):c(r)):a(n)}catch(t){f&&!s&&f.exit(),a(t)}};r.length>o;)s(r[o++]);t._c=[],t._n=!1,e&&!t._h&&_n(t)}))}},_n=function(t){sn.call(_,(function(){var e,r,n,i=t._v,o=bn(t);if(o&&(e=Kr((function(){pn?an.emit("unhandledRejection",i,t):(r=_.onunhandledrejection)?r({promise:t,reason:i}):(n=_.console)&&n.error&&n.error("Unhandled promise rejection",i)})),t._h=pn||bn(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},bn=function(t){return 1!==t._h&&0===(t._a||t._c).length},wn=function(t){sn.call(_,(function(){var e;pn?an.emit("rejectionHandled",t):(e=_.onrejectionhandled)&&e({promise:t,reason:t._v})}))},On=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),mn(e,!0))},jn=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw cn("Promise can't be resolved itself");(e=yn(t))?un((function(){var n={_w:r,_d:!1};try{e.call(t,P(jn,n,1),P(On,n,1))}catch(t){On.call(n,t)}})):(r._v=t,r._s=1,mn(r,!1))}catch(t){On.call({_w:r,_d:!1},t)}}};gn||(ln=function(t){$e(this,ln,"Promise","_h"),E(t),en.call(this);try{t(P(jn,this,1),P(On,this,1))}catch(t){On.call(this,t)}},(en=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Ce(ln.prototype,{then:function(t,e){var r=vn(Tr(this,ln));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=pn?an.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&mn(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),nn=function(){var t=new en;this.promise=t,this.resolve=P(jn,t,1),this.reject=P(On,t,1)},Jr.f=vn=function(t){return t===ln||t===on?new nn(t):rn(t)}),z(z.G+z.W+z.F*!gn,{Promise:ln}),Y(ln,"Promise"),pr("Promise"),on=S.Promise,z(z.S+z.F*!gn,"Promise",{reject:function(t){var e=vn(this);return(0,e.reject)(t),e.promise}}),z(z.S+!0*z.F,"Promise",{resolve:function(t){return Xr(this===on?ln:this,t)}}),z(z.S+z.F*!(gn&&function(t,e){if(!e&&!Zr)return!1;var r=!1;try{var n=[7],i=n[Qr]();i.next=function(){return{done:r=!0}},n[Qr]=function(){return i},t(n)}catch(t){}return r}((function(t){ln.all(t).catch(dn)}))),"Promise",{all:function(t){var e=this,r=vn(e),n=r.resolve,i=r.reject,o=Kr((function(){var r=[],o=0,s=1;Ke(t,!1,(function(t){var u=o++,c=!1;r.push(void 0),s++,e.resolve(t).then((function(t){c||(c=!0,r[u]=t,--s||n(r))}),i)})),--s||n(r)}));return o.e&&i(o.v),r.promise},race:function(t){var e=this,r=vn(e),n=r.reject,i=Kr((function(){Ke(t,!1,(function(t){e.resolve(t).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}}),z(z.P+z.R,"Promise",{finally:function(t){var e=Tr(this,S.Promise||_.Promise),r="function"==typeof t;return this.then(r?function(r){return Xr(e,t()).then((function(){return r}))}:t,r?function(r){return Xr(e,t()).then((function(){throw r}))}:t)}}),z(z.S,"Promise",{try:function(t){var e=Jr.f(this),r=Kr(t);return(r.e?e.reject:e.resolve)(r.v),e.promise}});var Sn=S.Promise;const En={[t.RECORD]:"Recorded",[t.REPLAY]:"Replayed",[t.INTERCEPT]:"Intercepted",[t.PASSTHROUGH]:"Passthrough"};class Pn{constructor(t){this.polly=t,this.log=h.getLogger("@pollyjs/core:"+this.polly.recordingName),this.log.setLevel(t.config.logLevel)}connect(){this._middleware=this.polly.server.any().on("error",(...t)=>this.logRequestError(...t)).on("request",(...t)=>this.logRequest(...t)).on("response",(...t)=>this.logRequestResponse(...t))}disconnect(){this._middleware.off("error"),this._middleware.off("response")}logRequest(t){const{log:e}=t,r=e.getLevel()<=e.levels.DEBUG;e.info(`Request: ${t.method} ${t.url}`,...r?[{request:t}]:[])}logRequestResponse(t,e){const{log:r}=t,n=r.getLevel()<=r.levels.DEBUG;r.info(`Response: ${En[t.action]} ➞ ${t.method} ${t.url} ${e.statusCode} • ${t.responseTime}ms`,...n?[{request:t,response:e}]:[])}logRequestError(t,e){const{log:r}=t,n=r.getLevel()<=r.levels.DEBUG;r.error(`Errored ➞ ${t.method} ${t.url}`,e,...n?[{request:t}]:[])}}function xn(t){return`${t.type}:${t.id}`}class An{constructor(){this._registry=new wr}register(t){e(`Attempted to register ${t} but invalid factory provided. Expected function, received: "${typeof t}"`,"function"==typeof t);const{type:r}=t,n=t.id;e(`Invalid registration id provided. Expected string, received: "${typeof n}"`,"string"==typeof n),e(`Invalid registration type provided. Expected string, received: "${typeof r}"`,"string"==typeof r),this._registry.set(xn(t),t)}unregister(t){const{_registry:e}=this,r="function"==typeof t?xn(t):t;e.delete(r)}lookup(t){return this._registry.get(t)||null}has(t){const{_registry:e}=this,r="function"==typeof t?xn(t):t;return e.has(r)}}var Tn={fixed:t=>()=>r(t),relative:t=>e=>r(t*e)},Rn={mode:n.REPLAY,adapters:[],adapterOptions:{},persister:null,persisterOptions:{keepUnusedRequests:!1,disableSortingHarEntries:!1},logLevel:h.levels.WARN,flushRequestsOnStop:!1,recordIfMissing:!0,recordFailedRequests:!1,expiresIn:null,expiryStrategy:i.WARN,timing:Tn.fixed(0),matchRequestsBy:{method:!0,headers:!0,body:!0,order:!0,url:{protocol:!0,username:!0,password:!0,hostname:!0,port:!0,pathname:!0,query:!0,hash:!1}}};function kn(t){return null!=t&&"object"==typeof t}function In(t,...e){const r=new o(t,...e);return d(t)||(t.startsWith("//")?r.set("protocol",""):function(t){t.set("protocol",""),t.set("host",""),t.set("slashes",!1)}(r)),r}const{keys:Nn}=Object,Ln={get:(t,e)=>t["string"==typeof e?e.toLowerCase():e],set:(t,e,r)=>"string"==typeof e&&(null==r?delete t[e.toLowerCase()]:t[e.toLowerCase()]=r,!0),deleteProperty:(t,e)=>"string"==typeof e&&(delete t[e.toLowerCase()],!0)};function Fn(t){const e=new Proxy({},Ln);return kn(t)&&Nn(t).forEach(r=>e[r]=t[r]),e}const{keys:Mn}=Object,{isArray:qn}=Array,{parse:Cn}=JSON;function $n(t){return"function"==typeof t}var zn={headers:function(t,e,r){const n=new Fn(t);return $n(e)?e(n,r):(kn(e)&&qn(e.exclude)&&e.exclude.forEach(t=>delete n[t]),n)},method:function(t,e,r){return $n(e)?e(t,r):t.toUpperCase()},body:function(t,e,r){return $n(e)?e(t,r):t},url:function(t,e,r){let n=In(t,!0);return $n(e)?n=In(e(t,r),!0):Mn(e||{}).forEach(t=>{$n(e[t])?n.set(t,e[t](n[t],r)):e[t]||n.set(t,"")}),kn(n.query)&&n.set("query",Cn(p(n.query))),n.href}};function Dn(t){const e=v(t).toString();let r=g(function(t){return t.replace(/\W/g,"-")}(t));return r=r.substring(0,100-e.length-1),`${r}_${e}`}function Hn(t){return(t||"").split("/").map(Dn).join("/")}z(z.S,"Array",{isArray:wt});var Un=S.Array.isArray;function Wn(t,e){return t===e||t!=t&&e!=e}function Bn(t,e){for(var r=t.length;r--;)if(Wn(t[r][0],e))return r;return-1}var Gn=Array.prototype.splice;function Jn(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jn.prototype.clear=function(){this.__data__=[],this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,r=Bn(e,t);return!(r<0)&&(r==e.length-1?e.pop():Gn.call(e,r,1),--this.size,!0)},Jn.prototype.get=function(t){var e=this.__data__,r=Bn(e,t);return r<0?void 0:e[r][1]},Jn.prototype.has=function(t){return Bn(this.__data__,t)>-1},Jn.prototype.set=function(t,e){var r=this.__data__,n=Bn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Kn="object"==typeof global&&global&&global.Object===Object&&global,Vn="object"==typeof self&&self&&self.Object===Object&&self,Yn=Kn||Vn||Function("return this")(),Xn=Yn.Symbol,Qn=Object.prototype,Zn=Qn.hasOwnProperty,ti=Qn.toString,ei=Xn?Xn.toStringTag:void 0;var ri=Object.prototype.toString;var ni=Xn?Xn.toStringTag:void 0;function ii(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ni&&ni in Object(t)?function(t){var e=Zn.call(t,ei),r=t[ei];try{t[ei]=void 0;var n=!0}catch(t){}var i=ti.call(t);return n&&(e?t[ei]=r:delete t[ei]),i}(t):function(t){return ri.call(t)}(t)}function oi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function si(t){if(!oi(t))return!1;var e=ii(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var ui,ci=Yn["__core-js_shared__"],ai=(ui=/[^.]+$/.exec(ci&&ci.keys&&ci.keys.IE_PROTO||""))?"Symbol(src)_1."+ui:"";var fi=Function.prototype.toString;var hi=/^\[object .+?Constructor\]$/,li=Function.prototype,pi=Object.prototype,di=li.toString,vi=pi.hasOwnProperty,gi=RegExp("^"+di.call(vi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yi(t){return!(!oi(t)||(e=t,ai&&ai in e))&&(si(t)?gi:hi).test(function(t){if(null!=t){try{return fi.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function mi(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return yi(r)?r:void 0}var _i=mi(Yn,"Map"),bi=mi(Object,"create");var wi=Object.prototype.hasOwnProperty;var Oi=Object.prototype.hasOwnProperty;function ji(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Si(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ei(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ji.prototype.clear=function(){this.__data__=bi?bi(null):{},this.size=0},ji.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ji.prototype.get=function(t){var e=this.__data__;if(bi){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return wi.call(e,t)?e[t]:void 0},ji.prototype.has=function(t){var e=this.__data__;return bi?void 0!==e[t]:Oi.call(e,t)},ji.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=bi&&void 0===e?"__lodash_hash_undefined__":e,this},Ei.prototype.clear=function(){this.size=0,this.__data__={hash:new ji,map:new(_i||Jn),string:new ji}},Ei.prototype.delete=function(t){var e=Si(this,t).delete(t);return this.size-=e?1:0,e},Ei.prototype.get=function(t){return Si(this,t).get(t)},Ei.prototype.has=function(t){return Si(this,t).has(t)},Ei.prototype.set=function(t,e){var r=Si(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Pi(t){var e=this.__data__=new Jn(t);this.size=e.size}Pi.prototype.clear=function(){this.__data__=new Jn,this.size=0},Pi.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Pi.prototype.get=function(t){return this.__data__.get(t)},Pi.prototype.has=function(t){return this.__data__.has(t)},Pi.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Jn){var n=r.__data__;if(!_i||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ei(n)}return r.set(t,e),this.size=r.size,this};var xi=function(){try{var t=mi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Ai(t,e,r){"__proto__"==e&&xi?xi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ti(t,e,r){(void 0!==r&&!Wn(t[e],r)||void 0===r&&!(e in t))&&Ai(t,e,r)}var Ri,ki=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var u=o[Ri?s:++n];if(!1===e(i[u],u,i))break}return t},Ii="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ni=Ii&&"object"==typeof module&&module&&!module.nodeType&&module,Li=Ni&&Ni.exports===Ii?Yn.Buffer:void 0,Fi=Li?Li.allocUnsafe:void 0;var Mi=Yn.Uint8Array;function qi(t,e){var r,n,i=e?(r=t.buffer,n=new r.constructor(r.byteLength),new Mi(n).set(new Mi(r)),n):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}var Ci=Object.create,$i=function(){function t(){}return function(e){if(!oi(e))return{};if(Ci)return Ci(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var zi,Di,Hi=(zi=Object.getPrototypeOf,Di=Object,function(t){return zi(Di(t))}),Ui=Object.prototype;function Wi(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ui)}function Bi(t){return kn(t)&&"[object Arguments]"==ii(t)}var Gi=Object.prototype,Ji=Gi.hasOwnProperty,Ki=Gi.propertyIsEnumerable,Vi=Bi(function(){return arguments}())?Bi:function(t){return kn(t)&&Ji.call(t,"callee")&&!Ki.call(t,"callee")},Yi=Array.isArray;function Xi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Qi(t){return null!=t&&Xi(t.length)&&!si(t)}var Zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,to=Zi&&"object"==typeof module&&module&&!module.nodeType&&module,eo=to&&to.exports===Zi?Yn.Buffer:void 0,ro=(eo?eo.isBuffer:void 0)||function(){return!1},no=Function.prototype,io=Object.prototype,oo=no.toString,so=io.hasOwnProperty,uo=oo.call(Object);var co={};co["[object Float32Array]"]=co["[object Float64Array]"]=co["[object Int8Array]"]=co["[object Int16Array]"]=co["[object Int32Array]"]=co["[object Uint8Array]"]=co["[object Uint8ClampedArray]"]=co["[object Uint16Array]"]=co["[object Uint32Array]"]=!0,co["[object Arguments]"]=co["[object Array]"]=co["[object ArrayBuffer]"]=co["[object Boolean]"]=co["[object DataView]"]=co["[object Date]"]=co["[object Error]"]=co["[object Function]"]=co["[object Map]"]=co["[object Number]"]=co["[object Object]"]=co["[object RegExp]"]=co["[object Set]"]=co["[object String]"]=co["[object WeakMap]"]=!1;var ao="object"==typeof exports&&exports&&!exports.nodeType&&exports,fo=ao&&"object"==typeof module&&module&&!module.nodeType&&module,ho=fo&&fo.exports===ao&&Kn.process,lo=function(){try{var t=fo&&fo.require&&fo.require("util").types;return t||ho&&ho.binding&&ho.binding("util")}catch(t){}}(),po=lo&&lo.isTypedArray,vo=po?function(t){return function(e){return t(e)}}(po):function(t){return kn(t)&&Xi(t.length)&&!!co[ii(t)]};function go(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var yo=Object.prototype.hasOwnProperty;function mo(t,e,r){var n=t[e];yo.call(t,e)&&Wn(n,r)&&(void 0!==r||e in t)||Ai(t,e,r)}var _o=/^(?:0|[1-9]\d*)$/;function bo(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&_o.test(t))&&t>-1&&t%1==0&&t<e}var wo=Object.prototype.hasOwnProperty;function Oo(t,e){var r=Yi(t),n=!r&&Vi(t),i=!r&&!n&&ro(t),o=!r&&!n&&!i&&vo(t),s=r||n||i||o,u=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var a in t)!e&&!wo.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||bo(a,c))||u.push(a);return u}var jo=Object.prototype.hasOwnProperty;function So(t){if(!oi(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Wi(t),r=[];for(var n in t)("constructor"!=n||!e&&jo.call(t,n))&&r.push(n);return r}function Eo(t){return Qi(t)?Oo(t,!0):So(t)}function Po(t){return function(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var u=e[o],c=n?n(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),i?Ai(r,u,c):mo(r,u,c)}return r}(t,Eo(t))}function xo(t,e,r,n,i,o,s){var u=go(t,r),c=go(e,r),a=s.get(c);if(a)Ti(t,r,a);else{var f,h=o?o(u,c,r+"",t,e,s):void 0,l=void 0===h;if(l){var p=Yi(c),d=!p&&ro(c),v=!p&&!d&&vo(c);h=c,p||d||v?Yi(u)?h=u:kn(f=u)&&Qi(f)?h=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(u):d?(l=!1,h=function(t,e){if(e)return t.slice();var r=t.length,n=Fi?Fi(r):new t.constructor(r);return t.copy(n),n}(c,!0)):v?(l=!1,h=qi(c,!0)):h=[]:function(t){if(!kn(t)||"[object Object]"!=ii(t))return!1;var e=Hi(t);if(null===e)return!0;var r=so.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&oo.call(r)==uo}(c)||Vi(c)?(h=u,Vi(u)?h=Po(u):oi(u)&&!si(u)||(h=function(t){return"function"!=typeof t.constructor||Wi(t)?{}:$i(Hi(t))}(c))):l=!1}l&&(s.set(c,h),i(h,c,n,o,s),s.delete(c)),Ti(t,r,h)}}function Ao(t,e,r,n,i){t!==e&&ki(e,(function(o,s){if(i||(i=new Pi),oi(o))xo(t,e,s,r,Ao,n,i);else{var u=n?n(go(t,s),o,s+"",t,e,i):void 0;void 0===u&&(u=o),Ti(t,s,u)}}),Eo)}function To(t){return t}function Ro(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var ko=Math.max;var Io=xi?function(t,e){return xi(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:To,No=Date.now;var Lo=function(t){var e=0,r=0;return function(){var n=No(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Io);function Fo(t,e){return Lo(function(t,e,r){return e=ko(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=ko(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=r(s),Ro(t,this,u)}}(t,e,To),t+"")}var Mo,qo=(Mo=function(t,e,r,n){Ao(t,e,r,n)},Fo((function(t,e){var r=-1,n=e.length,i=n>1?e[n-1]:void 0,o=n>2?e[2]:void 0;for(i=Mo.length>3&&"function"==typeof i?(n--,i):void 0,o&&function(t,e,r){if(!oi(r))return!1;var n=typeof e;return!!("number"==n?Qi(r)&&bo(e,r.length):"string"==n&&e in r)&&Wn(r[e],t)}(e[0],e[1],o)&&(i=n<3?void 0:i,n=1),t=Object(t);++r<n;){var s=e[r];s&&Mo(t,s,r,i)}return t})));function Co(t,e,r){if(Un(t)||["context"].includes(r))return e}function $o(...t){return qo({},...t,Co)}function zo(t){e(`Invalid recording name provided. Expected string, received: "${typeof t}".`,"string"==typeof t),e("Invalid recording name provided. Received An empty or blank string.",t.trim().length>0)}function Do(t){e(`Invalid config provided. Expected object, received: "${typeof t}".`,kn(t)&&!Un(t)),["mode","adapters","adapterOptions","persister","persisterOptions"].forEach(r=>e(`Invalid configuration option provided. The "${r}" option cannot be overridden using the server configuration API.`,!(r in t)))}function Ho(t){e(`Invalid number provided. Expected number, received: "${typeof t}".`,"number"==typeof t),e(`Invalid number provided. The number must be greater than 0, received "${typeof t}".`,t>0)}const{freeze:Uo}=Object,{parse:Wo}=JSON;class Bo{constructor(){this.headers=new Fn}getHeader(t){return this.headers[t]}setHeader(t,e){return this.headers[t]=e,this}setHeaders(t={}){for(const e in t)this.setHeader(e,t[e]);return this}removeHeader(t){return this.setHeader(t,null),this}removeHeaders(t=[]){for(const e of t)this.removeHeader(e);return this}hasHeader(t){return!!this.getHeader(t)}type(t){return this.setHeader("Content-Type",t)}send(t){let e=t;switch(typeof e){case"string":this.hasHeader("Content-Type")||this.type("text/html");break;case"boolean":case"number":case"object":if(null!==e)return this.json(e);e=""}if("string"==typeof e){const t=this.getHeader("Content-Type");t&&!t.includes("charset")&&this.type(t+"; charset=utf-8")}return this.body=e,this}json(t){return this.hasHeader("Content-Type")||this.type("application/json"),this.send(p(t))}jsonBody(){return Wo(this.body)}end(){return Uo(this),Uo(this.headers),this}}var Go="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",Jo="["+Go+"]",Ko=RegExp("^"+Jo+Jo+"*"),Vo=RegExp(Jo+Jo+"*$"),Yo=function(t,e,r){var n={},i=O((function(){return!!Go[t]()||"​…"!="​…"[t]()})),o=n[t]=i?e(Xo):Go[t];r&&(n[r]=o),z(z.P+z.F*i,"String",n)},Xo=Yo.trim=function(t,e){return t=String(nt(t)),1&e&&(t=t.replace(Ko,"")),2&e&&(t=t.replace(Vo,"")),t},Qo=Yo,Zo=_.parseInt,ts=Qo.trim,es=/^[-+]?0[xX]/,rs=8!==Zo(Go+"08")||22!==Zo(Go+"0x16")?function(t,e){var r=ts(String(t),3);return Zo(r,e>>>0||(es.test(r)?16:10))}:Zo;z(z.G+z.F*(parseInt!=rs),{parseInt:rs});var ns=S.parseInt;class is extends Bo{constructor(t,e,r,n){super(),this.status(t||200),this.setHeaders(e),this.body=r,this.encoding=n}get ok(){return this.statusCode&&this.statusCode>=200&&this.statusCode<300}get statusText(){return s[this.statusCode]||s[200]}status(t){const r=ns(t,10);return e("[Response] Invalid status code: "+r,r>=100&&r<600),this.statusCode=r,this}sendStatus(t){return this.status(t),this.type("text/plain"),this.send(this.statusText)}}var os=function(t,e){var r=(S.Object||{})[t]||Object[t],n={};n[t]=e(r),z(z.S+z.F*O((function(){r(1)})),"Object",n)};os("keys",(function(){return function(t){return mt(Ot(t))}}));var ss=S.Object.keys,us=S.Object.getOwnPropertySymbols,cs=qt.f;os("getOwnPropertyDescriptor",(function(){return function(t,e){return cs(it(t),e)}}));var as=S.Object,fs=function(t,e){return as.getOwnPropertyDescriptor(t,e)},hs=_.Reflect,ls=hs&&hs.ownKeys||function(t){var e=kt.f(A(t)),r=_t.f;return r?e.concat(r(t)):e},ps=function(t,e,r){e in t?F.f(t,e,M(0,r)):t[e]=r};z(z.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r,n=it(t),i=qt.f,o=ls(n),s={},u=0;o.length>u;)void 0!==(r=i(n,e=o[u++]))&&ps(s,e,r);return s}});var ds=S.Object.getOwnPropertyDescriptors;z(z.S+z.F*!j,"Object",{defineProperties:jt});var vs=S.Object,gs=function(t,e){return vs.defineProperties(t,e)};z(z.S+z.F*!j,"Object",{defineProperty:F.f});var ys,ms=S.Object,_s=function(t,e,r){return ms.defineProperty(t,e,r)},bs=m((function(t){t.exports=function(t,e,r){return e in t?_s(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0})),ws=(ys=bs)&&ys.__esModule&&Object.prototype.hasOwnProperty.call(ys,"default")?ys.default:ys;sr("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return mr.def(Ve(this,"Set"),t=0===t?0:t,t)}},mr);z(z.P+z.R,"Set",{toJSON:_r("Set")}),ur("Set"),cr("Set");var Os=S.Set;function js(t,e,r){let n=0;return function(...i){return++n>=e&&r(),t(...i)}}z(z.S+z.F,"Object",{assign:qe});var Ss=S.Object.assign;const Es=ve();class Ps{constructor(t,r){e(`Invalid type provided. Expected a non-empty string, received: "${typeof t}".`,t&&"string"==typeof t),_s(this,"type",{value:t}),Ss(this,r||{}),this[Es]=!1}stopPropagation(){this[Es]=!0}get shouldStopPropagating(){return this[Es]}}function xs(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function As(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xs(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):xs(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}const Ts=ve(),Rs=ve();function ks(t,r){e(`Invalid event name provided. Expected string, received: "${typeof t}".`,"string"==typeof t),e(`Invalid event name provided: "${t}". Possible events: ${[...r].join(", ")}.`,r.has(t))}class Is{constructor(t={}){const{eventNames:r}=t;e("An array of supported events must be provided via the `eventNames` option.",Un(r)&&r.length>0),this[Ts]=new wr,this[Rs]=new Os(r)}eventNames(){const t=[];return this[Ts].forEach((e,r)=>this.hasListeners(r)&&t.push(r)),t}on(t,r,n={}){ks(t,this[Rs]),function(t){e(`Invalid listener provided. Expected function, received: "${typeof t}".`,"function"==typeof t)}(r);const i=this[Ts],{times:o}=n;if(i.has(t)||i.set(t,new Os),o){Ho(o);const e=js(r,o,()=>this.off(t,e));this.off(t,r),e.listener=r,r=e}return i.get(t).add(r),this}once(t,e,r={}){return this.on(t,e,As(As({},r),{},{times:1})),this}off(t,e){ks(t,this[Rs]);const r=this[Ts];return this.hasListeners(t)&&("function"==typeof e?(r.get(t).delete(e),this.listeners(t).forEach(n=>{n.listener===e&&r.get(t).delete(n)})):r.get(t).clear(t)),this}listeners(t){return ks(t,this[Rs]),this.hasListeners(t)?[...this[Ts].get(t)]:[]}hasListeners(t){ks(t,this[Rs]);const e=this[Ts];return e.has(t)&&e.get(t).size>0}async emit(t,...e){ks(t,this[Rs]);const r=new Ps(t);for(const n of this.listeners(t))if(await n(...e,r),r.shouldStopPropagating)return!1;return!0}async emitParallel(t,...e){ks(t,this[Rs]);const r=new Ps(t);return await Sn.all(this.listeners(t).map(t=>t(...e,r))),!r.shouldStopPropagating}emitSync(t,...r){ks(t,this[Rs]);const n=new Ps(t);for(const i of this.listeners(t)){const o=i(...r,n);if(e(`Attempted to emit a synchronous event "${t}" but an asynchronous listener was called.`,!(kn(o)&&"function"==typeof o.then)),n.shouldStopPropagating)return!1}return!0}}const Ns=ve(),Ls=ve();function Fs(t){t[Ns]=!1,t[Ls]=!1}class Ms extends Ps{constructor(){super("intercept"),Fs(this)}abort(){Fs(this),this[Ns]=!0}passthrough(){Fs(this),this[Ls]=!0}get shouldAbort(){return this[Ns]}get shouldPassthrough(){return this[Ls]}get shouldIntercept(){return!this.shouldAbort&&!this.shouldPassthrough}}const{keys:qs,freeze:Cs}=Object,$s=ve(),zs=ve(),Ds=ve(),Hs=ve(),Us=["identify"];class Ws extends Bo{constructor(t,r){super(),e("Url is required.",r.url),e("Method is required.",r.method&&"string"==typeof r.method),this.didRespond=!1,this.aborted=!1,this.url=r.url,this.method=r.method.toUpperCase(),this.body=r.body,this.setHeaders(r.headers),this.recordingName=t.recordingName,this.recordingId=t.recordingId,this.requestArguments=Cs(r.requestArguments),this.promise=function(){let t,e;const r=new Sn((r,n)=>{t=r,e=n});return r.catch(()=>{}),r.resolve=t,r.reject=e,r}(),this[zs]=t,this[Hs]=new Is({eventNames:Us}),this.action=null,this._interceptor=new Ms,this[$s]=t.server.lookup(this.method,this.url),this[$s].applyFiltersWithArgs(this),this.configure(this[$s].config());const n=this[$s].recordingName();n&&this.overrideRecordingName(n)}get url(){return this[Ds].toString()}set url(t){this[Ds]=In(""+t,!0)}get absoluteUrl(){const{url:t}=this;return d(t)?t:new o(t).href}get protocol(){return this[Ds].protocol}get hostname(){return this[Ds].hostname}get port(){return this[Ds].port}get origin(){return this[Ds].origin}get pathname(){return this[Ds].pathname}get query(){return this[Ds].query}set query(t){this[Ds].set("query",t)}get hash(){return this[Ds].hash}set hash(t){this[Ds].set("hash",t)}get shouldPassthrough(){return this[$s].shouldPassthrough()}get shouldIntercept(){return this[$s].shouldIntercept()}get log(){if(this.id){const t=h.getLogger(`@pollyjs/core:${this.recordingName}:${this.id}`);return t.setLevel(this.config.logLevel),t}return this[zs].logger.log}on(t,e){return this[Hs].on(t,e),this}once(t,e){return this[Hs].once(t,e),this}off(t,e){return this[Hs].off(t,e),this}async init(){await this._emit("request"),this.response=new is,this.didRespond=!1,await this._identify(),this.timestamp=u()}async respond(t){const{statusCode:r,headers:n,body:i,encoding:o}=t||{};e("Cannot respond to a request that already has a response.",!this.didRespond),this.aborted||(this.response.timestamp=u(),this.response.status(r),this.response.setHeaders(n),this.response.body=i,this.response.encoding=o,await this._emit("beforeResponse",this.response),this.response.end(),this.responseTime=new Date(this.response.timestamp).getTime()-new Date(this.timestamp).getTime(),this.didRespond=!0,this.end(),await this._emit("response",this.response))}abort(){this.aborted=!0}overrideRecordingName(t){zo(t),this.recordingName=t,this.recordingId=Hn(t)}configure(t){Do(t),this.config=$o(this[zs].config,this.config||{},t)}_intercept(){return this[$s].intercept(this,this.response,...arguments)}_emit(t,...e){return this[$s].emit(t,this,...e)}async _identify(){const t=this[zs],{_requests:e}=t,{matchRequestsBy:r}=this.config;this.identifiers={},qs(zn).forEach(t=>{this[t]&&r[t]&&(this.identifiers[t]=zn[t](this[t],r[t],this))}),await this[Hs].emit("identify",this),Cs(this.identifiers),this.id=l(p(this.identifiers)),this.order=!r.order||this.shouldPassthrough||this.shouldIntercept?0:e.slice(0,e.indexOf(this)).filter(t=>t.id===this.id&&t.recordingId===this.recordingId).length,this.log.debug("Request Identified:",{id:this.id,order:this.order,identifiers:this.identifiers,request:this})}}function Bs(){if(!arguments.length)return[];var t=arguments[0];return Yi(t)?t:[t]}z(z.S,"Reflect",{get:function t(e,r){var n,i,o=arguments.length<3?e:arguments[2];return A(e)===o?e[r]:(n=qt.f(e,r))?w(n,"value")?n.value:void 0!==n.get?n.get.call(o):void 0:x(i=Oe(e))?t(i,r,o):void 0}});var Gs=S.Reflect.get;function Js(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ks(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Js(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):Js(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}const Vs=ve();function Ys(t,{params:e}){return new Proxy(t,{set:(t,e,r)=>(t[e]=r,!0),get:(t,r)=>"params"===r?Ks({},e):Gs(t,r)})}class Xs{constructor(t,e){const r=t&&t[0];this.params={},this.queryParams={},this.handlers=[],this.middleware=e||[],r&&(this.handlers=r.handler,this.params=Ks({},r.params),this.queryParams=t.queryParams),this[Vs]=this._orderedHandlers()}shouldPassthrough(){return Boolean(this._valueFor("passthrough"))}shouldIntercept(){return Boolean(this._valueFor("intercept"))}recordingName(){return this._valueFor("recordingName")||null}config(){return $o(...this[Vs].map(({handler:t})=>t.get("config")))}applyFiltersWithArgs(t,...e){this[Vs]=this[Vs].filter(({route:r,handler:n})=>[...n.get("filters")].every(n=>n(Ys(t,r),...e)))}async intercept(t,e,r){for(const{route:n,handler:i}of this[Vs]){if(!r.shouldIntercept||r.shouldStopPropagating)return;i.has("intercept")&&await i.get("intercept")(Ys(t,n),e,r)}}async emit(t,e,...r){for(const{route:n,handler:i}of this[Vs]){if(!await i._eventEmitter.emit(t,Ys(e,n),...r))return}}_orderedHandlers(){return[...this.middleware,this].reduce((t,e)=>(t.push(...e.handlers.map(t=>({route:e,handler:t}))),t),[])}_valueFor(t){let e;for(const{handler:r}of this[Vs])r.has(t)&&(e=r.get(t));return e}}function Qs(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qs(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):Qs(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}class tu extends wr{constructor(){super(),this.set("config",{}),this.set("defaultOptions",{}),this.set("filters",new Os),this._eventEmitter=new Is({eventNames:["error","abort","request","beforeReplay","beforePersist","beforeResponse","response"]})}on(t,e,r={}){return this._eventEmitter.on(t,e,Zs(Zs({},this.get("defaultOptions")),r)),this}once(t,e){return this._eventEmitter.once(t,e),this}off(t,e){return this._eventEmitter.off(t,e),this}passthrough(t=!0){return this.set("passthrough",Boolean(t)),this.get("passthrough")&&this.delete("intercept"),this}intercept(t,r={}){return e(`Invalid intercept handler provided. Expected function, received: "${typeof t}".`,"function"==typeof t),"times"in(r=Zs(Zs({},this.get("defaultOptions")),r))&&(Ho(r.times),t=js(t,r.times,()=>this.delete("intercept"))),this.set("intercept",t),this.passthrough(!1),this}recordingName(t){return t&&zo(t),this.set("recordingName",t),this}configure(t){return Do(t),this.set("config",t),this}filter(t){return e(`Invalid filter callback provided. Expected function, received: "${typeof t}".`,"function"==typeof t),this.get("filters").add(t),this}times(t){return t||"number"==typeof t?(Ho(t),this.get("defaultOptions").times=t):delete this.get("defaultOptions").times,this}}class eu{constructor({host:t,paths:e,global:r,handler:n}){this.global=Boolean(r),this.handler=n,this.host=t,this.paths=this.global?["__GLOBAL__"]:e,this._routeRecognizer=new y,this.paths.forEach(t=>this._routeRecognizer.add([{path:t,handler:[n]}]))}match(t,e){if(this.global)return new Xs(this._routeRecognizer.recognize("__GLOBAL__"));if(this.host===t){const t=this._routeRecognizer.recognize(e);return t&&new Xs(t)}}}const ru=ve(),nu=ve(),iu=ve(),ou=ve(),su=ve(),uu="/",cu="*",au=":",{keys:fu}=Object;function hu(t){const e=new o(t);return{host:e.host?e.origin:uu,path:e.pathname||uu}}class lu{constructor(){this[ru]="",this[iu]={},this[nu]=[],this[ou]=[]}host(t,r){const n=this[ru];e("[Server] A host cannot be specified within another host.",!n),this[ru]=t,r(this),this[ru]=n}namespace(t,e){const r=this[nu];this[nu]=[...r,t],e(this),this[nu]=r}timeout(){return r(...arguments)}get(){return this._register("GET",...arguments)}put(){return this._register("PUT",...arguments)}post(){return this._register("POST",...arguments)}delete(){return this._register("DELETE",...arguments)}patch(){return this._register("PATCH",...arguments)}merge(){return this._register("MERGE",...arguments)}head(){return this._register("HEAD",...arguments)}options(){return this._register("OPTIONS",...arguments)}any(){return this._registerMiddleware(...arguments)}lookup(t,e){return new Xs(this._recognize(t,e),this._lookupMiddleware(e))}_lookupMiddleware(t){const{host:e,path:r}=hu(t);return this[ou].map(t=>t.match(e,r)).filter(Boolean)}_register(t,e){const r=new tu;return Bs(e).forEach(e=>{const{host:n,path:i}=hu(this._buildUrl(e)),o=this._registryForHost(n),s=this._nameForPath(i),u=o[t.toUpperCase()];u[su].has(s)?u[su].get(s).push(r):(u[su].set(s,[r]),u.add([{path:i,handler:u[su].get(s)}]))}),r}_registerMiddleware(t){const e=new tu,r={};return Bs(t).forEach(t=>{if(t&&t!==cu||this[ru]||0!==this[nu].length){const{host:e,path:n}=hu(this._buildUrl(t));r[e]=r[e]||[],r[e].push(n)}else this[ou].push(new eu({global:!0,handler:e}))}),fu(r).forEach(t=>{this[ou].push(new eu({host:t,paths:r[t],handler:e}))}),e}_recognize(t,e){const{host:r,path:n}=hu(e);return this._registryForHost(r)[t.toUpperCase()].recognize(n)}_buildUrl(t){return c(this[ru],...this[nu],t)}_nameForPath(t=""){return t.split(uu).map(t=>{switch(t.charAt(0)){case au:return au;case cu:return cu;default:return t}}).join(uu).replace(/\/$/,"")||uu}_registryForHost(t){return this[iu][t]||(this[iu][t]=a.reduce((t,e)=>(t[e]=new y,t[e][su]=new wr,t),{})),this[iu][t]}}const pu=ve(),du=ve(),vu=ve(),gu=new fr,yu=new Is({eventNames:["register","create","stop"]});class mu{constructor(t,e){this.recordingName=t,this.server=new lu,this.config={},this.container=new An,yu.emitSync("register",this.container),this.adapters=new wr,this.persister=null,this._requests=[],yu.emitSync("create",this),this.configure(e)}static get VERSION(){return"6.0.2"}get recordingName(){return this[pu]}set recordingName(t){zo(t),this[pu]=t,this[du]=Hn(t)}get recordingId(){return this[du]}get mode(){return this.config.mode}set mode(t){const r=xr(n);e(`Invalid mode provided: "${t}". Possible modes: ${r.join(", ")}.`,r.includes(t)),this.config.mode=t}static on(t,e){return yu.on(t,e),this}static once(t,e){return yu.once(t,e),this}static off(t,e){return yu.off(t,e),this}static register(t){return gu.has(t)||gu.set(t,e=>e.register(t)),this.on("register",gu.get(t)),this}static unregister(t){return gu.has(t)&&this.off("register",gu.get(t)),this}configure(t={}){const{container:r}=this;e("Cannot call `configure` once requests have been handled.",0===this._requests.length),e("Cannot call `configure` on an instance of Polly that is not running.",this.mode!==n.STOPPED),this.disconnect(),this.logger&&this.logger.disconnect(),this.config=$o(Rn,this.config,t),this.logger=new Pn(this),this.logger.connect(),this.config.adapters.forEach(t=>this.connectTo(t));let{persister:i}=this.config;i&&("function"==typeof i&&(r.register(i),i=i.id),e(`Persister matching the name \`${i}\` was not registered.`,r.has("persister:"+i)),this.persister=new(r.lookup("persister:"+i))(this)),this.logger.log.debug("Polly instance configured.",{config:this.config})}record(){this.mode=n.RECORD}replay(){this.mode=n.REPLAY}passthrough(){this.mode=n.PASSTHROUGH}pause(){this[vu]=[...this.adapters.keys()],this.disconnect()}play(){this[vu]&&(this[vu].forEach(t=>this.connectTo(t)),delete this[vu])}async stop(){this.mode!==n.STOPPED&&(this.config.flushRequestsOnStop&&await this.flush(),this.disconnect(),await(this.persister&&this.persister.persist()),this.mode=n.STOPPED,await yu.emit("stop",this),this.logger.log.debug("Polly instance stopped.",{recordingName:this.recordingName}),this.logger.disconnect())}async flush(){const t=()=>{};await Sn.all(this._requests.map(e=>Sn.resolve(e.promise).then(t,t)))}connectTo(t){const{container:r,adapters:n}=this;let i=t;"function"==typeof t&&(r.register(t),i=t.id),e(`Adapter matching the name \`${i}\` was not registered.`,r.has("adapter:"+i)),this.disconnectFrom(i);const o=new(r.lookup("adapter:"+i))(this);o.connect(),n.set(i,o)}disconnectFrom(t){const{adapters:e}=this;let r=t;"function"==typeof t&&(r=t.id),e.has(r)&&(e.get(r).disconnect(),e.delete(r))}disconnect(){for(const t of this.adapters.keys())this.disconnectFrom(t)}registerRequest(t={}){const e=new Ws(this,t);return this._requests.push(e),e}}const{defineProperty:_u}=Object;function bu(t,e,r){_u(t,"polly",{writable:!0,enumerable:!0,configurable:!0,value:new mu(e,r)})}async function wu(t,e){await t.polly.stop(),_u(t,"polly",{enumerable:!0,configurable:!0,get(){throw new f(`You are trying to access an instance of Polly that is no longer available.\nSee: https://netflix.github.io/pollyjs/#/test-frameworks/${e}?id=test-hook-ordering`)}})}function Ou(t){return t.test.testReport.fullName.join("/")}function ju(t,e={}){ju.beforeEach(t,e),ju.afterEach(t)}function Su(t={},e=global){Su.beforeEach(t,e),Su.afterEach(e)}ju.beforeEach=function(t,e={}){t.beforeEach((function(){return bu(this,Ou(...arguments),e)}))},ju.afterEach=function(t){t.afterEach((function(){return wu(this,"qunit")}))},Su.beforeEach=function(t,e=global){e.beforeEach((function(){return bu(this,function(t){const{currentTest:e}=t,r=[e.title];let n=e.parent;for(;n&&n.title;)r.push(n.title),n=n.parent;return r.reverse().join("/")}(this),t)}))},Su.afterEach=function(t=global){t.afterEach((function(){return wu(this,"mocha")}))};export{mu as Polly,Tn as Timing,Su as setupMocha,ju as setupQunit};
import{ACTIONS as t,assert as e,timeout as r,MODES as n,EXPIRY_STRATEGIES as i,URL as o,HTTP_STATUS_CODES as s,timestamp as u,buildUrl as c,HTTP_METHODS as a,PollyError as f}from"@pollyjs/utils";import h from"loglevel";import l from"blueimp-md5";import p from"fast-json-stable-stringify";import d from"is-absolute-url";import v from"@sindresorhus/fnv1a";import g from"slugify";import y from"route-recognizer";function m(t,e){return t(e={exports:{}},e.exports),e.exports}var _=m((function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)})),b={}.hasOwnProperty,w=function(t,e){return b.call(t,e)},O=function(t){try{return!!t()}catch(t){return!0}},j=!O((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),S=m((function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)})),E=(S.version,function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}),P=function(t,e,r){if(E(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},A=function(t){if(!x(t))throw TypeError(t+" is not an object!");return t},T=_.document,R=x(T)&&x(T.createElement),k=function(t){return R?T.createElement(t):{}},I=!j&&!O((function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a})),N=function(t,e){if(!x(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!x(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!x(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!x(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},L=Object.defineProperty,F={f:j?Object.defineProperty:function(t,e,r){if(A(t),e=N(e,!0),A(r),I)try{return L(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},M=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=j?function(t,e,r){return F.f(t,e,M(1,r))}:function(t,e,r){return t[e]=r,t},C=function(t,e,r){var n,i,o,s=t&C.F,u=t&C.G,c=t&C.S,a=t&C.P,f=t&C.B,h=t&C.W,l=u?S:S[e]||(S[e]={}),p=l.prototype,d=u?_:c?_[e]:(_[e]||{}).prototype;for(n in u&&(r=e),r)(i=!s&&d&&void 0!==d[n])&&w(l,n)||(o=i?d[n]:r[n],l[n]=u&&"function"!=typeof d[n]?r[n]:f&&i?P(o,_):h&&d[n]==o?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(o):a&&"function"==typeof o?P(Function.call,o):o,a&&((l.virtual||(l.virtual={}))[n]=o,t&C.R&&p&&!p[n]&&q(p,n,o)))};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128;var $,z=C,D=q,H=0,U=Math.random(),W=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++H+U).toString(36))},B=m((function(t){var e=W("meta"),r=F.f,n=0,i=Object.isExtensible||function(){return!0},o=!O((function(){return i(Object.preventExtensions({}))})),s=function(t){r(t,e,{value:{i:"O"+ ++n,w:{}}})},u=t.exports={KEY:e,NEED:!1,fastKey:function(t,r){if(!x(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!w(t,e)){if(!i(t))return"F";if(!r)return"E";s(t)}return t[e].i},getWeak:function(t,r){if(!w(t,e)){if(!i(t))return!0;if(!r)return!1;s(t)}return t[e].w},onFreeze:function(t){return o&&u.NEED&&i(t)&&!w(t,e)&&s(t),t}}})),G=(B.KEY,B.NEED,B.fastKey,B.getWeak,B.onFreeze,m((function(t){var e=_["__core-js_shared__"]||(_["__core-js_shared__"]={});(t.exports=function(t,r){return e[t]||(e[t]=void 0!==r?r:{})})("versions",[]).push({version:S.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}))),J=m((function(t){var e=G("wks"),r=_.Symbol,n="function"==typeof r;(t.exports=function(t){return e[t]||(e[t]=n&&r[t]||(n?r:W)("Symbol."+t))}).store=e})),K=F.f,V=J("toStringTag"),Y=function(t,e,r){t&&!w(t=r?t:t.prototype,V)&&K(t,V,{configurable:!0,value:e})},X={f:J},Q=F.f,Z=function(t){var e=S.Symbol||(S.Symbol={});"_"==t.charAt(0)||t in e||Q(e,t,{value:X.f(t)})},tt={}.toString,et=function(t){return tt.call(t).slice(8,-1)},rt=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==et(t)?t.split(""):Object(t)},nt=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},it=function(t){return rt(nt(t))},ot=Math.ceil,st=Math.floor,ut=function(t){return isNaN(t=+t)?0:(t>0?st:ot)(t)},ct=Math.min,at=function(t){return t>0?ct(ut(t),9007199254740991):0},ft=Math.max,ht=Math.min,lt=G("keys"),pt=function(t){return lt[t]||(lt[t]=W(t))},dt=($=!1,function(t,e,r){var n,i=it(t),o=at(i.length),s=function(t,e){return(t=ut(t))<0?ft(t+e,0):ht(t,e)}(r,o);if($&&e!=e){for(;o>s;)if((n=i[s++])!=n)return!0}else for(;o>s;s++)if(($||s in i)&&i[s]===e)return $||s||0;return!$&&-1}),vt=pt("IE_PROTO"),gt=function(t,e){var r,n=it(t),i=0,o=[];for(r in n)r!=vt&&w(n,r)&&o.push(r);for(;e.length>i;)w(n,r=e[i++])&&(~dt(o,r)||o.push(r));return o},yt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),mt=Object.keys||function(t){return gt(t,yt)},_t={f:Object.getOwnPropertySymbols},bt={f:{}.propertyIsEnumerable},wt=Array.isArray||function(t){return"Array"==et(t)},Ot=function(t){return Object(nt(t))},jt=j?Object.defineProperties:function(t,e){A(t);for(var r,n=mt(e),i=n.length,o=0;i>o;)F.f(t,r=n[o++],e[r]);return t},St=_.document,Et=St&&St.documentElement,Pt=pt("IE_PROTO"),xt=function(){},At=function(){var t,e=k("iframe"),r=yt.length;for(e.style.display="none",Et.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),At=t.F;r--;)delete At.prototype[yt[r]];return At()},Tt=Object.create||function(t,e){var r;return null!==t?(xt.prototype=A(t),r=new xt,xt.prototype=null,r[Pt]=t):r=At(),void 0===e?r:jt(r,e)},Rt=yt.concat("length","prototype"),kt={f:Object.getOwnPropertyNames||function(t){return gt(t,Rt)}},It=kt.f,Nt={}.toString,Lt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ft={f:function(t){return Lt&&"[object Window]"==Nt.call(t)?function(t){try{return It(t)}catch(t){return Lt.slice()}}(t):It(it(t))}},Mt=Object.getOwnPropertyDescriptor,qt={f:j?Mt:function(t,e){if(t=it(t),e=N(e,!0),I)try{return Mt(t,e)}catch(t){}if(w(t,e))return M(!bt.f.call(t,e),t[e])}},Ct=B.KEY,$t=qt.f,zt=F.f,Dt=Ft.f,Ht=_.Symbol,Ut=_.JSON,Wt=Ut&&Ut.stringify,Bt=J("_hidden"),Gt=J("toPrimitive"),Jt={}.propertyIsEnumerable,Kt=G("symbol-registry"),Vt=G("symbols"),Yt=G("op-symbols"),Xt=Object.prototype,Qt="function"==typeof Ht&&!!_t.f,Zt=_.QObject,te=!Zt||!Zt.prototype||!Zt.prototype.findChild,ee=j&&O((function(){return 7!=Tt(zt({},"a",{get:function(){return zt(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=$t(Xt,e);n&&delete Xt[e],zt(t,e,r),n&&t!==Xt&&zt(Xt,e,n)}:zt,re=function(t){var e=Vt[t]=Tt(Ht.prototype);return e._k=t,e},ne=Qt&&"symbol"==typeof Ht.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Ht},ie=function(t,e,r){return t===Xt&&ie(Yt,e,r),A(t),e=N(e,!0),A(r),w(Vt,e)?(r.enumerable?(w(t,Bt)&&t[Bt][e]&&(t[Bt][e]=!1),r=Tt(r,{enumerable:M(0,!1)})):(w(t,Bt)||zt(t,Bt,M(1,{})),t[Bt][e]=!0),ee(t,e,r)):zt(t,e,r)},oe=function(t,e){A(t);for(var r,n=function(t){var e=mt(t),r=_t.f;if(r)for(var n,i=r(t),o=bt.f,s=0;i.length>s;)o.call(t,n=i[s++])&&e.push(n);return e}(e=it(e)),i=0,o=n.length;o>i;)ie(t,r=n[i++],e[r]);return t},se=function(t){var e=Jt.call(this,t=N(t,!0));return!(this===Xt&&w(Vt,t)&&!w(Yt,t))&&(!(e||!w(this,t)||!w(Vt,t)||w(this,Bt)&&this[Bt][t])||e)},ue=function(t,e){if(t=it(t),e=N(e,!0),t!==Xt||!w(Vt,e)||w(Yt,e)){var r=$t(t,e);return!r||!w(Vt,e)||w(t,Bt)&&t[Bt][e]||(r.enumerable=!0),r}},ce=function(t){for(var e,r=Dt(it(t)),n=[],i=0;r.length>i;)w(Vt,e=r[i++])||e==Bt||e==Ct||n.push(e);return n},ae=function(t){for(var e,r=t===Xt,n=Dt(r?Yt:it(t)),i=[],o=0;n.length>o;)!w(Vt,e=n[o++])||r&&!w(Xt,e)||i.push(Vt[e]);return i};Qt||(D((Ht=function(){if(this instanceof Ht)throw TypeError("Symbol is not a constructor!");var t=W(arguments.length>0?arguments[0]:void 0),e=function(r){this===Xt&&e.call(Yt,r),w(this,Bt)&&w(this[Bt],t)&&(this[Bt][t]=!1),ee(this,t,M(1,r))};return j&&te&&ee(Xt,t,{configurable:!0,set:e}),re(t)}).prototype,"toString",(function(){return this._k})),qt.f=ue,F.f=ie,kt.f=Ft.f=ce,bt.f=se,_t.f=ae,X.f=function(t){return re(J(t))}),z(z.G+z.W+z.F*!Qt,{Symbol:Ht});for(var fe="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),he=0;fe.length>he;)J(fe[he++]);for(var le=mt(J.store),pe=0;le.length>pe;)Z(le[pe++]);z(z.S+z.F*!Qt,"Symbol",{for:function(t){return w(Kt,t+="")?Kt[t]:Kt[t]=Ht(t)},keyFor:function(t){if(!ne(t))throw TypeError(t+" is not a symbol!");for(var e in Kt)if(Kt[e]===t)return e},useSetter:function(){te=!0},useSimple:function(){te=!1}}),z(z.S+z.F*!Qt,"Object",{create:function(t,e){return void 0===e?Tt(t):oe(Tt(t),e)},defineProperty:ie,defineProperties:oe,getOwnPropertyDescriptor:ue,getOwnPropertyNames:ce,getOwnPropertySymbols:ae});var de=O((function(){_t.f(1)}));z(z.S+z.F*de,"Object",{getOwnPropertySymbols:function(t){return _t.f(Ot(t))}}),Ut&&z(z.S+z.F*(!Qt||O((function(){var t=Ht();return"[null]"!=Wt([t])||"{}"!=Wt({a:t})||"{}"!=Wt(Object(t))}))),"JSON",{stringify:function(t){for(var e,r,n=[t],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=e=n[1],(x(e)||void 0!==t)&&!ne(t))return wt(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!ne(e))return e}),n[1]=e,Wt.apply(Ut,n)}}),Ht.prototype[Gt]||q(Ht.prototype,Gt,Ht.prototype.valueOf),Y(Ht,"Symbol"),Y(Math,"Math",!0),Y(_.JSON,"JSON",!0),Z("asyncIterator"),Z("observable");var ve=S.Symbol,ge=function(t,e){return{value:e,done:!!t}},ye={},me={};q(me,J("iterator"),(function(){return this}));var _e=function(t,e,r){t.prototype=Tt(me,{next:M(1,r)}),Y(t,e+" Iterator")},be=pt("IE_PROTO"),we=Object.prototype,Oe=Object.getPrototypeOf||function(t){return t=Ot(t),w(t,be)?t[be]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?we:null},je=J("iterator"),Se=!([].keys&&"next"in[].keys()),Ee=function(){return this},Pe=function(t,e,r,n,i,o,s){_e(r,e,n);var u,c,a,f=function(t){if(!Se&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},h=e+" Iterator",l="values"==i,p=!1,d=t.prototype,v=d[je]||d["@@iterator"]||i&&d[i],g=v||f(i),y=i?l?f("entries"):g:void 0,m="Array"==e&&d.entries||v;if(m&&(a=Oe(m.call(new t)))!==Object.prototype&&a.next&&Y(a,h,!0),l&&v&&"values"!==v.name&&(p=!0,g=function(){return v.call(this)}),s&&(Se||p||!d[je])&&q(d,je,g),ye[e]=g,ye[h]=Ee,i)if(u={values:l?g:f("values"),keys:o?g:f("keys"),entries:y},s)for(c in u)c in d||D(d,c,u[c]);else z(z.P+z.F*(Se||p),e,u);return u};Pe(Array,"Array",(function(t,e){this._t=it(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,ge(1)):ge(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values");ye.Arguments=ye.Array;for(var xe=J("toStringTag"),Ae="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),Te=0;Te<Ae.length;Te++){var Re=Ae[Te],ke=_[Re],Ie=ke&&ke.prototype;Ie&&!Ie[xe]&&q(Ie,xe,Re),ye[Re]=ye.Array}var Ne=J("species"),Le=function(t,e){return new(function(t){var e;return wt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!wt(e.prototype)||(e=void 0),x(e)&&null===(e=e[Ne])&&(e=void 0)),void 0===e?Array:e}(t))(e)},Fe=function(t,e){var r=1==t,n=2==t,i=3==t,o=4==t,s=6==t,u=5==t||s,c=e||Le;return function(e,a,f){for(var h,l,p=Ot(e),d=rt(p),v=P(a,f,3),g=at(d.length),y=0,m=r?c(e,g):n?c(e,0):void 0;g>y;y++)if((u||y in d)&&(l=v(h=d[y],y,p),t))if(r)m[y]=l;else if(l)switch(t){case 3:return!0;case 5:return h;case 6:return y;case 2:m.push(h)}else if(o)return!1;return s?-1:i||o?o:m}},Me=Object.assign,qe=!Me||O((function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Me({},t)[r]||Object.keys(Me({},e)).join("")!=n}))?function(t,e){for(var r=Ot(t),n=arguments.length,i=1,o=_t.f,s=bt.f;n>i;)for(var u,c=rt(arguments[i++]),a=o?mt(c).concat(o(c)):mt(c),f=a.length,h=0;f>h;)u=a[h++],j&&!s.call(c,u)||(r[u]=c[u]);return r}:Me,Ce=function(t,e,r){for(var n in e)r&&t[n]?t[n]=e[n]:q(t,n,e[n]);return t},$e=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t},ze=function(t,e,r,n){try{return n?e(A(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&A(i.call(t)),e}},De=J("iterator"),He=Array.prototype,Ue=J("toStringTag"),We="Arguments"==et(function(){return arguments}()),Be=function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ue))?r:We?et(e):"Object"==(n=et(e))&&"function"==typeof e.callee?"Arguments":n},Ge=J("iterator"),Je=S.getIteratorMethod=function(t){if(null!=t)return t[Ge]||t["@@iterator"]||ye[Be(t)]},Ke=m((function(t){var e={},r={},n=t.exports=function(t,n,i,o,s){var u,c,a,f,h,l=s?function(){return t}:Je(t),p=P(i,o,n?2:1),d=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(void 0===(h=l)||ye.Array!==h&&He[De]!==h){for(a=l.call(t);!(c=a.next()).done;)if((f=ze(a,p,c.value,n))===e||f===r)return f}else for(u=at(t.length);u>d;d++)if((f=n?p(A(c=t[d])[0],c[1]):p(t[d]))===e||f===r)return f};n.BREAK=e,n.RETURN=r})),Ve=function(t,e){if(!x(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},Ye=B.getWeak,Xe=Fe(5),Qe=Fe(6),Ze=0,tr=function(t){return t._l||(t._l=new er)},er=function(){this.a=[]},rr=function(t,e){return Xe(t.a,(function(t){return t[0]===e}))};er.prototype={get:function(t){var e=rr(this,t);if(e)return e[1]},has:function(t){return!!rr(this,t)},set:function(t,e){var r=rr(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=Qe(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}};var nr={getConstructor:function(t,e,r,n){var i=t((function(t,o){$e(t,i,e,"_i"),t._t=e,t._i=Ze++,t._l=void 0,null!=o&&Ke(o,r,t[n],t)}));return Ce(i.prototype,{delete:function(t){if(!x(t))return!1;var r=Ye(t);return!0===r?tr(Ve(this,e)).delete(t):r&&w(r,this._i)&&delete r[this._i]},has:function(t){if(!x(t))return!1;var r=Ye(t);return!0===r?tr(Ve(this,e)).has(t):r&&w(r,this._i)}}),i},def:function(t,e,r){var n=Ye(A(e),!0);return!0===n?tr(t).set(e,r):n[t._i]=r,t},ufstore:tr},ir=F.f,or=Fe(0),sr=function(t,e,r,n,i,o){var s=_[t],u=s,c=i?"set":"add",a=u&&u.prototype,f={};return j&&"function"==typeof u&&(o||a.forEach&&!O((function(){(new u).entries().next()})))?(u=e((function(e,r){$e(e,u,t,"_c"),e._c=new s,null!=r&&Ke(r,i,e[c],e)})),or("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),(function(t){var e="add"==t||"set"==t;!(t in a)||o&&"clear"==t||q(u.prototype,t,(function(r,n){if($e(this,u,t),!e&&o&&!x(r))return"get"==t&&void 0;var i=this._c[t](0===r?0:r,n);return e?this:i}))})),o||ir(u.prototype,"size",{get:function(){return this._c.size}})):(u=n.getConstructor(e,t,i,c),Ce(u.prototype,r),B.NEED=!0),Y(u,t),f[t]=u,z(z.G+z.W+z.F,f),o||n.setStrong(u,t,i),u},ur=(m((function(t){var e,r=Fe(0),n=Ve,i=!_.ActiveXObject&&"ActiveXObject"in _,o=B.getWeak,s=Object.isExtensible,u=nr.ufstore,c=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},a={get:function(t){if(x(t)){var e=o(t);return!0===e?u(Ve(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return nr.def(Ve(this,"WeakMap"),t,e)}},f=t.exports=sr("WeakMap",c,a,nr,!0,!0);n&&i&&(e=nr.getConstructor(c,"WeakMap"),qe(e.prototype,a),B.NEED=!0,r(["delete","has","get","set"],(function(t){var r=f.prototype,n=r[t];D(r,t,(function(r,i){if(x(r)&&!s(r)){this._f||(this._f=new e);var o=this._f[t](r,i);return"set"==t?this:o}return n.call(this,r,i)}))})))})),function(t){z(z.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})});ur("WeakMap");var cr=function(t){z(z.S,t,{from:function(t){var e,r,n,i,o=arguments[1];return E(this),(e=void 0!==o)&&E(o),null==t?new this:(r=[],e?(n=0,i=P(o,arguments[2],2),Ke(t,!1,(function(t){r.push(i(t,n++))}))):Ke(t,!1,r.push,r),new this(r))}})};cr("WeakMap");var ar,fr=S.WeakMap,hr=(ar=!0,function(t,e){var r,n,i=String(nt(t)),o=ut(e),s=i.length;return o<0||o>=s?ar?"":void 0:(r=i.charCodeAt(o))<55296||r>56319||o+1===s||(n=i.charCodeAt(o+1))<56320||n>57343?ar?i.charAt(o):r:ar?i.slice(o,o+2):n-56320+(r-55296<<10)+65536});Pe(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=hr(e,r),this._i+=t.length,{value:t,done:!1})}));var lr=J("species"),pr=function(t){var e="function"==typeof S[t]?S[t]:_[t];j&&e&&!e[lr]&&F.f(e,lr,{configurable:!0,get:function(){return this}})},dr=F.f,vr=B.fastKey,gr=j?"_s":"size",yr=function(t,e){var r,n=vr(e);if("F"!==n)return t._i[n];for(r=t._f;r;r=r.n)if(r.k==e)return r},mr={getConstructor:function(t,e,r,n){var i=t((function(t,o){$e(t,i,e,"_i"),t._t=e,t._i=Tt(null),t._f=void 0,t._l=void 0,t[gr]=0,null!=o&&Ke(o,r,t[n],t)}));return Ce(i.prototype,{clear:function(){for(var t=Ve(this,e),r=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];t._f=t._l=void 0,t[gr]=0},delete:function(t){var r=Ve(this,e),n=yr(r,t);if(n){var i=n.n,o=n.p;delete r._i[n.i],n.r=!0,o&&(o.n=i),i&&(i.p=o),r._f==n&&(r._f=i),r._l==n&&(r._l=o),r[gr]--}return!!n},forEach:function(t){Ve(this,e);for(var r,n=P(t,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(t){return!!yr(Ve(this,e),t)}}),j&&dr(i.prototype,"size",{get:function(){return Ve(this,e)[gr]}}),i},def:function(t,e,r){var n,i,o=yr(t,e);return o?o.v=r:(t._l=o={i:i=vr(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[gr]++,"F"!==i&&(t._i[i]=o)),t},getEntry:yr,setStrong:function(t,e,r){Pe(t,e,(function(t,r){this._t=Ve(t,e),this._k=r,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?ge(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,ge(1))}),r?"entries":"values",!r,!0),pr(e)}},_r=(sr("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=mr.getEntry(Ve(this,"Map"),t);return e&&e.v},set:function(t,e){return mr.def(Ve(this,"Map"),0===t?0:t,e)}},mr,!0),function(t){return function(){if(Be(this)!=t)throw TypeError(t+"#toJSON isn't generic");return function(t,e){var r=[];return Ke(t,!1,r.push,r,e),r}(this)}});z(z.P+z.R,"Map",{toJSON:_r("Map")}),ur("Map"),cr("Map");var br,wr=S.Map,Or=bt.f,jr=(br=!1,function(t){for(var e,r=it(t),n=mt(r),i=n.length,o=0,s=[];i>o;)e=n[o++],j&&!Or.call(r,e)||s.push(br?[e,r[e]]:r[e]);return s});z(z.S,"Object",{values:function(t){return jr(t)}});var Sr,Er,Pr,xr=S.Object.values,Ar=J("species"),Tr=function(t,e){var r,n=A(t).constructor;return void 0===n||null==(r=A(n)[Ar])?e:E(r)},Rr=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)},kr=_.process,Ir=_.setImmediate,Nr=_.clearImmediate,Lr=_.MessageChannel,Fr=_.Dispatch,Mr=0,qr={},Cr=function(){var t=+this;if(qr.hasOwnProperty(t)){var e=qr[t];delete qr[t],e()}},$r=function(t){Cr.call(t.data)};Ir&&Nr||(Ir=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return qr[++Mr]=function(){Rr("function"==typeof t?t:Function(t),e)},Sr(Mr),Mr},Nr=function(t){delete qr[t]},"process"==et(kr)?Sr=function(t){kr.nextTick(P(Cr,t,1))}:Fr&&Fr.now?Sr=function(t){Fr.now(P(Cr,t,1))}:Lr?(Pr=(Er=new Lr).port2,Er.port1.onmessage=$r,Sr=P(Pr.postMessage,Pr,1)):_.addEventListener&&"function"==typeof postMessage&&!_.importScripts?(Sr=function(t){_.postMessage(t+"","*")},_.addEventListener("message",$r,!1)):Sr="onreadystatechange"in k("script")?function(t){Et.appendChild(k("script")).onreadystatechange=function(){Et.removeChild(this),Cr.call(t)}}:function(t){setTimeout(P(Cr,t,1),0)});var zr={set:Ir,clear:Nr},Dr=zr.set,Hr=_.MutationObserver||_.WebKitMutationObserver,Ur=_.process,Wr=_.Promise,Br="process"==et(Ur);function Gr(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=E(e),this.reject=E(r)}var Jr={f:function(t){return new Gr(t)}},Kr=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Vr=_.navigator,Yr=Vr&&Vr.userAgent||"",Xr=function(t,e){if(A(t),x(e)&&e.constructor===t)return e;var r=Jr.f(t);return(0,r.resolve)(e),r.promise},Qr=J("iterator"),Zr=!1;try{var tn=[7][Qr]();tn.return=function(){Zr=!0},Array.from(tn,(function(){throw 2}))}catch(t){}var en,rn,nn,on,sn=zr.set,un=function(){var t,e,r,n=function(){var n,i;for(Br&&(n=Ur.domain)&&n.exit();t;){i=t.fn,t=t.next;try{i()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(Br)r=function(){Ur.nextTick(n)};else if(!Hr||_.navigator&&_.navigator.standalone)if(Wr&&Wr.resolve){var i=Wr.resolve(void 0);r=function(){i.then(n)}}else r=function(){Dr.call(_,n)};else{var o=!0,s=document.createTextNode("");new Hr(n).observe(s,{characterData:!0}),r=function(){s.data=o=!o}}return function(n){var i={fn:n,next:void 0};e&&(e.next=i),t||(t=i,r()),e=i}}(),cn=_.TypeError,an=_.process,fn=an&&an.versions,hn=fn&&fn.v8||"",ln=_.Promise,pn="process"==Be(an),dn=function(){},vn=rn=Jr.f,gn=!!function(){try{var t=ln.resolve(1),e=(t.constructor={})[J("species")]=function(t){t(dn,dn)};return(pn||"function"==typeof PromiseRejectionEvent)&&t.then(dn)instanceof e&&0!==hn.indexOf("6.6")&&-1===Yr.indexOf("Chrome/66")}catch(t){}}(),yn=function(t){var e;return!(!x(t)||"function"!=typeof(e=t.then))&&e},mn=function(t,e){if(!t._n){t._n=!0;var r=t._c;un((function(){for(var n=t._v,i=1==t._s,o=0,s=function(e){var r,o,s,u=i?e.ok:e.fail,c=e.resolve,a=e.reject,f=e.domain;try{u?(i||(2==t._h&&wn(t),t._h=1),!0===u?r=n:(f&&f.enter(),r=u(n),f&&(f.exit(),s=!0)),r===e.promise?a(cn("Promise-chain cycle")):(o=yn(r))?o.call(r,c,a):c(r)):a(n)}catch(t){f&&!s&&f.exit(),a(t)}};r.length>o;)s(r[o++]);t._c=[],t._n=!1,e&&!t._h&&_n(t)}))}},_n=function(t){sn.call(_,(function(){var e,r,n,i=t._v,o=bn(t);if(o&&(e=Kr((function(){pn?an.emit("unhandledRejection",i,t):(r=_.onunhandledrejection)?r({promise:t,reason:i}):(n=_.console)&&n.error&&n.error("Unhandled promise rejection",i)})),t._h=pn||bn(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},bn=function(t){return 1!==t._h&&0===(t._a||t._c).length},wn=function(t){sn.call(_,(function(){var e;pn?an.emit("rejectionHandled",t):(e=_.onrejectionhandled)&&e({promise:t,reason:t._v})}))},On=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),mn(e,!0))},jn=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw cn("Promise can't be resolved itself");(e=yn(t))?un((function(){var n={_w:r,_d:!1};try{e.call(t,P(jn,n,1),P(On,n,1))}catch(t){On.call(n,t)}})):(r._v=t,r._s=1,mn(r,!1))}catch(t){On.call({_w:r,_d:!1},t)}}};gn||(ln=function(t){$e(this,ln,"Promise","_h"),E(t),en.call(this);try{t(P(jn,this,1),P(On,this,1))}catch(t){On.call(this,t)}},(en=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Ce(ln.prototype,{then:function(t,e){var r=vn(Tr(this,ln));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=pn?an.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&mn(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),nn=function(){var t=new en;this.promise=t,this.resolve=P(jn,t,1),this.reject=P(On,t,1)},Jr.f=vn=function(t){return t===ln||t===on?new nn(t):rn(t)}),z(z.G+z.W+z.F*!gn,{Promise:ln}),Y(ln,"Promise"),pr("Promise"),on=S.Promise,z(z.S+z.F*!gn,"Promise",{reject:function(t){var e=vn(this);return(0,e.reject)(t),e.promise}}),z(z.S+!0*z.F,"Promise",{resolve:function(t){return Xr(this===on?ln:this,t)}}),z(z.S+z.F*!(gn&&function(t,e){if(!e&&!Zr)return!1;var r=!1;try{var n=[7],i=n[Qr]();i.next=function(){return{done:r=!0}},n[Qr]=function(){return i},t(n)}catch(t){}return r}((function(t){ln.all(t).catch(dn)}))),"Promise",{all:function(t){var e=this,r=vn(e),n=r.resolve,i=r.reject,o=Kr((function(){var r=[],o=0,s=1;Ke(t,!1,(function(t){var u=o++,c=!1;r.push(void 0),s++,e.resolve(t).then((function(t){c||(c=!0,r[u]=t,--s||n(r))}),i)})),--s||n(r)}));return o.e&&i(o.v),r.promise},race:function(t){var e=this,r=vn(e),n=r.reject,i=Kr((function(){Ke(t,!1,(function(t){e.resolve(t).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}}),z(z.P+z.R,"Promise",{finally:function(t){var e=Tr(this,S.Promise||_.Promise),r="function"==typeof t;return this.then(r?function(r){return Xr(e,t()).then((function(){return r}))}:t,r?function(r){return Xr(e,t()).then((function(){throw r}))}:t)}}),z(z.S,"Promise",{try:function(t){var e=Jr.f(this),r=Kr(t);return(r.e?e.reject:e.resolve)(r.v),e.promise}});var Sn=S.Promise;const En={[t.RECORD]:"Recorded",[t.REPLAY]:"Replayed",[t.INTERCEPT]:"Intercepted",[t.PASSTHROUGH]:"Passthrough"};class Pn{constructor(t){this.polly=t,this.log=h.getLogger("@pollyjs/core:"+this.polly.recordingName),this.log.setLevel(t.config.logLevel)}connect(){this._middleware=this.polly.server.any().on("error",(...t)=>this.logRequestError(...t)).on("request",(...t)=>this.logRequest(...t)).on("response",(...t)=>this.logRequestResponse(...t))}disconnect(){this._middleware.off("error"),this._middleware.off("response")}logRequest(t){const{log:e}=t,r=e.getLevel()<=e.levels.DEBUG;e.info(`Request: ${t.method} ${t.url}`,...r?[{request:t}]:[])}logRequestResponse(t,e){const{log:r}=t,n=r.getLevel()<=r.levels.DEBUG;r.info(`Response: ${En[t.action]} ➞ ${t.method} ${t.url} ${e.statusCode} • ${t.responseTime}ms`,...n?[{request:t,response:e}]:[])}logRequestError(t,e){const{log:r}=t,n=r.getLevel()<=r.levels.DEBUG;r.error(`Errored ➞ ${t.method} ${t.url}`,e,...n?[{request:t}]:[])}}function xn(t){return`${t.type}:${t.id}`}class An{constructor(){this._registry=new wr}register(t){e(`Attempted to register ${t} but invalid factory provided. Expected function, received: "${typeof t}"`,"function"==typeof t);const{type:r}=t,n=t.id;e(`Invalid registration id provided. Expected string, received: "${typeof n}"`,"string"==typeof n),e(`Invalid registration type provided. Expected string, received: "${typeof r}"`,"string"==typeof r),this._registry.set(xn(t),t)}unregister(t){const{_registry:e}=this,r="function"==typeof t?xn(t):t;e.delete(r)}lookup(t){return this._registry.get(t)||null}has(t){const{_registry:e}=this,r="function"==typeof t?xn(t):t;return e.has(r)}}var Tn={fixed:t=>()=>r(t),relative:t=>e=>r(t*e)},Rn={mode:n.REPLAY,adapters:[],adapterOptions:{},persister:null,persisterOptions:{keepUnusedRequests:!1,disableSortingHarEntries:!1},logLevel:h.levels.WARN,flushRequestsOnStop:!1,recordIfMissing:!0,recordFailedRequests:!1,expiresIn:null,expiryStrategy:i.WARN,timing:Tn.fixed(0),matchRequestsBy:{method:!0,headers:!0,body:!0,order:!0,url:{protocol:!0,username:!0,password:!0,hostname:!0,port:!0,pathname:!0,query:!0,hash:!1}}};function kn(t){return null!=t&&"object"==typeof t}function In(t,...e){const r=new o(t,...e);return d(t)||(t.startsWith("//")?r.set("protocol",""):function(t){t.set("protocol",""),t.set("host",""),t.set("slashes",!1)}(r)),r}const{keys:Nn}=Object,Ln={get:(t,e)=>t["string"==typeof e?e.toLowerCase():e],set:(t,e,r)=>"string"==typeof e&&(null==r?delete t[e.toLowerCase()]:t[e.toLowerCase()]=r,!0),deleteProperty:(t,e)=>"string"==typeof e&&(delete t[e.toLowerCase()],!0)};function Fn(t){const e=new Proxy({},Ln);return kn(t)&&Nn(t).forEach(r=>e[r]=t[r]),e}const{keys:Mn}=Object,{isArray:qn}=Array,{parse:Cn}=JSON;function $n(t){return"function"==typeof t}var zn={headers:function(t,e,r){const n=new Fn(t);return $n(e)?e(n,r):(kn(e)&&qn(e.exclude)&&e.exclude.forEach(t=>delete n[t]),n)},method:function(t,e,r){return $n(e)?e(t,r):t.toUpperCase()},body:function(t,e,r){return $n(e)?e(t,r):t},url:function(t,e,r){let n=In(t,!0);return $n(e)?n=In(e(t,r),!0):Mn(e||{}).forEach(t=>{$n(e[t])?n.set(t,e[t](n[t],r)):e[t]||n.set(t,"")}),kn(n.query)&&n.set("query",Cn(p(n.query))),n.href}};function Dn(t){const e=v(t).toString();let r=g(function(t){return t.replace(/\W/g,"-")}(t));return r=r.substring(0,100-e.length-1),`${r}_${e}`}function Hn(t){return(t||"").split("/").map(Dn).join("/")}z(z.S,"Array",{isArray:wt});var Un=S.Array.isArray;function Wn(t,e){return t===e||t!=t&&e!=e}function Bn(t,e){for(var r=t.length;r--;)if(Wn(t[r][0],e))return r;return-1}var Gn=Array.prototype.splice;function Jn(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jn.prototype.clear=function(){this.__data__=[],this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,r=Bn(e,t);return!(r<0)&&(r==e.length-1?e.pop():Gn.call(e,r,1),--this.size,!0)},Jn.prototype.get=function(t){var e=this.__data__,r=Bn(e,t);return r<0?void 0:e[r][1]},Jn.prototype.has=function(t){return Bn(this.__data__,t)>-1},Jn.prototype.set=function(t,e){var r=this.__data__,n=Bn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Kn="object"==typeof global&&global&&global.Object===Object&&global,Vn="object"==typeof self&&self&&self.Object===Object&&self,Yn=Kn||Vn||Function("return this")(),Xn=Yn.Symbol,Qn=Object.prototype,Zn=Qn.hasOwnProperty,ti=Qn.toString,ei=Xn?Xn.toStringTag:void 0;var ri=Object.prototype.toString;var ni=Xn?Xn.toStringTag:void 0;function ii(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ni&&ni in Object(t)?function(t){var e=Zn.call(t,ei),r=t[ei];try{t[ei]=void 0;var n=!0}catch(t){}var i=ti.call(t);return n&&(e?t[ei]=r:delete t[ei]),i}(t):function(t){return ri.call(t)}(t)}function oi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function si(t){if(!oi(t))return!1;var e=ii(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var ui,ci=Yn["__core-js_shared__"],ai=(ui=/[^.]+$/.exec(ci&&ci.keys&&ci.keys.IE_PROTO||""))?"Symbol(src)_1."+ui:"";var fi=Function.prototype.toString;var hi=/^\[object .+?Constructor\]$/,li=Function.prototype,pi=Object.prototype,di=li.toString,vi=pi.hasOwnProperty,gi=RegExp("^"+di.call(vi).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yi(t){return!(!oi(t)||(e=t,ai&&ai in e))&&(si(t)?gi:hi).test(function(t){if(null!=t){try{return fi.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function mi(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return yi(r)?r:void 0}var _i=mi(Yn,"Map"),bi=mi(Object,"create");var wi=Object.prototype.hasOwnProperty;var Oi=Object.prototype.hasOwnProperty;function ji(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Si(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ei(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ji.prototype.clear=function(){this.__data__=bi?bi(null):{},this.size=0},ji.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ji.prototype.get=function(t){var e=this.__data__;if(bi){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return wi.call(e,t)?e[t]:void 0},ji.prototype.has=function(t){var e=this.__data__;return bi?void 0!==e[t]:Oi.call(e,t)},ji.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=bi&&void 0===e?"__lodash_hash_undefined__":e,this},Ei.prototype.clear=function(){this.size=0,this.__data__={hash:new ji,map:new(_i||Jn),string:new ji}},Ei.prototype.delete=function(t){var e=Si(this,t).delete(t);return this.size-=e?1:0,e},Ei.prototype.get=function(t){return Si(this,t).get(t)},Ei.prototype.has=function(t){return Si(this,t).has(t)},Ei.prototype.set=function(t,e){var r=Si(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Pi(t){var e=this.__data__=new Jn(t);this.size=e.size}Pi.prototype.clear=function(){this.__data__=new Jn,this.size=0},Pi.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Pi.prototype.get=function(t){return this.__data__.get(t)},Pi.prototype.has=function(t){return this.__data__.has(t)},Pi.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Jn){var n=r.__data__;if(!_i||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ei(n)}return r.set(t,e),this.size=r.size,this};var xi=function(){try{var t=mi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Ai(t,e,r){"__proto__"==e&&xi?xi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ti(t,e,r){(void 0!==r&&!Wn(t[e],r)||void 0===r&&!(e in t))&&Ai(t,e,r)}var Ri,ki=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var u=o[Ri?s:++n];if(!1===e(i[u],u,i))break}return t},Ii="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ni=Ii&&"object"==typeof module&&module&&!module.nodeType&&module,Li=Ni&&Ni.exports===Ii?Yn.Buffer:void 0,Fi=Li?Li.allocUnsafe:void 0;var Mi=Yn.Uint8Array;function qi(t,e){var r,n,i=e?(r=t.buffer,n=new r.constructor(r.byteLength),new Mi(n).set(new Mi(r)),n):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}var Ci=Object.create,$i=function(){function t(){}return function(e){if(!oi(e))return{};if(Ci)return Ci(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var zi,Di,Hi=(zi=Object.getPrototypeOf,Di=Object,function(t){return zi(Di(t))}),Ui=Object.prototype;function Wi(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ui)}function Bi(t){return kn(t)&&"[object Arguments]"==ii(t)}var Gi=Object.prototype,Ji=Gi.hasOwnProperty,Ki=Gi.propertyIsEnumerable,Vi=Bi(function(){return arguments}())?Bi:function(t){return kn(t)&&Ji.call(t,"callee")&&!Ki.call(t,"callee")},Yi=Array.isArray;function Xi(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Qi(t){return null!=t&&Xi(t.length)&&!si(t)}var Zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,to=Zi&&"object"==typeof module&&module&&!module.nodeType&&module,eo=to&&to.exports===Zi?Yn.Buffer:void 0,ro=(eo?eo.isBuffer:void 0)||function(){return!1},no=Function.prototype,io=Object.prototype,oo=no.toString,so=io.hasOwnProperty,uo=oo.call(Object);var co={};co["[object Float32Array]"]=co["[object Float64Array]"]=co["[object Int8Array]"]=co["[object Int16Array]"]=co["[object Int32Array]"]=co["[object Uint8Array]"]=co["[object Uint8ClampedArray]"]=co["[object Uint16Array]"]=co["[object Uint32Array]"]=!0,co["[object Arguments]"]=co["[object Array]"]=co["[object ArrayBuffer]"]=co["[object Boolean]"]=co["[object DataView]"]=co["[object Date]"]=co["[object Error]"]=co["[object Function]"]=co["[object Map]"]=co["[object Number]"]=co["[object Object]"]=co["[object RegExp]"]=co["[object Set]"]=co["[object String]"]=co["[object WeakMap]"]=!1;var ao="object"==typeof exports&&exports&&!exports.nodeType&&exports,fo=ao&&"object"==typeof module&&module&&!module.nodeType&&module,ho=fo&&fo.exports===ao&&Kn.process,lo=function(){try{var t=fo&&fo.require&&fo.require("util").types;return t||ho&&ho.binding&&ho.binding("util")}catch(t){}}(),po=lo&&lo.isTypedArray,vo=po?function(t){return function(e){return t(e)}}(po):function(t){return kn(t)&&Xi(t.length)&&!!co[ii(t)]};function go(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var yo=Object.prototype.hasOwnProperty;function mo(t,e,r){var n=t[e];yo.call(t,e)&&Wn(n,r)&&(void 0!==r||e in t)||Ai(t,e,r)}var _o=/^(?:0|[1-9]\d*)$/;function bo(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&_o.test(t))&&t>-1&&t%1==0&&t<e}var wo=Object.prototype.hasOwnProperty;function Oo(t,e){var r=Yi(t),n=!r&&Vi(t),i=!r&&!n&&ro(t),o=!r&&!n&&!i&&vo(t),s=r||n||i||o,u=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=u.length;for(var a in t)!e&&!wo.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||bo(a,c))||u.push(a);return u}var jo=Object.prototype.hasOwnProperty;function So(t){if(!oi(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Wi(t),r=[];for(var n in t)("constructor"!=n||!e&&jo.call(t,n))&&r.push(n);return r}function Eo(t){return Qi(t)?Oo(t,!0):So(t)}function Po(t){return function(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var u=e[o],c=n?n(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),i?Ai(r,u,c):mo(r,u,c)}return r}(t,Eo(t))}function xo(t,e,r,n,i,o,s){var u=go(t,r),c=go(e,r),a=s.get(c);if(a)Ti(t,r,a);else{var f,h=o?o(u,c,r+"",t,e,s):void 0,l=void 0===h;if(l){var p=Yi(c),d=!p&&ro(c),v=!p&&!d&&vo(c);h=c,p||d||v?Yi(u)?h=u:kn(f=u)&&Qi(f)?h=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(u):d?(l=!1,h=function(t,e){if(e)return t.slice();var r=t.length,n=Fi?Fi(r):new t.constructor(r);return t.copy(n),n}(c,!0)):v?(l=!1,h=qi(c,!0)):h=[]:function(t){if(!kn(t)||"[object Object]"!=ii(t))return!1;var e=Hi(t);if(null===e)return!0;var r=so.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&oo.call(r)==uo}(c)||Vi(c)?(h=u,Vi(u)?h=Po(u):oi(u)&&!si(u)||(h=function(t){return"function"!=typeof t.constructor||Wi(t)?{}:$i(Hi(t))}(c))):l=!1}l&&(s.set(c,h),i(h,c,n,o,s),s.delete(c)),Ti(t,r,h)}}function Ao(t,e,r,n,i){t!==e&&ki(e,(function(o,s){if(i||(i=new Pi),oi(o))xo(t,e,s,r,Ao,n,i);else{var u=n?n(go(t,s),o,s+"",t,e,i):void 0;void 0===u&&(u=o),Ti(t,s,u)}}),Eo)}function To(t){return t}function Ro(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var ko=Math.max;var Io=xi?function(t,e){return xi(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:To,No=Date.now;var Lo=function(t){var e=0,r=0;return function(){var n=No(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Io);function Fo(t,e){return Lo(function(t,e,r){return e=ko(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=ko(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=r(s),Ro(t,this,u)}}(t,e,To),t+"")}var Mo,qo=(Mo=function(t,e,r,n){Ao(t,e,r,n)},Fo((function(t,e){var r=-1,n=e.length,i=n>1?e[n-1]:void 0,o=n>2?e[2]:void 0;for(i=Mo.length>3&&"function"==typeof i?(n--,i):void 0,o&&function(t,e,r){if(!oi(r))return!1;var n=typeof e;return!!("number"==n?Qi(r)&&bo(e,r.length):"string"==n&&e in r)&&Wn(r[e],t)}(e[0],e[1],o)&&(i=n<3?void 0:i,n=1),t=Object(t);++r<n;){var s=e[r];s&&Mo(t,s,r,i)}return t})));function Co(t,e,r){if(Un(t)||["context"].includes(r))return e}function $o(...t){return qo({},...t,Co)}function zo(t){e(`Invalid recording name provided. Expected string, received: "${typeof t}".`,"string"==typeof t),e("Invalid recording name provided. Received An empty or blank string.",t.trim().length>0)}function Do(t){e(`Invalid config provided. Expected object, received: "${typeof t}".`,kn(t)&&!Un(t)),["mode","adapters","adapterOptions","persister","persisterOptions"].forEach(r=>e(`Invalid configuration option provided. The "${r}" option cannot be overridden using the server configuration API.`,!(r in t)))}function Ho(t){e(`Invalid number provided. Expected number, received: "${typeof t}".`,"number"==typeof t),e(`Invalid number provided. The number must be greater than 0, received "${typeof t}".`,t>0)}const{freeze:Uo}=Object,{parse:Wo}=JSON;class Bo{constructor(){this.headers=new Fn}getHeader(t){return this.headers[t]}setHeader(t,e){return this.headers[t]=e,this}setHeaders(t={}){for(const e in t)this.setHeader(e,t[e]);return this}removeHeader(t){return this.setHeader(t,null),this}removeHeaders(t=[]){for(const e of t)this.removeHeader(e);return this}hasHeader(t){return!!this.getHeader(t)}type(t){return this.setHeader("Content-Type",t)}send(t){let e=t;switch(typeof e){case"string":this.hasHeader("Content-Type")||this.type("text/html");break;case"boolean":case"number":case"object":if(null!==e)return this.json(e);e=""}if("string"==typeof e){const t=this.getHeader("Content-Type");t&&!t.includes("charset")&&this.type(t+"; charset=utf-8")}return this.body=e,this}json(t){return this.hasHeader("Content-Type")||this.type("application/json"),this.send(p(t))}jsonBody(){return Wo(this.body)}end(){return Uo(this),Uo(this.headers),this}}var Go="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",Jo="["+Go+"]",Ko=RegExp("^"+Jo+Jo+"*"),Vo=RegExp(Jo+Jo+"*$"),Yo=function(t,e,r){var n={},i=O((function(){return!!Go[t]()||"​…"!="​…"[t]()})),o=n[t]=i?e(Xo):Go[t];r&&(n[r]=o),z(z.P+z.F*i,"String",n)},Xo=Yo.trim=function(t,e){return t=String(nt(t)),1&e&&(t=t.replace(Ko,"")),2&e&&(t=t.replace(Vo,"")),t},Qo=Yo,Zo=_.parseInt,ts=Qo.trim,es=/^[-+]?0[xX]/,rs=8!==Zo(Go+"08")||22!==Zo(Go+"0x16")?function(t,e){var r=ts(String(t),3);return Zo(r,e>>>0||(es.test(r)?16:10))}:Zo;z(z.G+z.F*(parseInt!=rs),{parseInt:rs});var ns=S.parseInt;class is extends Bo{constructor(t,e,r,n){super(),this.status(t||200),this.setHeaders(e),this.body=r,this.encoding=n}get ok(){return this.statusCode&&this.statusCode>=200&&this.statusCode<300}get statusText(){return s[this.statusCode]||s[200]}status(t){const r=ns(t,10);return e("[Response] Invalid status code: "+r,r>=100&&r<600),this.statusCode=r,this}sendStatus(t){return this.status(t),this.type("text/plain"),this.send(this.statusText)}}var os=function(t,e){var r=(S.Object||{})[t]||Object[t],n={};n[t]=e(r),z(z.S+z.F*O((function(){r(1)})),"Object",n)};os("keys",(function(){return function(t){return mt(Ot(t))}}));var ss=S.Object.keys,us=S.Object.getOwnPropertySymbols,cs=qt.f;os("getOwnPropertyDescriptor",(function(){return function(t,e){return cs(it(t),e)}}));var as=S.Object,fs=function(t,e){return as.getOwnPropertyDescriptor(t,e)},hs=_.Reflect,ls=hs&&hs.ownKeys||function(t){var e=kt.f(A(t)),r=_t.f;return r?e.concat(r(t)):e},ps=function(t,e,r){e in t?F.f(t,e,M(0,r)):t[e]=r};z(z.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r,n=it(t),i=qt.f,o=ls(n),s={},u=0;o.length>u;)void 0!==(r=i(n,e=o[u++]))&&ps(s,e,r);return s}});var ds=S.Object.getOwnPropertyDescriptors;z(z.S+z.F*!j,"Object",{defineProperties:jt});var vs=S.Object,gs=function(t,e){return vs.defineProperties(t,e)};z(z.S+z.F*!j,"Object",{defineProperty:F.f});var ys,ms=S.Object,_s=function(t,e,r){return ms.defineProperty(t,e,r)},bs=m((function(t){t.exports=function(t,e,r){return e in t?_s(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0})),ws=(ys=bs)&&ys.__esModule&&Object.prototype.hasOwnProperty.call(ys,"default")?ys.default:ys;sr("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return mr.def(Ve(this,"Set"),t=0===t?0:t,t)}},mr);z(z.P+z.R,"Set",{toJSON:_r("Set")}),ur("Set"),cr("Set");var Os=S.Set;function js(t,e,r){let n=0;return function(...i){return++n>=e&&r(),t(...i)}}z(z.S+z.F,"Object",{assign:qe});var Ss=S.Object.assign;const Es=ve();class Ps{constructor(t,r){e(`Invalid type provided. Expected a non-empty string, received: "${typeof t}".`,t&&"string"==typeof t),_s(this,"type",{value:t}),Ss(this,r||{}),this[Es]=!1}stopPropagation(){this[Es]=!0}get shouldStopPropagating(){return this[Es]}}function xs(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function As(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xs(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):xs(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}const Ts=ve(),Rs=ve();function ks(t,r){e(`Invalid event name provided. Expected string, received: "${typeof t}".`,"string"==typeof t),e(`Invalid event name provided: "${t}". Possible events: ${[...r].join(", ")}.`,r.has(t))}class Is{constructor(t={}){const{eventNames:r}=t;e("An array of supported events must be provided via the `eventNames` option.",Un(r)&&r.length>0),this[Ts]=new wr,this[Rs]=new Os(r)}eventNames(){const t=[];return this[Ts].forEach((e,r)=>this.hasListeners(r)&&t.push(r)),t}on(t,r,n={}){ks(t,this[Rs]),function(t){e(`Invalid listener provided. Expected function, received: "${typeof t}".`,"function"==typeof t)}(r);const i=this[Ts],{times:o}=n;if(i.has(t)||i.set(t,new Os),o){Ho(o);const e=js(r,o,()=>this.off(t,e));this.off(t,r),e.listener=r,r=e}return i.get(t).add(r),this}once(t,e,r={}){return this.on(t,e,As(As({},r),{},{times:1})),this}off(t,e){ks(t,this[Rs]);const r=this[Ts];return this.hasListeners(t)&&("function"==typeof e?(r.get(t).delete(e),this.listeners(t).forEach(n=>{n.listener===e&&r.get(t).delete(n)})):r.get(t).clear(t)),this}listeners(t){return ks(t,this[Rs]),this.hasListeners(t)?[...this[Ts].get(t)]:[]}hasListeners(t){ks(t,this[Rs]);const e=this[Ts];return e.has(t)&&e.get(t).size>0}async emit(t,...e){ks(t,this[Rs]);const r=new Ps(t);for(const n of this.listeners(t))if(await n(...e,r),r.shouldStopPropagating)return!1;return!0}async emitParallel(t,...e){ks(t,this[Rs]);const r=new Ps(t);return await Sn.all(this.listeners(t).map(t=>t(...e,r))),!r.shouldStopPropagating}emitSync(t,...r){ks(t,this[Rs]);const n=new Ps(t);for(const i of this.listeners(t)){const o=i(...r,n);if(e(`Attempted to emit a synchronous event "${t}" but an asynchronous listener was called.`,!(kn(o)&&"function"==typeof o.then)),n.shouldStopPropagating)return!1}return!0}}const Ns=ve(),Ls=ve();function Fs(t){t[Ns]=!1,t[Ls]=!1}class Ms extends Ps{constructor(){super("intercept"),Fs(this)}abort(){Fs(this),this[Ns]=!0}passthrough(){Fs(this),this[Ls]=!0}get shouldAbort(){return this[Ns]}get shouldPassthrough(){return this[Ls]}get shouldIntercept(){return!this.shouldAbort&&!this.shouldPassthrough}}const{keys:qs,freeze:Cs}=Object,$s=ve(),zs=ve(),Ds=ve(),Hs=ve(),Us=["identify"];class Ws extends Bo{constructor(t,r){super(),e("Url is required.",r.url),e("Method is required.",r.method&&"string"==typeof r.method),this.didRespond=!1,this.aborted=!1,this.url=r.url,this.method=r.method.toUpperCase(),this.body=r.body,this.setHeaders(r.headers),this.recordingName=t.recordingName,this.recordingId=t.recordingId,this.requestArguments=Cs(r.requestArguments),this.promise=function(){let t,e;const r=new Sn((r,n)=>{t=r,e=n});return r.catch(()=>{}),r.resolve=t,r.reject=e,r}(),this[zs]=t,this[Hs]=new Is({eventNames:Us}),this.action=null,this._interceptor=new Ms,this[$s]=t.server.lookup(this.method,this.url),this[$s].applyFiltersWithArgs(this),this.configure(this[$s].config());const n=this[$s].recordingName();n&&this.overrideRecordingName(n)}get url(){return this[Ds].toString()}set url(t){this[Ds]=In(""+t,!0)}get absoluteUrl(){const{url:t}=this;return d(t)?t:new o(t).href}get protocol(){return this[Ds].protocol}get hostname(){return this[Ds].hostname}get port(){return this[Ds].port}get origin(){return this[Ds].origin}get pathname(){return this[Ds].pathname}get query(){return this[Ds].query}set query(t){this[Ds].set("query",t)}get hash(){return this[Ds].hash}set hash(t){this[Ds].set("hash",t)}get shouldPassthrough(){return this[$s].shouldPassthrough()}get shouldIntercept(){return this[$s].shouldIntercept()}get log(){if(this.id){const t=h.getLogger(`@pollyjs/core:${this.recordingName}:${this.id}`);return t.setLevel(this.config.logLevel),t}return this[zs].logger.log}on(t,e){return this[Hs].on(t,e),this}once(t,e){return this[Hs].once(t,e),this}off(t,e){return this[Hs].off(t,e),this}async init(){await this._emit("request"),this.response=new is,this.didRespond=!1,await this._identify(),this.timestamp=u()}async respond(t){const{statusCode:r,headers:n,body:i,encoding:o}=t||{};e("Cannot respond to a request that already has a response.",!this.didRespond),this.aborted||(this.response.timestamp=u(),this.response.status(r),this.response.setHeaders(n),this.response.body=i,this.response.encoding=o,await this._emit("beforeResponse",this.response),this.response.end(),this.responseTime=new Date(this.response.timestamp).getTime()-new Date(this.timestamp).getTime(),this.didRespond=!0,this.end(),await this._emit("response",this.response))}abort(){this.aborted=!0}overrideRecordingName(t){zo(t),this.recordingName=t,this.recordingId=Hn(t)}configure(t){Do(t),this.config=$o(this[zs].config,this.config||{},t)}_intercept(){return this[$s].intercept(this,this.response,...arguments)}_emit(t,...e){return this[$s].emit(t,this,...e)}async _identify(){const t=this[zs],{_requests:e}=t,{matchRequestsBy:r}=this.config;this.identifiers={},qs(zn).forEach(t=>{this[t]&&r[t]&&(this.identifiers[t]=zn[t](this[t],r[t],this))}),await this[Hs].emit("identify",this),Cs(this.identifiers),this.id=l(p(this.identifiers)),this.order=!r.order||this.shouldPassthrough||this.shouldIntercept?0:e.slice(0,e.indexOf(this)).filter(t=>t.id===this.id&&t.recordingId===this.recordingId).length,this.log.debug("Request Identified:",{id:this.id,order:this.order,identifiers:this.identifiers,request:this})}}function Bs(){if(!arguments.length)return[];var t=arguments[0];return Yi(t)?t:[t]}z(z.S,"Reflect",{get:function t(e,r){var n,i,o=arguments.length<3?e:arguments[2];return A(e)===o?e[r]:(n=qt.f(e,r))?w(n,"value")?n.value:void 0!==n.get?n.get.call(o):void 0:x(i=Oe(e))?t(i,r,o):void 0}});var Gs=S.Reflect.get;function Js(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ks(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Js(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):Js(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}const Vs=ve();function Ys(t,{params:e}){return new Proxy(t,{set:(t,e,r)=>(t[e]=r,!0),get:(t,r)=>"params"===r?Ks({},e):Gs(t,r)})}class Xs{constructor(t,e){const r=t&&t[0];this.params={},this.queryParams={},this.handlers=[],this.middleware=e||[],r&&(this.handlers=r.handler,this.params=Ks({},r.params),this.queryParams=t.queryParams),this[Vs]=this._orderedHandlers()}shouldPassthrough(){return Boolean(this._valueFor("passthrough"))}shouldIntercept(){return Boolean(this._valueFor("intercept"))}recordingName(){return this._valueFor("recordingName")||null}config(){return $o(...this[Vs].map(({handler:t})=>t.get("config")))}applyFiltersWithArgs(t,...e){this[Vs]=this[Vs].filter(({route:r,handler:n})=>[...n.get("filters")].every(n=>n(Ys(t,r),...e)))}async intercept(t,e,r){for(const{route:n,handler:i}of this[Vs]){if(!r.shouldIntercept||r.shouldStopPropagating)return;i.has("intercept")&&await i.get("intercept")(Ys(t,n),e,r)}}async emit(t,e,...r){for(const{route:n,handler:i}of this[Vs]){if(!await i._eventEmitter.emit(t,Ys(e,n),...r))return}}_orderedHandlers(){return[...this.middleware,this].reduce((t,e)=>(t.push(...e.handlers.map(t=>({route:e,handler:t}))),t),[])}_valueFor(t){let e;for(const{handler:r}of this[Vs])r.has(t)&&(e=r.get(t));return e}}function Qs(t,e){var r=ss(t);if(us){var n=us(t);e&&(n=n.filter((function(e){return fs(t,e).enumerable}))),r.push.apply(r,n)}return r}function Zs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qs(Object(r),!0).forEach((function(e){ws(t,e,r[e])})):ds?gs(t,ds(r)):Qs(Object(r)).forEach((function(e){_s(t,e,fs(r,e))}))}return t}class tu extends wr{constructor(){super(),this.set("config",{}),this.set("defaultOptions",{}),this.set("filters",new Os),this._eventEmitter=new Is({eventNames:["error","abort","request","beforeReplay","beforePersist","beforeResponse","response"]})}on(t,e,r={}){return this._eventEmitter.on(t,e,Zs(Zs({},this.get("defaultOptions")),r)),this}once(t,e){return this._eventEmitter.once(t,e),this}off(t,e){return this._eventEmitter.off(t,e),this}passthrough(t=!0){return this.set("passthrough",Boolean(t)),this.get("passthrough")&&this.delete("intercept"),this}intercept(t,r={}){return e(`Invalid intercept handler provided. Expected function, received: "${typeof t}".`,"function"==typeof t),"times"in(r=Zs(Zs({},this.get("defaultOptions")),r))&&(Ho(r.times),t=js(t,r.times,()=>this.delete("intercept"))),this.set("intercept",t),this.passthrough(!1),this}recordingName(t){return t&&zo(t),this.set("recordingName",t),this}configure(t){return Do(t),this.set("config",t),this}filter(t){return e(`Invalid filter callback provided. Expected function, received: "${typeof t}".`,"function"==typeof t),this.get("filters").add(t),this}times(t){return t||"number"==typeof t?(Ho(t),this.get("defaultOptions").times=t):delete this.get("defaultOptions").times,this}}class eu{constructor({host:t,paths:e,global:r,handler:n}){this.global=Boolean(r),this.handler=n,this.host=t,this.paths=this.global?["__GLOBAL__"]:e,this._routeRecognizer=new y,this.paths.forEach(t=>this._routeRecognizer.add([{path:t,handler:[n]}]))}match(t,e){if(this.global)return new Xs(this._routeRecognizer.recognize("__GLOBAL__"));if(this.host===t){const t=this._routeRecognizer.recognize(e);return t&&new Xs(t)}}}const ru=ve(),nu=ve(),iu=ve(),ou=ve(),su=ve(),uu="/",cu="*",au=":",{keys:fu}=Object;function hu(t){const e=new o(t);return{host:e.host?e.origin:uu,path:e.pathname||uu}}class lu{constructor(){this[ru]="",this[iu]={},this[nu]=[],this[ou]=[]}host(t,r){const n=this[ru];e("[Server] A host cannot be specified within another host.",!n),this[ru]=t,r(this),this[ru]=n}namespace(t,e){const r=this[nu];this[nu]=[...r,t],e(this),this[nu]=r}timeout(){return r(...arguments)}get(){return this._register("GET",...arguments)}put(){return this._register("PUT",...arguments)}post(){return this._register("POST",...arguments)}delete(){return this._register("DELETE",...arguments)}patch(){return this._register("PATCH",...arguments)}merge(){return this._register("MERGE",...arguments)}head(){return this._register("HEAD",...arguments)}options(){return this._register("OPTIONS",...arguments)}any(){return this._registerMiddleware(...arguments)}lookup(t,e){return new Xs(this._recognize(t,e),this._lookupMiddleware(e))}_lookupMiddleware(t){const{host:e,path:r}=hu(t);return this[ou].map(t=>t.match(e,r)).filter(Boolean)}_register(t,e){const r=new tu;return Bs(e).forEach(e=>{const{host:n,path:i}=hu(this._buildUrl(e)),o=this._registryForHost(n),s=this._nameForPath(i),u=o[t.toUpperCase()];u[su].has(s)?u[su].get(s).push(r):(u[su].set(s,[r]),u.add([{path:i,handler:u[su].get(s)}]))}),r}_registerMiddleware(t){const e=new tu,r={};return Bs(t).forEach(t=>{if(t&&t!==cu||this[ru]||0!==this[nu].length){const{host:e,path:n}=hu(this._buildUrl(t));r[e]=r[e]||[],r[e].push(n)}else this[ou].push(new eu({global:!0,handler:e}))}),fu(r).forEach(t=>{this[ou].push(new eu({host:t,paths:r[t],handler:e}))}),e}_recognize(t,e){const{host:r,path:n}=hu(e);return this._registryForHost(r)[t.toUpperCase()].recognize(n)}_buildUrl(t){return c(this[ru],...this[nu],t)}_nameForPath(t=""){return t.split(uu).map(t=>{switch(t.charAt(0)){case au:return au;case cu:return cu;default:return t}}).join(uu).replace(/\/$/,"")||uu}_registryForHost(t){return this[iu][t]||(this[iu][t]=a.reduce((t,e)=>(t[e]=new y,t[e][su]=new wr,t),{})),this[iu][t]}}const pu=ve(),du=ve(),vu=ve(),gu=new fr,yu=new Is({eventNames:["register","create","stop"]});class mu{constructor(t,e){this.recordingName=t,this.server=new lu,this.config={},this.container=new An,yu.emitSync("register",this.container),this.adapters=new wr,this.persister=null,this._requests=[],yu.emitSync("create",this),this.configure(e)}static get VERSION(){return"6.0.3"}get recordingName(){return this[pu]}set recordingName(t){zo(t),this[pu]=t,this[du]=Hn(t)}get recordingId(){return this[du]}get mode(){return this.config.mode}set mode(t){const r=xr(n);e(`Invalid mode provided: "${t}". Possible modes: ${r.join(", ")}.`,r.includes(t)),this.config.mode=t}static on(t,e){return yu.on(t,e),this}static once(t,e){return yu.once(t,e),this}static off(t,e){return yu.off(t,e),this}static register(t){return gu.has(t)||gu.set(t,e=>e.register(t)),this.on("register",gu.get(t)),this}static unregister(t){return gu.has(t)&&this.off("register",gu.get(t)),this}configure(t={}){const{container:r}=this;e("Cannot call `configure` once requests have been handled.",0===this._requests.length),e("Cannot call `configure` on an instance of Polly that is not running.",this.mode!==n.STOPPED),this.disconnect(),this.logger&&this.logger.disconnect(),this.config=$o(Rn,this.config,t),this.logger=new Pn(this),this.logger.connect(),this.config.adapters.forEach(t=>this.connectTo(t));let{persister:i}=this.config;i&&("function"==typeof i&&(r.register(i),i=i.id),e(`Persister matching the name \`${i}\` was not registered.`,r.has("persister:"+i)),this.persister=new(r.lookup("persister:"+i))(this)),this.logger.log.debug("Polly instance configured.",{config:this.config})}record(){this.mode=n.RECORD}replay(){this.mode=n.REPLAY}passthrough(){this.mode=n.PASSTHROUGH}pause(){this[vu]=[...this.adapters.keys()],this.disconnect()}play(){this[vu]&&(this[vu].forEach(t=>this.connectTo(t)),delete this[vu])}async stop(){this.mode!==n.STOPPED&&(this.config.flushRequestsOnStop&&await this.flush(),this.disconnect(),await(this.persister&&this.persister.persist()),this.mode=n.STOPPED,await yu.emit("stop",this),this.logger.log.debug("Polly instance stopped.",{recordingName:this.recordingName}),this.logger.disconnect())}async flush(){const t=()=>{};await Sn.all(this._requests.map(e=>Sn.resolve(e.promise).then(t,t)))}connectTo(t){const{container:r,adapters:n}=this;let i=t;"function"==typeof t&&(r.register(t),i=t.id),e(`Adapter matching the name \`${i}\` was not registered.`,r.has("adapter:"+i)),this.disconnectFrom(i);const o=new(r.lookup("adapter:"+i))(this);o.connect(),n.set(i,o)}disconnectFrom(t){const{adapters:e}=this;let r=t;"function"==typeof t&&(r=t.id),e.has(r)&&(e.get(r).disconnect(),e.delete(r))}disconnect(){for(const t of this.adapters.keys())this.disconnectFrom(t)}registerRequest(t={}){const e=new Ws(this,t);return this._requests.push(e),e}}const{defineProperty:_u}=Object;function bu(t,e,r){_u(t,"polly",{writable:!0,enumerable:!0,configurable:!0,value:new mu(e,r)})}async function wu(t,e){await t.polly.stop(),_u(t,"polly",{enumerable:!0,configurable:!0,get(){throw new f(`You are trying to access an instance of Polly that is no longer available.\nSee: https://netflix.github.io/pollyjs/#/test-frameworks/${e}?id=test-hook-ordering`)}})}function Ou(t){return t.test.testReport.fullName.join("/")}function ju(t,e={}){ju.beforeEach(t,e),ju.afterEach(t)}function Su(t={},e=global){Su.beforeEach(t,e),Su.afterEach(e)}ju.beforeEach=function(t,e={}){t.beforeEach((function(){return bu(this,Ou(...arguments),e)}))},ju.afterEach=function(t){t.afterEach((function(){return wu(this,"qunit")}))},Su.beforeEach=function(t,e=global){e.beforeEach((function(){return bu(this,function(t){const{currentTest:e}=t,r=[e.title];let n=e.parent;for(;n&&n.title;)r.push(n.title),n=n.parent;return r.reverse().join("/")}(this),t)}))},Su.afterEach=function(t=global){t.afterEach((function(){return wu(this,"mocha")}))};export{mu as Polly,Tn as Timing,Su as setupMocha,ju as setupQunit};
//# sourceMappingURL=pollyjs-core.min.js.map
{
"name": "@pollyjs/core",
"version": "6.0.2",
"version": "6.0.3",
"description": "Record, replay, and stub HTTP Interactions",

@@ -59,6 +59,6 @@ "main": "dist/cjs/pollyjs-core.js",

"@pollyjs/adapter": "^6.0.2",
"@pollyjs/persister": "^6.0.2",
"@pollyjs/persister": "^6.0.3",
"rollup": "^1.14.6"
},
"gitHead": "9f4179a76d4c09f26c4cd21683bf00ac3f99ac59"
"gitHead": "dab6789f83952cb8f9ff5980f268110ea05346c0"
}

@@ -108,12 +108,2 @@ import Adapter from '@pollyjs/adapter';

extends HTTPBase {
constructor(
polly: Polly,
request: {
url: string;
method: string;
headers: Headers;
body?: string;
requestArguments: TArguments;
}
);
method: string;

@@ -120,0 +110,0 @@ url: string;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc