/*! For license information please see decap-cms-backend-gitlab.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("decap-cms-lib-util"),require("react"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default"),require("immutable")):"function"==typeof define&&define.amd?define("DecapCmsBackendGitlab",["decap-cms-lib-util","react","@emotion/react","prop-types","decap-cms-lib-auth","decap-cms-ui-default","immutable"],t):"object"==typeof exports?exports.DecapCmsBackendGitlab=t(require("decap-cms-lib-util"),require("react"),require("@emotion/react"),require("prop-types"),require("decap-cms-lib-auth"),require("decap-cms-ui-default"),require("immutable")):e.DecapCmsBackendGitlab=t(e.DecapCmsLibUtil,e.React,e.DecapCmsDefaultExports.EmotionCore,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsLibAuth,e.DecapCmsUiDefault,e.DecapCmsDefaultExports.Immutable)}(window,((e,t,r,n,i,o,a)=>(()=>{var s={5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;sc?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8834:(e,t,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?s(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function F(e,t,r,n,i){U(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function U(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new q.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const H=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},5695:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,a;if(Array.isArray(t)){for(a="[",r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=o(r(5006)),i=o(r(8019));function o(e){return e&&e.__esModule?e:{default:e}}},8048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return u(e,[])};var n,i=(n=r(8019))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=10,s=2;function u(e,t){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var o=n.call(e);if(o!==e)return"string"==typeof o?o:u(o,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";for(var r=Math.min(a,e.length),n=e.length-r,i=[],o=0;o1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>s?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+u(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},5006:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8019:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},4560:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(2678))&&n.__esModule?n:{default:n},o=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=o,(0,i.default)(o);var a=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=a,(0,i.default)(a)},9501:(e,t)=>{"use strict";function r(e){for(var t=0;ta&&r(t[s-1]);)--s;return t.slice(a,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!n||o||a||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}},3083:(e,t,r)=>{"use strict";t.S=function(e){return(0,n.visit)(e,{leave:o})};var n=r(2624),i=r(9501),o={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=c("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+c(" = ",n)+c(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,a=c("",t,": ")+r,u=a+c("(",s(n,", "),")");return u.length>80&&(u=a+c("(\n",l(s(n,"\n")),"\n)")),s([u,s(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+c(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",c("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(c("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(c("",s(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+c("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:a((function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),u(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:a((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")})),FieldDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(h(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+": "+n+c(" ",s(i," "))})),InputValueDefinition:a((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,c("= ",n),s(i," ")]," ")})),InterfaceTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")})),UnionTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")})),EnumTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),u(n)]," ")})),EnumValueDefinition:a((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),u(n)]," ")})),DirectiveDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(h(r)?c("(\n",l(s(r,"\n")),"\n)"):c("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),u(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,c("implements ",s(r," & ")),s(n," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),u(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),u(n)]," ")}};function a(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function u(e){return c("{\n",l(s(e,"\n")),"\n}")}function c(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return c(" ",e.replace(/\n/g,"\n "))}function f(e){return-1!==e.indexOf("\n")}function h(e){return null!=e&&e.some(f)}},2624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],m=[],g=e;do{var b=++f===l.length,w=b&&0!==h.length;if(b){if(d=0===m.length?void 0:v[v.length-1],p=y,y=m.pop(),w){if(c)p=p.slice();else{for(var E={},_=0,x=Object.keys(p);_{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*y}},9612:(e,t,r)=>{var n=r(2118),i=r(6909),o=r(8138),a=r(4174),s=r(7942);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(9413),i=r(3620);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},235:(e,t,r)=>{var n=r(3945),i=r(1846),o=r(8028),a=r(2344),s=r(4769);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(9413),i=r(3620);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=n(i.prototype),o.prototype.constructor=o,e.exports=o},326:(e,t,r)=>{var n=r(8761)(r(7772),"Map");e.exports=n},6738:(e,t,r)=>{var n=r(2411),i=r(6417),o=r(6928),a=r(9493),s=r(4150);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{var n=r(7772).Symbol;e.exports=n},3215:(e,t,r)=>{var n=r(8761)(r(7772),"WeakMap");e.exports=n},9432:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},2517:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r{var n=r(7832);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},343:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r{e.exports=function(e){return e.split("")}},2218:(e,t,r)=>{var n=r(1225);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},9413:(e,t,r)=>{var n=r(9259),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},1359:e=>{e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o{var n=r(5067),i=r(5882);e.exports=function e(t,r,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u0&&o(l)?r>1?e(l,r-1,o,a,s):n(s,l):a||(s[s.length]=l)}return s}},3366:(e,t,r)=>{var n=r(857),i=r(2107),o=r(7157),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},7832:(e,t,r)=>{var n=r(1359),i=r(2195),o=r(6024);e.exports=function(e,t,r){return t==t?o(e,t,r):n(e,i,r)}},5183:(e,t,r)=>{var n=r(3366),i=r(5125);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},2195:e=>{e.exports=function(e){return e!=e}},6840:(e,t,r)=>{var n=r(1049),i=r(7394),o=r(9259),a=r(7035),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?h:s).test(a(e))}},3620:e=>{e.exports=function(){}},6060:(e,t,r)=>{var n=r(3059),i=r(3114),o=r(5251);e.exports=function(e,t){return o(i(e,t,n),e+"")}},4817:(e,t,r)=>{var n=r(3059),i=r(529),o=i?function(e,t){return i.set(e,t),e}:n;e.exports=o},6532:(e,t,r)=>{var n=r(6874),i=r(3043),o=r(3059),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},9872:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n{var n=r(857),i=r(343),o=r(6152),a=r(4795),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},1704:(e,t,r)=>{var n=r(2153),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},7297:(e,t,r)=>{var n=r(6152),i=r(1401),o=r(4452),a=r(6188);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},3895:(e,t,r)=>{var n=r(9872);e.exports=function(e,t,r){var i=e.length;return r=void 0===r?i:r,!t&&r>=i?e:n(e,t,r)}},768:(e,t,r)=>{var n=r(7832);e.exports=function(e,t){for(var r=e.length;r--&&n(t,e[r],0)>-1;);return r}},1821:(e,t,r)=>{var n=r(7832);e.exports=function(e,t){for(var r=-1,i=e.length;++r-1;);return r}},1495:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=n.length,u=-1,c=r.length,l=t(a-s,0),f=Array(c+l),h=!i;++u{var t=Math.max;e.exports=function(e,r,n,i){for(var o=-1,a=e.length,s=-1,u=n.length,c=-1,l=r.length,f=t(a-u,0),h=Array(f+l),p=!i;++o{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(7772)["__core-js_shared__"];e.exports=n},1176:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},3485:(e,t,r)=>{var n=r(2248),i=r(7772);e.exports=function(e,t,r){var o=1&t,a=n(e);return function t(){return(this&&this!==i&&this instanceof t?a:e).apply(o?r:this,arguments)}}},2248:(e,t,r)=>{var n=r(9413),i=r(9259);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),o=e.apply(r,t);return i(o)?o:r}}},8462:(e,t,r)=>{var n=r(9432),i=r(2248),o=r(764),a=r(7891),s=r(3325),u=r(527),c=r(7772);e.exports=function(e,t,r){var l=i(e);return function i(){for(var f=arguments.length,h=Array(f),p=f,d=s(i);p--;)h[p]=arguments[p];var y=f<3&&h[0]!==d&&h[f-1]!==d?[]:u(h,d);return(f-=y.length){var n=r(5859),i=r(9097),o=r(8203),a=r(9350),s=r(6152),u=r(3735);e.exports=function(e){return i((function(t){var r=t.length,i=r,c=n.prototype.thru;for(e&&t.reverse();i--;){var l=t[i];if("function"!=typeof l)throw new TypeError("Expected a function");if(c&&!f&&"wrapper"==a(l))var f=new n([],!0)}for(i=f?i:r;++i{var n=r(1495),i=r(152),o=r(1176),a=r(2248),s=r(7891),u=r(3325),c=r(3418),l=r(527),f=r(7772);e.exports=function e(t,r,h,p,d,y,v,m,g,b){var w=128&r,E=1&r,_=2&r,x=24&r,S=512&r,O=_?void 0:a(t);return function k(){for(var I=arguments.length,A=Array(I),T=I;T--;)A[T]=arguments[T];if(x)var R=u(k),C=o(A,R);if(p&&(A=n(A,p,d,x)),y&&(A=i(A,y,v,x)),I-=C,x&&I1&&A.reverse(),w&&g{var n=r(9432),i=r(2248),o=r(7772);e.exports=function(e,t,r,a){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,f=a.length,h=Array(f+c),p=this&&this!==o&&this instanceof t?u:e;++l{var n=r(3735),i=r(9890),o=r(5877);e.exports=function(e,t,r,a,s,u,c,l,f,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,f,h],y=r.apply(void 0,d);return n(e)&&i(y,d),y.placeholder=a,o(y,e,t)}},7902:(e,t,r)=>{var n=r(4817),i=r(3485),o=r(8462),a=r(764),s=r(5468),u=r(8203),c=r(9e3),l=r(9890),f=r(5877),h=r(8101),p=Math.max;e.exports=function(e,t,r,d,y,v,m,g){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var w=d?d.length:0;if(w||(t&=-97,d=y=void 0),m=void 0===m?m:p(h(m),0),g=void 0===g?g:h(g),w-=y?y.length:0,64&t){var E=d,_=y;d=y=void 0}var x=b?void 0:u(e),S=[e,t,r,d,y,E,_,v,m,g];if(x&&c(S,x),e=S[0],t=S[1],r=S[2],d=S[3],y=S[4],!(g=S[9]=void 0===S[9]?b?0:e.length:p(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)O=8==t||16==t?o(e,t,g):32!=t&&33!=t||y.length?a.apply(void 0,S):s(e,t,r,d);else var O=i(e,t,r);return f((x?n:l)(O,S),e,t)}},3043:(e,t,r)=>{var n=r(8761),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9097:(e,t,r)=>{var n=r(5676),i=r(3114),o=r(5251);e.exports=function(e){return o(i(e,void 0,n),e+"")}},1242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8203:(e,t,r)=>{var n=r(529),i=r(4291),o=n?function(e){return n.get(e)}:i;e.exports=o},9350:(e,t,r)=>{var n=r(9212),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],o=i.call(n,t)?r.length:0;o--;){var a=r[o],s=a.func;if(null==s||s==e)return a.name}return t}},3325:e=>{e.exports=function(e){return e.placeholder}},7937:(e,t,r)=>{var n=r(8304);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},8761:(e,t,r)=>{var n=r(6840),i=r(8109);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},2107:(e,t,r)=>{var n=r(857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},4842:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},3880:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2118:(e,t,r)=>{var n=r(9191);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,r)=>{var n=r(9191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},4174:(e,t,r)=>{var n=r(9191),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},7942:(e,t,r)=>{var n=r(9191);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},8442:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},5882:(e,t,r)=>{var n=r(857),i=r(9631),o=r(6152),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e{var n=r(6152),i=r(4795),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},3735:(e,t,r)=>{var n=r(6504),i=r(8203),o=r(9350),a=r(8674);e.exports=function(e){var t=o(e),r=a[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},7394:(e,t,r)=>{var n,i=r(4019),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,r)=>{var n=r(2218),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},8028:(e,t,r)=>{var n=r(2218);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},2344:(e,t,r)=>{var n=r(2218);e.exports=function(e){return n(this.__data__,e)>-1}},4769:(e,t,r)=>{var n=r(2218);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},2411:(e,t,r)=>{var n=r(9612),i=r(235),o=r(326);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},6417:(e,t,r)=>{var n=r(7937);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6928:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).get(e)}},9493:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).has(e)}},4150:(e,t,r)=>{var n=r(7937);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},7777:(e,t,r)=>{var n=r(733);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},9e3:(e,t,r)=>{var n=r(1495),i=r(152),o=r(527),a="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],u=t[1],c=r|u,l=c<131,f=128==u&&8==r||128==u&&256==r&&e[7].length<=t[8]||384==u&&t[7].length<=t[8]&&8==r;if(!l&&!f)return e;1&u&&(e[2]=t[2],c|=1&r?0:4);var h=t[3];if(h){var p=e[3];e[3]=p?n(p,h,t[4]):h,e[4]=p?o(e[3],a):t[4]}return(h=t[5])&&(p=e[5],e[5]=p?i(p,h,t[6]):h,e[6]=p?o(e[5],a):t[6]),(h=t[7])&&(e[7]=h),128&u&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},529:(e,t,r)=>{var n=r(3215),i=n&&new n;e.exports=i},9191:(e,t,r)=>{var n=r(8761)(Object,"create");e.exports=n},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},3114:(e,t,r)=>{var n=r(9432),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a{e.exports={}},3418:(e,t,r)=>{var n=r(1522),i=r(9045),o=Math.min;e.exports=function(e,t){for(var r=e.length,a=o(t.length,r),s=n(e);a--;){var u=t[a];e[a]=i(u,r)?s[u]:void 0}return e}},527:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,o=0,a=[];++n{var n=r(1242),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},9890:(e,t,r)=>{var n=r(4817),i=r(7787)(n);e.exports=i},5251:(e,t,r)=>{var n=r(6532),i=r(7787)(n);e.exports=i},5877:(e,t,r)=>{var n=r(4842),i=r(8442),o=r(5251),a=r(6985);e.exports=function(e,t,r){var s=t+"";return o(e,i(s,a(n(s),r)))}},7787:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),o=16-(i-n);if(n=i,o>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},6024:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n{var n=r(217),i=r(3880),o=r(3344);e.exports=function(e){return i(e)?o(e):n(e)}},4452:(e,t,r)=>{var n=r(7777),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}));e.exports=a},3812:(e,t,r)=>{var n=r(4795);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2153:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},3344:e=>{var t="\\ud800-\\udfff",r="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",u="(?:"+n+"|"+i+")?",c="[\\ufe0e\\ufe0f]?",l=c+u+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+u+")*",f="(?:"+[o+n+"?",n,a,s,r].join("|")+")",h=RegExp(i+"(?="+i+")|"+f+l,"g");e.exports=function(e){return e.match(h)||[]}},6985:(e,t,r)=>{var n=r(2517),i=r(8333),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(o,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},7366:(e,t,r)=>{var n=r(6504),i=r(5859),o=r(1522);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},6874:e=>{e.exports=function(e){return function(){return e}}},1225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5676:(e,t,r)=>{var n=r(2034);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},5395:(e,t,r)=>{var n=r(7541)();e.exports=n},3059:e=>{e.exports=function(e){return e}},9631:(e,t,r)=>{var n=r(5183),i=r(5125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},6152:e=>{var t=Array.isArray;e.exports=t},1049:(e,t,r)=>{var n=r(3366),i=r(9259);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4795:(e,t,r)=>{var n=r(3366),i=r(5125);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},733:(e,t,r)=>{var n=r(6738);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},4291:e=>{e.exports=function(){}},3465:(e,t,r)=>{var n=r(6060),i=r(7902),o=r(3325),a=r(527),s=n((function(e,t){var r=a(t,o(s));return i(e,32,void 0,t,r)}));s.placeholder={},e.exports=s},6346:(e,t,r)=>{var n=r(7297),i=r(1049),o=r(3812);e.exports=function(e,t,r){var a=-1,s=(t=n(t,e)).length;for(s||(s=1,e=void 0);++a{var n=r(7642);e.exports=function(e){return e?Infinity===(e=n(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},8101:(e,t,r)=>{var n=r(5707);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},7642:(e,t,r)=>{var n=r(1704),i=r(9259),o=r(4795),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):a.test(e)?NaN:+e}},6188:(e,t,r)=>{var n=r(1054);e.exports=function(e){return null==e?"":n(e)}},5648:(e,t,r)=>{var n=r(1054),i=r(1704),o=r(3895),a=r(768),s=r(1821),u=r(8435),c=r(6188);e.exports=function(e,t,r){if((e=c(e))&&(r||void 0===t))return i(e);if(!e||!(t=n(t)))return e;var l=u(e),f=u(t),h=s(l,f),p=a(l,f)+1;return o(l,h,p).join("")}},3433:(e,t,r)=>{var n=r(1054),i=r(3895),o=r(1821),a=r(8435),s=r(6188),u=/^\s+/;e.exports=function(e,t,r){if((e=s(e))&&(r||void 0===t))return e.replace(u,"");if(!e||!(t=n(t)))return e;var c=a(e),l=o(c,a(t));return i(c,l).join("")}},8674:(e,t,r)=>{var n=r(6504),i=r(5859),o=r(3620),a=r(6152),s=r(5125),u=r(7366),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!a(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=o.prototype,l.prototype.constructor=l,e.exports=l},1023:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,i=47===a.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;ic){if(47===r.charCodeAt(s+f))return r.slice(s+f+1);if(0===f)return r.slice(s+f)}else a>c&&(47===e.charCodeAt(i+f)?l=f:0===f&&(l=0));break}var h=e.charCodeAt(i+f);if(h!==r.charCodeAt(s+f))break;47===h&&(l=f)}var p="";for(f=i+l+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(s+l):(s+=l,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,u=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!a){i=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(c===r.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=u))}return i===o?o=u:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){i=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,a=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===i&&(o=!1,i=s+1),46===u?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!o){n=s+1;break}}return-1===r||-1===i||0===a||1===a&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,c=!0,l=e.length-1,f=0;l>=n;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===a?a=l:1!==f&&(f=1):-1!==a&&(f=-1);else if(!c){s=l+1;break}return-1===a||-1===u||0===f||1===f&&a===u-1&&a===s+1?-1!==u&&(r.base=r.name=0===s&&o?e.slice(1,u):e.slice(s,u)):(0===s&&o?(r.name=e.slice(1,a),r.base=e.slice(1,u)):(r.name=e.slice(s,a),r.base=e.slice(s,u)),r.ext=e.slice(a,u)),s>0?r.dir=e.slice(0,s-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},3252:function(e){!function(t){"use strict";var r=function(e){setTimeout(e,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(r=process.nextTick),e.exports=function(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var n=t.queue[0];n.n+t.current>t.capacity||(t.queue.shift(),t.current+=n.n,r(n.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}}()},7288:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n}),e=r.hmd(e);const n=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},2394:(e,t,r)=>{e.exports=r(5757).Observable},5757:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(a("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,o=void 0;try{for(var a,s=n.call(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r{"use strict";e.exports=t},1756:e=>{"use strict";e.exports=r},4106:e=>{"use strict";e.exports=a},2673:e=>{"use strict";e.exports=n},82:e=>{"use strict";e.exports=i},4688:t=>{"use strict";t.exports=e},3327:e=>{"use strict";e.exports=o}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={id:e,loaded:!1,exports:{}};return s[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l={};return(()=>{"use strict";c.d(l,{DecapCmsBackendGitlab:()=>po});var e,t,r=c(5648),n=c.n(r),i=c(3433),o=c.n(i),a=c(3252),s=c.n(a),u=function(){function e(e,t){for(var r=0;r1?r-1:0),i=1;i0&&Array.isArray(n[0])&&(n=n[0]),this.transformers=n.map((function(e){return"function"==typeof e?e():e})),this.tag}return u(e,[{key:"interimTag",value:function(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:d;return{onSubstitution:function(t,r){if(Array.isArray(t)){var n=t.length,i=e.separator,o=e.conjunction,a=e.serial,s=r.match(/(\n?[^\S\n]+)$/);if(t=s?t.join(i+s[1]):t.join(i+" "),o&&n>1){var u=t.lastIndexOf(i);t=t.slice(0,u)+(a?i:"")+" "+o+t.slice(u+1)}}return t}}},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"initial";return{onEndResult:function(t){if("initial"===e){var r=t.match(/^[^\S\n]*(?=\S)/gm),n=r&&Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:"";return{onEndResult:function(t){if(""===e)return t.trim();if("start"===(e=e.toLowerCase())||"left"===e)return t.replace(/^\s*/,"");if("end"===e||"right"===e)return t.replace(/\s*$/,"");throw new Error("Side not supported: "+e)}}};new p(y({separator:","}),v,m),new p(y({separator:",",conjunction:"and"}),v,m),new p(y({separator:",",conjunction:"or"}),v,m);const g=function(e){return{onSubstitution:function(t,r){if(null==e||"string"!=typeof e)throw new Error("You need to specify a string character to split by.");return"string"==typeof t&&t.includes(e)&&(t=t.split(e)),t}}};var b=function(e){return null!=e&&!Number.isNaN(e)&&"boolean"!=typeof e};new p(g("\n"),(function(){return{onSubstitution:function(e){return Array.isArray(e)?e.filter(b):b(e)?e:""}}}),y,v,m);const w=function(e,t){return{onSubstitution:function(r,n){if(null==e||null==t)throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");return null==r?r:r.toString().replace(e,t)}}};new p(g("\n"),y,v,m,w(/&/g,"&"),w(//g,">"),w(/"/g,"""),w(/'/g,"'"),w(/`/g,"`"));const E=function(e,t){return{onEndResult:function(r){if(null==e||null==t)throw new Error("replaceResultTransformer requires at least 2 arguments.");return r.replace(e,t)}}},_=new p(E(/(?:\n(?:\s*))+/g," "),m);new p(E(/(?:\n\s*)/g,""),m),new p(y({separator:","}),E(/(?:\s+)/g," "),m),new p(y({separator:",",conjunction:"or"}),E(/(?:\s+)/g," "),m),new p(y({separator:",",conjunction:"and"}),E(/(?:\s+)/g," "),m),new p(y,v,m),new p(y,E(/(?:\s+)/g," "),m);const x=new p(v,m);new p(v("all"),m);var S=c(4688);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?G:K},J=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},W=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return N(t,r,n),$((function(){return function(e,t,r){N(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)})),null},Y=function e(t,r){var n,i,o=t.__emotion_real===t,a=o&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var s=J(t,r,o),u=s||z(a),c=!u("as");return function(){var l=arguments,f=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&f.push("label:"+n+";"),null==l[0]||void 0===l[0].raw)f.push.apply(f,l);else{f.push(l[0][0]);for(var h=l.length,p=1;p=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:c,styles:i,next:Q}}(f.concat(y),t.registered,v);d+=t.key+"-"+g.name,void 0!==i&&(d+=" "+i);var b=c&&void 0===s?z(p):u,w={};for(var E in e)c&&"as"===E||b(E)&&(w[E]=e[E]);return w.className=d,w.ref=r,k.createElement(k.Fragment,null,k.createElement(W,{cache:t,serialized:g,isStringTag:"string"==typeof p}),k.createElement(p,w))}));return d.displayName=void 0!==n?n:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=f,d.__emotion_forwardProp=s,Object.defineProperty(d,"toString",{value:function(){return"."+i}}),d.withComponent=function(t,n){return e(t,O({},r,n,{shouldForwardProp:J(d,n,!0)})).apply(void 0,f)},d}},H=c(2673),X=c.n(H),Z=c(82),ee=c(3327);function te(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const re=Y(ee.Icon,{target:"e80yw6v0",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"}),ne={pkce:({base_url:e,auth_endpoint:t,app_id:r,auth_token_endpoint:n})=>new Z.PkceAuthenticator({base_url:e,auth_endpoint:t,app_id:r,auth_token_endpoint:n,auth_token_endpoint_content_type:"application/json; charset=utf-8"}),implicit:({base_url:e,auth_endpoint:t,app_id:r,clearHash:n})=>new Z.ImplicitAuthenticator({base_url:e,auth_endpoint:t,app_id:r,clearHash:n})};class ie extends I().Component{constructor(...e){super(...e),te(this,"state",{}),te(this,"handleLogin",(e=>{e.preventDefault(),this.auth.authenticate({provider:"gitlab",scope:"api"},((e,t)=>{e?this.setState({loginError:e.toString()}):this.props.onLogin(t)}))}))}componentDidMount(){const{auth_type:e="",base_url:t="https://gitlab.com",auth_endpoint:r="oauth/authorize",app_id:n=""}=this.props.config.backend;ne[e]?(this.auth=ne[e]({base_url:t,auth_endpoint:r,app_id:n,auth_token_endpoint:"oauth/token",clearHash:this.props.clearHash}),this.auth.completeAuth(((e,t)=>{e?this.setState({loginError:e.toString()}):this.props.onLogin(t)}))):this.auth=new Z.NetlifyAuthenticator({base_url:this.props.base_url,site_id:"localhost"===document.location.host.split(":")[0]?"demo.decapcms.org":this.props.siteId,auth_endpoint:this.props.authEndpoint})}render(){const{inProgress:e,config:t,t:r}=this.props;return(0,C.jsx)(ee.AuthenticationPage,{onLogin:this.handleLogin,loginDisabled:e,loginErrorMessage:this.state.loginError,logoUrl:t.logo_url,siteUrl:t.site_url,renderButtonContent:()=>(0,C.jsx)(I().Fragment,null,(0,C.jsx)(re,{type:"gitlab"})," ",r(e?"auth.loggingIn":"auth.loginWithGitLab")),t:r})}}te(ie,"propTypes",{onLogin:X().func.isRequired,inProgress:X().bool,base_url:X().string,siteId:X().string,authEndpoint:X().string,config:X().object.isRequired,clearHash:X().func,t:X().func.isRequired});var oe=c(6346),ae=c.n(oe),se=c(3465),ue=c.n(se),ce=c(5395),le=c.n(ce),fe=function(e,t){return fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},fe(e,t)};function he(e,t){function r(){this.constructor=e}fe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var pe=function(){return pe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i=t,o={};return n.forEach((function(e){o[e]=i[e]})),r.connection.key+"("+JSON.stringify(o)+")"}return r.connection.key}var a=e;if(t){var s=Te()(t);a+="("+s+")"}return r&&Object.keys(r).forEach((function(e){-1===je.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function Be(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return Me(r,n,i,t)})),r}return null}function Qe(e){return e.alias?e.alias.value:e.name.value}function Ue(e){return"Field"===e.kind}function Ve(e){return"InlineFragment"===e.kind}function $e(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Ge(e,t){return void 0===t&&(t=!1),ke({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Ke(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach((function(e){r[e.name.value]=Be(e,t)})),r}return null}function ze(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Ye).map((function(e){var t=e.arguments;e.name.value,xe(t&&1===t.length,14);var r=t[0];xe(r.name&&"if"===r.name.value,15);var n=r.value;return xe(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}})):[]).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?xe(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i}));var r}function Je(e,t){return function(e){var t=[];return(0,me.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function We(e){return e&&Je(["client"],e)&&Je(["export"],e)}function Ye(e){var t=e.name.value;return"skip"===t||"include"===t}function He(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new _e(11);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&(xe(1===n.length,12),r=n[0].name.value),ke(ke({},e),{definitions:Ie([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function Xe(e){for(var t=[],r=1;r1){var n=[];t=It(t,n);for(var i=1;i0}var Jt,Wt=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",zt((n=c).graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"})),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return he(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(Jt||(Jt={}));var Yt=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=o;var s=et(n.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=r,a}return he(t,e),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Vt.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&zt(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new Wt({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=pe(pe({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:Gt(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var f=c||a&&"cache-only"!==u;t={data:o,loading:f,networkStatus:f?Vt.loading:Vt.ready}}return a||this.updateLastResult(pe(pe({},t),{stale:!1})),pe(pe({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Pe(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new _e(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Pe(this.variables,e)||(this.variables=pe(pe({},this.variables),e)),Pe(this.options.variables,this.variables)||(this.options.variables=pe(pe({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,pe(pe({},this.options),{fetchPolicy:t}),Jt.refetch))},t.prototype.fetchMore=function(e){var t=this;xe(e.updateQuery,2);var r=pe(pe({},e.query?e:pe(pe(pe({},this.options),e),{variables:pe(pe({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,Jt.normal,this.queryId).then((function(i){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})})),t.queryManager.stopQuery(n),i}),(function(e){throw t.queryManager.stopQuery(n),e}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=pe(pe({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&Pe(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,o=r.document,a=wt((function(){return e(n,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Zt(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:mt(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=Ht)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(Zt(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(pe(pe({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Vt.error,loading:!1})),Xt(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(o).serverQuery&&!Pe(a,i)?e.refetch():Xt(e.observers,"next",r)})):Xt(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Kt);function Ht(e){}function Xt(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function Zt(e){var t=e.options.fetchPolicy;xe("cache-first"!==t&&"cache-only"!==t,3)}var er=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),tr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];xe(!t||t.document===e.document||Pe(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Vt.loading&&(Pe(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Vt.setVariables:e.isPoll?Vt.poll:e.isRefetch?Vt.refetch:Vt.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Vt.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=zt(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Vt.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Vt.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Vt.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Vt.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Vt.loading}))},e}(),rr=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=xt(t.resolvers,e)})):this.resolvers=xt(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return de(this,void 0,void 0,(function(){return ye(this,(function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,a).then((function(e){return pe(pe({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Je(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){Ze(e);var t=ft([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,me.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Ue(e)&&"__typename"===e.name.value})))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return pe(pe({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);xe(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),de(this,void 0,void 0,(function(){return ye(this,(function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return pe(pe({},t),e.exportedVariables)}))]:[2,pe({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,me.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return me.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:dt(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),de(this,void 0,void 0,(function(){var a,s,u,c,l,f,h,p,d;return ye(this,(function(y){var v;return a=nt(e),s=rt(e),u=it(s),c=a.operation,l=c?(v=c).charAt(0).toUpperCase()+v.slice(1):"Query",h=(f=this).cache,p=f.client,d={fragmentMap:u,context:pe(pe({},r),{cache:h,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then((function(e){return{result:e,exportedVariables:d.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return de(this,void 0,void 0,(function(){var n,i,o,a,s,u=this;return ye(this,(function(c){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],s=function(e){return de(u,void 0,void 0,(function(){var s,u;return ye(this,(function(c){return ze(e,o)?Ue(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&a.push(((r={})[Qe(e)]=t,r))}))]:(Ve(e)?s=e:xe(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return St(a)}))]}))}))},e.prototype.resolveField=function(e,t,r){return de(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,f,h=this;return ye(this,(function(p){return n=r.variables,i=e.name.value,o=Qe(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(f=l[a?i:o])&&(u=Promise.resolve(f(t,Be(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?h.resolveSubSelectedArray(e,t,r):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}();function nr(e){var t=new Set,r=null;return new Kt((function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}}))}var ir=Object.prototype.hasOwnProperty,or=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,h=e.assumeImmutableResults;this.mutationStore=new er,this.queryStore=new tr,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(yt?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=f||new rr({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!h}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.fetchQueryRejectFns.forEach((function(e){e(new _e(8))}))},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,f=void 0===l?"none":l,h=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return de(this,void 0,void 0,(function(){var e,o,s,l=this;return ye(this,(function(p){switch(p.label){case 0:return xe(t,9),xe(!h||"no-cache"===h,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach((function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&ir.call(i,o)&&(e[r]={updater:i[o],query:l.queryStore.get(r)})}})),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:o(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise((function(i,l){var p,y;s.getObservableFromLink(t,pe(pe({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){Et(n)&&"none"===f?y=new Wt({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==h&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:o(),update:c}),p=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,(function(){return{document:null}})),l(new Wt({networkError:t}))},complete:function(){if(y&&s.mutationStore.markMutationError(e,y),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),y)l(y);else{"function"==typeof a&&(a=a(p));var t=[];zt(a)&&a.forEach((function(e){if("string"==typeof e)s.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}})),Promise.all(u?t:[]).then((function(){s.setQuery(e,(function(){return{document:null}})),"ignore"===f&&p&&Et(p)&&delete p.errors,i(p)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,r,n){return de(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,f,h,p,d,y,v,m,g,b,w,E,_=this;return ye(this,(function(x){switch(x.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,f=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,f,c)]:[3,2];case 1:f=x.sent(),x.label=2;case 2:if(t=pe(pe({},t),{variables:f}),d=p="network-only"===s||"no-cache"===s,p||(y=this.dataStore.getCache().diff({query:l,variables:f,returnPartialData:!0,optimistic:!1}),v=y.complete,m=y.result,d=!v||"cache-and-network"===s,h=m),g=d&&"cache-only"!==s&&"standby"!==s,Je(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,(function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}})),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:f,isPoll:r===Jt.poll,isRefetch:r===Jt.refetch,metadata:o,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(E=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=_.getQuery(e).lastRequestId&&(_.queryStore.markQueryError(e,t,n),_.invalidate(e),_.invalidate(n),_.broadcastQueries()),new Wt({networkError:t}))})),"cache-and-network"!==s)return[2,E];E.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:h},context:c,variables:f,onlyRunForcedResolvers:!0}).then((function(r){return _.markQueryResult(e,r,t,n),_.broadcastQueries(),r}))]:(this.broadcastQueries(),[2,{data:h}])}}))}))},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,o=r.variables,a=r.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,n,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,o){if(n.invalidate(e,!1),r){var a=n.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Gt(r.networkStatus),f=s&&s.getLastResult(),h=!(!f||f.networkStatus===r.networkStatus),p=t.returnPartialData||!o&&r.previousVariables||h&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=zt(r.graphQLErrors),y=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===y&&d||r.networkError)return i("error",new Wt({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var v=void 0,m=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,(function(){return{newData:null}})),v=o.result,m=!o.complete;else{var g=s&&s.getLastError(),b="none"!==y&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(f&&f.data&&!b)v=f.data,m=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});v=w.result,m=!w.complete}}var E=m&&!(t.returnPartialData||"cache-only"===c),_={data:E?f&&f.data:v,loading:l,networkStatus:r.networkStatus,stale:E};"all"===y&&d&&(_.errors=r.graphQLErrors),i("next",_)}catch(e){i("error",new Wt({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),o=(t=n.transformForLink(i),ft([ht],Ze(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:We(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:ot(et(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(a),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return pe(pe({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),xe("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=pe({},e);return new Yt({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return xe(e.query,12),xe("Document"===e.query.kind,13),xe(!e.returnPartialData,14),xe(!e.pollInterval,15),new Promise((function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new _e(16))}));var e=[];return this.queries.forEach((function(t,r){t.observableQuery&&e.push(r)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var o=function(e){return t.getObservableFromLink(r,{},e,!1).map((function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),Et(i))throw new Wt({graphQLErrors:i.errors});return i}))};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(o);return new Kt((function(e){var t=null;return a.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=r.fetchPolicy,a=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,f=c.complete;return{data:f||a?l:void 0,partial:!f}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;xe(r,17),t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,r){t.invalidated&&t.listeners.forEach((function(n){n&&n(e.queryStore.get(r),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o=this;void 0===n&&(n=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:r,operationName:tt(a)||void 0,context:this.prepareContext(pe(pe({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(a)||new Map;s.set(a,l);var f=JSON.stringify(r);if(!(i=l.get(f))){l.set(f,i=nr(Ut(u,c)));var h=function(){l.delete(f),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:h,error:h,complete:h})}}else i=nr(Ut(u,c))}else i=Kt.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e,n){return new Kt((function(n){var i=n.next,a=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise((function(n){n(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))})).then((function(e){--u,i&&i.call(n,e),c&&l.complete()}),(function(e){--u,a&&a.call(n,e)}))},error:function(e){a&&a.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},f=e.subscribe(l);return function(){return f.unsubscribe()}}))}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,f=void 0===l?"none":l,h=s.fetchPolicy;return new Promise((function(e,l){var p=n.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;n.fetchQueryRejectFns.set(d,l);var y=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(o,(function(e){e.subscriptions.delete(v)}))},v=p.map((function(e){if(i>=n.getQuery(o).lastRequestId&&(n.markQueryResult(o,e,s,u),n.queryStore.markQueryResult(o,e,u),n.invalidate(o),n.invalidate(u),n.broadcastQueries()),"none"===f&&zt(e.errors))return l(new Wt({graphQLErrors:e.errors}));if("all"===f&&(r=e.errors),u||"no-cache"===h)t=e.data;else{var p=n.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}})).subscribe({error:function(e){y(),l(e)},complete:function(){y(),e({data:t,errors:r,loading:!1,networkStatus:Vt.ready,stale:!1})}});n.setQuery(o,(function(e){e.subscriptions.add(v)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=pe(pe({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return pe(pe({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Vt.ready&&t.networkStatus!==Vt.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(xe(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=pe(pe({},e),{fetchPolicy:"network-only"});var a=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,Jt.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),ar=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var o=!Et(e);i&&Et(e)&&e.data&&(o=!0),!n&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){Et(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Et(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach((function(i){var o=n[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=wt((function(){return s(c,{mutationResult:e.result,queryName:tt(a.document)||void 0,queryVariables:a.variables})}));l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){r.forEach((function(e){return t.write(e)}));var n=e.update;n&&wt((function(){return n(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),sr=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,f=e.assumeImmutableResults,h=void 0!==f&&f,p=e.resolvers,d=e.typeDefs,y=e.fragmentMatcher,v=e.name,m=e.version,g=e.link;if(!g&&p&&(g=Qt.empty()),!g||!r)throw new _e(4);this.link=g,this.cache=r,this.store=new ar(r),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new rr({cache:r,client:this,resolvers:p,fragmentMatcher:y}),this.queryManager=new or({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:v,version:m},localState:this.localState,assumeImmutableResults:h,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=pe(pe({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=pe(pe({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=pe(pe({},this.defaultOptions.query),e)),xe("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=pe(pe({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=pe(pe({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Ut(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}(),ur=function(e,t){return ur=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ur(e,t)};function cr(e,t){function r(){this.constructor=e}ur(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var lr=function(){return lr=Object.assign||function(e){for(var t,r=1,n=arguments.length;rthis.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Sr=new Er,Or=[],kr=[],Ir=100;function Ar(e,t){if(!e)throw new Error(t||"assertion failure")}function Tr(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Rr=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(Ar(!this.recomputing,"already recomputing"),function(e){var t=Sr.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Nr(e)?Fr(t,e):Lr(t,e),t}(this)||!jr(this))return Nr(this)?(t=qr(e=this),Sr.withValue(e,Cr,[e]),function(e){if("function"==typeof e.subscribe)try{Qr(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,Nr(e)||Pr(e)}(e),t.forEach(jr),Tr(e.value)):Tr(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Dr(this),Qr(this))},e.prototype.dispose=function(){var e=this;qr(this).forEach(jr),Qr(this),this.parents.forEach((function(t){t.setDirty(),Br(t,e)}))},e.count=0,e}();function Cr(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function Nr(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Dr(e){e.parents.forEach((function(t){return Fr(t,e)}))}function Pr(e){e.parents.forEach((function(t){return Lr(t,e)}))}function Fr(e,t){if(Ar(e.childValues.has(t)),Ar(Nr(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=kr.pop()||new Set;e.dirtyChildren.add(t),Dr(e)}function Lr(e,t){Ar(e.childValues.has(t)),Ar(!Nr(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),Mr(e,t),Nr(e)||Pr(e)}function Mr(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(kr.length0&&(t=[],e.childValues.forEach((function(r,n){Br(e,n),t.push(n)}))),Ar(null===e.dirtyChildren),t}function Br(e,t){t.parents.delete(e),e.childValues.delete(t),Mr(e,t)}function Qr(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ur=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach((function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map((function(e){return e.name})))})),t}}(),Object.prototype.hasOwnProperty),Hr=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Kr((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Yr.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(r){t.set(r,e[r])})),Object.keys(this.data).forEach((function(r){Yr.call(e,r)||t.delete(r)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function Xr(e){return new Hr(e)}var Zr=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Ur(yt):n,o=r.freezeResults,a=void 0!==o&&o,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Kr((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(n.store instanceof Hr)return i.lookup(n.store,t,a,JSON.stringify(o),r.id)}}),this.executeSelectionSet=Kr((function(e){return c.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof Hr)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Kr((function(e){return l.call(t,e)}),{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof Hr)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(lr(lr({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,f=e.config;i=Xe({},ot((xe((t=et(n))&&"query"===t.operation,6),t)),i);var h={store:r,dataIdFromObject:f&&f.dataIdFromObject,cacheRedirects:f&&f.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:h,variableValues:i,fragmentMatcher:l}),d=p.missing&&p.missing.length>0;return d&&!s&&p.missing.forEach((function(e){if(!e.tolerable)throw new _e(8)})),o&&Pe(o,p.result)&&(p.result=o),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?tn:o,s=nt(t),u={query:t,fragmentMap:it(rt(t)),contextValue:n,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(n.id),f=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function h(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach((function(e){var r;if(ze(e,s))if(Ue(e)){var u=h(t.executeField(l,f,e,i));void 0!==u&&c.push(((r={})[Qe(e)]=u,r))}else{var p=void 0;if(Ve(e))p=e;else if(!(p=o[e.name.value]))throw new _e(9);var d=p.typeCondition&&p.typeCondition.name.value,y=!d||i.fragmentMatcher(n,d,a);if(y){var v=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:n,execContext:i});"heuristic"===y&&v.missing&&(v=lr(lr({},v),{missing:v.missing.map((function(e){return lr(lr({},e),{tolerable:!0})}))})),c.push(h(v))}}})),u.result=St(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,o=n.contextValue,a=function(e,t,r,n,i,o){var a=o.directives,s=r;(n||a)&&(s=qe(s,n,a));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var f=l[r];f&&(c=f(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Ge({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,Be(r,i),o,{resultKey:Qe(r),directives:Ke(r,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:r,array:a.result,execContext:n})):r.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:a.result,execContext:n})):(en(r,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var cn={fragmentMatcher:new Wr,dataIdFromObject:function(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null},addTypename:!0,resultCaching:!0,freezeResults:!1},ln=Object.prototype.hasOwnProperty,fn=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return cr(t,e),t.prototype.toObject=function(){return lr(lr({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return ln.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(rn),hn=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Ur(yt),r.silenceBroadcast=!1,r.config=lr(lr({},cn),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new Hr:new rn,r.optimisticData=r.data,r.storeWriter=new on,r.storeReader=new Zr({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Kr((function(e){return i.call(r,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof Hr?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return cr(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new _e(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof fn;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new fn(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,me.visit)(Ze(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some((function(e){return Ue(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(Ue(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return ke(ke({},e),{selections:Ie(n,[st])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(yr),pn=function(e,t){return pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},pn(e,t)},dn=function(){return dn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=300&&gn(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||gn(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){f&&f.abort()}}))}))};!function(e){!function(e,t){function r(){this.constructor=e}pn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}((function(t){return e.call(this,wn(t).request)||this}),e)}(Qt);var En=c(8834).lW;const _n="function"==typeof atob,xn="function"==typeof btoa,Sn="function"==typeof En,On="function"==typeof TextDecoder?new TextDecoder:void 0,kn="function"==typeof TextEncoder?new TextEncoder:void 0,In=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),An=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(In),Tn=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Rn=String.fromCharCode.bind(String),Cn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Nn=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Dn=xn?e=>btoa(e):Sn?e=>En.from(e,"binary").toString("base64"):e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=In[t>>18&63]+In[t>>12&63]+In[t>>6&63]+In[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},Pn=Sn?e=>En.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Rn(192|t>>>6)+Rn(128|63&t):Rn(224|t>>>12&15)+Rn(128|t>>>6&63)+Rn(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Rn(240|t>>>18&7)+Rn(128|t>>>12&63)+Rn(128|t>>>6&63)+Rn(128|63&t)},Ln=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Mn=Sn?e=>En.from(e,"utf8").toString("base64"):kn?e=>Pn(kn.encode(e)):e=>Dn(e.replace(Ln,Fn)),jn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,qn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Rn(55296+(t>>>10))+Rn(56320+(1023&t));case 3:return Rn((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Rn((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Bn=_n?e=>atob(Nn(e)):Sn?e=>En.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!Tn.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o>16&255):64===n?Rn(t>>16&255,t>>8&255):Rn(t>>16&255,t>>8&255,255&t);return i},Qn=Sn?e=>Cn(En.from(e,"base64")):e=>Cn(Bn(e).split("").map((e=>e.charCodeAt(0)))),Un=Sn?e=>En.from(e,"base64").toString("utf8"):On?e=>On.decode(Qn(e)):e=>Bn(e).replace(jn,qn),Vn=(e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(Mn(e)):Mn(e),$n=e=>Un(Nn(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))));var Gn=c(4106),Kn=c(1023),zn=function(){return zn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r120){for(var h=Math.floor(u/80),p=u%80,d=[],y=0;y0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(ai(h),"stack",{value:s.stack,writable:!0,configurable:!0}),oi(h)):(Error.captureStackTrace?Error.captureStackTrace(ai(h),a):Object.defineProperty(ai(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return n=a,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Ei(e){return Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ei(e)}function _i(e,t){switch(Ei(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(vi)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:_i(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+_i(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function xi(e,t){if(!Boolean(e))throw new Error(t)}function Si(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||xi(0,"Body must be a string. Received: ".concat(_i(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||xi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||xi(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:Wn,get:function(){return"Source"}}])&&Si(t.prototype,r),e}(),ki=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Ii(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;ai&&Ai(t[o-1]);)--o;return t.slice(i,o).join("\n")}function Ai(e){for(var t=0;t31||9===o));return new bi(wi.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function Pi(e,t,r,n,i,o){var a=e.body,s=r,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw di(e,u,"Invalid number, unexpected digit after 0: ".concat(Ri(s),"."))}else u=Fi(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=Fi(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=Fi(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw di(e,u,"Invalid number, expected digit but got: ".concat(Ri(s),"."));return new bi(c?wi.FLOAT:wi.INT,t,u,n,i,o,a.slice(t,u))}function Fi(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw di(e,i,"Invalid number, expected digit but got: ".concat(Ri(o),"."))}function Li(e,t,r,n,i){for(var o,a,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function qi(e,t,r,n,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new bi(wi.NAME,t,s,r,n,i,o.slice(t,s))}var Bi=function(){function e(e,t){var r=function(e){return e instanceof Oi}(e)?e:new Oi(e);this._lexer=new Ti(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(wi.NAME);return{kind:yi.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:yi.DOCUMENT,definitions:this.many(wi.SOF,this.parseDefinition,wi.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(wi.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(wi.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(wi.BRACE_L))return{kind:yi.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(wi.NAME)&&(t=this.parseName()),{kind:yi.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(wi.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(wi.PAREN_L,this.parseVariableDefinition,wi.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:yi.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(wi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(wi.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(wi.DOLLAR),{kind:yi.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:yi.SELECTION_SET,selections:this.many(wi.BRACE_L,this.parseSelection,wi.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(wi.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(wi.COLON)?(e=n,t=this.parseName()):t=n,{kind:yi.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(wi.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(wi.PAREN_L,t,wi.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(wi.COLON),{kind:yi.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:yi.ARGUMENT,name:this.parseName(),value:(this.expectToken(wi.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(wi.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(wi.NAME)?{kind:yi.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:yi.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:yi.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:yi.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case wi.BRACKET_L:return this.parseList(e);case wi.BRACE_L:return this.parseObject(e);case wi.INT:return this._lexer.advance(),{kind:yi.INT,value:t.value,loc:this.loc(t)};case wi.FLOAT:return this._lexer.advance(),{kind:yi.FLOAT,value:t.value,loc:this.loc(t)};case wi.STRING:case wi.BLOCK_STRING:return this.parseStringLiteral();case wi.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:yi.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:yi.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:yi.NULL,loc:this.loc(t)};default:return{kind:yi.ENUM,value:t.value,loc:this.loc(t)}}case wi.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:yi.STRING,value:e.value,block:e.kind===wi.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:yi.LIST,values:this.any(wi.BRACKET_L,(function(){return t.parseValueLiteral(e)}),wi.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:yi.OBJECT,fields:this.any(wi.BRACE_L,(function(){return t.parseObjectField(e)}),wi.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(wi.COLON),{kind:yi.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(wi.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(wi.AT),{kind:yi.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(wi.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(wi.BRACKET_R),e={kind:yi.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(wi.BANG)?{kind:yi.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:yi.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===wi.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(wi.STRING)||this.peek(wi.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(wi.BRACE_L,this.parseOperationTypeDefinition,wi.BRACE_R);return{kind:yi.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(wi.COLON);var r=this.parseNamedType();return{kind:yi.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:yi.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:yi.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(wi.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(wi.AMP)||this.peek(wi.NAME));return t}return this.delimitedMany(wi.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(wi.BRACE_L)&&this._lexer.lookahead().kind===wi.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(wi.BRACE_L,this.parseFieldDefinition,wi.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(wi.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:yi.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(wi.PAREN_L,this.parseInputValueDef,wi.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(wi.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(wi.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:yi.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:yi.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:yi.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(wi.EQUALS)?this.delimitedMany(wi.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:yi.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(wi.BRACE_L,this.parseEnumValueDefinition,wi.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:yi.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:yi.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(wi.BRACE_L,this.parseInputValueDef,wi.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===wi.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(wi.BRACE_L,this.parseOperationTypeDefinition,wi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:yi.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:yi.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:yi.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:yi.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:yi.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:yi.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:yi.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(wi.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:yi.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(wi.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==ki[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new gi(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw di(this._lexer.source,t.start,"Expected ".concat(Ui(e),", found ").concat(Qi(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==wi.NAME||t.value!==e)throw di(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(Qi(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===wi.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return di(this._lexer.source,t.start,"Unexpected ".concat(Qi(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function Qi(e){var t=e.value;return Ui(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function Ui(e){return function(e){return e===wi.BANG||e===wi.DOLLAR||e===wi.AMP||e===wi.PAREN_L||e===wi.PAREN_R||e===wi.SPREAD||e===wi.COLON||e===wi.EQUALS||e===wi.AT||e===wi.BRACKET_L||e===wi.BRACKET_R||e===wi.BRACE_L||e===wi.PIPE||e===wi.BRACE_R}(e)?'"'.concat(e,'"'):e}var Vi=new Map,$i=new Map,Gi=!0,Ki=!1;function zi(e){return e.replace(/[\s,]+/g," ").trim()}function Ji(e){var t,r,n,i=zi(e);if(!Vi.has(i)){var o=function(e,t){return new Bi(e,t).parseDocument()}(e,{experimentalFragmentVariables:Ki,allowLegacyFragmentVariables:Ki});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");Vi.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=zi((a=e.loc).source.body.substring(a.start,a.end)),o=$i.get(t);o&&!o.has(i)?Gi&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||$i.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var a})),zn(zn({},t),{definitions:n}))))}return Vi.get(i)}function Wi(e){for(var t=[],r=1;r_` tree${t}: tree(ref: $branch, path: "${e}") { lastCommit { authorName authoredDate author { id username name publicEmail } } } `)).join("\n")} } } } `}function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ro(e){for(var t=1;t{const t=S.unsentRequest.withHeaders(this.token?{Authorization:`Bearer ${this.token}`}:{},e);return Promise.resolve(t)})),no(this,"buildRequest",(async e=>{const t=S.unsentRequest.withRoot(this.apiRoot)(e),r=await this.withAuthorizationHeaders(t);return r.has("cache")?r:S.unsentRequest.withNoCache(r)})),no(this,"request",(async e=>{try{return(0,S.requestWithBackoff)(this,e)}catch(e){throw new S.APIError(e.message,null,oo)}})),no(this,"responseToJSON",(0,S.responseParser)({format:"json",apiName:oo})),no(this,"responseToBlob",(0,S.responseParser)({format:"blob",apiName:oo})),no(this,"responseToText",(0,S.responseParser)({format:"text",apiName:oo})),no(this,"requestJSON",(e=>this.request(e).then(this.responseToJSON))),no(this,"requestText",(e=>this.request(e).then(this.responseToText))),no(this,"user",(()=>this.requestJSON("/user"))),no(this,"WRITE_ACCESS",30),no(this,"MAINTAINER_ACCESS",40),no(this,"hasWriteAccess",(async()=>{const{shared_with_groups:e,permissions:t}=await this.requestJSON(this.repoURL),{project_access:r,group_access:n}=t;if(r&&r.access_level>=this.WRITE_ACCESS)return!0;if(n&&n.access_level>=this.WRITE_ACCESS)return!0;if(e&&e.length>0){const t=(i=e).reduce(((e,t)=>t.group_access_level>e.group_access_level?t:e),i[0]);if(t.group_access_level>=this.MAINTAINER_ACCESS)return!0;if(t.group_access_level>=this.WRITE_ACCESS)try{const e=await this.getDefaultBranch();if(e.developers_can_merge&&e.developers_can_push)return!0}catch(e){console.log("Failed getting default branch",e)}}var i;return!1})),no(this,"readFile",(async(e,t,{parseText:r=!0,branch:n=this.branch}={})=>await(0,S.readFile)(t,(async()=>await this.request({url:`${this.repoURL}/repository/files/${encodeURIComponent(e)}/raw`,params:{ref:n},cache:"no-store"}).then(r?this.responseToText:this.responseToBlob)),S.localForage,r))),no(this,"getCursorFromHeaders",(e=>{const t=parseInt(e.get("X-Page"),10),r=parseInt(e.get("X-Total-Pages"),10),n=parseInt(e.get("X-Per-Page"),10),i=parseInt(e.get("X-Total"),10),o=(0,S.parseLinkHeader)(e.get("Link")),a=(0,Gn.Map)(o).keySeq().flatMap((e=>"prev"===e&&t>1||"next"===e&&t1||"last"===e&&tthis.getCursorFromHeaders(e))),no(this,"fetchCursor",(e=>le()([S.unsentRequest.withMethod("HEAD"),this.request,(0,S.then)(this.getCursor)])(e))),no(this,"fetchCursorAndEntries",(e=>le()([S.unsentRequest.withMethod("GET"),this.request,e=>Promise.all([e.then(this.getCursor),e.then(this.responseToJSON).catch((e=>{if(404===e.status)return[];throw e}))]),(0,S.then)((([e,t])=>({cursor:e,entries:t})))])(e))),no(this,"listFiles",(async(e,t=!1)=>{const{entries:r,cursor:n}=await this.fetchCursorAndEntries({url:`${this.repoURL}/repository/tree`,params:{path:e,ref:this.branch,recursive:t}});return{files:r.filter((({type:e})=>"blob"===e)),cursor:n}})),no(this,"traverseCursor",(async(e,t)=>{const r=e.data.getIn(["links",t]),{entries:n,cursor:i}=await this.fetchCursorAndEntries(r);return{entries:n.filter((({type:e})=>"blob"===e)),cursor:i}})),no(this,"listAllFilesGraphQL",(async(e,t,r)=>{const n=[];let i,o;do{i=await this.graphQLClient.query({query:Xi,variables:{repo:this.repo,branch:r,path:e,recursive:t,cursor:o}}),n.push(...i.data.project.repository.tree.blobs.nodes),o=i.data.project.repository.tree.blobs.pageInfo.endCursor}while(i.data.project.repository.tree.blobs.pageInfo.hasNextPage);return n})),no(this,"readFilesGraphQL",(async e=>{const t=e.map((({path:e})=>e)),r=[];uo(t,90,(e=>{r.push(this.graphQLClient.query({query:Zi,variables:{repo:this.repo,branch:this.branch,paths:e},fetchPolicy:"cache-first"}))}));const n=[];uo(t,8,(e=>{n.push(this.graphQLClient.query({query:eo(e),variables:{repo:this.repo,branch:this.branch},fetchPolicy:"cache-first"}))}));const[i,o]=await Promise.all([(await Promise.all(r)).map((e=>e.data.project.repository.blobs.nodes)),(await Promise.all(n)).map((e=>Object.values(e.data.project.repository).map((({lastCommit:e})=>e)).filter(Boolean)))]),a=i.flat().map((e=>e.data)),s=o.flat().map((({author:e,authoredDate:t,authorName:r})=>({author:e?e.name||e.username||e.publicEmail:r,updatedOn:t})));return e.map(((e,t)=>({file:ro(ro({},e),s[t]),data:a[t]})))})),no(this,"listAllFiles",(async(e,t=!1,r=this.branch)=>{if(this.graphQLClient)return await this.listAllFilesGraphQL(e,t,r);const n=[];let{cursor:i,entries:o}=await this.fetchCursorAndEntries({url:`${this.repoURL}/repository/tree`,params:{path:e,ref:r,per_page:100,recursive:t}});for(n.push(...o);i&&i.actions.has("next");){const e=i.data.getIn(["links","next"]),{cursor:t,entries:r}=await this.fetchCursorAndEntries(e);n.push(...r),i=t}return n.filter((({type:e})=>"blob"===e))})),no(this,"toBase64",(e=>Promise.resolve(Vn(e)))),no(this,"fromBase64",(e=>$n(e))),no(this,"deleteFiles",((e,t)=>{const r={commit_message:t,branch:this.branch};if(this.commitAuthor){const{name:e,email:t}=this.commitAuthor;r.author_name=e,r.author_email=t}const n=e.map((e=>({path:e,action:ao.DELETE})));return this.uploadAndCommit(n,{commitMessage:t})})),this.apiRoot=e.apiRoot||"https://gitlab.com/api/v4",this.graphQLAPIRoot=e.graphQLAPIRoot||"https://gitlab.com/api/graphql",this.token=e.token||!1,this.branch=e.branch||"master",this.repo=e.repo||"",this.repoURL=`/projects/${encodeURIComponent(this.repo)}`,this.squashMerges=e.squashMerges,this.initialWorkflowStatus=e.initialWorkflowStatus,this.cmsLabelPrefix=e.cmsLabelPrefix,!0===e.useGraphQL&&(this.graphQLClient=this.getApolloClient())}getApolloClient(){const e=(r=(e,{headers:t})=>({headers:ro(ro({"Content-Type":"application/json; charset=utf-8"},t),{},{authorization:this.token?`token ${this.token}`:""})}),new Qt((function(e,t){var n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i{try{const t=(await this.requestJSON({url:`${this.repoURL}/repository/commits`,params:{path:e,ref_name:this.branch}}))[0];return{author:t.author_name||t.author_email,updatedOn:t.authored_date}}catch(e){return{author:"",updatedOn:""}}}),S.localForage)}async getBranch(e){return await this.requestJSON(`${this.repoURL}/repository/branches/${encodeURIComponent(e)}`)}async uploadAndCommit(e,{commitMessage:t="",branch:r=this.branch,newBranch:n=!1}){const i=e.map((e=>ro(ro({action:e.action,file_path:e.path},e.oldPath?{previous_path:e.oldPath}:{}),void 0!==e.base64Content?{content:e.base64Content,encoding:"base64"}:{}))),o=ro({branch:r,commit_message:t,actions:i},n?{start_branch:this.branch}:{});if(this.commitAuthor){const{name:e,email:t}=this.commitAuthor;o.author_name=e,o.author_email=t}try{return await this.requestJSON({url:`${this.repoURL}/repository/commits`,method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(o)})}catch(e){const t=e.message||"";throw n&&t.includes(`Could not update ${r}`)&&await(0,S.throwOnConflictingBranches)(r,(e=>this.getBranch(e)),oo),e}}async getCommitItems(e,t){const r=await Promise.all(e.map((async e=>{const[r,n]=await Promise.all([ae()(e,"toBase64",ue()(this.toBase64,e.raw)),this.isFileExists(e.path,t)]);let i,a=ao.CREATE,s=o()(e.path,"/");return n&&(i=e.newPath&&s,a=e.newPath&&e.newPath!==i?ao.MOVE:ao.UPDATE,s=e.newPath?o()(e.newPath,"/"):s),{action:a,base64Content:r,path:s,oldPath:i}})));for(const e of r.filter((e=>e.oldPath&&e.action===ao.MOVE))){const n=(0,Kn.dirname)(e.oldPath),i=(0,Kn.dirname)(e.path);(await this.listAllFiles(n,!0,t)).filter((t=>t.path!==e.oldPath)).forEach((e=>{r.push({action:ao.MOVE,path:e.path.replace(n,i),oldPath:e.path})}))}return r}async persistFiles(e,t,r){const n=[...e,...t];if(r.useWorkflow){const t=e[0].slug;return this.editorialWorkflowGit(n,t,r)}{const e=await this.getCommitItems(n,this.branch);return this.uploadAndCommit(e,{commitMessage:r.commitMessage})}}async getMergeRequests(e){return(await this.requestJSON({url:`${this.repoURL}/merge_requests`,params:ro({state:"opened",labels:"Any",per_page:100,target_branch:this.branch},e?{source_branch:e}:{})})).filter((e=>e.source_branch.startsWith(S.CMS_BRANCH_PREFIX)&&e.labels.some((e=>(0,S.isCMSLabel)(e,this.cmsLabelPrefix)))))}async listUnpublishedBranches(){return console.log("%c Checking for Unpublished entries","line-height: 30px;text-align: center;font-weight: bold"),(await this.getMergeRequests()).map((e=>e.source_branch))}async getFileId(e,t){return(await this.request({method:"HEAD",url:`${this.repoURL}/repository/files/${encodeURIComponent(e)}`,params:{ref:t}})).headers.get("X-Gitlab-Blob-Id")}async isFileExists(e,t){return await this.requestText({method:"HEAD",url:`${this.repoURL}/repository/files/${encodeURIComponent(e)}`,params:{ref:t}}).then((()=>!0)).catch((e=>{if(e instanceof S.APIError&&404===e.status)return!1;throw e}))}async getBranchMergeRequest(e){const t=await this.getMergeRequests(e);if(t.length<=0)throw new S.EditorialWorkflowError("content is not under editorial workflow",!0);return t[0]}async getDifferences(e,t=this.branch){if(e===t)return[];const r=await this.requestJSON({url:`${this.repoURL}/repository/compare`,params:{from:t,to:e}});if(r.diffs.length>=1e3)throw new S.APIError("Diff limit reached",null,oo);return r.diffs.map((e=>{let t="modified";return e.new_file?t="added":e.deleted_file?t="deleted":e.renamed_file&&(t="renamed"),{status:t,oldPath:e.old_path,newPath:e.new_path,newFile:e.new_file,path:e.new_path||e.old_path,binary:e.diff.startsWith("Binary")||/.svg$/.test(e.new_path)}}))}async retrieveUnpublishedEntryData(e){const{collection:t,slug:r}=(0,S.parseContentKey)(e),n=(0,S.branchFromContentKey)(e),i=await this.getBranchMergeRequest(n),o=await this.getDifferences(i.sha),a=await Promise.all(o.map((async e=>{const{path:t,newFile:r}=e;return{id:await this.getFileId(t,n),path:t,newFile:r}}))),s=i.labels.find((e=>(0,S.isCMSLabel)(e,this.cmsLabelPrefix)));return{collection:t,slug:r,status:(0,S.labelToStatus)(s,this.cmsLabelPrefix),diffs:a,updatedAt:i.updated_at,pullRequestAuthor:i.author.name}}async rebaseMergeRequest(e){let t=await this.requestJSON({method:"PUT",url:`${this.repoURL}/merge_requests/${e.iid}/rebase?skip_ci=true`}),r=1;for(;t.rebase_in_progress&&(await new Promise((e=>setTimeout(e,1e3))),t=await this.requestJSON({url:`${this.repoURL}/merge_requests/${e.iid}`,params:{include_rebase_in_progress:!0}}),t.rebase_in_progress&&!(r>30));)r++;if(t.rebase_in_progress)throw new S.APIError("Timed out rebasing merge request",null,oo);if(t.merge_error)throw new S.APIError(`Rebase error: ${t.merge_error}`,null,oo)}async createMergeRequest(e,t,r){await this.requestJSON({method:"POST",url:`${this.repoURL}/merge_requests`,params:{source_branch:e,target_branch:this.branch,title:t,description:S.DEFAULT_PR_BODY,labels:(0,S.statusToLabel)(r,this.cmsLabelPrefix),remove_source_branch:!0,squash:this.squashMerges}})}async editorialWorkflowGit(e,t,r){const n=(0,S.generateContentKey)(r.collectionName,t),i=(0,S.branchFromContentKey)(n);if(r.unpublished){const t=await this.getBranchMergeRequest(i);await this.rebaseMergeRequest(t);const[n,o]=await Promise.all([this.getCommitItems(e,i),this.getDifferences(i)]);for(const e of o.filter((e=>e.binary)))n.some((t=>t.path===e.path))||n.push({action:ao.DELETE,path:e.newPath});await this.uploadAndCommit(n,{commitMessage:r.commitMessage,branch:i})}else{const t=await this.getCommitItems(e,this.branch);await this.uploadAndCommit(t,{commitMessage:r.commitMessage,branch:i,newBranch:!0}),await this.createMergeRequest(i,r.commitMessage,r.status||this.initialWorkflowStatus)}}async updateMergeRequestLabels(e,t){await this.requestJSON({method:"PUT",url:`${this.repoURL}/merge_requests/${e.iid}`,params:{labels:t.join(",")}})}async updateUnpublishedEntryStatus(e,t,r){const n=(0,S.generateContentKey)(e,t),i=(0,S.branchFromContentKey)(n),o=await this.getBranchMergeRequest(i),a=[...o.labels.filter((e=>!(0,S.isCMSLabel)(e,this.cmsLabelPrefix))),(0,S.statusToLabel)(r,this.cmsLabelPrefix)];await this.updateMergeRequestLabels(o,a)}async mergeMergeRequest(e){await this.requestJSON({method:"PUT",url:`${this.repoURL}/merge_requests/${e.iid}/merge`,params:{merge_commit_message:S.MERGE_COMMIT_MESSAGE,squash_commit_message:S.MERGE_COMMIT_MESSAGE,squash:this.squashMerges,should_remove_source_branch:!0}})}async publishUnpublishedEntry(e,t){const r=(0,S.generateContentKey)(e,t),n=(0,S.branchFromContentKey)(r),i=await this.getBranchMergeRequest(n);await this.mergeMergeRequest(i)}async closeMergeRequest(e){await this.requestJSON({method:"PUT",url:`${this.repoURL}/merge_requests/${e.iid}`,params:{state_event:"close"}})}async getDefaultBranch(){return await this.getBranch(this.branch)}async isShaExistsInBranch(e,t){return(await this.requestJSON({url:`${this.repoURL}/repository/commits/${t}/refs`,params:{type:"branch"}})).some((t=>t.name===e))}async deleteBranch(e){await this.request({method:"DELETE",url:`${this.repoURL}/repository/branches/${encodeURIComponent(e)}`})}async deleteUnpublishedEntry(e,t){const r=(0,S.generateContentKey)(e,t),n=(0,S.branchFromContentKey)(r),i=await this.getBranchMergeRequest(n);await this.closeMergeRequest(i),await this.deleteBranch(n)}async getMergeRequestStatues(e,t){return await this.requestJSON({url:`${this.repoURL}/repository/commits/${e.sha}/statuses`,params:{ref:t}})}async getStatuses(e,t){const r=(0,S.generateContentKey)(e,t),n=(0,S.branchFromContentKey)(r),i=await this.getBranchMergeRequest(n);return(await this.getMergeRequestStatues(i,n)).map((({name:e,status:t,target_url:r})=>({context:e,state:t===so.Success?S.PreviewState.Success:S.PreviewState.Other,target_url:r})))}async getUnpublishedEntrySha(e,t){const r=(0,S.generateContentKey)(e,t),n=(0,S.branchFromContentKey)(r);return(await this.getBranchMergeRequest(n)).sha}}function lo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fo(e){for(var t=1;t!!e)).catch((e=>(console.warn("Failed getting GitLab user",e),!1))))||!1},api:{status:!0,statusPage:""}}}authComponent(){return ie}restoreUser(e){return this.authenticate(e)}async authenticate(e){this.token=e.token,this.api=new co({token:this.token,branch:this.branch,repo:this.repo,apiRoot:this.apiRoot,squashMerges:this.squashMerges,cmsLabelPrefix:this.cmsLabelPrefix,initialWorkflowStatus:this.options.initialWorkflowStatus,useGraphQL:this.useGraphQL,graphQLAPIRoot:this.graphQLAPIRoot});const t=await this.api.user();if(!await this.api.hasWriteAccess().catch((e=>{throw e.message=x` Repo "${this.repo}" not found. Please ensure the repo information is spelled correctly. If the repo is private, make sure you're logged into a GitLab account with access. `,e})))throw new Error("Your GitLab user account does not have access to this repo.");if(!this.isBranchConfigured){const e=await(0,S.getDefaultBranchName)({backend:"gitlab",repo:this.repo,token:this.token,apiRoot:this.apiRoot});e&&(this.branch=e)}return fo(fo({},t),{},{login:t.username,token:e.token})}async logout(){this.token=null}getToken(){return Promise.resolve(this.token)}filterFile(e,t,r,i){const o=n()(t.path.split(e)[1]||"/","/");return(0,S.filterByExtension)(t,r)&&o.split("/").length<=i}async entriesByFolder(e,t,r){let n;const i=await(0,S.entriesByFolder)((()=>this.api.listFiles(e,r>1).then((({files:i,cursor:o})=>(n=o.mergeMeta({folder:e,extension:t,depth:r}),i.filter((n=>this.filterFile(e,n,t,r))))))),this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),oo);return i[S.CURSOR_COMPATIBILITY_SYMBOL]=n,i}async listAllFiles(e,t,r){return(await this.api.listAllFiles(e,r>1)).filter((n=>this.filterFile(e,n,t,r)))}async allEntriesByFolder(e,t,r){const n=await(0,S.allEntriesByFolder)({listAllFiles:()=>this.listAllFiles(e,t,r),readFile:this.api.readFile.bind(this.api),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:oo,branch:this.branch,localForage:S.localForage,folder:e,extension:t,depth:r,getDefaultBranch:()=>this.api.getDefaultBranch().then((e=>({name:e.name,sha:e.commit.id}))),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>this.api.getFileId(e,this.branch),filterFile:n=>this.filterFile(e,n,t,r),customFetch:this.useGraphQL?e=>this.api.readFilesGraphQL(e):void 0});return n}entriesByFiles(e){return(0,S.entriesByFiles)(e,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),oo)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}getMedia(e=this.mediaFolder){return this.api.listAllFiles(e).then((e=>e.map((({id:e,name:t,path:r})=>({id:e,name:t,path:r,displayURL:{id:e,name:t,path:r}})))))}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||s()(10),(0,S.getMediaDisplayURL)(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=(0,S.basename)(e),r=await(0,S.getMediaAsBlob)(e,null,this.api.readFile.bind(this.api)),n=(0,S.blobToFileObj)(t,r),i=URL.createObjectURL(n);return{id:await(0,S.getBlobSHA)(r),displayURL:i,path:e,name:t,size:n.size,file:n,url:i}}async persistEntry(e,t){return(0,S.runWithLock)(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const r=e.fileObj,[n]=await Promise.all([(0,S.getBlobSHA)(r),this.api.persistFiles([],[e],t)]),{path:i}=e,a=URL.createObjectURL(r);return{displayURL:a,path:o()(i,"/"),name:r.name,size:r.size,file:r,url:a,id:n}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this.api.traverseCursor(e,t).then((async({entries:t,cursor:r})=>{var n,i,o;const[a,s,u]=[null===(n=e.meta)||void 0===n?void 0:n.get("folder"),null===(i=e.meta)||void 0===i?void 0:i.get("depth"),null===(o=e.meta)||void 0===o?void 0:o.get("extension")];return a&&s&&u&&(t=t.filter((e=>this.filterFile(a,e,u,s))),r=r.mergeMeta({folder:a,extension:u,depth:s})),{entries:await(0,S.entriesByFiles)(t,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),oo),cursor:r}}))}loadMediaFile(e,t){return(0,S.getMediaAsBlob)(t.path,null,((t,r,{parseText:n})=>this.api.readFile(t,r,{branch:e,parseText:n}))).then((e=>{const r=(0,S.basename)(t.path),n=(0,S.blobToFileObj)(r,e);return{id:t.path,displayURL:URL.createObjectURL(n),path:t.path,name:r,size:n.size,file:n}}))}async loadEntryMediaFiles(e,t){return await Promise.all(t.map((t=>this.loadMediaFile(e,t))))}async unpublishedEntries(){return await(0,S.unpublishedEntries)((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>(0,S.contentKeyFromBranch)(e)))))))}async unpublishedEntry({id:e,collection:t,slug:r}){if(e)return await this.api.retrieveUnpublishedEntryData(e);if(t&&r){const e=(0,S.generateContentKey)(t,r);return await this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){const r=(0,S.generateContentKey)(e,t);return(0,S.branchFromContentKey)(r)}async unpublishedEntryDataFile(e,t,r,n){const i=this.getBranch(e,t);return await this.api.readFile(r,n,{branch:i})}async unpublishedEntryMediaFile(e,t,r,n){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:r,id:n})}async updateUnpublishedEntryStatus(e,t,r){return(0,S.runWithLock)(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,r)),"Failed to acquire update entry status lock")}async deleteUnpublishedEntry(e,t){return(0,S.runWithLock)(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t)),"Failed to acquire delete entry lock")}async publishUnpublishedEntry(e,t){return(0,S.runWithLock)(this.lock,(()=>this.api.publishUnpublishedEntry(e,t)),"Failed to acquire publish entry lock")}async getDeployPreview(e,t){try{const r=await this.api.getStatuses(e,t),n=(0,S.getPreviewStatus)(r,this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}},API:co,AuthenticationPage:ie}})(),l.DecapCmsBackendGitlab})())); //# sourceMappingURL=decap-cms-backend-gitlab.js.map