!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.contentful=t():e.contentful=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return j})),r.d(t,"b",(function(){return O})),r.d(t,"c",(function(){return x})),r.d(t,"d",(function(){return _})),r.d(t,"e",(function(){return P}));var n=r(1),o=r.n(n),i=r(31),c=r.n(i),a=r(32),s=r.n(a),u=r(11);function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(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 p(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:5;y.set(e,t);var n=y.get(e),o=n.responseLogger,i=void 0===o?function(){}:o,c=n.requestLogger,a=void 0===c?function(){}:c;e.interceptors.request.use((function(e){return a(e),e}),(function(e){return Promise.reject(e)})),e.interceptors.response.use((function(e){return i(e),e}),(function(t){var o=t.response,i=t.config;if(!i||!n.retryOnError)return Promise.reject(t);var c=null,a=0;if(o)v=0;else{if(c="Connection",++v>r)return t.attempts=v,Promise.reject(t);a=Math.pow(Math.SQRT2,v),o={}}if(o.status>=500&&o.status<600){c="Server ".concat(o.status);var s=(o.headers||{})["x-contentful-request-id"]||null;if(h[s]=h[s]||0,h[s]++,h[s]>r||!s)return t.attempts=h[s],Promise.reject(t);a=Math.pow(Math.SQRT2,h[s])}else 429===o.status&&(c="Rate limit",o.headers&&t.response.headers["x-contentful-ratelimit-reset"]&&(a=o.headers["x-contentful-ratelimit-reset"]));var u;return c?(a=Math.floor(1e3*a+200*Math.random()+500),n.logHandler("warning","".concat(c," error occurred. Waiting for ").concat(a," ms before retrying...")),delete i.httpAgent,delete i.httpsAgent,(u=a,new Promise((function(e){setTimeout(e,u)}))).then((function(){return e(i)}))):Promise.reject(t)}))}(w,x,r.retryLimit),w}function O(e){var t=e.query,r={};return delete t.resolveLinks,r.params=o()(t),r}function x(e){return function e(t){return Object.keys(t).forEach((function(r){var n=t[r];s()(n)&&e(n)})),Object.freeze(t)}(e.sys||{}),e}function w(){if(!window)return null;var e=window.navigator.userAgent,t=window.navigator.platform,r=null;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?r="macOS":-1!==["iPhone","iPad","iPod"].indexOf(t)?r="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?r="Windows":/Android/.test(e)?r="Android":/Linux/.test(t)&&(r="Linux"),r}function _(e,t,r,n){var o=[];t&&o.push("app ".concat(t)),r&&o.push("integration ".concat(r)),n&&o.push("feature "+n),o.push("sdk ".concat(e));var i=null;try{"undefined"!=typeof window&&"navigator"in window&&"product"in window.navigator&&"ReactNative"===window.navigator.product?(i=w(),o.push("platform ReactNative")):b()?(i=function(){var e=Object(u.platform)()||"linux",t=Object(u.release)()||"0.0.0",r={android:"Android",aix:"Linux",darwin:"macOS",freebsd:"Linux",linux:"Linux",openbsd:"Linux",sunos:"Linux",win32:"Windows"};return e in r?"".concat(r[e]||"Linux","/").concat(t):null}(),o.push("platform node.js/".concat(m()))):(i=w(),o.push("platform browser"))}catch(e){i=null}return i&&o.push("os ".concat(i)),"".concat(o.filter((function(e){return""!==e})).join("; "),";")}function P(e){return Object.defineProperty(e,"toPlainObject",{enumerable:!1,configurable:!1,writable:!1,value:function(){return o()(this)}})}}).call(this,r(16))},function(e,t,r){var n=r(52);e.exports=function(e){return n(e,5)}},function(e,t,r){"use strict";var n=r(12),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function c(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function s(e){return"[object Function]"===o.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?o+=n.charAt(c):a<128?o+=i[a]:a<2048?o+=i[192|a>>6]+i[128|63&a]:a<55296||a>=57344?o+=i[224|a>>12]+i[128|a>>6&63]+i[128|63&a]:(c+=1,a=65536+((1023&a)<<10|1023&n.charCodeAt(c)),o+=i[240|a>>18]+i[128|a>>12&63]+i[128|a>>6&63]+i[128|63&a])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,i){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var a=t;return o(t)&&!o(r)&&(a=c(t,i)),o(t)&&o(r)?(r.forEach((function(r,o){if(n.call(t,o)){var c=t[o];c&&"object"==typeof c&&r&&"object"==typeof r?t[o]=e(c,r,i):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var c=r[o];return n.call(t,o)?t[o]=e(t[o],c,i):t[o]=c,t}),a)}}},function(e,t){},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){s.headers[e]=n.merge(i)})),e.exports=s}).call(this,r(16))},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var s,u=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=a(p);f=!0;for(var t=u.length;t;){for(s=u,u=[];++l1)for(var r=1;r0){var c=r.indexOf(this);~c?r.splice(c+1):r.push(this),~c?n.splice(c,1/0,o):n.push(o),~r.indexOf(i)&&(i=t.call(this,o,i))}else r.push(i);return null==e?i:e.call(this,o,i)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r},function(e,t,r){e.exports=r(107)},function(e,t,r){"use strict";var n=r(2),o=r(12),i=r(36),c=r(19);function a(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var s=a(r(15));s.Axios=i,s.create=function(e){return a(c(s.defaults,e))},s.Cancel=r(20),s.CancelToken=r(50),s.isCancel=r(14),s.all=function(e){return Promise.all(e)},s.spread=r(51),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(2),o=r(13),i=r(37),c=r(38),a=r(19);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[c,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},s.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,r,o){return this.request(n.merge(o||{},{method:e,url:t,data:r}))}})),e.exports=s},function(e,t,r){"use strict";var n=r(2);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,r){"use strict";var n=r(2),o=r(39),i=r(14),c=r(15);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||c.adapter)(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(2);e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},function(e,t,r){"use strict";var n=r(2);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(18);e.exports=function(e,t,r){var o=r.config.validateStatus;!o||o(r.status)?e(r):t(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,r){"use strict";var n=r(44),o=r(45);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,c={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(c[t]&&o.indexOf(t)>=0)return;c[t]="set-cookie"===t?(c[t]?c[t]:[]).concat([r]):c[t]?c[t]+", "+r:r}})),c):c}},function(e,t,r){"use strict";var n=r(2),o=r(48);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;if(o(e))throw new Error("URL contains XSS injection attempt");return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";e.exports=function(e){return/(\b)(on\w+)=|javascript|(<\s*)(\/*)script/gi.test(e)}},function(e,t,r){"use strict";var n=r(2);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,c){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===c&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";var n=r(20);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){var n=r(53),o=r(79),i=r(24),c=r(81),a=r(82),s=r(84),u=r(86),f=r(87),l=r(89),p=r(91),d=r(92),h=r(93),y=r(94),v=r(95),b=r(96),m=r(99),g=r(100),j=r(101),O=r(27),x=r(102),w=r(26),_={};_["[object Arguments]"]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_["[object Object]"]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_["[object Function]"]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,P,E,S,A){var k,T=1&r,L=2&r,C=4&r;if(P&&(k=S?P(t,E,S,A):P(t)),void 0!==k)return k;if(!O(t))return t;var U=m(t);if(U){if(k=y(t),!T)return u(t,k)}else{var N=h(t),R="[object Function]"==N||"[object GeneratorFunction]"==N;if(g(t))return s(t,T);if("[object Object]"==N||"[object Arguments]"==N||R&&!S){if(k=L||R?{}:b(t),!T)return L?l(t,a(k,t)):f(t,c(k,t))}else{if(!_[N])return S?t:{};k=v(t,N,T)}}A||(A=new n);var D=A.get(t);if(D)return D;A.set(t,k),x(t)?t.forEach((function(n){k.add(e(n,r,P,n,t,A))})):j(t)&&t.forEach((function(n,o){k.set(o,e(n,r,P,o,t,A))}));var z=C?L?d:p:L?keysIn:w,B=U?void 0:z(t);return o(B||t,(function(n,o){B&&(n=t[o=n]),i(k,o,e(n,r,P,o,t,A))})),k}},function(e,t,r){var n=r(3),o=r(59),i=r(60),c=r(61),a=r(62),s=r(63);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=c,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(4),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(4);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(4);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(4);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(3);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(3),o=r(22),i=r(66);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var c=r.__data__;if(!o||c.length<199)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(c)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(65))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(67),o=r(74),i=r(76),c=r(77),a=r(78);function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t0?m+b:""}},function(e,t,r){"use strict";var n=r(10),o=Object.prototype.hasOwnProperty,i=Array.isArray,c={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(n),a=c?n.slice(0,c.index):n,s=[];if(a){if(!r.plainObjects&&o.call(Object.prototype,a)&&!r.allowPrototypes)return;s.push(a)}for(var u=0;r.depth>0&&null!==(c=i.exec(n))&&u=0;--o){var i,c=e[o];if("[]"===c&&r.parseArrays)i=[].concat(n);else{i=r.plainObjects?Object.create(null):{};var a="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,s=parseInt(a,10);r.parseArrays||""!==a?!isNaN(s)&&c!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(i=[])[s]=n:i[a]=n:i={0:n}}n=i}return n}(s,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return c;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?c.charset:e.charset;return{allowDots:void 0===e.allowDots?c.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:c.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:c.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:c.comma,decoder:"function"==typeof e.decoder?e.decoder:c.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:c.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:c.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:c.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:c.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:c.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:c.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,s={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,l=u.split(t.delimiter,f),p=-1,d=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(y=y.split(",")),v.indexOf("[]=")>-1&&(y=i(y)?[y]:y),o.call(s,h)?s[h]=n.combine(s[h],y):s[h]=y}return s}(e,r):e,f=r.plainObjects?Object.create(null):{},l=Object.keys(u),p=0;p({sys:{type:"Link",linkType:"Entry",id:t.sys.id,circular:!0}}))}})}var b="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};function m(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t{const c=i.data;return r=r.concat(c.items),c.nextPageUrl?o?(delete n.initial,n.sync_token=F(c.nextPageUrl),e(t,r,n,{paginate:o})):{items:r,nextPageToken:F(c.nextPageUrl)}:c.nextSyncUrl?{items:r,nextSyncToken:F(c.nextSyncUrl)}:void 0})}(e,[],t,{paginate:i}).then(e=>{n&&(e.items=w(e,{removeUnresolved:o,itemEntryPoints:["fields"]}));const t=function(e){const t=e=>(t,r)=>(r.sys.type===e&&t.push(Object(f.e)(r)),t);return{entries:e.reduce(t("Entry"),[]),assets:e.reduce(t("Asset"),[]),deletedEntries:e.reduce(t("DeletedEntry"),[]),deletedAssets:e.reduce(t("DeletedAsset"),[])}}(e.items);return e.nextSyncToken&&(t.nextSyncToken=e.nextSyncToken),e.nextPageToken&&(t.nextPageToken=e.nextPageToken),Object(f.c)(v(Object(f.e)(t)))},e=>{throw e})}function F(e){const t=e.split("?");return t.length>0?t[1].replace("sync_token=",""):""}function H(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 M(e){for(var t=1;t{const r=new Error("The resource could not be found.");return r.sys={type:"Error",id:"NotFound"},r.details={type:"Entry",id:e,environment:t().environment,space:t().space},r};function p(e){if(e.data)throw e.data;if(e.response&&e.response.data)throw e.response.data;throw e}function d(e){e.select&&!/sys/i.test(e.select)&&(e.select+=",sys")}function h(e){e.defaults.baseURL=t().environmentBaseUrl}return{getSpace:function(){return function(e){e.defaults.baseURL=t().spaceBaseUrl}(e),e.get("").then(e=>r(e.data),p)},getContentType:function(t){return h(e),e.get("content_types/"+t).then(e=>n(e.data),p)},getContentTypes:function(t={}){return h(e),e.get("content_types",Object(f.b)({query:t})).then(e=>o(e.data),p)},getEntry:function(e,t={}){return e?this.getEntries(M({"sys.id":e},t)).then(t=>{if(t.items.length>0)return i(t.items[0]);throw l(e)},p):Promise.reject(l(e))},getEntries:function(r={}){h(e);const{resolveLinks:n,removeUnresolved:o}=t(r);return d(r),e.get("entries",Object(f.b)({query:r})).then(e=>c(e.data,{resolveLinks:n,removeUnresolved:o}),p)},getAsset:function(t,r={}){return h(e),d(r),e.get("assets/"+t,Object(f.b)({query:r})).then(e=>a(e.data),p)},getAssets:function(t={}){return h(e),d(t),e.get("assets",Object(f.b)({query:t})).then(e=>s(e.data),p)},getLocales:function(t={}){return h(e),e.get("locales",Object(f.b)({query:t})).then(e=>u(e.data),p)},parseEntries:function(e){const{resolveLinks:r,removeUnresolved:n}=t({});return c(e,{resolveLinks:r,removeUnresolved:n})},sync:function(r={},n={paginate:!0}){const{resolveLinks:o,removeUnresolved:i}=t(r);return h(e),q(e,r,M({resolveLinks:o,removeUnresolved:i},n))}}}function V(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 $(e){for(var t=1;te,e=>{if(e.response&&e.response.config.headers.Authorization){const t=e.response.config.headers.Authorization;e.response.config.headers.Authorization=e.response.config.headers.Authorization.replace(t,`Bearer...${t.substr(-5)}`),e.response.request._headers&&e.response.request._headers.authorization&&(e.response.request._headers.authorization=e.response.request._headers.authorization.replace(t,`Bearer...${t.substr(-5)}`)),e.response.request._header&&(e.response.request._header=e.response.request._header.replace(t,`Bearer...${t.substr(-5)}`))}return Promise.reject(e)})}(n),Q({http:n,getGlobalOptions:o})}r.d(t,"createClient",(function(){return X}))}])}));