@gradientedge/commercetools-utils 4.32.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
  2. package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
  3. package/dist/ge-commercetools-utils-browser.esm.js +1 -1
  4. package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
  5. package/dist/ge-commercetools-utils-node.cjs.js +1 -1
  6. package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
  7. package/dist/ge-commercetools-utils-node.esm.js +1 -1
  8. package/dist/typings/api/CommercetoolsApi.d.ts +4 -13
  9. package/dist/typings/api/types.d.ts +1 -1
  10. package/dist/typings/auth/CommercetoolsAuthApi.d.ts +8 -7
  11. package/dist/typings/auth/types.d.ts +4 -10
  12. package/dist/typings/constants.d.ts +10 -0
  13. package/dist/typings/error/CommercetoolsError.d.ts +3 -8
  14. package/dist/typings/index.d.ts +1 -1
  15. package/dist/typings/request/index.d.ts +2 -0
  16. package/dist/typings/request/is-retryable-error.d.ts +1 -0
  17. package/dist/typings/request/request-executor.d.ts +11 -0
  18. package/dist/typings/request/request.d.ts +10 -0
  19. package/dist/typings/request/transform-error.d.ts +2 -0
  20. package/dist/typings/types.d.ts +26 -9
  21. package/dist/typings/utils/axios/convert-error.d.ts +3 -0
  22. package/dist/typings/utils/axios/convert-response.d.ts +3 -0
  23. package/dist/typings/utils/axios/create-instance.d.ts +6 -0
  24. package/dist/typings/utils/axios/extract-headers.d.ts +1 -0
  25. package/dist/typings/utils/axios/index.d.ts +4 -0
  26. package/dist/typings/utils/index.d.ts +1 -0
  27. package/dist/typings/utils/mask.d.ts +3 -3
  28. package/dist/typings/utils/plain-clone.d.ts +1 -0
  29. package/dist/typings/utils/retry-on-conflict.d.ts +1 -1
  30. package/package.json +13 -14
  31. package/dist/typings/axios/interceptors/logger.d.ts +0 -3
