@pollyjs/persister
Version:
Extendable base persister class used by @pollyjs
3 lines (2 loc) • 36.1 kB
JavaScript
import t from"fast-json-stable-stringify";import{assert as e,ACTIONS as n}from"@pollyjs/utils";import r from"bowser";import o from"utf8-byte-length";import i from"set-cookie-parser";var s=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},c=function(t){return Object(s(t))},u={}.hasOwnProperty,a=function(t,e){return u.call(t,e)},f={}.toString,l=function(t){return f.call(t).slice(8,-1)},h=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==l(t)?t.split(""):Object(t)},p=function(t){return h(s(t))},d=Math.ceil,v=Math.floor,y=function(t){return isNaN(t=+t)?0:(t>0?v:d)(t)},g=Math.min,_=function(t){return t>0?g(y(t),9007199254740991):0},m=Math.max,b=Math.min;function w(t,e){return t(e={exports:{}},e.exports),e.exports}var O,S=w((function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)})),j=(S.version,w((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)}))),P=w((function(t){var e=j["__core-js_shared__"]||(j["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:S.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),E=0,T=Math.random(),x=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++E+T).toString(36))},k=P("keys"),R=function(t){return k[t]||(k[t]=x(t))},M=(O=!1,function(t,e,n){var r,o=p(t),i=_(o.length),s=function(t,e){return(t=y(t))<0?m(t+e,0):b(t,e)}(n,i);if(O&&e!=e){for(;i>s;)if((r=o[s++])!=r)return!0}else for(;i>s;s++)if((O||s in o)&&o[s]===e)return O||s||0;return!O&&-1}),F=R("IE_PROTO"),A=function(t,e){var n,r=p(t),o=0,i=[];for(n in r)n!=F&&a(r,n)&&i.push(n);for(;e.length>o;)a(r,n=e[o++])&&(~M(i,n)||i.push(n));return i},L="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),D=Object.keys||function(t){return A(t,L)},C=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},N=function(t,e,n){if(C(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},z=function(t){return"object"==typeof t?null!==t:"function"==typeof t},I=function(t){if(!z(t))throw TypeError(t+" is not an object!");return t},q=function(t){try{return!!t()}catch(t){return!0}},$=!q((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),G=j.document,H=z(G)&&z(G.createElement),U=function(t){return H?G.createElement(t):{}},V=!$&&!q((function(){return 7!=Object.defineProperty(U("div"),"a",{get:function(){return 7}}).a})),W=function(t,e){if(!z(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!z(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},J=Object.defineProperty,K={f:$?Object.defineProperty:function(t,e,n){if(I(t),e=W(e,!0),I(n),V)try{return J(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},B=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Y=$?function(t,e,n){return K.f(t,e,B(1,n))}:function(t,e,n){return t[e]=n,t},Q=function(t,e,n){var r,o,i,s=t&Q.F,c=t&Q.G,u=t&Q.S,f=t&Q.P,l=t&Q.B,h=t&Q.W,p=c?S:S[e]||(S[e]={}),d=p.prototype,v=c?j:u?j[e]:(j[e]||{}).prototype;for(r in c&&(n=e),n)(o=!s&&v&&void 0!==v[r])&&a(p,r)||(i=o?v[r]:n[r],p[r]=c&&"function"!=typeof v[r]?n[r]:l&&o?N(i,j):h&&v[r]==i?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(i):f&&"function"==typeof i?N(Function.call,i):i,f&&((p.virtual||(p.virtual={}))[r]=i,t&Q.R&&d&&!d[r]&&Y(d,r,i)))};Q.F=1,Q.G=2,Q.S=4,Q.P=8,Q.B=16,Q.W=32,Q.U=64,Q.R=128;var X=Q,Z=function(t,e){var n=(S.Object||{})[t]||Object[t],r={};r[t]=e(n),X(X.S+X.F*q((function(){n(1)})),"Object",r)};Z("keys",(function(){return function(t){return D(c(t))}}));var tt=S.Object.keys,et=Y,nt=w((function(t){var e=x("meta"),n=K.f,r=0,o=Object.isExtensible||function(){return!0},i=!q((function(){return o(Object.preventExtensions({}))})),s=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},c=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!z(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,e)){if(!o(t))return"F";if(!n)return"E";s(t)}return t[e].i},getWeak:function(t,n){if(!a(t,e)){if(!o(t))return!0;if(!n)return!1;s(t)}return t[e].w},onFreeze:function(t){return i&&c.NEED&&o(t)&&!a(t,e)&&s(t),t}}})),rt=(nt.KEY,nt.NEED,nt.fastKey,nt.getWeak,nt.onFreeze,w((function(t){var e=P("wks"),n=j.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:x)("Symbol."+t))}).store=e}))),ot=K.f,it=rt("toStringTag"),st=function(t,e,n){t&&!a(t=n?t:t.prototype,it)&&ot(t,it,{configurable:!0,value:e})},ct={f:rt},ut=K.f,at=function(t){var e=S.Symbol||(S.Symbol={});"_"==t.charAt(0)||t in e||ut(e,t,{value:ct.f(t)})},ft={f:Object.getOwnPropertySymbols},lt={f:{}.propertyIsEnumerable},ht=Array.isArray||function(t){return"Array"==l(t)},pt=$?Object.defineProperties:function(t,e){I(t);for(var n,r=D(e),o=r.length,i=0;o>i;)K.f(t,n=r[i++],e[n]);return t},dt=j.document,vt=dt&&dt.documentElement,yt=R("IE_PROTO"),gt=function(){},_t=function(){var t,e=U("iframe"),n=L.length;for(e.style.display="none",vt.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),_t=t.F;n--;)delete _t.prototype[L[n]];return _t()},mt=Object.create||function(t,e){var n;return null!==t?(gt.prototype=I(t),n=new gt,gt.prototype=null,n[yt]=t):n=_t(),void 0===e?n:pt(n,e)},bt=L.concat("length","prototype"),wt={f:Object.getOwnPropertyNames||function(t){return A(t,bt)}},Ot=wt.f,St={}.toString,jt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Pt={f:function(t){return jt&&"[object Window]"==St.call(t)?function(t){try{return Ot(t)}catch(t){return jt.slice()}}(t):Ot(p(t))}},Et=Object.getOwnPropertyDescriptor,Tt={f:$?Et:function(t,e){if(t=p(t),e=W(e,!0),V)try{return Et(t,e)}catch(t){}if(a(t,e))return B(!lt.f.call(t,e),t[e])}},xt=nt.KEY,kt=Tt.f,Rt=K.f,Mt=Pt.f,Ft=j.Symbol,At=j.JSON,Lt=At&&At.stringify,Dt=rt("_hidden"),Ct=rt("toPrimitive"),Nt={}.propertyIsEnumerable,zt=P("symbol-registry"),It=P("symbols"),qt=P("op-symbols"),$t=Object.prototype,Gt="function"==typeof Ft&&!!ft.f,Ht=j.QObject,Ut=!Ht||!Ht.prototype||!Ht.prototype.findChild,Vt=$&&q((function(){return 7!=mt(Rt({},"a",{get:function(){return Rt(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=kt($t,e);r&&delete $t[e],Rt(t,e,n),r&&t!==$t&&Rt($t,e,r)}:Rt,Wt=function(t){var e=It[t]=mt(Ft.prototype);return e._k=t,e},Jt=Gt&&"symbol"==typeof Ft.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Ft},Kt=function(t,e,n){return t===$t&&Kt(qt,e,n),I(t),e=W(e,!0),I(n),a(It,e)?(n.enumerable?(a(t,Dt)&&t[Dt][e]&&(t[Dt][e]=!1),n=mt(n,{enumerable:B(0,!1)})):(a(t,Dt)||Rt(t,Dt,B(1,{})),t[Dt][e]=!0),Vt(t,e,n)):Rt(t,e,n)},Bt=function(t,e){I(t);for(var n,r=function(t){var e=D(t),n=ft.f;if(n)for(var r,o=n(t),i=lt.f,s=0;o.length>s;)i.call(t,r=o[s++])&&e.push(r);return e}(e=p(e)),o=0,i=r.length;i>o;)Kt(t,n=r[o++],e[n]);return t},Yt=function(t){var e=Nt.call(this,t=W(t,!0));return!(this===$t&&a(It,t)&&!a(qt,t))&&(!(e||!a(this,t)||!a(It,t)||a(this,Dt)&&this[Dt][t])||e)},Qt=function(t,e){if(t=p(t),e=W(e,!0),t!==$t||!a(It,e)||a(qt,e)){var n=kt(t,e);return!n||!a(It,e)||a(t,Dt)&&t[Dt][e]||(n.enumerable=!0),n}},Xt=function(t){for(var e,n=Mt(p(t)),r=[],o=0;n.length>o;)a(It,e=n[o++])||e==Dt||e==xt||r.push(e);return r},Zt=function(t){for(var e,n=t===$t,r=Mt(n?qt:p(t)),o=[],i=0;r.length>i;)!a(It,e=r[i++])||n&&!a($t,e)||o.push(It[e]);return o};Gt||(et((Ft=function(){if(this instanceof Ft)throw TypeError("Symbol is not a constructor!");var t=x(arguments.length>0?arguments[0]:void 0),e=function(n){this===$t&&e.call(qt,n),a(this,Dt)&&a(this[Dt],t)&&(this[Dt][t]=!1),Vt(this,t,B(1,n))};return $&&Ut&&Vt($t,t,{configurable:!0,set:e}),Wt(t)}).prototype,"toString",(function(){return this._k})),Tt.f=Qt,K.f=Kt,wt.f=Pt.f=Xt,lt.f=Yt,ft.f=Zt,ct.f=function(t){return Wt(rt(t))}),X(X.G+X.W+X.F*!Gt,{Symbol:Ft});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;te.length>ee;)rt(te[ee++]);for(var ne=D(rt.store),re=0;ne.length>re;)at(ne[re++]);X(X.S+X.F*!Gt,"Symbol",{for:function(t){return a(zt,t+="")?zt[t]:zt[t]=Ft(t)},keyFor:function(t){if(!Jt(t))throw TypeError(t+" is not a symbol!");for(var e in zt)if(zt[e]===t)return e},useSetter:function(){Ut=!0},useSimple:function(){Ut=!1}}),X(X.S+X.F*!Gt,"Object",{create:function(t,e){return void 0===e?mt(t):Bt(mt(t),e)},defineProperty:Kt,defineProperties:Bt,getOwnPropertyDescriptor:Qt,getOwnPropertyNames:Xt,getOwnPropertySymbols:Zt});var oe=q((function(){ft.f(1)}));X(X.S+X.F*oe,"Object",{getOwnPropertySymbols:function(t){return ft.f(c(t))}}),At&&X(X.S+X.F*(!Gt||q((function(){var t=Ft();return"[null]"!=Lt([t])||"{}"!=Lt({a:t})||"{}"!=Lt(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(z(e)||void 0!==t)&&!Jt(t))return ht(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Jt(e))return e}),r[1]=e,Lt.apply(At,r)}}),Ft.prototype[Ct]||Y(Ft.prototype,Ct,Ft.prototype.valueOf),st(Ft,"Symbol"),st(Math,"Math",!0),st(j.JSON,"JSON",!0);var ie=S.Object.getOwnPropertySymbols,se=Tt.f;Z("getOwnPropertyDescriptor",(function(){return function(t,e){return se(p(t),e)}}));var ce=S.Object,ue=function(t,e){return ce.getOwnPropertyDescriptor(t,e)},ae=j.Reflect,fe=ae&&ae.ownKeys||function(t){var e=wt.f(I(t)),n=ft.f;return n?e.concat(n(t)):e},le=function(t,e,n){e in t?K.f(t,e,B(0,n)):t[e]=n};X(X.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=p(t),o=Tt.f,i=fe(r),s={},c=0;i.length>c;)void 0!==(n=o(r,e=i[c++]))&&le(s,e,n);return s}});var he=S.Object.getOwnPropertyDescriptors;X(X.S+X.F*!$,"Object",{defineProperties:pt});var pe=S.Object,de=function(t,e){return pe.defineProperties(t,e)};X(X.S+X.F*!$,"Object",{defineProperty:K.f});var ve,ye=S.Object,ge=function(t,e,n){return ye.defineProperty(t,e,n)},_e=w((function(t){t.exports=function(t,e,n){return e in t?ge(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0})),me=(ve=_e)&&ve.__esModule&&Object.prototype.hasOwnProperty.call(ve,"default")?ve.default:ve,be={},we={};Y(we,rt("iterator"),(function(){return this}));var Oe,Se=function(t,e,n){t.prototype=mt(we,{next:B(1,n)}),st(t,e+" Iterator")},je=R("IE_PROTO"),Pe=Object.prototype,Ee=Object.getPrototypeOf||function(t){return t=c(t),a(t,je)?t[je]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Pe:null},Te=rt("iterator"),xe=!([].keys&&"next"in[].keys()),ke=function(){return this},Re=function(t,e,n,r,o,i,s){Se(n,e,r);var c,u,a,f=function(t){if(!xe&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",h="values"==o,p=!1,d=t.prototype,v=d[Te]||d["@@iterator"]||o&&d[o],y=v||f(o),g=o?h?f("entries"):y:void 0,_="Array"==e&&d.entries||v;if(_&&(a=Ee(_.call(new t)))!==Object.prototype&&a.next&&st(a,l,!0),h&&v&&"values"!==v.name&&(p=!0,y=function(){return v.call(this)}),s&&(xe||p||!d[Te])&&Y(d,Te,y),be[e]=y,be[l]=ke,o)if(c={values:h?y:f("values"),keys:i?y:f("keys"),entries:g},s)for(u in c)u in d||et(d,u,c[u]);else X(X.P+X.F*(xe||p),e,c);return c},Me=(Oe=!0,function(t,e){var n,r,o=String(s(t)),i=y(e),c=o.length;return i<0||i>=c?Oe?"":void 0:(n=o.charCodeAt(i))<55296||n>56319||i+1===c||(r=o.charCodeAt(i+1))<56320||r>57343?Oe?o.charAt(i):n:Oe?o.slice(i,i+2):r-56320+(n-55296<<10)+65536});Re(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=Me(e,n),this._i+=t.length,{value:t,done:!1})}));var Fe=function(t,e){return{value:e,done:!!t}};Re(Array,"Array",(function(t,e){this._t=p(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,Fe(1)):Fe(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values");be.Arguments=be.Array;for(var Ae=rt("toStringTag"),Le="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(","),De=0;De<Le.length;De++){var Ce=Le[De],Ne=j[Ce],ze=Ne&&Ne.prototype;ze&&!ze[Ae]&&Y(ze,Ae,Ce),be[Ce]=be.Array}var Ie=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:Y(t,r,e[r]);return t},qe=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},$e=function(t,e,n,r){try{return r?e(I(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&I(o.call(t)),e}},Ge=rt("iterator"),He=Array.prototype,Ue=rt("toStringTag"),Ve="Arguments"==l(function(){return arguments}()),We=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ue))?n:Ve?l(e):"Object"==(r=l(e))&&"function"==typeof e.callee?"Arguments":r},Je=rt("iterator"),Ke=S.getIteratorMethod=function(t){if(null!=t)return t[Je]||t["@@iterator"]||be[We(t)]},Be=w((function(t){var e={},n={},r=t.exports=function(t,r,o,i,s){var c,u,a,f,l,h=s?function(){return t}:Ke(t),p=N(o,i,r?2:1),d=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(void 0===(l=h)||be.Array!==l&&He[Ge]!==l){for(a=h.call(t);!(u=a.next()).done;)if((f=$e(a,p,u.value,r))===e||f===n)return f}else for(c=_(t.length);c>d;d++)if((f=r?p(I(u=t[d])[0],u[1]):p(t[d]))===e||f===n)return f};r.BREAK=e,r.RETURN=n})),Ye=rt("species"),Qe=function(t){var e="function"==typeof S[t]?S[t]:j[t];$&&e&&!e[Ye]&&K.f(e,Ye,{configurable:!0,get:function(){return this}})},Xe=function(t,e){if(!z(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},Ze=K.f,tn=nt.fastKey,en=$?"_s":"size",nn=function(t,e){var n,r=tn(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n},rn={getConstructor:function(t,e,n,r){var o=t((function(t,i){qe(t,o,e,"_i"),t._t=e,t._i=mt(null),t._f=void 0,t._l=void 0,t[en]=0,null!=i&&Be(i,n,t[r],t)}));return Ie(o.prototype,{clear:function(){for(var t=Xe(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[en]=0},delete:function(t){var n=Xe(this,e),r=nn(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[en]--}return!!r},forEach:function(t){Xe(this,e);for(var n,r=N(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!nn(Xe(this,e),t)}}),$&&Ze(o.prototype,"size",{get:function(){return Xe(this,e)[en]}}),o},def:function(t,e,n){var r,o,i=nn(t,e);return i?i.v=n:(t._l=i={i:o=tn(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[en]++,"F"!==o&&(t._i[o]=i)),t},getEntry:nn,setStrong:function(t,e,n){Re(t,e,(function(t,n){this._t=Xe(t,e),this._k=n,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)?Fe(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,Fe(1))}),n?"entries":"values",!n,!0),Qe(e)}},on=rt("species"),sn=function(t,e){return new(function(t){var e;return ht(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!ht(e.prototype)||(e=void 0),z(e)&&null===(e=e[on])&&(e=void 0)),void 0===e?Array:e}(t))(e)},cn=K.f,un=function(t,e){var n=1==t,r=2==t,o=3==t,i=4==t,s=6==t,u=5==t||s,a=e||sn;return function(e,f,l){for(var p,d,v=c(e),y=h(v),g=N(f,l,3),m=_(y.length),b=0,w=n?a(e,m):r?a(e,0):void 0;m>b;b++)if((u||b in y)&&(d=g(p=y[b],b,v),t))if(n)w[b]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return b;case 2:w.push(p)}else if(i)return!1;return s?-1:o||i?i:w}}(0);!function(t,e,n,r,o,i){var s=j[t],c=s,u=o?"set":"add",a=c&&c.prototype,f={};$&&"function"==typeof c&&(i||a.forEach&&!q((function(){(new c).entries().next()})))?(c=e((function(e,n){qe(e,c,t,"_c"),e._c=new s,null!=n&&Be(n,o,e[u],e)})),un("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),(function(t){var e="add"==t||"set"==t;!(t in a)||i&&"clear"==t||Y(c.prototype,t,(function(n,r){if(qe(this,c,t),!e&&i&&!z(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,r);return e?this:o}))})),i||cn(c.prototype,"size",{get:function(){return this._c.size}})):(c=r.getConstructor(e,t,o,u),Ie(c.prototype,n),nt.NEED=!0),st(c,t),f[t]=c,X(X.G+X.W+X.F,f),i||r.setStrong(c,t,o)}("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=rn.getEntry(Xe(this,"Map"),t);return e&&e.v},set:function(t,e){return rn.def(Xe(this,"Map"),0===t?0:t,e)}},rn,!0);X(X.P+X.R,"Map",{toJSON:function(t){return function(){if(We(this)!=t)throw TypeError(t+"#toJSON isn't generic");return function(t,e){var n=[];return Be(t,!1,n.push,n,e),n}(this)}}("Map")});var an;an="Map",X(X.S,an,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}});!function(t){X(X.S,t,{from:function(t){var e,n,r,o,i=arguments[1];return C(this),(e=void 0!==i)&&C(i),null==t?new this:(n=[],e?(r=0,o=N(i,arguments[2],2),Be(t,!1,(function(t){n.push(o(t,r++))}))):Be(t,!1,n.push,n),new this(n))}})}("Map");var fn,ln,hn,pn=S.Map,dn=rt("species"),vn=function(t,e){var n,r=I(t).constructor;return void 0===r||null==(n=I(r)[dn])?e:C(n)},yn=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)},gn=j.process,_n=j.setImmediate,mn=j.clearImmediate,bn=j.MessageChannel,wn=j.Dispatch,On=0,Sn={},jn=function(){var t=+this;if(Sn.hasOwnProperty(t)){var e=Sn[t];delete Sn[t],e()}},Pn=function(t){jn.call(t.data)};_n&&mn||(_n=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Sn[++On]=function(){yn("function"==typeof t?t:Function(t),e)},fn(On),On},mn=function(t){delete Sn[t]},"process"==l(gn)?fn=function(t){gn.nextTick(N(jn,t,1))}:wn&&wn.now?fn=function(t){wn.now(N(jn,t,1))}:bn?(hn=(ln=new bn).port2,ln.port1.onmessage=Pn,fn=N(hn.postMessage,hn,1)):j.addEventListener&&"function"==typeof postMessage&&!j.importScripts?(fn=function(t){j.postMessage(t+"","*")},j.addEventListener("message",Pn,!1)):fn="onreadystatechange"in U("script")?function(t){vt.appendChild(U("script")).onreadystatechange=function(){vt.removeChild(this),jn.call(t)}}:function(t){setTimeout(N(jn,t,1),0)});var En={set:_n,clear:mn},Tn=En.set,xn=j.MutationObserver||j.WebKitMutationObserver,kn=j.process,Rn=j.Promise,Mn="process"==l(kn);function Fn(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=C(e),this.reject=C(n)}var An={f:function(t){return new Fn(t)}},Ln=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Dn=j.navigator,Cn=Dn&&Dn.userAgent||"",Nn=function(t,e){if(I(t),z(e)&&e.constructor===t)return e;var n=An.f(t);return(0,n.resolve)(e),n.promise},zn=rt("iterator"),In=!1;try{var qn=[7][zn]();qn.return=function(){In=!0},Array.from(qn,(function(){throw 2}))}catch(t){}var $n,Gn,Hn,Un,Vn=En.set,Wn=function(){var t,e,n,r=function(){var r,o;for(Mn&&(r=kn.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(Mn)n=function(){kn.nextTick(r)};else if(!xn||j.navigator&&j.navigator.standalone)if(Rn&&Rn.resolve){var o=Rn.resolve(void 0);n=function(){o.then(r)}}else n=function(){Tn.call(j,r)};else{var i=!0,s=document.createTextNode("");new xn(r).observe(s,{characterData:!0}),n=function(){s.data=i=!i}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}(),Jn=j.TypeError,Kn=j.process,Bn=Kn&&Kn.versions,Yn=Bn&&Bn.v8||"",Qn=j.Promise,Xn="process"==We(Kn),Zn=function(){},tr=Gn=An.f,er=!!function(){try{var t=Qn.resolve(1),e=(t.constructor={})[rt("species")]=function(t){t(Zn,Zn)};return(Xn||"function"==typeof PromiseRejectionEvent)&&t.then(Zn)instanceof e&&0!==Yn.indexOf("6.6")&&-1===Cn.indexOf("Chrome/66")}catch(t){}}(),nr=function(t){var e;return!(!z(t)||"function"!=typeof(e=t.then))&&e},rr=function(t,e){if(!t._n){t._n=!0;var n=t._c;Wn((function(){for(var r=t._v,o=1==t._s,i=0,s=function(e){var n,i,s,c=o?e.ok:e.fail,u=e.resolve,a=e.reject,f=e.domain;try{c?(o||(2==t._h&&sr(t),t._h=1),!0===c?n=r:(f&&f.enter(),n=c(r),f&&(f.exit(),s=!0)),n===e.promise?a(Jn("Promise-chain cycle")):(i=nr(n))?i.call(n,u,a):u(n)):a(r)}catch(t){f&&!s&&f.exit(),a(t)}};n.length>i;)s(n[i++]);t._c=[],t._n=!1,e&&!t._h&&or(t)}))}},or=function(t){Vn.call(j,(function(){var e,n,r,o=t._v,i=ir(t);if(i&&(e=Ln((function(){Xn?Kn.emit("unhandledRejection",o,t):(n=j.onunhandledrejection)?n({promise:t,reason:o}):(r=j.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=Xn||ir(t)?2:1),t._a=void 0,i&&e.e)throw e.v}))},ir=function(t){return 1!==t._h&&0===(t._a||t._c).length},sr=function(t){Vn.call(j,(function(){var e;Xn?Kn.emit("rejectionHandled",t):(e=j.onrejectionhandled)&&e({promise:t,reason:t._v})}))},cr=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()),rr(e,!0))},ur=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Jn("Promise can't be resolved itself");(e=nr(t))?Wn((function(){var r={_w:n,_d:!1};try{e.call(t,N(ur,r,1),N(cr,r,1))}catch(t){cr.call(r,t)}})):(n._v=t,n._s=1,rr(n,!1))}catch(t){cr.call({_w:n,_d:!1},t)}}};er||(Qn=function(t){qe(this,Qn,"Promise","_h"),C(t),$n.call(this);try{t(N(ur,this,1),N(cr,this,1))}catch(t){cr.call(this,t)}},($n=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=Ie(Qn.prototype,{then:function(t,e){var n=tr(vn(this,Qn));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Xn?Kn.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&rr(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Hn=function(){var t=new $n;this.promise=t,this.resolve=N(ur,t,1),this.reject=N(cr,t,1)},An.f=tr=function(t){return t===Qn||t===Un?new Hn(t):Gn(t)}),X(X.G+X.W+X.F*!er,{Promise:Qn}),st(Qn,"Promise"),Qe("Promise"),Un=S.Promise,X(X.S+X.F*!er,"Promise",{reject:function(t){var e=tr(this);return(0,e.reject)(t),e.promise}}),X(X.S+!0*X.F,"Promise",{resolve:function(t){return Nn(this===Un?Qn:this,t)}}),X(X.S+X.F*!(er&&function(t,e){if(!e&&!In)return!1;var n=!1;try{var r=[7],o=r[zn]();o.next=function(){return{done:n=!0}},r[zn]=function(){return o},t(r)}catch(t){}return n}((function(t){Qn.all(t).catch(Zn)}))),"Promise",{all:function(t){var e=this,n=tr(e),r=n.resolve,o=n.reject,i=Ln((function(){var n=[],i=0,s=1;Be(t,!1,(function(t){var c=i++,u=!1;n.push(void 0),s++,e.resolve(t).then((function(t){u||(u=!0,n[c]=t,--s||r(n))}),o)})),--s||r(n)}));return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=tr(e),r=n.reject,o=Ln((function(){Be(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}}),X(X.P+X.R,"Promise",{finally:function(t){var e=vn(this,S.Promise||j.Promise),n="function"==typeof t;return this.then(n?function(n){return Nn(e,t()).then((function(){return n}))}:t,n?function(n){return Nn(e,t()).then((function(){throw n}))}:t)}}),X(X.S,"Promise",{try:function(t){var e=An.f(this),n=Ln(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}});var ar=S.Promise,fr=Object.assign,lr=!fr||q((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=fr({},t)[n]||Object.keys(fr({},e)).join("")!=r}))?function(t,e){for(var n=c(t),r=arguments.length,o=1,i=ft.f,s=lt.f;r>o;)for(var u,a=h(arguments[o++]),f=i?D(a).concat(i(a)):D(a),l=f.length,p=0;l>p;)u=f[p++],$&&!s.call(a,u)||(n[u]=a[u]);return n}:fr;X(X.S+X.F,"Object",{assign:lr});var hr=S.Object.assign,pr="object"==typeof global&&global&&global.Object===Object&&global,dr="object"==typeof self&&self&&self.Object===Object&&self,vr=pr||dr||Function("return this")(),yr=vr.Symbol,gr=Object.prototype,_r=gr.hasOwnProperty,mr=gr.toString,br=yr?yr.toStringTag:void 0;var wr=Object.prototype.toString;var Or=yr?yr.toStringTag:void 0;function Sr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Or&&Or in Object(t)?function(t){var e=_r.call(t,br),n=t[br];try{t[br]=void 0;var r=!0}catch(t){}var o=mr.call(t);return r&&(e?t[br]=n:delete t[br]),o}(t):function(t){return wr.call(t)}(t)}function jr(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Pr,Er=vr["__core-js_shared__"],Tr=(Pr=/[^.]+$/.exec(Er&&Er.keys&&Er.keys.IE_PROTO||""))?"Symbol(src)_1."+Pr:"";var xr=Function.prototype.toString;var kr=/^\[object .+?Constructor\]$/,Rr=Function.prototype,Mr=Object.prototype,Fr=Rr.toString,Ar=Mr.hasOwnProperty,Lr=RegExp("^"+Fr.call(Ar).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dr(t){return!(!jr(t)||(e=t,Tr&&Tr in e))&&(function(t){if(!jr(t))return!1;var e=Sr(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)?Lr:kr).test(function(t){if(null!=t){try{return xr.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function Cr(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Dr(n)?n:void 0}var Nr=Cr(Object,"create");var zr=Object.prototype.hasOwnProperty;var Ir=Object.prototype.hasOwnProperty;function qr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function $r(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}qr.prototype.clear=function(){this.__data__=Nr?Nr(null):{},this.size=0},qr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qr.prototype.get=function(t){var e=this.__data__;if(Nr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return zr.call(e,t)?e[t]:void 0},qr.prototype.has=function(t){var e=this.__data__;return Nr?void 0!==e[t]:Ir.call(e,t)},qr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nr&&void 0===e?"__lodash_hash_undefined__":e,this};var Gr=Array.prototype.splice;function Hr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Hr.prototype.clear=function(){this.__data__=[],this.size=0},Hr.prototype.delete=function(t){var e=this.__data__,n=$r(e,t);return!(n<0)&&(n==e.length-1?e.pop():Gr.call(e,n,1),--this.size,!0)},Hr.prototype.get=function(t){var e=this.__data__,n=$r(e,t);return n<0?void 0:e[n][1]},Hr.prototype.has=function(t){return $r(this.__data__,t)>-1},Hr.prototype.set=function(t,e){var n=this.__data__,r=$r(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Ur=Cr(vr,"Map");function Vr(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Wr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new qr,map:new(Ur||Hr),string:new qr}},Wr.prototype.delete=function(t){var e=Vr(this,t).delete(t);return this.size-=e?1:0,e},Wr.prototype.get=function(t){return Vr(this,t).get(t)},Wr.prototype.has=function(t){return Vr(this,t).has(t)},Wr.prototype.set=function(t,e){var n=Vr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Jr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wr;++e<n;)this.add(t[e])}function Kr(t){return t!=t}function Br(t,e){return!!(null==t?0:t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,Kr,n)}(t,e,0)>-1}function Yr(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Qr(t,e){return t.has(e)}Jr.prototype.add=Jr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Jr.prototype.has=function(t){return this.__data__.has(t)};var Xr=Cr(vr,"Set");function Zr(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var to=Xr&&1/Zr(new Xr([,-0]))[1]==1/0?function(t){return new Xr(t)}:function(){};function eo(t,e){return e="function"==typeof e?e:void 0,t&&t.length?function(t,e,n){var r=-1,o=Br,i=t.length,s=!0,c=[],u=c;if(n)s=!1,o=Yr;else if(i>=200){var a=e?null:to(t);if(a)return Zr(a);s=!1,o=Qr,u=new Jr}else u=e?[]:c;t:for(;++r<i;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,s&&l==l){for(var h=u.length;h--;)if(u[h]===l)continue t;e&&u.push(l),c.push(f)}else o(u,l,n)||(u!==c&&u.push(l),c.push(f))}return c}(t,void 0,e):[]}const no=global.navigator&&global.navigator.userAgent?r.getParser(global.navigator.userAgent).getBrowser():null,ro=no&&no.name&&no.version?{name:no.name,version:no.version}:null;class oo{constructor(t={}){hr(this,{version:"1.2",entries:[],pages:[]},t),!this.browser&&ro&&(this.browser=ro)}addEntries(t=[]){this.entries=eo([...t,...this.entries],(t,e)=>t._id===e._id&&t._order===e._order)}sortEntries(){this.entries=this.entries.sort((t,e)=>new Date(t.startedDateTime)-new Date(e.startedDateTime))}}class io{constructor(t={}){this.log=new oo(t.log)}}var so="\t\n\v\f\r \u2028\u2029\ufeff",co="["+so+"]",uo=RegExp("^"+co+co+"*"),ao=RegExp(co+co+"*$"),fo=function(t,e,n){var r={},o=q((function(){return!!so[t]()||"
"!="
"[t]()})),i=r[t]=o?e(lo):so[t];n&&(r[n]=i),X(X.P+X.F*o,"String",r)},lo=fo.trim=function(t,e){return t=String(s(t)),1&e&&(t=t.replace(uo,"")),2&e&&(t=t.replace(ao,"")),t},ho=fo,po=j.parseInt,vo=ho.trim,yo=/^[-+]?0[xX]/,go=8!==po(so+"08")||22!==po(so+"0x16")?function(t,e){var n=vo(String(t),3);return po(n,e>>>0||(yo.test(n)?16:10))}:po;X(X.G+X.F*(parseInt!=go),{parseInt:go});var _o=S.parseInt;const{keys:mo}=Object,{isArray:bo}=Array;function wo(t){return mo(t||{}).reduce((e,n)=>{const r=t[n];return bo(r)?e.push(...r.map(t=>({name:n,value:t,_fromType:"array"}))):e.push({name:n,value:r}),e},[])}const{isArray:Oo}=Array;function So(t,e){const n=t.getHeader(e);return Oo(n)?n.length>0?n[0]:"":n}class jo{constructor(t){this.httpVersion="HTTP/1.1",this.url=t.absoluteUrl,this.method=t.method,this.headers=wo(t.headers),this.headersSize=function(t){const e=[],n=[];t.headers.forEach(({name:t,value:r})=>{e.push(t),n.push(r)});const r=t.method+t.url+e.join()+n.join();return o(r)+2*e.length+2+12+2}(this),this.queryString=wo(t.query),this.cookies=i.parse(t.getHeader("Set-Cookie")),t.body&&(this.postData={mimeType:So(t,"Content-Type")||"text/plain",params:[]},"string"==typeof t.body&&(this.postData.text=t.body));const e=So(t,"Content-Length");this.bodySize=e?_o(e,10):this.postData&&this.postData.text?o(this.postData.text):0}}class Po{constructor(t){this.httpVersion="HTTP/1.1",this.status=t.statusCode,this.statusText=t.statusText,this.headers=wo(t.headers),this.headersSize=function(t){const e=[],n=[];t.headers.forEach(({name:t,value:r})=>{e.push(t),n.push(r)});const r=e.join()+n.join();return o(r)+2*e.length+2+2}(this),this.cookies=i.parse(t.getHeader("Set-Cookie")),this.redirectURL=So(t,"Location")||"",this.content={mimeType:So(t,"Content-Type")||"text/plain"},t.body&&"string"==typeof t.body&&(this.content.text=t.body,t.encoding&&(this.content.encoding=t.encoding));const e=So(t,"Content-Length");this.content.size=e?_o(e,10):this.content.text?o(this.content.text):0,this.bodySize=this.content.size}}const{keys:Eo}=Object;class To{constructor(t){this._id=t.id,this._order=t.order,this.startedDateTime=t.timestamp,this.request=new jo(t),this.response=new Po(t.response),this.cache={},this.timings={blocked:-1,dns:-1,connect:-1,send:0,wait:t.responseTime,receive:0,ssl:-1},this.time=function(t={}){return Eo(t).reduce((e,n)=>t[n]>0?e+=t[n]:e,0)}(this.timings)}}function xo(t,e){var n=tt(t);if(ie){var r=ie(t);e&&(r=r.filter((function(e){return ue(t,e).enumerable}))),n.push.apply(n,r)}return n}function ko(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xo(Object(n),!0).forEach((function(e){me(t,e,n[e])})):he?de(t,he(n)):xo(Object(n)).forEach((function(e){ge(t,e,ue(n,e))}))}return t}export default class{constructor(t){this.polly=t,this.pending=new pn,this._cache=new pn}static get type(){return"persister"}static get id(){e("Must override the static `id` getter.")}get defaultOptions(){return{}}get options(){return ko(ko({},this.defaultOptions||{}),(this.polly.config.persisterOptions||{})[this.constructor.id]||{})}get hasPending(){return this.pending.size>0}async persist(){if(!this.hasPending)return;const t=[],e={name:"Polly.JS",version:this.polly.constructor.VERSION,comment:`${this.constructor.type}:${this.constructor.id}`};for(const[n,{name:r,requests:o}]of this.pending){const i=[],s=await this.findRecording(n);let c;c=new io(s||{log:{creator:e,_recordingName:r}});for(const t of o){const e=new To(t);this.assert(`Cannot persist response for [${e.request.method}] ${e.request.url} because the status code was ${e.response.status} and \`recordFailedRequests\` is \`false\``,e.response.status<400||t.config.recordFailedRequests),await t._emit("beforePersist",e),i.push(e)}c.log.addEntries(i),this.polly.config.persisterOptions.disableSortingHarEntries||c.log.sortEntries(),this.polly.config.persisterOptions.keepUnusedRequests||this._removeUnusedEntries(n,c),t.push(this.saveRecording(n,c))}await ar.all(t),this.pending.clear()}recordRequest(t){this.assert("You must pass a PollyRequest to 'recordRequest'.",t),this.assert("Cannot save a request with no response.",t.didRespond);const{recordingId:e,recordingName:n}=t;this.pending.has(e)||this.pending.set(e,{name:n,requests:[]}),this.pending.get(e).requests.push(t)}async findRecording(t){const{_cache:e}=this;if(!e.has(t)){const n=async()=>{const n=await this.onFindRecording(t);return n?(this.assert(`Recording with id '${t}' is invalid. Please delete the recording so a new one can be created.`,n.log&&"Polly.JS"===n.log.creator.name),n):(e.delete(t),null)};e.set(t,n())}return e.get(t)}onFindRecording(){this.assert("Must implement the `onFindRecording` hook.")}async saveRecording(t,e){await this.onSaveRecording(...arguments),this._cache.delete(t),this.polly.logger.log.debug("Recording saved.",{recordingId:t,har:e})}onSaveRecording(){this.assert("Must implement the `onSaveRecording` hook.")}async deleteRecording(t){await this.onDeleteRecording(...arguments),this._cache.delete(t)}onDeleteRecording(){this.assert("Must implement the `onDeleteRecording` hook.")}async findEntry(t){const{id:e,order:n,recordingId:r}=t,o=await this.findRecording(r);return o&&o.log.entries.find(t=>t._id===e&&t._order===n)||null}stringify(){return t(...arguments)}assert(t,...n){e(`[${this.constructor.type}:${this.constructor.id}] ${t}`,...n)}_removeUnusedEntries(t,e){const r=this.polly._requests.filter(e=>e.recordingId===t&&(e.action===n.RECORD||e.action===n.REPLAY));e.log.entries=e.log.entries.filter(t=>r.find(e=>t._id===e.id&&t._order===e.order))}}
//# sourceMappingURL=pollyjs-persister.min.js.map