@@ -1,2 +1,2 @@
1
- var t={8842:(t,e,r)=>{e.Status=void 0;var o=r(7536);Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});r(7890)},7890:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=void 0;const o=r(7536);e.reason=function(t){switch(t){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(o.Status).find((e=>o.Status[e]===t))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Status=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=void 0,e.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},e.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},e.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},e.ErrorStatus={BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RequestedRangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511},e.Status=Object.assign(Object.assign(Object.assign(Object.assign({},e.InformationStatus),e.SuccessStatus),e.RedirectionStatus),e.ErrorStatus)},9669:(t,e,r)=>{t.exports=r(1609)},5448:(t,e,r)=>{var o=r(4867),n=r(6026),s=r(4372),a=r(5327),i=r(4097),u=r(4109),c=r(7985),p=r(7874),l=r(2648),h=r(644),f=r(205);t.exports=function(t){return new Promise((function(e,r){var y,d=t.data,m=t.headers,g=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(y),t.signal&&t.signal.removeEventListener("abort",y)}o.isFormData(d)&&o.isStandardBrowserEnv()&&delete m["Content-Type"];var b=new XMLHttpRequest;if(t.auth){var O=t.auth.username||"",S=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";m.Authorization="Basic "+btoa(O+":"+S)}var E=i(t.baseURL,t.url);function w(){if(b){var o="getAllResponseHeaders"in b?u(b.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:o,config:t,request:b};n((function(t){e(t),v()}),(function(t){r(t),v()}),s),b=null}}if(b.open(t.method.toUpperCase(),a(E,t.params,t.paramsSerializer),!0),b.timeout=t.timeout,"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(w)},b.onabort=function(){b&&(r(new l("Request aborted",l.ECONNABORTED,t,b)),b=null)},b.onerror=function(){r(new l("Network Error",l.ERR_NETWORK,t,b,b)),b=null},b.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",o=t.transitional||p;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new l(e,o.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,t,b)),b=null},o.isStandardBrowserEnv()){var x=(t.withCredentials||c(E))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;x&&(m[t.xsrfHeaderName]=x)}"setRequestHeader"in b&&o.forEach(m,(function(t,e){void 0===d&&"content-type"===e.toLowerCase()?delete m[e]:b.setRequestHeader(e,t)})),o.isUndefined(t.withCredentials)||(b.withCredentials=!!t.withCredentials),g&&"json"!==g&&(b.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&b.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(y=function(t){b&&(r(!t||t&&t.type?new h:t),b.abort(),b=null)},t.cancelToken&&t.cancelToken.subscribe(y),t.signal&&(t.signal.aborted?y():t.signal.addEventListener("abort",y))),d||(d=null);var T=f(E);T&&-1===["http","https","file"].indexOf(T)?r(new l("Unsupported protocol "+T+":",l.ERR_BAD_REQUEST,t)):b.send(d)}))}},1609:(t,e,r)=>{var o=r(4867),n=r(1849),s=r(321),a=r(7185),i=function t(e){var r=new s(e),i=n(s.prototype.request,r);return o.extend(i,s.prototype,r),o.extend(i,r),i.create=function(r){return t(a(e,r))},i}(r(5546));i.Axios=s,i.CanceledError=r(644),i.CancelToken=r(4972),i.isCancel=r(6502),i.VERSION=r(7288).version,i.toFormData=r(7675),i.AxiosError=r(2648),i.Cancel=i.CanceledError,i.all=function(t){return Promise.all(t)},i.spread=r(8713),i.isAxiosError=r(6268),t.exports=i,t.exports.default=i},4972:(t,e,r)=>{var o=r(644);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,o=r._listeners.length;for(e=0;e<o;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,o=new Promise((function(t){r.subscribe(t),e=t})).then(t);return o.cancel=function(){r.unsubscribe(e)},o},t((function(t){r.reason||(r.reason=new o(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},n.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},644:(t,e,r)=>{var o=r(2648);function n(t){o.call(this,null==t?"canceled":t,o.ERR_CANCELED),this.name="CanceledError"}r(4867).inherits(n,o,{__CANCEL__:!0}),t.exports=n},6502:t=>{t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,r)=>{var o=r(4867),n=r(5327),s=r(782),a=r(3572),i=r(7185),u=r(4097),c=r(4875),p=c.validators;function l(t){this.defaults=t,this.interceptors={request:new s,response:new s}}l.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean)},!1);var o=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,o.unshift(t.fulfilled,t.rejected))}));var s,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!n){var l=[a,void 0];for(Array.prototype.unshift.apply(l,o),l=l.concat(u),s=Promise.resolve(e);l.length;)s=s.then(l.shift(),l.shift());return s}for(var h=e;o.length;){var f=o.shift(),y=o.shift();try{h=f(h)}catch(t){y(t);break}}try{s=a(h)}catch(t){return Promise.reject(t)}for(;u.length;)s=s.then(u.shift(),u.shift());return s},l.prototype.getUri=function(t){t=i(this.defaults,t);var e=u(t.baseURL,t.url);return n(e,t.params,t.paramsSerializer)},o.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,r){return this.request(i(r||{},{method:t,url:e,data:(r||{}).data}))}})),o.forEach(["post","put","patch"],(function(t){function e(e){return function(r,o,n){return this.request(i(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}l.prototype[t]=e(),l.prototype[t+"Form"]=e(!0)})),t.exports=l},2648:(t,e,r)=>{var o=r(4867);function n(t,e,r,o,n){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),o&&(this.request=o),n&&(this.response=n)}o.inherits(n,Error,{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,status:this.response&&this.response.status?this.response.status:null}}});var s=n.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(t){a[t]={value:t}})),Object.defineProperties(n,a),Object.defineProperty(s,"isAxiosError",{value:!0}),n.from=function(t,e,r,a,i,u){var c=Object.create(s);return o.toFlatObject(t,c,(function(t){return t!==Error.prototype})),n.call(c,t.message,e,r,a,i),c.name=t.name,u&&Object.assign(c,u),c},t.exports=n},782:(t,e,r)=>{var o=r(4867);function n(){this.handlers=[]}n.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){o.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=n},4097:(t,e,r)=>{var o=r(1793),n=r(7303);t.exports=function(t,e){return t&&!o(e)?n(t,e):e}},3572:(t,e,r)=>{var o=r(4867),n=r(8527),s=r(6502),a=r(5546),i=r(644);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new i}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=n.call(t,t.data,t.headers,t.transformRequest),t.headers=o.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),o.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return u(t),e.data=n.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(u(t),e&&e.response&&(e.response.data=n.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},7185:(t,e,r)=>{var o=r(4867);t.exports=function(t,e){e=e||{};var r={};function n(t,e){return o.isPlainObject(t)&&o.isPlainObject(e)?o.merge(t,e):o.isPlainObject(e)?o.merge({},e):o.isArray(e)?e.slice():e}function s(r){return o.isUndefined(e[r])?o.isUndefined(t[r])?void 0:n(void 0,t[r]):n(t[r],e[r])}function a(t){if(!o.isUndefined(e[t]))return n(void 0,e[t])}function i(r){return o.isUndefined(e[r])?o.isUndefined(t[r])?void 0:n(void 0,t[r]):n(void 0,e[r])}function u(r){return r in e?n(t[r],e[r]):r in t?n(void 0,t[r]):void 0}var c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u};return o.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||s,n=e(t);o.isUndefined(n)&&e!==u||(r[t]=n)})),r}},6026:(t,e,r)=>{var o=r(2648);t.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new o("Request failed with status code "+r.status,[o.ERR_BAD_REQUEST,o.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}},8527:(t,e,r)=>{var o=r(4867),n=r(5546);t.exports=function(t,e,r){var s=this||n;return o.forEach(r,(function(r){t=r.call(s,t,e)})),t}},5546:(t,e,r)=>{var o=r(4867),n=r(6016),s=r(2648),a=r(7874),i=r(7675),u={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!o.isUndefined(t)&&o.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var p,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(p=r(5448)),p),transformRequest:[function(t,e){if(n(e,"Accept"),n(e,"Content-Type"),o.isFormData(t)||o.isArrayBuffer(t)||o.isBuffer(t)||o.isStream(t)||o.isFile(t)||o.isBlob(t))return t;if(o.isArrayBufferView(t))return t.buffer;if(o.isURLSearchParams(t))return c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,s=o.isObject(t),a=e&&e["Content-Type"];if((r=o.isFileList(t))||s&&"multipart/form-data"===a){var u=this.env&&this.env.FormData;return i(r?{"files[]":t}:t,u&&new u)}return s||"application/json"===a?(c(e,"application/json"),function(t,e,r){if(o.isString(t))try{return(0,JSON.parse)(t),o.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||l.transitional,r=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||n&&o.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(a){if("SyntaxError"===t.name)throw s.from(t,s.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(1623)},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],(function(t){l.headers[t]={}})),o.forEach(["post","put","patch"],(function(t){l.headers[t]=o.merge(u)})),t.exports=l},7874:t=>{t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:t=>{t.exports={version:"0.27.2"}},1849:t=>{t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return t.apply(e,r)}}},5327:(t,e,r)=>{var o=r(4867);function n(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var s;if(r)s=r(e);else if(o.isURLSearchParams(e))s=e.toString();else{var a=[];o.forEach(e,(function(t,e){null!=t&&(o.isArray(t)?e+="[]":t=[t],o.forEach(t,(function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),a.push(n(e)+"="+n(t))})))})),s=a.join("&")}if(s){var i=t.indexOf("#");-1!==i&&(t=t.slice(0,i)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}},7303:t=>{t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,r)=>{var o=r(4867);t.exports=o.isStandardBrowserEnv()?{write:function(t,e,r,n,s,a){var i=[];i.push(t+"="+encodeURIComponent(e)),o.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),o.isString(n)&&i.push("path="+n),o.isString(s)&&i.push("domain="+s),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:t=>{t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},6268:(t,e,r)=>{var o=r(4867);t.exports=function(t){return o.isObject(t)&&!0===t.isAxiosError}},7985:(t,e,r)=>{var o=r(4867);t.exports=o.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(t){var o=t;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{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 t=n(window.location.href),function(e){var r=o.isString(e)?n(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},6016:(t,e,r)=>{var o=r(4867);t.exports=function(t,e){o.forEach(t,(function(r,o){o!==e&&o.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[o])}))}},1623:t=>{t.exports=null},4109:(t,e,r)=>{var o=r(4867),n=["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"];t.exports=function(t){var e,r,s,a={};return t?(o.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=o.trim(t.substr(0,s)).toLowerCase(),r=o.trim(t.substr(s+1)),e){if(a[e]&&n.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r}})),a):a}},205:t=>{t.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},8713:t=>{t.exports=function(t){return function(e){return t.apply(null,e)}}},7675:(t,e,r)=>{var o=r(4867);t.exports=function(t,e){e=e||new FormData;var r=[];function n(t){return null===t?"":o.isDate(t)?t.toISOString():o.isArrayBuffer(t)||o.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(s,a){if(o.isPlainObject(s)||o.isArray(s)){if(-1!==r.indexOf(s))throw Error("Circular reference detected in "+a);r.push(s),o.forEach(s,(function(r,s){if(!o.isUndefined(r)){var i,u=a?a+"."+s:s;if(r&&!a&&"object"==typeof r)if(o.endsWith(s,"{}"))r=JSON.stringify(r);else if(o.endsWith(s,"[]")&&(i=o.toArray(r)))return void i.forEach((function(t){!o.isUndefined(t)&&e.append(u,n(t))}));t(r,u)}})),r.pop()}else e.append(a,n(s))}(t),e}},4875:(t,e,r)=>{var o=r(7288).version,n=r(2648),s={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){s[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var a={};s.transitional=function(t,e,r){function s(t,e){return"[Axios v"+o+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,o,i){if(!1===t)throw new n(s(o," has been removed"+(e?" in "+e:"")),n.ERR_DEPRECATED);return e&&!a[o]&&(a[o]=!0,console.warn(s(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}},t.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new n("options must be an object",n.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(t),s=o.length;s-- >0;){var a=o[s],i=e[a];if(i){var u=t[a],c=void 0===u||i(u,a,t);if(!0!==c)throw new n("option "+a+" must be "+c,n.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new n("Unknown option "+a,n.ERR_BAD_OPTION)}},validators:s}},4867:(t,e,r)=>{var o,n=r(1849),s=Object.prototype.toString,a=(o=Object.create(null),function(t){var e=s.call(t);return o[e]||(o[e]=e.slice(8,-1).toLowerCase())});function i(t){return t=t.toLowerCase(),function(e){return a(e)===t}}function u(t){return Array.isArray(t)}function c(t){return void 0===t}var p=i("ArrayBuffer");function l(t){return null!==t&&"object"==typeof t}function h(t){if("object"!==a(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var f=i("Date"),y=i("File"),d=i("Blob"),m=i("FileList");function g(t){return"[object Function]"===s.call(t)}var v=i("URLSearchParams");function b(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}var O,S=(O="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return O&&t instanceof O});t.exports={isArray:u,isArrayBuffer:p,isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||s.call(t)===e||g(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&p(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:l,isPlainObject:h,isUndefined:c,isDate:f,isFile:y,isBlob:d,isFunction:g,isStream:function(t){return l(t)&&g(t.pipe)},isURLSearchParams:v,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:b,merge:function t(){var e={};function r(r,o){h(e[o])&&h(r)?e[o]=t(e[o],r):h(r)?e[o]=t({},r):u(r)?e[o]=r.slice():e[o]=r}for(var o=0,n=arguments.length;o<n;o++)b(arguments[o],r);return e},extend:function(t,e,r){return b(e,(function(e,o){t[o]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,r,o){t.prototype=Object.create(e.prototype,o),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,e,r){var o,n,s,a={};e=e||{};do{for(n=(o=Object.getOwnPropertyNames(t)).length;n-- >0;)a[s=o[n]]||(e[s]=t[s],a[s]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:i,endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;var o=t.indexOf(e,r);return-1!==o&&o===r},toArray:function(t){if(!t)return null;var e=t.length;if(c(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r},isTypedArray:S,isFileList:m}},1924:(t,e,r)=>{var o=r(210),n=r(5559),s=n(o("String.prototype.indexOf"));t.exports=function(t,e){var r=o(t,!!e);return"function"==typeof r&&s(t,".prototype.")>-1?n(r):r}},5559:(t,e,r)=>{var o=r(8612),n=r(210),s=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),i=n("%Reflect.apply%",!0)||o.call(a,s),u=n("%Object.getOwnPropertyDescriptor%",!0),c=n("%Object.defineProperty%",!0),p=n("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=i(o,a,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+p(0,t.length-(arguments.length-1))})}return e};var l=function(){return i(o,s,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},7648:t=>{var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,n="[object Function]";t.exports=function(t){var s=this;if("function"!=typeof s||o.call(s)!==n)throw new TypeError(e+s);for(var a,i=r.call(arguments,1),u=function(){if(this instanceof a){var e=s.apply(this,i.concat(r.call(arguments)));return Object(e)===e?e:this}return s.apply(t,i.concat(r.call(arguments)))},c=Math.max(0,s.length-i.length),p=[],l=0;l<c;l++)p.push("$"+l);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(u),s.prototype){var h=function(){};h.prototype=s.prototype,a.prototype=new h,h.prototype=null}return a}},8612:(t,e,r)=>{var o=r(7648);t.exports=Function.prototype.bind||o},210:(t,e,r)=>{var o,n=SyntaxError,s=Function,a=TypeError,i=function(t){try{return s('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},p=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},f={},y="undefined"==typeof Uint8Array?o:h(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):o,"%Symbol%":l?Symbol:o,"%SyntaxError%":n,"%ThrowTypeError%":p,"%TypedArray%":y,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},m=function t(e){var r;if("%AsyncFunction%"===e)r=i("async function () {}");else if("%GeneratorFunction%"===e)r=i("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=i("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&(r=h(n.prototype))}return d[e]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(8612),b=r(7642),O=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),E=v.call(Function.call,String.prototype.replace),w=v.call(Function.call,String.prototype.slice),x=v.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,C=function(t){var e=w(t,0,1),r=w(t,-1);if("%"===e&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new n("invalid intrinsic syntax, expected opening `%`");var o=[];return E(t,T,(function(t,e,r,n){o[o.length]=r?E(n,R,"$1"):e||t})),o},q=function(t,e){var r,o=t;if(b(g,o)&&(o="%"+(r=g[o])[0]+"%"),b(d,o)){var s=d[o];if(s===f&&(s=m(o)),void 0===s&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:s}}throw new n("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,t))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=C(t),o=r.length>0?r[0]:"",s=q("%"+o+"%",e),i=s.name,c=s.value,p=!1,l=s.alias;l&&(o=l[0],S(r,O([0,1],l)));for(var h=1,f=!0;h<r.length;h+=1){var y=r[h],m=w(y,0,1),g=w(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new n("property names with quotes must have matching quotes");if("constructor"!==y&&f||(p=!0),b(d,i="%"+(o+="."+y)+"%"))c=d[i];else if(null!=c){if(!(y in c)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&h+1>=r.length){var v=u(c,y);c=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[y]}else f=b(c,y),c=c[y];f&&!p&&(d[i]=c)}}return c}},1405:(t,e,r)=>{var o="undefined"!=typeof Symbol&&Symbol,n=r(5419);t.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"==typeof o("foo")&&"symbol"==typeof Symbol("bar")&&n()}},5419:t=>{t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},7642:(t,e,r)=>{var o=r(8612);t.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},4530:(t,e)=>{function r(t,e){var r=[],o=[];return null==e&&(e=function(t,e){return r[0]===e?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(e)).join(".")+"]"}),function(n,s){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,n):o.push(n),~r.indexOf(s)&&(s=e.call(this,n,s))}else r.push(s);return null==t?s:t.call(this,n,s)}}(t.exports=function(t,e,o,n){return JSON.stringify(t,r(e,n),o)}).getSerialize=r},3465:(t,e,r)=>{t=r.nmd(t);var o="__lodash_hash_undefined__",n=9007199254740991,s="[object Arguments]",a="[object Boolean]",i="[object Date]",u="[object Function]",c="[object GeneratorFunction]",p="[object Map]",l="[object Number]",h="[object Object]",f="[object Promise]",y="[object RegExp]",d="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",O="[object DataView]",S="[object Float32Array]",E="[object Float64Array]",w="[object Int8Array]",x="[object Int16Array]",T="[object Int32Array]",R="[object Uint8Array]",C="[object Uint8ClampedArray]",q="[object Uint16Array]",j="[object Uint32Array]",P=/\w*$/,A=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,_={};_[s]=_["[object Array]"]=_[b]=_[O]=_[a]=_[i]=_[S]=_[E]=_[w]=_[x]=_[T]=_[p]=_[l]=_[h]=_[y]=_[d]=_[m]=_[g]=_[R]=_[C]=_[q]=_[j]=!0,_["[object Error]"]=_[u]=_[v]=!1;var I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,B="object"==typeof self&&self&&self.Object===Object&&self,N=I||B||Function("return this")(),$=e&&!e.nodeType&&e,D=$&&t&&!t.nodeType&&t,M=D&&D.exports===$;function F(t,e){return t.set(e[0],e[1]),t}function G(t,e){return t.add(e),t}function L(t,e,r,o){var n=-1,s=t?t.length:0;for(o&&s&&(r=t[++n]);++n<s;)r=e(r,t[n],n,t);return r}function U(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t,o){r[++e]=[o,t]})),r}function W(t,e){return function(r){return t(e(r))}}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var V,z=Array.prototype,J=Function.prototype,Q=Object.prototype,X=N["__core-js_shared__"],Y=(V=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Z=J.toString,tt=Q.hasOwnProperty,et=Q.toString,rt=RegExp("^"+Z.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=M?N.Buffer:void 0,nt=N.Symbol,st=N.Uint8Array,at=W(Object.getPrototypeOf,Object),it=Object.create,ut=Q.propertyIsEnumerable,ct=z.splice,pt=Object.getOwnPropertySymbols,lt=ot?ot.isBuffer:void 0,ht=W(Object.keys,Object),ft=Nt(N,"DataView"),yt=Nt(N,"Map"),dt=Nt(N,"Promise"),mt=Nt(N,"Set"),gt=Nt(N,"WeakMap"),vt=Nt(Object,"create"),bt=Gt(ft),Ot=Gt(yt),St=Gt(dt),Et=Gt(mt),wt=Gt(gt),xt=nt?nt.prototype:void 0,Tt=xt?xt.valueOf:void 0;function Rt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}function Ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}function qt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}function jt(t){this.__data__=new Ct(t)}function Pt(t,e,r){var o=t[e];tt.call(t,e)&&Lt(o,r)&&(void 0!==r||e in t)||(t[e]=r)}function At(t,e){for(var r=t.length;r--;)if(Lt(t[r][0],e))return r;return-1}function kt(t,e,r,o,n,f,v){var A;if(o&&(A=f?o(t,n,f,v):o(t)),void 0!==A)return A;if(!Vt(t))return t;var k=Ut(t);if(k){if(A=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}(t,A)}else{var I=Dt(t),B=I==u||I==c;if(Wt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(I==h||I==s||B&&!f){if(U(t))return f?t:{};if(A=function(t){return"function"!=typeof t.constructor||Ft(t)?{}:Vt(e=at(t))?it(e):{};var e}(B?{}:t),!e)return function(t,e){return It(t,$t(t),e)}(t,function(t,e){return t&&It(e,zt(e),t)}(A,t))}else{if(!_[I])return f?t:{};A=function(t,e,r,o){var n,s=t.constructor;switch(e){case b:return _t(t);case a:case i:return new s(+t);case O:return function(t,e){var r=e?_t(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,o);case S:case E:case w:case x:case T:case R:case C:case q:case j:return function(t,e){var r=e?_t(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,o);case p:return function(t,e,r){return L(e?r(K(t),!0):K(t),F,new t.constructor)}(t,o,r);case l:case m:return new s(t);case y:return function(t){var e=new t.constructor(t.source,P.exec(t));return e.lastIndex=t.lastIndex,e}(t);case d:return function(t,e,r){return L(e?r(H(t),!0):H(t),G,new t.constructor)}(t,o,r);case g:return n=t,Tt?Object(Tt.call(n)):{}}}(t,I,kt,e)}}v||(v=new jt);var N=v.get(t);if(N)return N;if(v.set(t,A),!k)var $=r?function(t){return function(t,e,r){var o=e(t);return Ut(t)?o:function(t,e){for(var r=-1,o=e.length,n=t.length;++r<o;)t[n+r]=e[r];return t}(o,r(t))}(t,zt,$t)}(t):zt(t);return function(t,e){for(var r=-1,o=t?t.length:0;++r<o&&!1!==e(t[r],r););}($||t,(function(n,s){$&&(n=t[s=n]),Pt(A,s,kt(n,e,r,o,s,t,v))})),A}function _t(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function It(t,e,r,o){r||(r={});for(var n=-1,s=e.length;++n<s;){var a=e[n],i=o?o(r[a],t[a],a,r,t):void 0;Pt(r,a,void 0===i?t[a]:i)}return r}function Bt(t,e){var r,o,n=t.__data__;return("string"==(o=typeof(r=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Vt(t)||(e=t,Y&&Y in e))&&(Ht(t)||U(t)?rt:A).test(Gt(t));var e}(r)?r:void 0}Rt.prototype.clear=function(){this.__data__=vt?vt(null):{}},Rt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Rt.prototype.get=function(t){var e=this.__data__;if(vt){var r=e[t];return r===o?void 0:r}return tt.call(e,t)?e[t]:void 0},Rt.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:tt.call(e,t)},Rt.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?o:e,this},Ct.prototype.clear=function(){this.__data__=[]},Ct.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},Ct.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},Ct.prototype.has=function(t){return At(this.__data__,t)>-1},Ct.prototype.set=function(t,e){var r=this.__data__,o=At(r,t);return o<0?r.push([t,e]):r[o][1]=e,this},qt.prototype.clear=function(){this.__data__={hash:new Rt,map:new(yt||Ct),string:new Rt}},qt.prototype.delete=function(t){return Bt(this,t).delete(t)},qt.prototype.get=function(t){return Bt(this,t).get(t)},qt.prototype.has=function(t){return Bt(this,t).has(t)},qt.prototype.set=function(t,e){return Bt(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Ct},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ct){var o=r.__data__;if(!yt||o.length<199)return o.push([t,e]),this;r=this.__data__=new qt(o)}return r.set(t,e),this};var $t=pt?W(pt,Object):function(){return[]},Dt=function(t){return et.call(t)};function Mt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||k.test(t))&&t>-1&&t%1==0&&t<e}function Ft(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Q)}function Gt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Lt(t,e){return t===e||t!=t&&e!=e}(ft&&Dt(new ft(new ArrayBuffer(1)))!=O||yt&&Dt(new yt)!=p||dt&&Dt(dt.resolve())!=f||mt&&Dt(new mt)!=d||gt&&Dt(new gt)!=v)&&(Dt=function(t){var e=et.call(t),r=e==h?t.constructor:void 0,o=r?Gt(r):void 0;if(o)switch(o){case bt:return O;case Ot:return p;case St:return f;case Et:return d;case wt:return v}return e});var Ut=Array.isArray;function Kt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!Ht(t)}var Wt=lt||function(){return!1};function Ht(t){var e=Vt(t)?et.call(t):"";return e==u||e==c}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function zt(t){return Kt(t)?function(t,e){var r=Ut(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Kt(t)}(t)&&tt.call(t,"callee")&&(!ut.call(t,"callee")||et.call(t)==s)}(t)?function(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}(t.length,String):[],o=r.length,n=!!o;for(var a in t)!e&&!tt.call(t,a)||n&&("length"==a||Mt(a,o))||r.push(a);return r}(t):function(t){if(!Ft(t))return ht(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return kt(t,!0,!0)}},631:(t,e,r)=>{var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,s=o&&n&&"function"==typeof n.get?n.get:null,a=o&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=i&&u&&"function"==typeof u.get?u.get:null,p=i&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,O=String.prototype.toUpperCase,S=String.prototype.toLowerCase,E=RegExp.prototype.test,w=Array.prototype.concat,x=Array.prototype.join,T=Array.prototype.slice,R=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,q=Object.getOwnPropertySymbols,j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,_=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function I(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-R(-t):R(t);if(o!==t){var n=String(o),s=v.call(e,n.length+1);return b.call(n,r,"$&_")+"."+b.call(b.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(e,r,"$&_")}var B=r(4654),N=B.custom,$=L(N)?N:null;function D(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function M(t){return b.call(String(t),/"/g,"&quot;")}function F(t){return!("[object Array]"!==W(t)||A&&"object"==typeof t&&A in t)}function G(t){return!("[object RegExp]"!==W(t)||A&&"object"==typeof t&&A in t)}function L(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!j)return!1;try{return j.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,o,n){var i=r||{};if(K(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(K(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!K(i,"customInspect")||i.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(K(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(K(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=i.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return V(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var O=String(e);return d?I(e,O):O}if("bigint"==typeof e){var E=String(e)+"n";return d?I(e,E):E}var R=void 0===i.depth?5:i.depth;if(void 0===o&&(o=0),o>=R&&R>0&&"object"==typeof e)return F(e)?"[Array]":"[Object]";var q,N=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=x.call(Array(t.indent+1)," ")}return{base:r,prev:x.call(Array(e+1),r)}}(i,o);if(void 0===n)n=[];else if(H(n,e)>=0)return"[Circular]";function U(e,r,s){if(r&&(n=T.call(n)).push(r),s){var a={depth:i.depth};return K(i,"quoteStyle")&&(a.quoteStyle=i.quoteStyle),t(e,a,o+1,n)}return t(e,i,o+1,n)}if("function"==typeof e&&!G(e)){var z=function(t){if(t.name)return t.name;var e=g.call(m.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Z(e,U);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(tt.length>0?" { "+x.call(tt,", ")+" }":"")}if(L(e)){var et=P?b.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):j.call(e);return"object"!=typeof e||P?et:J(et)}if((q=e)&&"object"==typeof q&&("undefined"!=typeof HTMLElement&&q instanceof HTMLElement||"string"==typeof q.nodeName&&"function"==typeof q.getAttribute)){for(var rt="<"+S.call(String(e.nodeName)),ot=e.attributes||[],nt=0;nt<ot.length;nt++)rt+=" "+ot[nt].name+"="+D(M(ot[nt].value),"double",i);return rt+=">",e.childNodes&&e.childNodes.length&&(rt+="..."),rt+"</"+S.call(String(e.nodeName))+">"}if(F(e)){if(0===e.length)return"[]";var st=Z(e,U);return N&&!function(t){for(var e=0;e<t.length;e++)if(H(t[e],"\n")>=0)return!1;return!0}(st)?"["+Y(st,N)+"]":"[ "+x.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||A&&"object"==typeof t&&A in t)}(e)){var at=Z(e,U);return"cause"in Error.prototype||!("cause"in e)||k.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+x.call(at,", ")+" }":"{ ["+String(e)+"] "+x.call(w.call("[cause]: "+U(e.cause),at),", ")+" }"}if("object"==typeof e&&u){if($&&"function"==typeof e[$]&&B)return B(e,{depth:R-o});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var it=[];return a.call(e,(function(t,r){it.push(U(r,e,!0)+" => "+U(t,e))})),X("Map",s.call(e),it,N)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{s.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return p.call(e,(function(t){ut.push(U(t,e))})),X("Set",c.call(e),ut,N)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{l.call(t,l)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{return f.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return!("[object Number]"!==W(t)||A&&"object"==typeof t&&A in t)}(e))return J(U(Number(e)));if(function(t){if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}(e))return J(U(C.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||A&&"object"==typeof t&&A in t)}(e))return J(y.call(e));if(function(t){return!("[object String]"!==W(t)||A&&"object"==typeof t&&A in t)}(e))return J(U(String(e)));if(!function(t){return!("[object Date]"!==W(t)||A&&"object"==typeof t&&A in t)}(e)&&!G(e)){var ct=Z(e,U),pt=_?_(e)===Object.prototype:e instanceof Object||e.constructor===Object,lt=e instanceof Object?"":"null prototype",ht=!pt&&A&&Object(e)===e&&A in e?v.call(W(e),8,-1):lt?"Object":"",ft=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ht||lt?"["+x.call(w.call([],ht||[],lt||[]),": ")+"] ":"");return 0===ct.length?ft+"{}":N?ft+"{"+Y(ct,N)+"}":ft+"{ "+x.call(ct,", ")+" }"}return String(e)};var U=Object.prototype.hasOwnProperty||function(t){return t in this};function K(t,e){return U.call(t,e)}function W(t){return d.call(t)}function H(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function V(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return V(v.call(t,0,e.maxStringLength),e)+o}return D(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",e)}function z(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+O.call(e.toString(16))}function J(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function X(t,e,r,o){return t+" ("+e+") {"+(o?Y(r,o):x.call(r,", "))+"}"}function Y(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+x.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=F(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=K(t,n)?e(t[n],t):""}var s,a="function"==typeof q?q(t):[];if(P){s={};for(var i=0;i<a.length;i++)s["$"+a[i]]=a[i]}for(var u in t)K(t,u)&&(r&&String(Number(u))===u&&u<t.length||P&&s["$"+u]instanceof Symbol||(E.call(/[^\w$]/,u)?o.push(e(u,t)+": "+e(t[u],t)):o.push(u+": "+e(t[u],t))));if("function"==typeof q)for(var c=0;c<a.length;c++)k.call(t,a[c])&&o.push("["+e(a[c])+"]: "+e(t[a[c]],t));return o}},5798:t=>{var e=String.prototype.replace,r=/%20/g,o="RFC3986";t.exports={default:o,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:o}},129:(t,e,r)=>{var o=r(8261),n=r(5235),s=r(5798);t.exports={formats:s,parse:n,stringify:o}},5235:(t,e,r)=>{var o=r(2769),n=Object.prototype.hasOwnProperty,s=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},c=function(t,e,r,o){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,i=r.depth>0&&/(\[[^[\]]*])/.exec(s),c=i?s.slice(0,i.index):s,p=[];if(c){if(!r.plainObjects&&n.call(Object.prototype,c)&&!r.allowPrototypes)return;p.push(c)}for(var l=0;r.depth>0&&null!==(i=a.exec(s))&&l<r.depth;){if(l+=1,!r.plainObjects&&n.call(Object.prototype,i[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(i[1])}return i&&p.push("["+s.slice(i.index)+"]"),function(t,e,r,o){for(var n=o?e:u(e,r),s=t.length-1;s>=0;--s){var a,i=t[s];if("[]"===i&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var c="["===i.charAt(0)&&"]"===i.charAt(i.length-1)?i.slice(1,-1):i,p=parseInt(c,10);r.parseArrays||""!==c?!isNaN(p)&&i!==c&&String(p)===c&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(a=[])[p]=n:"__proto__"!==c&&(a[c]=n):a={0:n}}n=a}return n}(p,e,r,o)}};t.exports=function(t,e){var r=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var p="string"==typeof t?function(t,e){var r,c={},p=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,h=p.split(e.delimiter,l),f=-1,y=e.charset;if(e.charsetSentinel)for(r=0;r<h.length;++r)0===h[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[r]?y="utf-8":"utf8=%26%2310003%3B"===h[r]&&(y="iso-8859-1"),f=r,r=h.length);for(r=0;r<h.length;++r)if(r!==f){var d,m,g=h[r],v=g.indexOf("]="),b=-1===v?g.indexOf("="):v+1;-1===b?(d=e.decoder(g,a.decoder,y,"key"),m=e.strictNullHandling?null:""):(d=e.decoder(g.slice(0,b),a.decoder,y,"key"),m=o.maybeMap(u(g.slice(b+1),e),(function(t){return e.decoder(t,a.decoder,y,"value")}))),m&&e.interpretNumericEntities&&"iso-8859-1"===y&&(m=i(m)),g.indexOf("[]=")>-1&&(m=s(m)?[m]:m),n.call(c,d)?c[d]=o.combine(c[d],m):c[d]=m}return c}(t,r):t,l=r.plainObjects?Object.create(null):{},h=Object.keys(p),f=0;f<h.length;++f){var y=h[f],d=c(y,p[y],r,"string"==typeof t);l=o.merge(l,d,r)}return!0===r.allowSparse?l:o.compact(l)}},8261:(t,e,r)=>{var o=r(7478),n=r(2769),s=r(5798),a=Object.prototype.hasOwnProperty,i={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,c=String.prototype.split,p=Array.prototype.push,l=function(t,e){p.apply(t,u(e)?e:[e])},h=Date.prototype.toISOString,f=s.default,y={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:f,formatter:s.formatters[f],indices:!1,serializeDate:function(t){return h.call(t)},skipNulls:!1,strictNullHandling:!1},d={},m=function t(e,r,s,a,i,p,h,f,m,g,v,b,O,S,E,w){for(var x,T=e,R=w,C=0,q=!1;void 0!==(R=R.get(d))&&!q;){var j=R.get(e);if(C+=1,void 0!==j){if(j===C)throw new RangeError("Cyclic object value");q=!0}void 0===R.get(d)&&(C=0)}if("function"==typeof f?T=f(r,T):T instanceof Date?T=v(T):"comma"===s&&u(T)&&(T=n.maybeMap(T,(function(t){return t instanceof Date?v(t):t}))),null===T){if(i)return h&&!S?h(r,y.encoder,E,"key",b):r;T=""}if("string"==typeof(x=T)||"number"==typeof x||"boolean"==typeof x||"symbol"==typeof x||"bigint"==typeof x||n.isBuffer(T)){if(h){var P=S?r:h(r,y.encoder,E,"key",b);if("comma"===s&&S){for(var A=c.call(String(T),","),k="",_=0;_<A.length;++_)k+=(0===_?"":",")+O(h(A[_],y.encoder,E,"value",b));return[O(P)+(a&&u(T)&&1===A.length?"[]":"")+"="+k]}return[O(P)+"="+O(h(T,y.encoder,E,"value",b))]}return[O(r)+"="+O(String(T))]}var I,B=[];if(void 0===T)return B;if("comma"===s&&u(T))I=[{value:T.length>0?T.join(",")||null:void 0}];else if(u(f))I=f;else{var N=Object.keys(T);I=m?N.sort(m):N}for(var $=a&&u(T)&&1===T.length?r+"[]":r,D=0;D<I.length;++D){var M=I[D],F="object"==typeof M&&void 0!==M.value?M.value:T[M];if(!p||null!==F){var G=u(T)?"function"==typeof s?s($,M):$:$+(g?"."+M:"["+M+"]");w.set(e,C);var L=o();L.set(d,w),l(B,t(F,G,s,a,i,p,h,f,m,g,v,b,O,S,E,L))}}return B};t.exports=function(t,e){var r,n=t,c=function(t){if(!t)return y;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||y.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=s.default;if(void 0!==t.format){if(!a.call(s.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=s.formatters[r],n=y.filter;return("function"==typeof t.filter||u(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:y.addQueryPrefix,allowDots:void 0===t.allowDots?y.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:y.charsetSentinel,delimiter:void 0===t.delimiter?y.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:y.encode,encoder:"function"==typeof t.encoder?t.encoder:y.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:y.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:y.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:y.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:y.strictNullHandling}}(e);"function"==typeof c.filter?n=(0,c.filter)("",n):u(c.filter)&&(r=c.filter);var p,h=[];if("object"!=typeof n||null===n)return"";p=e&&e.arrayFormat in i?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var f=i[p];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d="comma"===f&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),c.sort&&r.sort(c.sort);for(var g=o(),v=0;v<r.length;++v){var b=r[v];c.skipNulls&&null===n[b]||l(h,m(n[b],b,f,d,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var O=h.join(c.delimiter),S=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),O.length>0?S+O:""}},2769:(t,e,r)=>{var o=r(5798),n=Object.prototype.hasOwnProperty,s=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),i=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r};t.exports={arrayToObject:i,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],a=n.obj[n.prop],i=Object.keys(a),u=0;u<i.length;++u){var c=i[u],p=a[c];"object"==typeof p&&null!==p&&-1===r.indexOf(p)&&(e.push({obj:a,prop:c}),r.push(p))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(s(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,r,n,s){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var u="",c=0;c<i.length;++c){var p=i.charCodeAt(c);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===o.RFC1738&&(40===p||41===p)?u+=i.charAt(c):p<128?u+=a[p]:p<2048?u+=a[192|p>>6]+a[128|63&p]:p<55296||p>=57344?u+=a[224|p>>12]+a[128|p>>6&63]+a[128|63&p]:(c+=1,p=65536+((1023&p)<<10|1023&i.charCodeAt(c)),u+=a[240|p>>18]+a[128|p>>12&63]+a[128|p>>6&63]+a[128|63&p])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(s(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(s(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var a=e;return s(e)&&!s(r)&&(a=i(e,o)),s(e)&&s(r)?(r.forEach((function(r,s){if(n.call(e,s)){var a=e[s];a&&"object"==typeof a&&r&&"object"==typeof r?e[s]=t(a,r,o):e.push(r)}else e[s]=r})),e):Object.keys(r).reduce((function(e,s){var a=r[s];return n.call(e,s)?e[s]=t(e[s],a,o):e[s]=a,e}),a)}}},7478:(t,e,r)=>{var o=r(210),n=r(1924),s=r(631),a=o("%TypeError%"),i=o("%WeakMap%",!0),u=o("%Map%",!0),c=n("WeakMap.prototype.get",!0),p=n("WeakMap.prototype.set",!0),l=n("WeakMap.prototype.has",!0),h=n("Map.prototype.get",!0),f=n("Map.prototype.set",!0),y=n("Map.prototype.has",!0),d=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new a("Side channel does not contain "+s(t))},get:function(o){if(i&&o&&("object"==typeof o||"function"==typeof o)){if(t)return c(t,o)}else if(u){if(e)return h(e,o)}else if(r)return function(t,e){var r=d(t,e);return r&&r.value}(r,o)},has:function(o){if(i&&o&&("object"==typeof o||"function"==typeof o)){if(t)return l(t,o)}else if(u){if(e)return y(e,o)}else if(r)return function(t,e){return!!d(t,e)}(r,o);return!1},set:function(o,n){i&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new i),p(t,o,n)):u?(e||(e=new u),f(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=d(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o}},3692:t=>{function e(t){return Object.prototype.toString.call(t)}var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)}var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},s=Object.prototype.hasOwnProperty||function(t,e){return e in t};function a(t){if("object"==typeof t&&null!==t){var s;if(r(t))s=[];else if("[object Date]"===e(t))s=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))s=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))s={message:t.message};else if(function(t){return"[object Boolean]"===e(t)}(t)||function(t){return"[object Number]"===e(t)}(t)||function(t){return"[object String]"===e(t)}(t))s=Object(t);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)s={};else{var a=t.constructor&&t.constructor.prototype||t.__proto__||{},i=function(){};i.prototype=a,s=new i}return o(n(t),(function(e){s[e]=t[e]})),s}return t}function i(t,e,i){var u=[],c=[],p=!0;return function t(l){var h=i?a(l):l,f={},y=!0,d={node:h,node_:l,path:[].concat(u),parent:c[c.length-1],parents:c,key:u[u.length-1],isRoot:0===u.length,level:u.length,circular:null,update:function(t,e){d.isRoot||(d.parent.node[d.key]=t),d.node=t,e&&(y=!1)},delete:function(t){delete d.parent.node[d.key],t&&(y=!1)},remove:function(t){r(d.parent.node)?d.parent.node.splice(d.key,1):delete d.parent.node[d.key],t&&(y=!1)},keys:null,before:function(t){f.before=t},after:function(t){f.after=t},pre:function(t){f.pre=t},post:function(t){f.post=t},stop:function(){p=!1},block:function(){y=!1}};if(!p)return d;function m(){if("object"==typeof d.node&&null!==d.node){d.keys&&d.node_===d.node||(d.keys=n(d.node)),d.isLeaf=0===d.keys.length;for(var t=0;t<c.length;t++)if(c[t].node_===l){d.circular=c[t];break}}else d.isLeaf=!0,d.keys=null;d.notLeaf=!d.isLeaf,d.notRoot=!d.isRoot}m();var g=e.call(d,d.node);return void 0!==g&&d.update&&d.update(g),f.before&&f.before.call(d,d.node),y?("object"!=typeof d.node||null===d.node||d.circular||(c.push(d),m(),o(d.keys,(function(e,r){u.push(e),f.pre&&f.pre.call(d,d.node[e],e);var o=t(d.node[e]);i&&s.call(d.node,e)&&(d.node[e]=o.node),o.isLast=r===d.keys.length-1,o.isFirst=0===r,f.post&&f.post.call(d,o),u.pop()})),c.pop()),f.after&&f.after.call(d,d.node),d):d}(t).node}function u(t){this.value=t}function c(t){return new u(t)}u.prototype.get=function(t){for(var e=this.value,r=0;r<t.length;r++){var o=t[r];if(!e||!s.call(e,o))return;e=e[o]}return e},u.prototype.has=function(t){for(var e=this.value,r=0;r<t.length;r++){var o=t[r];if(!e||!s.call(e,o))return!1;e=e[o]}return!0},u.prototype.set=function(t,e){for(var r=this.value,o=0;o<t.length-1;o++){var n=t[o];s.call(r,n)||(r[n]={}),r=r[n]}return r[t[o]]=e,e},u.prototype.map=function(t){return i(this.value,t,!0)},u.prototype.forEach=function(t){return this.value=i(this.value,t,!1),this.value},u.prototype.reduce=function(t,e){var r=1===arguments.length,o=r?this.value:e;return this.forEach((function(e){this.isRoot&&r||(o=t.call(this,o,e))})),o},u.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},u.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},u.prototype.clone=function(){var t=[],e=[];return function r(s){for(var i=0;i<t.length;i++)if(t[i]===s)return e[i];if("object"==typeof s&&null!==s){var u=a(s);return t.push(s),e.push(u),o(n(s),(function(t){u[t]=r(s[t])})),t.pop(),e.pop(),u}return s}(this.value)},o(n(u.prototype),(function(t){c[t]=function(e){var r=[].slice.call(arguments,1),o=new u(e);return o[t].apply(o,r)}})),t.exports=c},4654:()=>{}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={id:o,loaded:!1,exports:{}};return t[o](s,s.exports,r),s.loaded=!0,s.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var o={};(()=>{r.d(o,{A9:()=>M,M_:()=>I,Mq:()=>S,h4:()=>T,Eh:()=>f,eJ:()=>P,yp:()=>g,hw:()=>h,Xp:()=>l,dI:()=>O,gO:()=>n,Vl:()=>s,kD:()=>a,KD:()=>m,Jy:()=>d,s9:()=>y,iS:()=>b});var t=r(4530),e=r.n(t);function n(t,e){if(!e||0===t)return 0;const r=e.delayMs*2**(t-1);if(e.jitter){const e=r*(1+1/(t+1));return Math.floor(Math.random()*e)}return r}function s(t){let e="";if("string"!=typeof t)throw new S("The [input] parameter must be a string");if(e=t.trim().toLowerCase(),e=e.replace(/ {2,}/g,""),e=e.replace(/&/g,"and"),e=e.replace(/[ _]/g,"-"),e=e.replace(/[^0-9a-z-]+/g,""),e=e.replace(/-{2,}/g,"-"),e.length&&"-"===e[0]&&(e=e.slice(1)),e.length&&"-"===e[e.length-1]&&(e=e.slice(0,-1)),e.length<2)throw new S(`Formatted key did not meet minimum length of 2 characters: ${e}`);if(e.length>256)throw new S(`Formatted key exceeds the maximum length of 256 characters: ${e}`);return e}function a(t){if(t?.attributes?.length){const e=t.attributes?.find((e=>e.name===t.name));if(e)return e.value}return null}var i=r(3465),u=r.n(i),c=r(3692),p=r.n(c);const l=["password","refresh_token"],h=["authorization"],f="********";function y(t){return m(t,l)}function d(t){return m(t,h)}function m(t,e,r=f){if("object"==typeof t){const o=u()(t);return p()(o).forEach((function(){e.includes(this.key?.toLowerCase()??"")&&this.update(r)})),o}return t}var g,v=r(8842);async function b(t){const e=t?.maxRetries||3,r=t?.delayMs||100,o=!!t?.jitter;for(let s=1;s<=e;s++){if(s>1){const t=n(s-1,{delayMs:r,maxRetries:e,jitter:o});await new Promise((e=>setTimeout(e,t)))}try{return await t.executeFn(s)}catch(t){if(!t.isCommercetoolsError||t.status!==v.Status.Conflict||s===e)throw t}}}function O(t){let e="@gradientedge/commercetools-utils";return t&&(e=`${e} (${t})`),e}class S extends Error{constructor(t,e,r){super(t),this.isCommercetoolsError=!0,this.data=e,this.status=r,Object.setPrototypeOf(this,S.prototype)}static fromAxiosError(t){return new S(t.message,{code:t.code,request:{url:t.config?.url,method:t.config?.method,headers:d(t.config?.headers),params:y(t.config?.params),data:y(this.parseRequestData(t.config))},response:{status:t.response?.status,data:y(t.response?.data),headers:t.response?.headers}},t.response?.status)}static parseRequestData(t){let e=t?.data;if("string"==typeof e&&e){let r="";if("string"==typeof t?.headers?.["Content-Type"]&&(r=t?.headers?.["Content-Type"]),"application/json"===r.substring(0,16))try{e=JSON.parse(t.data)}catch(t){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{const r=new URLSearchParams(t.data),o={};r.forEach(((t,e,r)=>{const n=r.getAll(e);0===n.length?o[e]="":1===n.length?o[e]=n[0]:o[e]=n})),e=o}catch(t){}}return e}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return e()(this.toJSON())}}!function(t){t.NORTH_AMERICA_GCP="north_america_gcp",t.NORTH_AMERICA_AWS="north_america_aws",t.EUROPE_GCP="europe_gcp",t.EUROPE_AWS="europe_aws",t.AUSTRALIA_GCP="australia_gcp"}(g||(g={}));const E={[g.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[g.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[g.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[g.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[g.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},w=["anonymous_id","customer_id"];function x(t,e){return t?t.map((t=>`${t}:${e}`)).join(" "):""}class T{constructor(t){var e;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=t.access_token,this.expiresIn=t.expires_in,this.scopes=(e=t.scope)?e.split(" ").map((t=>t.split(":")[0])).filter((t=>!w.includes(t))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",t.scope),this.customerId=this.extractKeyFromScope("customer_id",t.scope),this.expiresAt=new Date((new Date).getTime()+1e3*t.expires_in),"refresh_token"in t&&t.refresh_token&&(this.refreshToken=t.refresh_token)}expiresWithin(t){const e=(new Date).getTime()+1e3*t;return this.expiresAt.getTime()<e}extractKeyFromScope(t,e){if(!e||!t)return;const r=e?.split(" ");if(!Array.isArray(r)||0===r.length)return;const o=r.find((e=>e.slice(0,t.length+1)===`${t}:`));return o?o.slice(t.length+1):void 0}}var R;!function(t){t.CLIENT_CREDENTIALS="client_credentials",t.REFRESH_TOKEN="refresh_token",t.PASSWORD="password"}(R||(R={}));var C=r(9669),q=r.n(C);const j=5e3,P=500;function A(t,e){t.interceptors.response.use((t=>(e({request:{url:t.config?.url??"",method:t.config?.method,params:t.config?.params,headers:t.request?.headers,data:t.config?.data},response:{status:t.status,headers:t.headers,data:t.data}}),t)),(t=>(e({request:{url:t.config?.url??"",method:t.config?.method,params:t.config?.params,headers:t.request?.headers,data:t.config?.data},response:{code:t.code,message:t.response?.status?void 0:t.message,status:t.response?.status,headers:t.response?.headers,data:t.response?.data}}),Promise.reject(t))))}class k{constructor(t){this.config=t,this.endpoints=E[this.config.region],this.userAgent=O(this.config.systemIdentifier),this.axios=this.createAxiosInstance({logFn:t.logFn})}createAxiosInstance(t){const e=q().create({timeout:this.config.timeoutMs||j,httpsAgent:void 0});return t?.logFn&&A(e,t.logFn),e}async getClientGrant(t){return this.post("/token",{grant_type:R.CLIENT_CREDENTIALS,scope:x(t,this.config.projectKey)})}async refreshGrant(t){return await this.post("/token",{grant_type:R.REFRESH_TOKEN,refresh_token:t})}async login(t){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",t.storeKey)}`,{username:t.username,password:t.password,grant_type:R.PASSWORD,scope:x(t.scopes,this.config.projectKey)})}async revokeToken(t){await this.post("/token/revoke",{token:t.tokenValue,token_type_hint:t.tokenType})}async logout(t){const e=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:t.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:t.refreshToken})])).reduce(((t,e)=>("rejected"===e.status&&t.push(e.reason),t)),[]);if(e.length)throw new S("Logout failed in one or more calls to the token revocation endpoint",e)}async getAnonymousGrant(t){const e={grant_type:R.CLIENT_CREDENTIALS};return t?.scopes?.length&&(e.scope=x(t.scopes,this.config.projectKey)),t?.anonymousId&&(e.anonymous_id=t.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,e)}async post(t,e){const r={url:`${this.endpoints.auth}/oauth${t}`,method:"POST",data:new URLSearchParams(e).toString()},o={Authorization:`Basic ${n=this.config.clientId,s=this.config.clientSecret,btoa(`${n}:${s}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var n,s;try{return(await this.axios({...r,headers:o,timeout:this.config.timeoutMs||j})).data}catch(t){if(t.isAxiosError)throw S.fromAxiosError(t);throw t}}applyStore(t,e){return"string"==typeof e&&""!==e?`/in-store/key=${e}${t}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${t}`:t}}const _={refreshIfWithinSecs:1800,timeoutMs:5e3};class I{constructor(t){if(this.grantPromise=null,this.config={..._,...t},!this.config.clientScopes.length)throw new S("`config.clientScopes` must contain at least one scope");this.api=new k(t)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((t=>(this.grant=new T(t),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(t){const e=await this.api.refreshGrant(t);return new T({...e,refresh_token:t})}async login(t){const e=t.scopes||this.config.customerScopes;if(!e)throw new S("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.login({...t,scopes:e});return new T(r)}async getAnonymousGrant(t){const e=t?.scopes||this.config.customerScopes,r=t?.anonymousId;if(!e)throw new S("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.getAnonymousGrant({scopes:e,anonymousId:r});return new T(o)}async logout(t){await this.api.logout(t)}async revokeToken(t){await this.api.revokeToken(t)}}var B=r(129),N=r.n(B);const $={maxRetries:0,delayMs:0},D=[v.Status.InternalServerError,v.Status.NotImplemented,v.Status.BadGateway,v.Status.ServiceUnavailable,v.Status.GatewayTimeout];class M{constructor(t){M.validateConfig(t),this.config=t,this.auth=new I(t),this.endpoints=E[this.config.region],this.userAgent=O(this.config.systemIdentifier),this.axios=this.createAxiosInstance({logFn:t.logFn}),this.retry=t.retry||$}createAxiosInstance(t){const e=q().create({timeout:this.config.timeoutMs||j,paramsSerializer:function(t){return N().stringify(t,{arrayFormat:"repeat"})},httpsAgent:void 0});return t?.logFn&&A(e,t.logFn),e}getStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"GET"})}getStoreByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/key=${t.key}`,method:"GET"})}queryStores(t){return this.request({...this.extractCommonRequestOptions(t),path:"/stores",method:"GET"})}createStore(t){return this.request({path:"/stores",method:"POST",data:t.data})}updateStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"POST",data:t.data})}updateStoreByKey(t){return this.request({path:`/stores/key=${t.key}`,method:"POST",data:t.data})}deleteStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteStoreByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}getCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"GET"})}getCategoryByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"GET"})}queryChannels(t){return this.request({...this.extractCommonRequestOptions(t),path:"/channels",method:"GET"})}async importOrder(t){return this.request({...this.extractCommonRequestOptions(t),path:"/orders/import",method:"POST",data:t.data})}getChannelById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/channels/${t.id}`,method:"GET"})}async getChannelByKey(t){const e=await this.request({...this.extractCommonRequestOptions(t),path:"/channels",method:"GET",params:{where:`key="${t.key}"`,limit:1}});if(!e?.count)throw new S(`No channel found with key [${t.key}]`,null,404);return e.results[0]}getCategory(t){if(!t.id&&!t.key)throw new S("Either an id, key or slug must be provided");return t.id?this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"GET"}):this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"GET"})}async getCategoryBySlug(t){if(!t.languageCode&&!t.languageCodes)throw new S("Either the `languageCode` or `languageCodes` property must be provided");const e=[];t.languageCodes?e.push(...t.languageCodes):t.languageCode&&e.push(t.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,where:`slug(${e.map((e=>`${e}="${t.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!r.count)throw new S(`No category found with slug [${t.slug}] and language code [${t.languageCode}]`,{options:t},404);return r.results[0]}queryCategories(t){return this.request({...this.extractCommonRequestOptions(t),path:"/categories",method:"GET"})}async getCategoryParents(t){const e=await this.getCategory({...t,params:{...t.params,expand:"ancestors[*]"}}),r=e.ancestors.map((t=>t.obj));return r.push({...e,ancestors:e.ancestors.map((t=>({id:t.id,typeId:t.typeId})))}),r}getProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"GET"})}getProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"GET"})}getProductProjectionById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-projections/${t.id}`,t.storeKey),method:"GET"})}getProductProjectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-projections/key=${t.key}`,t.storeKey),method:"GET"})}async getProductProjectionBySlug(t){if(!t.languageCode&&!t.languageCodes)throw new S("Either the `languageCode` or `languageCodes` property must be provided");const e=[];t.languageCodes?e.push(...t.languageCodes):t.languageCode&&e.push(t.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,where:`slug(${e.map((e=>`${e}="${t.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!r.count)throw new S(`No product projection found with slug [${t.slug}] and language code [${t.languageCode}]`,{options:t},404);return r.results[0]}queryProductProjections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-projections",method:"GET"})}searchProductProjections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-projections/search",method:"GET"})}getProductSelectionById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-selections/${t.id}`,t.storeKey),method:"GET"})}getProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-selections/key=${t.key}`,t.storeKey),method:"GET"})}queryProductSelections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-selections",method:"GET"})}createProductSelection(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-selections",method:"POST",data:t.data})}updateProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-selections/key=${t.key}`,method:"POST",data:{version:t.version,actions:t.actions}})}deleteProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-selections/key=${t.key}&version=${t.version}`,method:"DELETE"})}queryProductsInStore(t){return this.request({...this.extractCommonRequestOptions(t),path:`/in-store/key=${t.storeKey}/product-selection-assignments`,method:"GET"})}getCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"GET"})}async queryCarts(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/carts",t?.storeKey),method:"GET"})}async queryMyCarts(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/carts",t.storeKey),method:"GET",accessToken:t.accessToken})}async createCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/carts",t.storeKey),method:"POST",data:t.data})}async updateCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"POST",data:{version:t.version,actions:t.actions}})}async getMyActiveCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/active-cart",t.storeKey),method:"GET",accessToken:t.accessToken})}async getMyCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${t.cartId}`,t.storeKey),method:"GET",accessToken:t.accessToken})}async createMyCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/carts",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}async deleteMyActiveCart(t){const e=await this.getMyActiveCart(t);return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${e.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:e.version},accessToken:t.accessToken})}async deleteMyCartById(t){const e=await this.getMyCartById(t);return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${t.cartId}`,t.storeKey),method:"DELETE",params:{...t.params,version:e.version},accessToken:t.accessToken})}async updateMyActiveCart(t){const e=await this.getMyActiveCart(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${e.id}`,t.storeKey),method:"POST",data:{version:e.version,actions:t.actions},accessToken:t.accessToken})}async createMyOrderFromActiveCart(t){const e=await this.getMyActiveCart(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id},accessToken:t.accessToken})}async createOrderFromCart(t){const e=await this.getCartById(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id}})}async deleteCartById(t){return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version}})}createPayment(t){return this.request({...this.extractCommonRequestOptions(t),path:"/payments",method:"POST",data:t.data})}deletePaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}updatePaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"POST",data:t.data})}getPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"GET"})}queryPayments(t){return this.request({...this.extractCommonRequestOptions(t),path:"/payments",method:"GET"})}createMyPayment(t){return this.request({...this.extractCommonRequestOptions(t),path:"/me/payments",method:"POST",data:t.data,accessToken:t.accessToken})}updateMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"POST",data:t.data,accessToken:t.accessToken})}getMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"GET",accessToken:t.accessToken})}queryMyPayments(t){return this.request({...this.extractCommonRequestOptions(t),path:"/me/payments",method:"GET",accessToken:t.accessToken})}deleteMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"DELETE",params:{version:t.version},accessToken:t.accessToken})}getMyOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/orders/${t.id}`,t.storeKey),method:"GET",accessToken:t.accessToken})}queryMyOrders(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/orders",t.storeKey),method:"GET",accessToken:t.accessToken})}updateOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"POST",data:t.data})}updateOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNumber}`,t.storeKey),method:"POST",data:t.data})}getOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"GET"})}getOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNumber}`,t.storeKey),method:"GET"})}deleteOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}deleteOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNo}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}queryOrders(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/orders",t.storeKey),method:"GET"})}createProduct(t){return this.request({...this.extractCommonRequestOptions(t),path:"/products",method:"POST",data:t.data})}updateProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"POST",data:t.data})}updateProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"POST",data:t.data})}async deleteProductById(t){let e=t.version;return t.unpublish&&(e=(await this.unpublishProductById({id:t.id,version:t.version})).version),this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"DELETE",params:{...t.params,version:e}})}async deleteProductByKey(t){let e=t.version;return t.unpublish&&(e=(await this.unpublishProductByKey({key:t.key,version:t.version})).version),this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"DELETE",params:{...t.params,version:e}})}unpublishProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}})}unpublishProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}})}createCategory(t){return this.request({path:"/categories",method:"POST",data:t.data})}updateCategoryByKey(t){return this.request({path:`/categories/key=${t.key}`,method:"POST",data:t.data})}updateCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"POST",data:t.data})}deleteCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteCategoryByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}createAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers",t.storeKey),method:"POST",data:t.data})}deleteCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}deleteCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/key=${t.key}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}createMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/signup",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}loginMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/login",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}login(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/login",t.storeKey),method:"POST",data:t.data})}getMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me",t.storeKey),method:"GET",accessToken:t.accessToken})}updateMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}changeMyPassword(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/password",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}resetMyPassword(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/password/reset",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}getPasswordResetToken(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers/password-token",t.storeKey),method:"POST",data:t.data})}getCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/${t.id}`,t.storeKey),method:"GET"})}getCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/key=${t.key}`,t.storeKey),method:"GET"})}getCustomerByPasswordToken(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/password-token=${t.token}`,t.storeKey),method:"GET"})}queryCustomers(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers",t.storeKey),method:"GET"})}updateCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customers/${t.id}`,method:"POST",data:t.data})}updateCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customers/key=${t.key}`,method:"POST",data:t.data})}getProductTypeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-types/${t.id}`,method:"GET"})}getProductTypeByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-types/key=${t.key}`,method:"GET"})}queryProductTypes(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-types",method:"GET"})}getTypeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/types/${t.id}`,method:"GET"})}getTypeByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/types/key=${t.key}`,method:"GET"})}queryTypes(t){return this.request({...this.extractCommonRequestOptions(t),path:"/types",method:"GET"})}getDiscountCodeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/discount-codes/${t.id}`,method:"GET"})}getCartDiscountById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/cart-discounts/${t.id}`,method:"GET"})}getCartDiscountByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/cart-discounts/key=${t.key}`,method:"GET"})}queryCartDiscounts(t){return this.request({...this.extractCommonRequestOptions(t),path:"/cart-discounts",method:"GET"})}getCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.container}/${t.key}`,method:"GET"})}getCustomObjectById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.id}`,method:"GET"})}saveCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:"/custom-objects",method:"POST",data:t.data})}deleteCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.container}/${t.key}`,method:"DELETE"})}getShippingMethodById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/shipping-methods/${t.id}`,method:"GET"})}getShippingMethodByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/shipping-methods/key=${t.key}`,method:"GET"})}getShippingMethodsForLocation(t){return this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,country:t.country,state:t.state,currency:t.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:t.accessToken})}getShippingMethodsForCart(t){return this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,cartId:t.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:t.accessToken})}queryShippingMethods(t){return this.request({...this.extractCommonRequestOptions(t),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"GET"})}getCustomerGroupByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/key=${t.key}`,method:"GET"})}queryCustomerGroups(t){return this.request({...this.extractCommonRequestOptions(t),path:"/customer-groups",method:"GET"})}createCustomerGroup(t){return this.request({path:"/customer-groups",method:"POST",data:t.data})}updateCustomerGroupByKey(t){return this.request({path:`/customer-groups/key=${t.key}`,method:"POST",data:t.data})}updateCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"POST",data:t.data})}deleteCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteCustomerGroupByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}getStateById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/states/${t.id}`,method:"GET"})}getStateByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/states/key=${t.key}`,method:"GET"})}queryStates(t){return this.request({...this.extractCommonRequestOptions(t),path:"/states",method:"GET"})}getStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"GET"})}getStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"GET"})}queryStandalonePrices(t){return this.request({...this.extractCommonRequestOptions(t),path:"/standalone-prices",method:"GET"})}createStandalonePrice(t){return this.request({...this.extractCommonRequestOptions(t),path:"/standalone-prices",method:"POST",data:t.data})}updateStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"POST",data:t.data})}updateStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"POST",data:t.data})}deleteStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}graphql(t){return this.request({...this.extractCommonRequestOptions(t),path:"/graphql",method:"POST",data:t.data,accessToken:t.accessToken})}async request(t){const e=await this.getRequestOptions(t),r=this.getRetryConfig(t.retry);let o,s=0;do{if(s>0){e.headers["X-Retry-Count"]=s;const t=n(s,r);await new Promise((e=>setTimeout(e,t)))}try{return(await this.axios(e)).data}catch(t){if(!this.isRetryableError(t))throw this.transformError(t);o=t}s++}while(s<=r.maxRetries);throw this.transformError(o)}getRetryConfig(t){return t||this.retry}async getRequestOptions(t){let e=t.accessToken;const r=`${this.endpoints.api}/${this.config.projectKey}${t.path}`,o={...t};o.path&&delete o.path,o.accessToken&&delete o.accessToken,e||(e=(await this.auth.getClientGrant()).accessToken);const n={...this.axios.defaults.headers,Authorization:`Bearer ${e}`,...o.headers};return"string"==typeof t.correlationId&&""!==t.correlationId&&(n["X-Correlation-ID"]=t.correlationId,delete t.correlationId),{...o,url:r,headers:n}}isRetryableError(t){return!t.isAxiosError||!t.request||!t.response||D.includes(t.response.status)}extractCommonRequestOptions(t){return t?{correlationId:t.correlationId,params:t.params,retry:t.retry}:{}}applyStore(t,e){return"string"==typeof e&&""!==e?`/in-store/key=${e}${t}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${t}`:t}transformError(t){return t.isAxiosError?S.fromAxiosError(t):t}static validateConfig(t){const e=[];if(t?(t.projectKey?"string"!=typeof t.projectKey&&e.push("The `projectKey` property must be a string"):e.push("The `projectKey` property is empty"),t.clientId?"string"!=typeof t.clientId&&e.push("The `clientId` property must be a string"):e.push("The `clientId` property is empty"),t.clientSecret?"string"!=typeof t.clientSecret&&e.push("The `clientSecret` property must be a string"):e.push("The `clientSecret` property is empty"),Array.isArray(t.clientScopes)?0===t.clientScopes.length&&e.push("The `clientScopes` property must have at least 1 scope defined"):e.push("The `clientScopes` property must be an array")):e.push("The config object missing or empty"),e.length)throw new S("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+e.map((t=>`• ${t}`)).join("\n"))}}})();var n=o.A9,s=o.M_,a=o.Mq,i=o.h4,u=o.Eh,c=o.eJ,p=o.yp,l=o.hw,h=o.Xp,f=o.dI,y=o.gO,d=o.Vl,m=o.kD,g=o.KD,v=o.Jy,b=o.s9,O=o.iS;export{n as CommercetoolsApi,s as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,u as DEFAULT_MASKING_STRING,c as MAX_ITEMS_PER_QUERY,p as Region,l as SENSITIVE_HEADER_NAMES,h as SENSITIVE_PROPERTY_NAMES,f as buildUserAgent,y as calculateDelay,d as formatAsKey,m as getAttributeValue,g as maskSensitiveData,v as maskSensitiveHeaders,b as maskSensitiveInput,O as retryOnConflict};
1
+ var e={8842:(e,t,r)=>{t.Status=void 0;var o=r(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return o.Status}});r(7890)},7890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const o=r(7536);t.reason=function(e){switch(e){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(o.Status).find((t=>o.Status[t]===e))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Status=t.ErrorStatus=t.RedirectionStatus=t.SuccessStatus=t.InformationStatus=void 0,t.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},t.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},t.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},t.ErrorStatus={BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RequestedRangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511},t.Status=Object.assign(Object.assign(Object.assign(Object.assign({},t.InformationStatus),t.SuccessStatus),t.RedirectionStatus),t.ErrorStatus)},4530:(e,t)=>{function r(e,t){var r=[],o=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]"}),function(s,n){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,s):o.push(s),~r.indexOf(n)&&(n=t.call(this,s,n))}else r.push(n);return null==e?n:e.call(this,s,n)}}(e.exports=function(e,t,o,s){return JSON.stringify(e,r(t,s),o)}).getSerialize=r},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)}var s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},n=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var n;if(r(e))n=[];else if("[object Date]"===t(e))n=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))n=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))n={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))n=Object(e);else if(Object.create&&Object.getPrototypeOf)n=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)n={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,n=new i}return o(s(e),(function(t){n[t]=e[t]})),n}return e}function i(e,t,i){var c=[],u=[],h=!0;return function e(p){var d=i?a(p):p,l={},m=!0,f={node:d,node_:p,path:[].concat(c),parent:u[u.length-1],parents:u,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(m=!1)},delete:function(e){delete f.parent.node[f.key],e&&(m=!1)},remove:function(e){r(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(m=!1)},keys:null,before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){h=!1},block:function(){m=!1}};if(!h)return f;function y(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=s(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===p){f.circular=u[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}y();var g=t.call(f,f.node);return void 0!==g&&f.update&&f.update(g),l.before&&l.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(u.push(f),y(),o(f.keys,(function(t,r){c.push(t),l.pre&&l.pre.call(f,f.node[t],t);var o=e(f.node[t]);i&&n.call(f.node,t)&&(f.node[t]=o.node),o.isLast=r===f.keys.length-1,o.isFirst=0===r,l.post&&l.post.call(f,o),c.pop()})),u.pop()),l.after&&l.after.call(f,f.node),f):f}(e).node}function c(e){this.value=e}function u(e){return new c(e)}c.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return;t=t[o]}return t},c.prototype.has=function(e){for(var t=this.value,r=0;r<e.length;r++){var o=e[r];if(!t||!n.call(t,o))return!1;t=t[o]}return!0},c.prototype.set=function(e,t){for(var r=this.value,o=0;o<e.length-1;o++){var s=e[o];n.call(r,s)||(r[s]={}),r=r[s]}return r[e[o]]=t,t},c.prototype.map=function(e){return i(this.value,e,!0)},c.prototype.forEach=function(e){return this.value=i(this.value,e,!1),this.value},c.prototype.reduce=function(e,t){var r=1===arguments.length,o=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(o=e.call(this,o,t))})),o},c.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},c.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},c.prototype.clone=function(){var e=[],t=[];return function r(n){for(var i=0;i<e.length;i++)if(e[i]===n)return t[i];if("object"==typeof n&&null!==n){var c=a(n);return e.push(n),t.push(c),o(s(n),(function(e){c[e]=r(n[e])})),e.pop(),t.pop(),c}return n}(this.value)},o(s(c.prototype),(function(e){u[e]=function(t){var r=[].slice.call(arguments,1),o=new c(t);return o[e].apply(o,r)}})),e.exports=u}},t={};function r(o){var s=t[o];if(void 0!==s)return s.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};(()=>{r.d(o,{A9:()=>_t,M_:()=>It,Mq:()=>qt,h4:()=>xt,Eh:()=>yt,eJ:()=>ot,yp:()=>Ct,hw:()=>ft,Xp:()=>mt,dI:()=>Tt,gO:()=>it,qX:()=>et,jF:()=>tt,as:()=>at,cY:()=>Ze,Vl:()=>ct,kD:()=>ut,KD:()=>Et,Jy:()=>Ot,s9:()=>gt,iS:()=>St});var e=r(4530),t=r.n(e);function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=n.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,d=h("undefined"),l=u("ArrayBuffer"),m=h("string"),f=h("function"),y=h("number"),g=e=>null!==e&&"object"==typeof e,O=e=>{if("object"!==i(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=u("Date"),S=u("File"),T=u("Blob"),q=u("FileList"),C=u("URLSearchParams");function R(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let o,s;if("object"!=typeof e&&(e=[e]),p(e))for(o=0,s=e.length;o<s;o++)t.call(null,e[o],o,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),n=s.length;let a;for(o=0;o<n;o++)a=s[o],t.call(null,e[a],a,e)}}function w(e,t){t=t.toLowerCase();const r=Object.keys(e);let o,s=r.length;for(;s-- >0;)if(o=r[s],t===o.toLowerCase())return o;return null}const b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=e=>!d(e)&&e!==b,v=(k="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>k&&e instanceof k);var k;const P=u("HTMLFormElement"),A=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),j=u("RegExp"),B=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),o={};R(r,((r,s)=>{!1!==t(r,s,e)&&(o[s]=r)})),Object.defineProperties(e,o)},I="abcdefghijklmnopqrstuvwxyz",_="0123456789",N={DIGIT:_,ALPHA:I,ALPHA_DIGIT:I+I.toUpperCase()+_},$={isArray:p,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||n.call(e)===t||f(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:m,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:O,isUndefined:d,isDate:E,isFile:S,isBlob:T,isRegExp:j,isFunction:f,isStream:e=>g(e)&&f(e.pipe),isURLSearchParams:C,isTypedArray:v,isFileList:q,forEach:R,merge:function e(){const{caseless:t}=x(this)&&this||{},r={},o=(o,s)=>{const n=t&&w(r,s)||s;O(r[n])&&O(o)?r[n]=e(r[n],o):O(o)?r[n]=e({},o):p(o)?r[n]=o.slice():r[n]=o};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],o);return r},extend:(e,t,r,{allOwnKeys:o}={})=>(R(t,((t,o)=>{r&&f(t)?e[o]=s(t,r):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,o)=>{let s,n,i;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),n=s.length;n-- >0;)i=s[n],o&&!o(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const o=e.indexOf(t,r);return-1!==o&&o===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!y(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const r=o.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const o=[];for(;null!==(r=e.exec(t));)o.push(r);return o},isHTMLForm:P,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:B,freezeMethods:e=>{B(e,((t,r)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const o=e[r];f(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},o=e=>{e.forEach((e=>{r[e]=!0}))};return p(e)?o(e):o(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:w,global:b,isContextDefined:x,ALPHABET:N,generateString:(e=16,t=N.ALPHA_DIGIT)=>{let r="";const{length:o}=t;for(;e--;)r+=t[Math.random()*o|0];return r},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,o)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[o]=e;const s=p(e)?[]:{};return R(e,((e,t)=>{const n=r(e,o+1);!d(n)&&(s[t]=n)})),t[o]=void 0,s}}return e};return r(e,0)}};function D(e,t,r,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s)}$.inherits(D,Error,{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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K=D.prototype,L={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{L[e]={value:e}})),Object.defineProperties(D,L),Object.defineProperty(K,"isAxiosError",{value:!0}),D.from=(e,t,r,o,s,n)=>{const a=Object.create(K);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,r,o,s),a.cause=e,a.name=e.name,n&&Object.assign(a,n),a};const G=D;function M(e){return $.isPlainObject(e)||$.isArray(e)}function U(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function F(e,t,r){return e?e.concat(t).map((function(e,t){return e=U(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)})),z=function(e,t,r){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,s=r.visitor||u,n=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!i&&$.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,s){let i=e;if(e&&!s&&"object"==typeof e)if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(M)}(e)||($.isFileList(e)||$.endsWith(r,"[]"))&&(i=$.toArray(e)))return r=U(r),i.forEach((function(e,o){!$.isUndefined(e)&&null!==e&&t.append(!0===a?F([r],o,n):null===a?r:r+"[]",c(e))})),!1;return!!M(e)||(t.append(F(s,r,n),c(e)),!1)}const h=[],p=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(r,o){if(!$.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+o.join("."));h.push(r),$.forEach(r,(function(r,n){!0===(!($.isUndefined(r)||null===r)&&s.call(t,r,$.isString(n)?n.trim():n,o,p))&&e(r,o?o.concat(n):[n])})),h.pop()}}(e),t};function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&z(e,this,t)}const W=V.prototype;W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const X=V;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,r){if(!t)return e;const o=r&&r.encode||Y,s=r&&r.serialize;let n;if(n=s?s(t,r):$.isURLSearchParams(t)?t.toString():new X(t,r).toString(o),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}const Z=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},re=function(e){function t(e,r,o,s){let n=e[s++];const a=Number.isFinite(+n),i=s>=e.length;return n=!n&&$.isArray(o)?o.length:n,i?($.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!a):(o[n]&&$.isObject(o[n])||(o[n]=[]),t(e,r,o[n],s)&&$.isArray(o[n])&&(o[n]=function(e){const t={},r=Object.keys(e);let o;const s=r.length;let n;for(o=0;o<s;o++)n=r[o],t[n]=e[n];return t}(o[n])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const r={};return $.forEachEntry(e,((e,o)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),o,r,0)})),r}return null},oe={"Content-Type":void 0},se={transitional:ee,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,s=$.isObject(e);if(s&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return o&&o?JSON.stringify(re(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new te.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,o){return te.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=$.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||o?(t.setContentType("application/json",!1),function(e,t,r){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,r=t&&t.forcedJSONParsing,o="json"===this.responseType;if(e&&$.isString(e)&&(r&&!this.responseType||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};$.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),$.forEach(["post","put","patch"],(function(e){se.headers[e]=$.merge(oe)}));const ne=se,ae=$.toObjectSet(["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"]),ie=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function he(e,t,r,o,s){return $.isFunction(o)?o.call(this,t,r):(s&&(t=r),$.isString(t)?$.isString(o)?-1!==t.indexOf(o):$.isRegExp(o)?o.test(t):void 0:void 0)}class pe{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function s(e,t,r){const s=ce(t);if(!s)throw new Error("header name must be a non-empty string");const n=$.findKey(o,s);(!n||void 0===o[n]||!0===r||void 0===r&&!1!==o[n])&&(o[n||t]=ue(e))}const n=(e,t)=>$.forEach(e,((e,r)=>s(e,r,t)));return $.isPlainObject(e)||e instanceof this.constructor?n(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?n((e=>{const t={};let r,o,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),o=e.substring(s+1).trim(),!r||t[r]&&ae[r]||("set-cookie"===r?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)})),t})(e),t):null!=e&&s(t,e,r),this}get(e,t){if(e=ce(e)){const r=$.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}(e);if($.isFunction(t))return t.call(this,e,r);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ce(e)){const r=$.findKey(this,e);return!(!r||void 0===this[r]||t&&!he(0,this[r],r,t))}return!1}delete(e,t){const r=this;let o=!1;function s(e){if(e=ce(e)){const s=$.findKey(r,e);!s||t&&!he(0,r[s],s,t)||(delete r[s],o=!0)}}return $.isArray(e)?e.forEach(s):s(e),o}clear(e){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const s=t[r];e&&!he(0,this[s],s,e,!0)||(delete this[s],o=!0)}return o}normalize(e){const t=this,r={};return $.forEach(this,((o,s)=>{const n=$.findKey(r,s);if(n)return t[n]=ue(o),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(s):String(s).trim();a!==s&&delete t[s],t[a]=ue(o),r[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((r,o)=>{null!=r&&!1!==r&&(t[o]=e&&$.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function o(e){const o=ce(e);t[o]||(function(e,t){const r=$.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+r,{value:function(e,r,s){return this[o].call(this,t,e,r,s)},configurable:!0})}))}(r,e),t[o]=!0)}return $.isArray(e)?e.forEach(o):o(e),this}}pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.freezeMethods(pe.prototype),$.freezeMethods(pe);const de=pe;function le(e,t){const r=this||ne,o=t||r,s=de.from(o.headers);let n=o.data;return $.forEach(e,(function(e){n=e.call(r,n,s.normalize(),t?t.status:void 0)})),s.normalize(),n}function me(e){return!(!e||!e.__CANCEL__)}function fe(e,t,r){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,r),this.name="CanceledError"}$.inherits(fe,G,{__CANCEL__:!0});const ye=fe,ge=te.isStandardBrowserEnv?{write:function(e,t,r,o,s,n){const a=[];a.push(e+"="+encodeURIComponent(t)),$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(o)&&a.push("path="+o),$.isString(s)&&a.push("domain="+s),!0===n&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const 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 Oe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ee=te.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function o(r){let o=r;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=o(window.location.href),function(e){const t=$.isString(e)?o(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Se(e,t){let r=0;const o=function(e,t){e=e||10;const r=new Array(e),o=new Array(e);let s,n=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=o[a];s||(s=c),r[n]=i,o[n]=c;let h=a,p=0;for(;h!==n;)p+=r[h++],h%=e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*p/d):void 0}}(50,250);return s=>{const n=s.loaded,a=s.lengthComputable?s.total:void 0,i=n-r,c=o(i);r=n;const u={loaded:n,total:a,progress:a?n/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&n<=a?(a-n)/c:void 0,event:s};u[t?"download":"upload"]=!0,e(u)}}const Te={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let o=e.data;const s=de.from(e.headers).normalize(),n=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}$.isFormData(o)&&(te.isStandardBrowserEnv||te.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+r))}const u=Oe(e.baseURL,e.url);function h(){if(!c)return;const o=de.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),i()}),(function(e){r(e),i()}),{data:n&&"text"!==n&&"json"!==n?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:o,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(r(new G("Request aborted",G.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const o=e.transitional||ee;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,c)),c=null},te.isStandardBrowserEnv){const t=(e.withCredentials||Ee(u))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===o&&s.setContentType(null),"setRequestHeader"in c&&$.forEach(s.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),n&&"json"!==n&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Se(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Se(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(r(!t||t.type?new ye(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===te.protocols.indexOf(p)?r(new G("Unsupported protocol "+p+":",G.ERR_BAD_REQUEST,e)):c.send(o||null)}))}};$.forEach(Te,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Ce(e){return qe(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let r,o;for(let s=0;s<t&&(r=e[s],!(o=$.isString(r)?Te[r.toLowerCase()]:r));s++);if(!o){if(!1===o)throw new G(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error($.hasOwnProp(Te,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!$.isFunction(o))throw new TypeError("adapter is not a function");return o})(e.adapter||ne.adapter)(e).then((function(t){return qe(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return me(t)||(qe(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Re=e=>e instanceof de?e.toJSON():e;function we(e,t){t=t||{};const r={};function o(e,t,r){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:r},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function s(e,t,r){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e,r):o(e,t,r)}function n(e,t){if(!$.isUndefined(t))return o(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function i(r,s,n){return n in t?o(r,s):n in e?o(void 0,r):void 0}const c={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(e,t)=>s(Re(e),Re(t),!0)};return $.forEach(Object.keys(e).concat(Object.keys(t)),(function(o){const n=c[o]||s,a=n(e[o],t[o],o);$.isUndefined(a)&&n!==i||(r[o]=a)})),r}const be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const xe={};be.transitional=function(e,t,r){function o(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,n)=>{if(!1===e)throw new G(o(s," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!xe[s]&&(xe[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,n)}};const ve={assertOptions:function(e,t,r){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let s=o.length;for(;s-- >0;){const n=o[s],a=t[n];if(a){const t=e[n],r=void 0===t||a(t,n,e);if(!0!==r)throw new G("option "+n+" must be "+r,G.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new G("Unknown option "+n,G.ERR_BAD_OPTION)}},validators:be},ke=ve.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new Z,response:new Z}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:r,paramsSerializer:o,headers:s}=t;let n;void 0!==r&&ve.assertOptions(r,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),void 0!==o&&ve.assertOptions(o,{encode:ke.function,serialize:ke.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),n=s&&$.merge(s.common,s[t.method]),n&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=de.concat(n,s);const a=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let h,p=0;if(!i){const e=[Ce.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),h=e.length,u=Promise.resolve(t);p<h;)u=u.then(e[p++],e[p++]);return u}h=a.length;let d=t;for(p=0;p<h;){const e=a[p++],t=a[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Ce.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,h=c.length;p<h;)u=u.then(c[p++],c[p++]);return u}getUri(e){return Q(Oe((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,r){return this.request(we(r||{},{method:e,url:t,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(r,o,s){return this.request(we(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));const Ae=Pe;class je{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const o=new Promise((e=>{r.subscribe(e),t=e})).then(e);return o.cancel=function(){r.unsubscribe(t)},o},e((function(e,o,s){r.reason||(r.reason=new ye(e,o,s),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new je((function(t){e=t})),cancel:e}}}const Be=je,Ie={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ie).forEach((([e,t])=>{Ie[t]=e}));const _e=Ie,Ne=function e(t){const r=new Ae(t),o=s(Ae.prototype.request,r);return $.extend(o,Ae.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(we(t,r))},o}(ne);Ne.Axios=Ae,Ne.CanceledError=ye,Ne.CancelToken=Be,Ne.isCancel=me,Ne.VERSION="1.3.4",Ne.toFormData=z,Ne.AxiosError=G,Ne.Cancel=Ne.CanceledError,Ne.all=function(e){return Promise.all(e)},Ne.spread=function(e){return function(t){return e.apply(null,t)}},Ne.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},Ne.mergeConfig=we,Ne.AxiosHeaders=de,Ne.formToJSON=e=>re($.isHTMLForm(e)?new FormData(e):e),Ne.HttpStatusCode=_e,Ne.default=Ne;const $e=Ne,{Axios:De,AxiosError:Ke,CanceledError:Le,isCancel:Ge,CancelToken:Me,VERSION:Ue,all:Fe,Cancel:He,isAxiosError:ze,spread:Je,toFormData:Ve,AxiosHeaders:We,HttpStatusCode:Xe,formToJSON:Ye,mergeConfig:Qe}=$e;function Ze(e){let t={};if(e instanceof We){const r=e.toJSON();t={},Object.entries(r).forEach((([e,r])=>{const o=e.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?t[o]=r.toString():Array.isArray(r)&&(t[o]=r.join(", "))}))}return Object.keys(t).length?t:void 0}function et(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:Ze(e.response?.headers),data:e.response?.data},stats:t}:null}function tt(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:e.request?.headers,data:e.config?.data},response:{status:e.status,headers:Ze(e.headers),data:e.data},stats:t}}var rt=r(8842);const ot=500,st={maxRetries:0,delayMs:0},nt=[rt.Status.InternalServerError,rt.Status.NotImplemented,rt.Status.BadGateway,rt.Status.ServiceUnavailable,rt.Status.GatewayTimeout];function at(e){return $e.create({httpsAgent:void 0})}function it(e,t){if(!t||0===e)return 0;const r=t.delayMs*2**(e-1);if(t.jitter){const t=r*(1+1/(e+1));return Math.floor(Math.random()*t)}return r}function ct(e){let t="";if("string"!=typeof e)throw new qt("The [input] parameter must be a string");if(t=e.trim().toLowerCase(),t=t.replace(/ {2,}/g,""),t=t.replace(/&/g,"and"),t=t.replace(/[ _]/g,"-"),t=t.replace(/[^0-9a-z-]+/g,""),t=t.replace(/-{2,}/g,"-"),t.length&&"-"===t[0]&&(t=t.slice(1)),t.length&&"-"===t[t.length-1]&&(t=t.slice(0,-1)),t.length<2)throw new qt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new qt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function ut(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var ht=r(3692),pt=r.n(ht);function dt(e){return lt(e,{})}function lt(e,t){if(t&&e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]&&"object"==typeof e[r]?t[r]=lt(t[r],e[r]):t[r]=e[r]);return t}const mt=["password","refresh_token"],ft=["authorization"],yt="********";function gt(e){return Et(e,mt)}function Ot(e){return Et(e,ft)}function Et(e,t,r=yt){if("object"==typeof e&&null!=e){let o={};return o=dt(e instanceof We?e.toJSON():e),pt()(o).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(r)})),o}return e}async function St(e){const t=e?.maxRetries||3,r=e?.delayMs||100,o=!!e?.jitter;for(let s=1;s<=t;s++){if(s>1){const e=it(s-1,{delayMs:r,maxRetries:t,jitter:o});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(s)}catch(e){if(!e.isCommercetoolsError||e.status!==rt.Status.Conflict||s===t)throw e}}}function Tt(e){let t="@gradientedge/commercetools-utils";return e&&(t=`${t} (${e})`),t}class qt extends Error{constructor(e,t,r){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=r,Object.setPrototypeOf(this,qt.prototype)}static fromAxiosError(e){return new qt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Ot(Ze(e.config?.headers)),params:gt(e.config?.params),data:gt(this.parseRequestData(e.config))},response:{status:e.response?.status,data:gt(e.response?.data),headers:Ze(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let r="";if("string"==typeof e?.headers?.["Content-Type"]&&(r=e?.headers?.["Content-Type"]),"application/json"===r.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{const r=new URLSearchParams(e.data),o={};r.forEach(((e,t,r)=>{const s=r.getAll(t);0===s.length?o[t]="":1===s.length?o[t]=s[0]:o[t]=s})),t=o}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var Ct;!function(e){e.NORTH_AMERICA_GCP="north_america_gcp",e.NORTH_AMERICA_AWS="north_america_aws",e.EUROPE_GCP="europe_gcp",e.EUROPE_AWS="europe_aws",e.AUSTRALIA_GCP="australia_gcp"}(Ct||(Ct={}));const Rt={[Ct.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[Ct.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[Ct.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[Ct.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[Ct.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},wt=["anonymous_id","customer_id"];function bt(e,t){return e?e.map((e=>`${e}:${t}`)).join(" "):""}class xt{constructor(e){var t;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.scopes=(t=e.scope)?t.split(" ").map((e=>e.split(":")[0])).filter((e=>!wt.includes(e))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",e.scope),this.customerId=this.extractKeyFromScope("customer_id",e.scope),this.expiresAt=new Date((new Date).getTime()+1e3*e.expires_in),"refresh_token"in e&&e.refresh_token&&(this.refreshToken=e.refresh_token)}expiresWithin(e){const t=(new Date).getTime()+1e3*e;return this.expiresAt.getTime()<t}extractKeyFromScope(e,t){if(!t||!e)return;const r=t?.split(" ");if(!Array.isArray(r)||0===r.length)return;const o=r.find((t=>t.slice(0,e.length+1)===`${e}:`));return o?o.slice(e.length+1):void 0}}var vt;function kt(e){return!e.isAxiosError||!e.request||!e.response||nt.includes(e.response.status)}function Pt(e){return e.isAxiosError?qt.fromAxiosError(e):e}function At(e){const t=at(e.httpsAgent),r={"User-Agent":Tt(e.systemIdentifier)};return o=>{const s={...r,...o.headers};return async function(e){const{retry:t,onBeforeRequest:r,onAfterResponse:o,axiosInstance:s}=e,n=e.timeoutMs??5e3,a={};let i,c=dt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=Tt());let h,p,d=0;do{if(h=null,p=null,u>0){a["X-Retry-Count"]=`${u}`;const e=it(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(r){const e=await r(c);e&&(c=e)}h=Date.now();const e=await s({...c,headers:{...c.headers,...a},timeout:n});return p=Date.now(),d+=p-h,o&&o(tt(e,{accumulativeDurationMs:d,durationMs:p-h,retries:u})),e.data}catch(e){if(p=Date.now(),d+=h?p-h:0,o){const t=et(e,{accumulativeDurationMs:d,durationMs:h?p-h:0,retries:u});t&&o(t)}if(!kt(e))throw Pt(e);i=e}u++}while(u<=t.maxRetries);throw Pt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...o,headers:s},retry:{...st,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(vt||(vt={}));class jt{constructor(e){this.config=e,this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}async getClientGrant(e){return this.post("/token",{grant_type:vt.CLIENT_CREDENTIALS,scope:bt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:vt.REFRESH_TOKEN,refresh_token:e})}async login(e){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",e.storeKey)}`,{username:e.username,password:e.password,grant_type:vt.PASSWORD,scope:bt(e.scopes,this.config.projectKey)})}async revokeToken(e){await this.post("/token/revoke",{token:e.tokenValue,token_type_hint:e.tokenType})}async logout(e){const t=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:e.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:e.refreshToken})])).reduce(((e,t)=>("rejected"===t.status&&e.push(t.reason),e)),[]);if(t.length)throw new qt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:vt.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=bt(e.scopes,this.config.projectKey)),e?.anonymousId&&(t.anonymous_id=e.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,t)}async post(e,t){return await this.requestExecutor(this.getRequestOptions({path:e,body:t}))}getRequestOptions(e){const t=`${this.endpoints.auth}/oauth${e.path}`;let r;const o={Authorization:`Basic ${s=this.config.clientId,n=this.config.clientSecret,btoa(`${s}:${n}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var s,n;return e.correlationId&&""!==e.correlationId&&(o["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(r=new URLSearchParams(e.body).toString()),{method:"POST",data:r,url:t,headers:o}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}}const Bt={refreshIfWithinSecs:1800,timeoutMs:5e3};class It{constructor(e){if(this.grantPromise=null,this.config={...Bt,...e},!this.config.clientScopes.length)throw new qt("`config.clientScopes` must contain at least one scope");this.api=new jt(e)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((e=>(this.grant=new xt(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new xt({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.login({...e,scopes:t});return new xt(r)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,r=e?.anonymousId;if(!t)throw new qt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.getAnonymousGrant({scopes:t,anonymousId:r});return new xt(o)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class _t{constructor(e){_t.validateConfig(e),this.config=e,this.auth=new It(e),this.endpoints=Rt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"GET"})}queryStores(e){return this.request({...this.extractCommonRequestOptions(e),path:"/stores",method:"GET"})}createStore(e){return this.request({path:"/stores",method:"POST",data:e.data})}updateStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${e.key}`,method:"POST",data:e.data})}deleteStoreById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}queryChannels(e){return this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET"})}async importOrder(e){return this.request({...this.extractCommonRequestOptions(e),path:"/orders/import",method:"POST",data:e.data})}getChannelById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/channels/${e.id}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${e.key}"`,limit:1}});if(!t?.count)throw new qt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new qt("Either an id, key or slug must be provided");return e.id?this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"GET"}):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!r.count)throw new qt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryCategories(e){return this.request({...this.extractCommonRequestOptions(e),path:"/categories",method:"GET"})}async getCategoryParents(e){const t=await this.getCategory({...e,params:{...e.params,expand:"ancestors[*]"}}),r=t.ancestors.map((e=>e.obj));return r.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),r}getProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"GET"})}getProductProjectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${e.id}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${e.key}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new qt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!r.count)throw new qt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return r.results[0]}queryProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections",method:"GET"})}searchProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections/search",method:"GET"})}getProductSelectionById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${e.id}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${e.key}`,e.storeKey),method:"GET"})}queryProductSelections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"GET"})}createProductSelection(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"POST",data:e.data})}updateProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${e.key}&version=${e.version}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${e.storeKey}/product-selection-assignments`,method:"GET"})}getCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"GET"})}async queryCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e?.storeKey),method:"GET"})}async queryMyCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"GET",accessToken:e.accessToken})}async createCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e.storeKey),method:"POST",data:e.data})}async updateCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"POST",data:{version:e.version,actions:e.actions}})}async getMyActiveCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/active-cart",e.storeKey),method:"GET",accessToken:e.accessToken})}async getMyCartById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"GET",accessToken:e.accessToken})}async createMyCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${e.cartId}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async updateMyActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${t.id}`,e.storeKey),method:"POST",data:{version:t.version,actions:e.actions},accessToken:e.accessToken})}async createMyOrderFromActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id},accessToken:e.accessToken})}async createOrderFromCart(e){const t=await this.getCartById(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id}})}async deleteCartById(e){return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version}})}createPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"POST",data:e.data})}deletePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"POST",data:e.data})}getPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/payments/${e.id}`,method:"GET"})}queryPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"GET"})}createMyPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"POST",data:e.data,accessToken:e.accessToken})}updateMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"GET",accessToken:e.accessToken})}queryMyPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"GET",accessToken:e.accessToken})}deleteMyPaymentById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${e.id}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${e.id}`,e.storeKey),method:"GET",accessToken:e.accessToken})}queryMyOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"GET",accessToken:e.accessToken})}updateOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNumber}`,e.storeKey),method:"GET"})}deleteOrderById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${e.orderNo}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}queryOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"GET"})}createProduct(e){return this.request({...this.extractCommonRequestOptions(e),path:"/products",method:"POST",data:e.data})}updateProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",data:e.data})}updateProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",data:e.data})}async deleteProductById(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductById({id:e.id,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"DELETE",params:{...e.params,version:t}})}async deleteProductByKey(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductByKey({key:e.key,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${e.key}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/${e.id}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}createCategory(e){return this.request({path:"/categories",method:"POST",data:e.data})}updateCategoryByKey(e){return this.request({path:`/categories/key=${e.key}`,method:"POST",data:e.data})}updateCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"POST",data:e.data})}deleteCategoryById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}createAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"POST",data:e.data})}deleteCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}createMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/signup",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}loginMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/login",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}login(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/login",e.storeKey),method:"POST",data:e.data})}getMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"GET",accessToken:e.accessToken})}updateMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}changeMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}resetMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password/reset",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}getPasswordResetToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers/password-token",e.storeKey),method:"POST",data:e.data})}getCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${e.id}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${e.key}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${e.token}`,e.storeKey),method:"GET"})}queryCustomers(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"GET"})}updateCustomerById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/${e.id}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${e.key}`,method:"POST",data:e.data})}getProductTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${e.id}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${e.key}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/${e.id}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${e.key}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${e.id}`,method:"GET"})}getCartDiscountById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${e.id}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${e.key}`,method:"GET"})}queryCartDiscounts(e){return this.request({...this.extractCommonRequestOptions(e),path:"/cart-discounts",method:"GET"})}getCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"GET"})}getCustomObjectById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.id}`,method:"GET"})}saveCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:"/custom-objects",method:"POST",data:e.data})}deleteCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${e.container}/${e.key}`,method:"DELETE"})}getShippingMethodById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${e.id}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${e.key}`,method:"GET"})}getShippingMethodsForLocation(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,country:e.country,state:e.state,currency:e.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:e.accessToken})}getShippingMethodsForCart(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:e.accessToken})}queryShippingMethods(e){return this.request({...this.extractCommonRequestOptions(e),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"GET"})}queryCustomerGroups(e){return this.request({...this.extractCommonRequestOptions(e),path:"/customer-groups",method:"GET"})}createCustomerGroup(e){return this.request({path:"/customer-groups",method:"POST",data:e.data})}updateCustomerGroupByKey(e){return this.request({path:`/customer-groups/key=${e.key}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/${e.id}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${e.key}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"GET"})}queryStandalonePrices(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"GET"})}createStandalonePrice(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"POST",data:e.data})}updateStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${e.id}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${e.key}`,method:"DELETE",params:{...e.params,version:e.version}})}graphql(e){return this.request({...this.extractCommonRequestOptions(e),path:"/graphql",method:"POST",data:e.data,accessToken:e.accessToken})}async request(e){const t=await this.getRequestOptions(e);return await this.requestExecutor(t)}async getRequestOptions(e){let t,r=e.accessToken;const o=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;r||(r=(await this.auth.getClientGrant()).accessToken);const s={...e.headers,Authorization:`Bearer ${r}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(s["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.params&&Object.keys(e.params).length&&(t=e.params),{method:e.method,data:e.data,url:o,headers:s,params:t}}extractCommonRequestOptions(e){return e?{correlationId:e.correlationId,params:e.params,retry:e.retry}:{}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}static validateConfig(e){const t=[];if(e?(e.projectKey?"string"!=typeof e.projectKey&&t.push("The `projectKey` property must be a string"):t.push("The `projectKey` property is empty"),e.clientId?"string"!=typeof e.clientId&&t.push("The `clientId` property must be a string"):t.push("The `clientId` property is empty"),e.clientSecret?"string"!=typeof e.clientSecret&&t.push("The `clientSecret` property must be a string"):t.push("The `clientSecret` property is empty"),Array.isArray(e.clientScopes)?0===e.clientScopes.length&&t.push("The `clientScopes` property must have at least 1 scope defined"):t.push("The `clientScopes` property must be an array")):t.push("The config object missing or empty"),t.length)throw new qt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var s=o.A9,n=o.M_,a=o.Mq,i=o.h4,c=o.Eh,u=o.eJ,h=o.yp,p=o.hw,d=o.Xp,l=o.dI,m=o.gO,f=o.qX,y=o.jF,g=o.as,O=o.cY,E=o.Vl,S=o.kD,T=o.KD,q=o.Jy,C=o.s9,R=o.iS;export{s as CommercetoolsApi,n as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,h as Region,p as SENSITIVE_HEADER_NAMES,d as SENSITIVE_PROPERTY_NAMES,l as buildUserAgent,m as calculateDelay,f as convertAxiosError,y as convertAxiosResponse,g as createAxiosInstance,O as extractAxiosHeaders,E as formatAsKey,S as getAttributeValue,T as maskSensitiveData,q as maskSensitiveHeaders,C as maskSensitiveInput,R as retryOnConflict};
2
2
  //# sourceMappingURL=ge-commercetools-utils-browser.esm.js.map