@gradientedge/commercetools-utils 5.5.1 → 5.7.0
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.
- package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-node.esm.js +1 -1
- package/dist/typings/api/CommercetoolsApi.d.ts +7 -3
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={8842:(e,t,o)=>{t.Status=void 0;var r=o(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return r.Status}});o(7890)},7890:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const r=o(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(r.Status).find((t=>r.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 o(e,t){var o=[],r=[];return null==t&&(t=function(e,t){return o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]"}),function(n,s){if(o.length>0){var a=o.indexOf(this);~a?o.splice(a+1):o.push(this),~a?r.splice(a,1/0,n):r.push(n),~o.indexOf(s)&&(s=t.call(this,n,s))}else o.push(s);return null==e?s:e.call(this,n,s)}}(e.exports=function(e,t,r,n){return JSON.stringify(e,o(t,n),r)}).getSerialize=o},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var o=0;o<e.length;o++)t(e[o],o,e)}var n=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t},s=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var s;if(o(e))s=[];else if("[object Date]"===t(e))s=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))s=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))s={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))s=Object(e);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)s={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,s=new i}return r(n(e),(function(t){s[t]=e[t]})),s}return e}function i(e,t,i){var c=[],u=[],p=!0;return function e(d){var h=i?a(d):d,m={},l=!0,y={node:h,node_:d,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){y.isRoot||(y.parent.node[y.key]=e),y.node=e,t&&(l=!1)},delete:function(e){delete y.parent.node[y.key],e&&(l=!1)},remove:function(e){o(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],e&&(l=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){p=!1},block:function(){l=!1}};if(!p)return y;function f(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=n(y.node)),y.isLeaf=0===y.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===d){y.circular=u[e];break}}else y.isLeaf=!0,y.keys=null;y.notLeaf=!y.isLeaf,y.notRoot=!y.isRoot}f();var g=t.call(y,y.node);return void 0!==g&&y.update&&y.update(g),m.before&&m.before.call(y,y.node),l?("object"!=typeof y.node||null===y.node||y.circular||(u.push(y),f(),r(y.keys,(function(t,o){c.push(t),m.pre&&m.pre.call(y,y.node[t],t);var r=e(y.node[t]);i&&s.call(y.node,t)&&(y.node[t]=r.node),r.isLast=o===y.keys.length-1,r.isFirst=0===o,m.post&&m.post.call(y,r),c.pop()})),u.pop()),m.after&&m.after.call(y,y.node),y):y}(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,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return;t=t[r]}return t},c.prototype.has=function(e){for(var t=this.value,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return!1;t=t[r]}return!0},c.prototype.set=function(e,t){for(var o=this.value,r=0;r<e.length-1;r++){var n=e[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[e[r]]=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 o=1===arguments.length,r=o?this.value:t;return this.forEach((function(t){this.isRoot&&o||(r=e.call(this,r,t))})),r},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 o(s){for(var i=0;i<e.length;i++)if(e[i]===s)return t[i];if("object"==typeof s&&null!==s){var c=a(s);return e.push(s),t.push(c),r(n(s),(function(e){c[e]=o(s[e])})),e.pop(),t.pop(),c}return s}(this.value)},r(n(c.prototype),(function(e){u[e]=function(t){var o=[].slice.call(arguments,1),r=new c(t);return r[e].apply(r,o)}})),e.exports=u}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{o.d(r,{A9:()=>Kt,M_:()=>Dt,Mq:()=>bt,h4:()=>At,Eh:()=>Rt,eJ:()=>st,yp:()=>xt,hw:()=>Ct,Xp:()=>gt,dI:()=>wt,gO:()=>ut,qX:()=>tt,jF:()=>ot,as:()=>ct,e1:()=>pt,cY:()=>et,Vl:()=>dt,kD:()=>ht,KD:()=>Tt,Jy:()=>Et,s9:()=>Ot,iS:()=>vt});var e=o(4530),t=o.n(e);function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:s}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),p=e=>t=>typeof t===e,{isArray:d}=Array,h=p("undefined"),m=u("ArrayBuffer"),l=p("string"),y=p("function"),f=p("number"),g=e=>null!==e&&"object"==typeof e,C=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)},R=u("Date"),O=u("File"),E=u("Blob"),T=u("FileList"),S=u("URLSearchParams");function q(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let r,n;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{const n=o?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let a;for(r=0;r<s;r++)a=n[r],t.call(null,e[a],a,e)}}function v(e,t){t=t.toLowerCase();const o=Object.keys(e);let r,n=o.length;for(;n-- >0;)if(r=o[n],t===r.toLowerCase())return r;return null}const w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,b=e=>!h(e)&&e!==w,x=(I="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>I&&e instanceof I);var I;const k=u("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),A=u("RegExp"),U=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};q(o,((o,n)=>{!1!==t(o,n,e)&&(r[n]=o)})),Object.defineProperties(e,r)},j="abcdefghijklmnopqrstuvwxyz",B="0123456789",$={DIGIT:B,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+B},_=u("AsyncFunction"),N={isArray:d,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=i(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:l,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:C,isUndefined:h,isDate:R,isFile:O,isBlob:E,isRegExp:A,isFunction:y,isStream:e=>g(e)&&y(e.pipe),isURLSearchParams:S,isTypedArray:x,isFileList:T,forEach:q,merge:function e(){const{caseless:t}=b(this)&&this||{},o={},r=(r,n)=>{const s=t&&v(o,n)||n;C(o[s])&&C(r)?o[s]=e(o[s],r):C(r)?o[s]=e({},r):d(r)?o[s]=r.slice():o[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&q(arguments[e],r);return o},extend:(e,t,o,{allOwnKeys:r}={})=>(q(t,((t,r)=>{o&&y(t)?e[r]=n(t,o):e[r]=t}),{allOwnKeys:r}),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,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,r)=>{let n,s,i;const c={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==o&&a(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return-1!==r&&r===o},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!f(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=o.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const r=[];for(;null!==(o=e.exec(t));)r.push(o);return r},isHTMLForm:k,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:U,freezeMethods:e=>{U(e,((t,o)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=e[o];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(e,t)=>{const o={},r=e=>{e.forEach((e=>{o[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,o){return t.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:w,isContextDefined:b,ALPHABET:$,generateString:(e=16,t=$.ALPHA_DIGIT)=>{let o="";const{length:r}=t;for(;e--;)o+=t[Math.random()*r|0];return o},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),o=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const n=d(e)?[]:{};return q(e,((e,t)=>{const s=o(e,r+1);!h(s)&&(n[t]=s)})),t[r]=void 0,n}}return e};return o(e,0)},isAsyncFn:_,isThenable:e=>e&&(g(e)||y(e))&&y(e.then)&&y(e.catch)};function D(e,t,o,r,n){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),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}N.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:N.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,o,r,n,s)=>{const a=Object.create(K);return N.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,o,r,n),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const G=D;function M(e){return N.isPlainObject(e)||N.isArray(e)}function F(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function H(e,t,o){return e?e.concat(t).map((function(e,t){return e=F(e),!o&&t?"["+e+"]":e})).join(o?".":""):t}const z=N.toFlatObject(N,{},null,(function(e){return/^is[A-Z]/.test(e)})),J=function(e,t,o){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(o=N.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!N.isUndefined(t[e])}))).metaTokens,n=o.visitor||u,s=o.dots,a=o.indexes,i=(o.Blob||"undefined"!=typeof Blob&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(n))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(N.isDate(e))return e.toISOString();if(!i&&N.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(e)||N.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,o,n){let i=e;if(e&&!n&&"object"==typeof e)if(N.endsWith(o,"{}"))o=r?o:o.slice(0,-2),e=JSON.stringify(e);else if(N.isArray(e)&&function(e){return N.isArray(e)&&!e.some(M)}(e)||(N.isFileList(e)||N.endsWith(o,"[]"))&&(i=N.toArray(e)))return o=F(o),i.forEach((function(e,r){!N.isUndefined(e)&&null!==e&&t.append(!0===a?H([o],r,s):null===a?o:o+"[]",c(e))})),!1;return!!M(e)||(t.append(H(n,o,s),c(e)),!1)}const p=[],d=Object.assign(z,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!N.isObject(e))throw new TypeError("data must be an object");return function e(o,r){if(!N.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),N.forEach(o,(function(o,s){!0===(!(N.isUndefined(o)||null===o)&&n.call(t,o,N.isString(s)?s.trim():s,r,d))&&e(o,r?r.concat(s):[s])})),p.pop()}}(e),t};function V(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&J(e,this,t)}const X=W.prototype;X.append=function(e,t){this._pairs.push([e,t])},X.toString=function(e){const t=e?function(t){return e.call(this,t,V)}:V;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Y=W;function Q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(e,t,o){if(!t)return e;const r=o&&o.encode||Q,n=o&&o.serialize;let s;if(s=n?n(t,o):N.isURLSearchParams(t)?t.toString():new Y(t,o).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ee=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){N.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},te={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Y,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,o,r,n){let s=e[n++];const a=Number.isFinite(+s),i=n>=e.length;return s=!s&&N.isArray(r)?r.length:s,i?(N.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!a):(r[s]&&N.isObject(r[s])||(r[s]=[]),t(e,o,r[s],n)&&N.isArray(r[s])&&(r[s]=function(e){const t={},o=Object.keys(e);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],t[s]=e[s];return t}(r[s])),!a)}if(N.isFormData(e)&&N.isFunction(e.entries)){const o={};return N.forEachEntry(e,((e,r)=>{t(function(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,o,0)})),o}return null},ne={"Content-Type":void 0},se={transitional:te,adapter:["xhr","http"],transformRequest:[function(e,t){const o=t.getContentType()||"",r=o.indexOf("application/json")>-1,n=N.isObject(e);if(n&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return r&&r?JSON.stringify(re(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return J(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,o,r){return oe.isNode&&N.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=N.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return J(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),function(e,t,o){if(N.isString(e))try{return(0,JSON.parse)(e),N.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,o=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&N.isString(e)&&(o&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){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:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};N.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),N.forEach(["post","put","patch"],(function(e){se.headers[e]=N.merge(ne)}));const ae=se,ie=N.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"]),ce=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function pe(e){return!1===e||null==e?e:N.isArray(e)?e.map(pe):String(e)}function de(e,t,o,r,n){return N.isFunction(r)?r.call(this,t,o):(n&&(t=o),N.isString(t)?N.isString(r)?-1!==t.indexOf(r):N.isRegExp(r)?r.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,o){const r=this;function n(e,t,o){const n=ue(t);if(!n)throw new Error("header name must be a non-empty string");const s=N.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||t]=pe(e))}const s=(e,t)=>N.forEach(e,((e,o)=>n(e,o,t)));return N.isPlainObject(e)||e instanceof this.constructor?s(e,t):N.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let o,r,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),o=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!o||t[o]&&ie[o]||("set-cookie"===o?t[o]?t[o].push(r):t[o]=[r]:t[o]=t[o]?t[o]+", "+r:r)})),t})(e),t):null!=e&&n(t,e,o),this}get(e,t){if(e=ue(e)){const o=N.findKey(this,e);if(o){const e=this[o];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(e);)t[r[1]]=r[2];return t}(e);if(N.isFunction(t))return t.call(this,e,o);if(N.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const o=N.findKey(this,e);return!(!o||void 0===this[o]||t&&!de(0,this[o],o,t))}return!1}delete(e,t){const o=this;let r=!1;function n(e){if(e=ue(e)){const n=N.findKey(o,e);!n||t&&!de(0,o[n],n,t)||(delete o[n],r=!0)}}return N.isArray(e)?e.forEach(n):n(e),r}clear(e){const t=Object.keys(this);let o=t.length,r=!1;for(;o--;){const n=t[o];e&&!de(0,this[n],n,e,!0)||(delete this[n],r=!0)}return r}normalize(e){const t=this,o={};return N.forEach(this,((r,n)=>{const s=N.findKey(o,n);if(s)return t[s]=pe(r),void delete t[n];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,o)=>t.toUpperCase()+o))}(n):String(n).trim();a!==n&&delete t[n],t[a]=pe(r),o[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return N.forEach(this,((o,r)=>{null!=o&&!1!==o&&(t[r]=e&&N.isArray(o)?o.join(", "):o)})),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 o=new this(e);return t.forEach((e=>o.set(e))),o}static accessor(e){const t=(this[ce]=this[ce]={accessors:{}}).accessors,o=this.prototype;function r(e){const r=ue(e);t[r]||(function(e,t){const o=N.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+o,{value:function(e,o,n){return this[r].call(this,t,e,o,n)},configurable:!0})}))}(o,e),t[r]=!0)}return N.isArray(e)?e.forEach(r):r(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.freezeMethods(he.prototype),N.freezeMethods(he);const me=he;function le(e,t){const o=this||ae,r=t||o,n=me.from(r.headers);let s=r.data;return N.forEach(e,(function(e){s=e.call(o,s,n.normalize(),t?t.status:void 0)})),n.normalize(),s}function ye(e){return!(!e||!e.__CANCEL__)}function fe(e,t,o){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,o),this.name="CanceledError"}N.inherits(fe,G,{__CANCEL__:!0});const ge=fe,Ce=oe.isStandardBrowserEnv?{write:function(e,t,o,r,n,s){const a=[];a.push(e+"="+encodeURIComponent(t)),N.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),N.isString(r)&&a.push("path="+r),N.isString(n)&&a.push("domain="+n),!0===s&&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 Re(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 Oe=oe.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let o;function r(o){let r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{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 o=r(window.location.href),function(e){const t=N.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}}():function(){return!0};function Ee(e,t){let o=0;const r=function(e,t){e=e||10;const o=new Array(e),r=new Array(e);let n,s=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=r[a];n||(n=c),o[s]=i,r[s]=c;let p=a,d=0;for(;p!==s;)d+=o[p++],p%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-n<t)return;const h=u&&c-u;return h?Math.round(1e3*d/h):void 0}}(50,250);return n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,i=s-o,c=r(i);o=s;const u={loaded:s,total:a,progress:a?s/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:n};u[t?"download":"upload"]=!0,e(u)}}const Te={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,o){let r=e.data;const n=me.from(e.headers).normalize(),s=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}N.isFormData(r)&&(oe.isStandardBrowserEnv||oe.isStandardBrowserWebWorkerEnv?n.setContentType(!1):n.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",o=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(t+":"+o))}const u=Re(e.baseURL,e.url);function p(){if(!c)return;const r=me.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?t(new G("Request failed with status code "+o.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}((function(e){t(e),i()}),(function(e){o(e),i()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Z(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(o(new G("Request aborted",G.ECONNABORTED,e,c)),c=null)},c.onerror=function(){o(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 r=e.transitional||te;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),o(new G(t,r.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,c)),c=null},oe.isStandardBrowserEnv){const t=(e.withCredentials||Oe(u))&&e.xsrfCookieName&&Ce.read(e.xsrfCookieName);t&&n.set(e.xsrfHeaderName,t)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&N.forEach(n.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),N.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Ee(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ee(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(o(!t||t.type?new ge(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 d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===oe.protocols.indexOf(d)?o(new G("Unsupported protocol "+d+":",G.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};N.forEach(Te,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ge(null,e)}function qe(e){return Se(e),e.headers=me.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=N.isArray(e)?e:[e];const{length:t}=e;let o,r;for(let n=0;n<t&&(o=e[n],!(r=N.isString(o)?Te[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new G(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(N.hasOwnProp(Te,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!N.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||ae.adapter)(e).then((function(t){return Se(e),t.data=le.call(e,e.transformResponse,t),t.headers=me.from(t.headers),t}),(function(t){return ye(t)||(Se(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=me.from(t.response.headers))),Promise.reject(t)}))}const ve=e=>e instanceof me?e.toJSON():e;function we(e,t){t=t||{};const o={};function r(e,t,o){return N.isPlainObject(e)&&N.isPlainObject(t)?N.merge.call({caseless:o},e,t):N.isPlainObject(t)?N.merge({},t):N.isArray(t)?t.slice():t}function n(e,t,o){return N.isUndefined(t)?N.isUndefined(e)?void 0:r(void 0,e,o):r(e,t,o)}function s(e,t){if(!N.isUndefined(t))return r(void 0,t)}function a(e,t){return N.isUndefined(t)?N.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(o,n,s){return s in t?r(o,n):s in e?r(void 0,o):void 0}const c={url:s,method:s,data:s,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)=>n(ve(e),ve(t),!0)};return N.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||n,a=s(e[r],t[r],r);N.isUndefined(a)&&s!==i||(o[r]=a)})),o}const be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{be[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const xe={};be.transitional=function(e,t,o){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,n,s)=>{if(!1===e)throw new G(r(n," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!xe[n]&&(xe[n]=!0,console.warn(r(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,n,s)}};const Ie={assertOptions:function(e,t,o){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const s=r[n],a=t[s];if(a){const t=e[s],o=void 0===t||a(t,s,e);if(!0!==o)throw new G("option "+s+" must be "+o,G.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new G("Unknown option "+s,G.ERR_BAD_OPTION)}},validators:be},ke=Ie.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new ee,response:new ee}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:o,paramsSerializer:r,headers:n}=t;let s;void 0!==o&&Ie.assertOptions(o,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(N.isFunction(r)?t.paramsSerializer={serialize:r}:Ie.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=n&&N.merge(n.common,n[t.method]),s&&N.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=me.concat(s,n);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 p,d=0;if(!i){const e=[qe.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),p=e.length,u=Promise.resolve(t);d<p;)u=u.then(e[d++],e[d++]);return u}p=a.length;let h=t;for(d=0;d<p;){const e=a[d++],t=a[d++];try{h=e(h)}catch(e){t.call(this,e);break}}try{u=qe.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,p=c.length;d<p;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Z(Re((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}N.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,o){return this.request(we(o||{},{method:e,url:t,data:(o||{}).data}))}})),N.forEach(["post","put","patch"],(function(e){function t(t){return function(o,r,n){return this.request(we(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));const Ae=Pe;class Ue{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 o=this;this.promise.then((e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{o.subscribe(e),t=e})).then(e);return r.cancel=function(){o.unsubscribe(t)},r},e((function(e,r,n){o.reason||(o.reason=new ge(e,r,n),t(o.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 Ue((function(t){e=t})),cancel:e}}}const je=Ue,Be={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(Be).forEach((([e,t])=>{Be[t]=e}));const $e=Be,_e=function e(t){const o=new Ae(t),r=n(Ae.prototype.request,o);return N.extend(r,Ae.prototype,o,{allOwnKeys:!0}),N.extend(r,o,null,{allOwnKeys:!0}),r.create=function(o){return e(we(t,o))},r}(ae);_e.Axios=Ae,_e.CanceledError=ge,_e.CancelToken=je,_e.isCancel=ye,_e.VERSION="1.4.0",_e.toFormData=J,_e.AxiosError=G,_e.Cancel=_e.CanceledError,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return N.isObject(e)&&!0===e.isAxiosError},_e.mergeConfig=we,_e.AxiosHeaders=me,_e.formToJSON=e=>re(N.isHTMLForm(e)?new FormData(e):e),_e.HttpStatusCode=$e,_e.default=_e;const Ne=_e,{Axios:De,AxiosError:Ke,CanceledError:Le,isCancel:Ge,CancelToken:Me,VERSION:Fe,all:He,Cancel:ze,isAxiosError:Je,spread:Ve,toFormData:We,AxiosHeaders:Xe,HttpStatusCode:Ye,formToJSON:Qe,mergeConfig:Ze}=Ne;function et(e){let t={};if(e instanceof Xe){const o=e.toJSON();t={},Object.entries(o).forEach((([e,o])=>{const r=e.toLowerCase();"boolean"==typeof o||"number"==typeof o||"string"==typeof o?t[r]=o.toString():Array.isArray(o)&&(t[r]=o.join(", "))}))}return Object.keys(t).length?t:void 0}function tt(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:et(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:et(e.response?.headers),data:e.response?.data},stats:t}:null}function ot(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:et(e.config?.headers),data:e.config?.data},response:{status:e.status,headers:et(e.headers),data:e.data},stats:t}}var rt=o(8842);const nt="@gradientedge/commercetools-utils",st=500,at={maxRetries:3,delayMs:50,jitter:!0},it=[rt.Status.InternalServerError,rt.Status.NotImplemented,rt.Status.BadGateway,rt.Status.ServiceUnavailable,rt.Status.GatewayTimeout];function ct(e){return Ne.create({httpsAgent:void 0})}function ut(e,t){if(!t||0===e)return 0;const o=t.delayMs*2**(e-1);if(t.jitter){const t=o*(1+1/(e+1));return Math.floor(Math.random()*t)}return o}function pt(e){if(!e.value.trim())throw new bt(`The string parameter '${e.name}' cannot be empty`)}function dt(e){let t="";if("string"!=typeof e)throw new bt("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 bt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new bt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function ht(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var mt=o(3692),lt=o.n(mt);function yt(e){return ft(e,{})}function ft(e,t){if(t&&e)for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&("object"==typeof e[o]?(Array.isArray(e[o])?t[o]=[]:t[o]={},t[o]=ft(e[o],t[o])):t[o]=e[o]);return t}const gt=["password","refresh_token"],Ct=["authorization"],Rt="********";function Ot(e){return Tt(e,gt)}function Et(e){return Tt(e,Ct)}function Tt(e,t,o=Rt){if("object"==typeof e&&null!=e){let r={};return r=yt(e instanceof Xe?e.toJSON():e),lt()(r).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(o)})),r}return e}const St=3,qt=100;async function vt(e){const t=(e?.maxRetries||St)+1,o=e?.delayMs||qt,r=!!e?.jitter;for(let n=1;n<=t;n++){if(n>1){const e=ut(n-1,{delayMs:o,jitter:r});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(n)}catch(e){if(!e.isCommercetoolsError||e.status!==rt.Status.Conflict||n===t)throw e}}}function wt(e){let t=nt;return e&&(t=`${t} (${e})`),t}class bt extends Error{constructor(e,t,o){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=o,Object.setPrototypeOf(this,bt.prototype)}static fromAxiosError(e){return new bt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Et(et(e.config?.headers)),params:Ot(e.config?.params),data:Ot(this.parseRequestData(e.config))},response:{status:e.response?.status,data:Ot(e.response?.data),headers:et(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let o="";if("string"==typeof e?.headers?.["Content-Type"]&&(o=e?.headers?.["Content-Type"]),"application/json"===o.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===o.substring(0,33))try{const o=new URLSearchParams(e.data),r={};o.forEach(((e,t,o)=>{const n=o.getAll(t);0===n.length?r[t]="":1===n.length?r[t]=n[0]:r[t]=n})),t=r}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var xt;!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"}(xt||(xt={}));const It={[xt.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[xt.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[xt.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[xt.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[xt.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},kt=["anonymous_id","customer_id"];function Pt(e,t){return e.length?e.map((e=>`${e}:${t}`)).join(" "):""}class At{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=>!kt.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 o=t?.split(" ");if(!Array.isArray(o)||0===o.length)return;const r=o.find((t=>t.slice(0,e.length+1)===`${e}:`));return r?r.slice(e.length+1):void 0}}var Ut;function jt(e){return!e.isAxiosError||!e.request||!e.response||it.includes(e.response.status)}function Bt(e){return e.isAxiosError?bt.fromAxiosError(e):e}function $t(e){const t=ct(e.httpsAgent),o={"User-Agent":wt(e.systemIdentifier)};return r=>{const n={...o,...r.headers};return async function(e){const{retry:t,onBeforeRequest:o,onAfterResponse:r,axiosInstance:n}=e,s=e.timeoutMs??5e3,a={};let i,c=yt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=wt());let p,d,h=0;do{if(p=null,d=null,u>0){a["X-Retry-Count"]=`${u}`;const e=ut(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(o){const e=await o(c);e&&(c=e)}p=Date.now();const e=await n({...c,headers:{...c.headers,...a},timeout:s});return d=Date.now(),h+=d-p,r&&r(ot(e,{accumulativeDurationMs:h,durationMs:d-p,retries:u})),e.data}catch(e){if(d=Date.now(),h+=p?d-p:0,r){const t=tt(e,{accumulativeDurationMs:h,durationMs:p?d-p:0,retries:u});t&&r(t)}if(!jt(e))throw Bt(e);i=e}u++}while(u<=t.maxRetries);throw Bt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...r,headers:n},retry:{...at,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(Ut||(Ut={}));class _t{constructor(e){this.config=e,this.endpoints=It[this.config.region],this.requestExecutor=$t({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:Ut.CLIENT_CREDENTIALS,scope:Pt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:Ut.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:Ut.PASSWORD,scope:Pt(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 bt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:Ut.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=Pt(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 o;const r={Authorization:`Basic ${n=this.config.clientId,s=this.config.clientSecret,btoa(`${n}:${s}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var n,s;return e.correlationId&&""!==e.correlationId&&(r["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(o=new URLSearchParams(e.body).toString()),{method:"POST",data:o,url:t,headers:r}}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 Nt={refreshIfWithinSecs:1800,timeoutMs:5e3};class Dt{constructor(e){if(this.grantPromise=null,this.config={...Nt,...e},!this.config.clientScopes.length)throw new bt("`config.clientScopes` must contain at least one scope");this.api=new _t(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 At(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new At({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new bt("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.login({...e,scopes:t});return new At(o)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,o=e?.anonymousId;if(!t)throw new bt("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.getAnonymousGrant({scopes:t,anonymousId:o});return new At(r)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class Kt{constructor(e){Kt.validateConfig(e),this.config=e,this.auth=new Dt(e),this.endpoints=It[this.config.region],this.requestExecutor=$t({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStoreById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/channels/${encodeURIComponent(e.id)}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${encodeURIComponent(e.key)}"`,limit:1}});if(!t?.count)throw new bt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new bt("Either an id, key or slug must be provided");return e.id?(pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(e.key??"")}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new bt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!o.count)throw new bt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.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[*]"}}),o=t.ancestors.map((e=>e.obj));return o.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),o}getProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"GET"})}getProductProjectionById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new bt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=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(!o.count)throw new bt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${encodeURIComponent(e.key)}&version=${encodeURIComponent(e.version)}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${encodeURIComponent(e.storeKey??"")}/product-selection-assignments`,method:"GET"})}getCartById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(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 updateMyCart(e){return pt({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(e.cartId)}`,e.storeKey),method:"POST",data:{version:e.cartVersion,actions:e.actions},accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(t.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){pt({value:e.cartId,name:"cartId"});const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(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/${encodeURIComponent(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 pt({value:e.id,name:"id"}),await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}getPaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"GET"})}deleteOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(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=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}async deleteProductById(e){pt({value:e.id,name:"id"});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/${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(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=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customers/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}getProductTypeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${encodeURIComponent(e.id)}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/types/${encodeURIComponent(e.id)}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${encodeURIComponent(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/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"GET"})}getCustomObjectById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${encodeURIComponent(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/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"DELETE"})}getShippingMethodById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${encodeURIComponent(e.id)}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/states/${encodeURIComponent(e.id)}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(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,o=e.accessToken;const r=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;o||(o=(await this.auth.getClientGrant()).accessToken);const n={...e.headers,Authorization:`Bearer ${o}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(n["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:r,headers:n,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"),e.region?"string"!=typeof e.region?t.push("The `region` property must be a string"):Object.prototype.hasOwnProperty.call(It,e.region)||t.push(`The \`region\` property value is not valid: ${e.region}. Must be one of: ${Object.keys(It).join(", ")}`):t.push("The `region` property is empty")):t.push("The config object missing or empty"),t.length)throw new bt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var n=r.A9,s=r.M_,a=r.Mq,i=r.h4,c=r.Eh,u=r.eJ,p=r.yp,d=r.hw,h=r.Xp,m=r.dI,l=r.gO,y=r.qX,f=r.jF,g=r.as,C=r.e1,R=r.cY,O=r.Vl,E=r.kD,T=r.KD,S=r.Jy,q=r.s9,v=r.iS;export{n as CommercetoolsApi,s as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,p as Region,d as SENSITIVE_HEADER_NAMES,h as SENSITIVE_PROPERTY_NAMES,m as buildUserAgent,l as calculateDelay,y as convertAxiosError,f as convertAxiosResponse,g as createAxiosInstance,C as ensureNonEmptyString,R as extractAxiosHeaders,O as formatAsKey,E as getAttributeValue,T as maskSensitiveData,S as maskSensitiveHeaders,q as maskSensitiveInput,v as retryOnConflict};
|
|
1
|
+
var e={8842:(e,t,o)=>{t.Status=void 0;var r=o(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return r.Status}});o(7890)},7890:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const r=o(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(r.Status).find((t=>r.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 o(e,t){var o=[],r=[];return null==t&&(t=function(e,t){return o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]"}),function(n,s){if(o.length>0){var a=o.indexOf(this);~a?o.splice(a+1):o.push(this),~a?r.splice(a,1/0,n):r.push(n),~o.indexOf(s)&&(s=t.call(this,n,s))}else o.push(s);return null==e?s:e.call(this,n,s)}}(e.exports=function(e,t,r,n){return JSON.stringify(e,o(t,n),r)}).getSerialize=o},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var o=0;o<e.length;o++)t(e[o],o,e)}var n=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t},s=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var s;if(o(e))s=[];else if("[object Date]"===t(e))s=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))s=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))s={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))s=Object(e);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)s={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,s=new i}return r(n(e),(function(t){s[t]=e[t]})),s}return e}function i(e,t,i){var c=[],u=[],p=!0;return function e(d){var h=i?a(d):d,m={},l=!0,y={node:h,node_:d,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){y.isRoot||(y.parent.node[y.key]=e),y.node=e,t&&(l=!1)},delete:function(e){delete y.parent.node[y.key],e&&(l=!1)},remove:function(e){o(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],e&&(l=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){p=!1},block:function(){l=!1}};if(!p)return y;function f(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=n(y.node)),y.isLeaf=0===y.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===d){y.circular=u[e];break}}else y.isLeaf=!0,y.keys=null;y.notLeaf=!y.isLeaf,y.notRoot=!y.isRoot}f();var g=t.call(y,y.node);return void 0!==g&&y.update&&y.update(g),m.before&&m.before.call(y,y.node),l?("object"!=typeof y.node||null===y.node||y.circular||(u.push(y),f(),r(y.keys,(function(t,o){c.push(t),m.pre&&m.pre.call(y,y.node[t],t);var r=e(y.node[t]);i&&s.call(y.node,t)&&(y.node[t]=r.node),r.isLast=o===y.keys.length-1,r.isFirst=0===o,m.post&&m.post.call(y,r),c.pop()})),u.pop()),m.after&&m.after.call(y,y.node),y):y}(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,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return;t=t[r]}return t},c.prototype.has=function(e){for(var t=this.value,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return!1;t=t[r]}return!0},c.prototype.set=function(e,t){for(var o=this.value,r=0;r<e.length-1;r++){var n=e[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[e[r]]=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 o=1===arguments.length,r=o?this.value:t;return this.forEach((function(t){this.isRoot&&o||(r=e.call(this,r,t))})),r},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 o(s){for(var i=0;i<e.length;i++)if(e[i]===s)return t[i];if("object"==typeof s&&null!==s){var c=a(s);return e.push(s),t.push(c),r(n(s),(function(e){c[e]=o(s[e])})),e.pop(),t.pop(),c}return s}(this.value)},r(n(c.prototype),(function(e){u[e]=function(t){var o=[].slice.call(arguments,1),r=new c(t);return r[e].apply(r,o)}})),e.exports=u}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{o.d(r,{A9:()=>Kt,M_:()=>Dt,Mq:()=>bt,h4:()=>At,Eh:()=>Rt,eJ:()=>st,yp:()=>xt,hw:()=>Ct,Xp:()=>gt,dI:()=>wt,gO:()=>ut,qX:()=>tt,jF:()=>ot,as:()=>ct,e1:()=>pt,cY:()=>et,Vl:()=>dt,kD:()=>ht,KD:()=>Tt,Jy:()=>Et,s9:()=>Ot,iS:()=>vt});var e=o(4530),t=o.n(e);function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:s}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),p=e=>t=>typeof t===e,{isArray:d}=Array,h=p("undefined"),m=u("ArrayBuffer"),l=p("string"),y=p("function"),f=p("number"),g=e=>null!==e&&"object"==typeof e,C=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)},R=u("Date"),O=u("File"),E=u("Blob"),T=u("FileList"),S=u("URLSearchParams");function q(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let r,n;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{const n=o?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let a;for(r=0;r<s;r++)a=n[r],t.call(null,e[a],a,e)}}function v(e,t){t=t.toLowerCase();const o=Object.keys(e);let r,n=o.length;for(;n-- >0;)if(r=o[n],t===r.toLowerCase())return r;return null}const w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,b=e=>!h(e)&&e!==w,x=(I="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>I&&e instanceof I);var I;const k=u("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),A=u("RegExp"),U=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};q(o,((o,n)=>{!1!==t(o,n,e)&&(r[n]=o)})),Object.defineProperties(e,r)},j="abcdefghijklmnopqrstuvwxyz",B="0123456789",$={DIGIT:B,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+B},_=u("AsyncFunction"),N={isArray:d,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=i(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:l,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:C,isUndefined:h,isDate:R,isFile:O,isBlob:E,isRegExp:A,isFunction:y,isStream:e=>g(e)&&y(e.pipe),isURLSearchParams:S,isTypedArray:x,isFileList:T,forEach:q,merge:function e(){const{caseless:t}=b(this)&&this||{},o={},r=(r,n)=>{const s=t&&v(o,n)||n;C(o[s])&&C(r)?o[s]=e(o[s],r):C(r)?o[s]=e({},r):d(r)?o[s]=r.slice():o[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&q(arguments[e],r);return o},extend:(e,t,o,{allOwnKeys:r}={})=>(q(t,((t,r)=>{o&&y(t)?e[r]=n(t,o):e[r]=t}),{allOwnKeys:r}),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,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,r)=>{let n,s,i;const c={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==o&&a(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return-1!==r&&r===o},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!f(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=o.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const r=[];for(;null!==(o=e.exec(t));)r.push(o);return r},isHTMLForm:k,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:U,freezeMethods:e=>{U(e,((t,o)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=e[o];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(e,t)=>{const o={},r=e=>{e.forEach((e=>{o[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,o){return t.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:w,isContextDefined:b,ALPHABET:$,generateString:(e=16,t=$.ALPHA_DIGIT)=>{let o="";const{length:r}=t;for(;e--;)o+=t[Math.random()*r|0];return o},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),o=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const n=d(e)?[]:{};return q(e,((e,t)=>{const s=o(e,r+1);!h(s)&&(n[t]=s)})),t[r]=void 0,n}}return e};return o(e,0)},isAsyncFn:_,isThenable:e=>e&&(g(e)||y(e))&&y(e.then)&&y(e.catch)};function D(e,t,o,r,n){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),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}N.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:N.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,o,r,n,s)=>{const a=Object.create(K);return N.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,o,r,n),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const G=D;function M(e){return N.isPlainObject(e)||N.isArray(e)}function F(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function H(e,t,o){return e?e.concat(t).map((function(e,t){return e=F(e),!o&&t?"["+e+"]":e})).join(o?".":""):t}const z=N.toFlatObject(N,{},null,(function(e){return/^is[A-Z]/.test(e)})),J=function(e,t,o){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(o=N.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!N.isUndefined(t[e])}))).metaTokens,n=o.visitor||u,s=o.dots,a=o.indexes,i=(o.Blob||"undefined"!=typeof Blob&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(n))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(N.isDate(e))return e.toISOString();if(!i&&N.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(e)||N.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,o,n){let i=e;if(e&&!n&&"object"==typeof e)if(N.endsWith(o,"{}"))o=r?o:o.slice(0,-2),e=JSON.stringify(e);else if(N.isArray(e)&&function(e){return N.isArray(e)&&!e.some(M)}(e)||(N.isFileList(e)||N.endsWith(o,"[]"))&&(i=N.toArray(e)))return o=F(o),i.forEach((function(e,r){!N.isUndefined(e)&&null!==e&&t.append(!0===a?H([o],r,s):null===a?o:o+"[]",c(e))})),!1;return!!M(e)||(t.append(H(n,o,s),c(e)),!1)}const p=[],d=Object.assign(z,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!N.isObject(e))throw new TypeError("data must be an object");return function e(o,r){if(!N.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),N.forEach(o,(function(o,s){!0===(!(N.isUndefined(o)||null===o)&&n.call(t,o,N.isString(s)?s.trim():s,r,d))&&e(o,r?r.concat(s):[s])})),p.pop()}}(e),t};function V(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&J(e,this,t)}const X=W.prototype;X.append=function(e,t){this._pairs.push([e,t])},X.toString=function(e){const t=e?function(t){return e.call(this,t,V)}:V;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Y=W;function Q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(e,t,o){if(!t)return e;const r=o&&o.encode||Q,n=o&&o.serialize;let s;if(s=n?n(t,o):N.isURLSearchParams(t)?t.toString():new Y(t,o).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const ee=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){N.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},te={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Y,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,o,r,n){let s=e[n++];const a=Number.isFinite(+s),i=n>=e.length;return s=!s&&N.isArray(r)?r.length:s,i?(N.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!a):(r[s]&&N.isObject(r[s])||(r[s]=[]),t(e,o,r[s],n)&&N.isArray(r[s])&&(r[s]=function(e){const t={},o=Object.keys(e);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],t[s]=e[s];return t}(r[s])),!a)}if(N.isFormData(e)&&N.isFunction(e.entries)){const o={};return N.forEachEntry(e,((e,r)=>{t(function(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,o,0)})),o}return null},ne={"Content-Type":void 0},se={transitional:te,adapter:["xhr","http"],transformRequest:[function(e,t){const o=t.getContentType()||"",r=o.indexOf("application/json")>-1,n=N.isObject(e);if(n&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return r&&r?JSON.stringify(re(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return J(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,o,r){return oe.isNode&&N.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=N.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return J(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),function(e,t,o){if(N.isString(e))try{return(0,JSON.parse)(e),N.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,o=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&N.isString(e)&&(o&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){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:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};N.forEach(["delete","get","head"],(function(e){se.headers[e]={}})),N.forEach(["post","put","patch"],(function(e){se.headers[e]=N.merge(ne)}));const ae=se,ie=N.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"]),ce=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function pe(e){return!1===e||null==e?e:N.isArray(e)?e.map(pe):String(e)}function de(e,t,o,r,n){return N.isFunction(r)?r.call(this,t,o):(n&&(t=o),N.isString(t)?N.isString(r)?-1!==t.indexOf(r):N.isRegExp(r)?r.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,o){const r=this;function n(e,t,o){const n=ue(t);if(!n)throw new Error("header name must be a non-empty string");const s=N.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||t]=pe(e))}const s=(e,t)=>N.forEach(e,((e,o)=>n(e,o,t)));return N.isPlainObject(e)||e instanceof this.constructor?s(e,t):N.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let o,r,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),o=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!o||t[o]&&ie[o]||("set-cookie"===o?t[o]?t[o].push(r):t[o]=[r]:t[o]=t[o]?t[o]+", "+r:r)})),t})(e),t):null!=e&&n(t,e,o),this}get(e,t){if(e=ue(e)){const o=N.findKey(this,e);if(o){const e=this[o];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(e);)t[r[1]]=r[2];return t}(e);if(N.isFunction(t))return t.call(this,e,o);if(N.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const o=N.findKey(this,e);return!(!o||void 0===this[o]||t&&!de(0,this[o],o,t))}return!1}delete(e,t){const o=this;let r=!1;function n(e){if(e=ue(e)){const n=N.findKey(o,e);!n||t&&!de(0,o[n],n,t)||(delete o[n],r=!0)}}return N.isArray(e)?e.forEach(n):n(e),r}clear(e){const t=Object.keys(this);let o=t.length,r=!1;for(;o--;){const n=t[o];e&&!de(0,this[n],n,e,!0)||(delete this[n],r=!0)}return r}normalize(e){const t=this,o={};return N.forEach(this,((r,n)=>{const s=N.findKey(o,n);if(s)return t[s]=pe(r),void delete t[n];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,o)=>t.toUpperCase()+o))}(n):String(n).trim();a!==n&&delete t[n],t[a]=pe(r),o[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return N.forEach(this,((o,r)=>{null!=o&&!1!==o&&(t[r]=e&&N.isArray(o)?o.join(", "):o)})),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 o=new this(e);return t.forEach((e=>o.set(e))),o}static accessor(e){const t=(this[ce]=this[ce]={accessors:{}}).accessors,o=this.prototype;function r(e){const r=ue(e);t[r]||(function(e,t){const o=N.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+o,{value:function(e,o,n){return this[r].call(this,t,e,o,n)},configurable:!0})}))}(o,e),t[r]=!0)}return N.isArray(e)?e.forEach(r):r(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.freezeMethods(he.prototype),N.freezeMethods(he);const me=he;function le(e,t){const o=this||ae,r=t||o,n=me.from(r.headers);let s=r.data;return N.forEach(e,(function(e){s=e.call(o,s,n.normalize(),t?t.status:void 0)})),n.normalize(),s}function ye(e){return!(!e||!e.__CANCEL__)}function fe(e,t,o){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,o),this.name="CanceledError"}N.inherits(fe,G,{__CANCEL__:!0});const ge=fe,Ce=oe.isStandardBrowserEnv?{write:function(e,t,o,r,n,s){const a=[];a.push(e+"="+encodeURIComponent(t)),N.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),N.isString(r)&&a.push("path="+r),N.isString(n)&&a.push("domain="+n),!0===s&&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 Re(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 Oe=oe.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let o;function r(o){let r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{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 o=r(window.location.href),function(e){const t=N.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}}():function(){return!0};function Ee(e,t){let o=0;const r=function(e,t){e=e||10;const o=new Array(e),r=new Array(e);let n,s=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=r[a];n||(n=c),o[s]=i,r[s]=c;let p=a,d=0;for(;p!==s;)d+=o[p++],p%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-n<t)return;const h=u&&c-u;return h?Math.round(1e3*d/h):void 0}}(50,250);return n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,i=s-o,c=r(i);o=s;const u={loaded:s,total:a,progress:a?s/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:n};u[t?"download":"upload"]=!0,e(u)}}const Te={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,o){let r=e.data;const n=me.from(e.headers).normalize(),s=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}N.isFormData(r)&&(oe.isStandardBrowserEnv||oe.isStandardBrowserWebWorkerEnv?n.setContentType(!1):n.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",o=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(t+":"+o))}const u=Re(e.baseURL,e.url);function p(){if(!c)return;const r=me.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?t(new G("Request failed with status code "+o.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}((function(e){t(e),i()}),(function(e){o(e),i()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Z(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(o(new G("Request aborted",G.ECONNABORTED,e,c)),c=null)},c.onerror=function(){o(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 r=e.transitional||te;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),o(new G(t,r.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,c)),c=null},oe.isStandardBrowserEnv){const t=(e.withCredentials||Oe(u))&&e.xsrfCookieName&&Ce.read(e.xsrfCookieName);t&&n.set(e.xsrfHeaderName,t)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&N.forEach(n.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),N.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Ee(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ee(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(o(!t||t.type?new ge(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 d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===oe.protocols.indexOf(d)?o(new G("Unsupported protocol "+d+":",G.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};N.forEach(Te,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ge(null,e)}function qe(e){return Se(e),e.headers=me.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=N.isArray(e)?e:[e];const{length:t}=e;let o,r;for(let n=0;n<t&&(o=e[n],!(r=N.isString(o)?Te[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new G(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(N.hasOwnProp(Te,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!N.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||ae.adapter)(e).then((function(t){return Se(e),t.data=le.call(e,e.transformResponse,t),t.headers=me.from(t.headers),t}),(function(t){return ye(t)||(Se(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=me.from(t.response.headers))),Promise.reject(t)}))}const ve=e=>e instanceof me?e.toJSON():e;function we(e,t){t=t||{};const o={};function r(e,t,o){return N.isPlainObject(e)&&N.isPlainObject(t)?N.merge.call({caseless:o},e,t):N.isPlainObject(t)?N.merge({},t):N.isArray(t)?t.slice():t}function n(e,t,o){return N.isUndefined(t)?N.isUndefined(e)?void 0:r(void 0,e,o):r(e,t,o)}function s(e,t){if(!N.isUndefined(t))return r(void 0,t)}function a(e,t){return N.isUndefined(t)?N.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(o,n,s){return s in t?r(o,n):s in e?r(void 0,o):void 0}const c={url:s,method:s,data:s,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)=>n(ve(e),ve(t),!0)};return N.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||n,a=s(e[r],t[r],r);N.isUndefined(a)&&s!==i||(o[r]=a)})),o}const be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{be[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const xe={};be.transitional=function(e,t,o){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,n,s)=>{if(!1===e)throw new G(r(n," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!xe[n]&&(xe[n]=!0,console.warn(r(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,n,s)}};const Ie={assertOptions:function(e,t,o){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const s=r[n],a=t[s];if(a){const t=e[s],o=void 0===t||a(t,s,e);if(!0!==o)throw new G("option "+s+" must be "+o,G.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new G("Unknown option "+s,G.ERR_BAD_OPTION)}},validators:be},ke=Ie.validators;class Pe{constructor(e){this.defaults=e,this.interceptors={request:new ee,response:new ee}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:o,paramsSerializer:r,headers:n}=t;let s;void 0!==o&&Ie.assertOptions(o,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(N.isFunction(r)?t.paramsSerializer={serialize:r}:Ie.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=n&&N.merge(n.common,n[t.method]),s&&N.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=me.concat(s,n);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 p,d=0;if(!i){const e=[qe.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),p=e.length,u=Promise.resolve(t);d<p;)u=u.then(e[d++],e[d++]);return u}p=a.length;let h=t;for(d=0;d<p;){const e=a[d++],t=a[d++];try{h=e(h)}catch(e){t.call(this,e);break}}try{u=qe.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,p=c.length;d<p;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Z(Re((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}N.forEach(["delete","get","head","options"],(function(e){Pe.prototype[e]=function(t,o){return this.request(we(o||{},{method:e,url:t,data:(o||{}).data}))}})),N.forEach(["post","put","patch"],(function(e){function t(t){return function(o,r,n){return this.request(we(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Pe.prototype[e]=t(),Pe.prototype[e+"Form"]=t(!0)}));const Ae=Pe;class Ue{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 o=this;this.promise.then((e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{o.subscribe(e),t=e})).then(e);return r.cancel=function(){o.unsubscribe(t)},r},e((function(e,r,n){o.reason||(o.reason=new ge(e,r,n),t(o.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 Ue((function(t){e=t})),cancel:e}}}const je=Ue,Be={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(Be).forEach((([e,t])=>{Be[t]=e}));const $e=Be,_e=function e(t){const o=new Ae(t),r=n(Ae.prototype.request,o);return N.extend(r,Ae.prototype,o,{allOwnKeys:!0}),N.extend(r,o,null,{allOwnKeys:!0}),r.create=function(o){return e(we(t,o))},r}(ae);_e.Axios=Ae,_e.CanceledError=ge,_e.CancelToken=je,_e.isCancel=ye,_e.VERSION="1.4.0",_e.toFormData=J,_e.AxiosError=G,_e.Cancel=_e.CanceledError,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return N.isObject(e)&&!0===e.isAxiosError},_e.mergeConfig=we,_e.AxiosHeaders=me,_e.formToJSON=e=>re(N.isHTMLForm(e)?new FormData(e):e),_e.HttpStatusCode=$e,_e.default=_e;const Ne=_e,{Axios:De,AxiosError:Ke,CanceledError:Le,isCancel:Ge,CancelToken:Me,VERSION:Fe,all:He,Cancel:ze,isAxiosError:Je,spread:Ve,toFormData:We,AxiosHeaders:Xe,HttpStatusCode:Ye,formToJSON:Qe,mergeConfig:Ze}=Ne;function et(e){let t={};if(e instanceof Xe){const o=e.toJSON();t={},Object.entries(o).forEach((([e,o])=>{const r=e.toLowerCase();"boolean"==typeof o||"number"==typeof o||"string"==typeof o?t[r]=o.toString():Array.isArray(o)&&(t[r]=o.join(", "))}))}return Object.keys(t).length?t:void 0}function tt(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:et(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:et(e.response?.headers),data:e.response?.data},stats:t}:null}function ot(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:et(e.config?.headers),data:e.config?.data},response:{status:e.status,headers:et(e.headers),data:e.data},stats:t}}var rt=o(8842);const nt="@gradientedge/commercetools-utils",st=500,at={maxRetries:3,delayMs:50,jitter:!0},it=[rt.Status.InternalServerError,rt.Status.NotImplemented,rt.Status.BadGateway,rt.Status.ServiceUnavailable,rt.Status.GatewayTimeout];function ct(e){return Ne.create({httpsAgent:void 0})}function ut(e,t){if(!t||0===e)return 0;const o=t.delayMs*2**(e-1);if(t.jitter){const t=o*(1+1/(e+1));return Math.floor(Math.random()*t)}return o}function pt(e){if(!e.value.trim())throw new bt(`The string parameter '${e.name}' cannot be empty`)}function dt(e){let t="";if("string"!=typeof e)throw new bt("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 bt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new bt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function ht(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var mt=o(3692),lt=o.n(mt);function yt(e){return ft(e,{})}function ft(e,t){if(t&&e)for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&("object"==typeof e[o]?(Array.isArray(e[o])?t[o]=[]:t[o]={},t[o]=ft(e[o],t[o])):t[o]=e[o]);return t}const gt=["password","refresh_token"],Ct=["authorization"],Rt="********";function Ot(e){return Tt(e,gt)}function Et(e){return Tt(e,Ct)}function Tt(e,t,o=Rt){if("object"==typeof e&&null!=e){let r={};return r=yt(e instanceof Xe?e.toJSON():e),lt()(r).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(o)})),r}return e}const St=3,qt=100;async function vt(e){const t=(e?.maxRetries||St)+1,o=e?.delayMs||qt,r=!!e?.jitter;for(let n=1;n<=t;n++){if(n>1){const e=ut(n-1,{delayMs:o,jitter:r});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(n)}catch(e){if(!e.isCommercetoolsError||e.status!==rt.Status.Conflict||n===t)throw e}}}function wt(e){let t=nt;return e&&(t=`${t} (${e})`),t}class bt extends Error{constructor(e,t,o){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=o,Object.setPrototypeOf(this,bt.prototype)}static fromAxiosError(e){return new bt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Et(et(e.config?.headers)),params:Ot(e.config?.params),data:Ot(this.parseRequestData(e.config))},response:{status:e.response?.status,data:Ot(e.response?.data),headers:et(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let o="";if("string"==typeof e?.headers?.["Content-Type"]&&(o=e?.headers?.["Content-Type"]),"application/json"===o.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===o.substring(0,33))try{const o=new URLSearchParams(e.data),r={};o.forEach(((e,t,o)=>{const n=o.getAll(t);0===n.length?r[t]="":1===n.length?r[t]=n[0]:r[t]=n})),t=r}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var xt;!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"}(xt||(xt={}));const It={[xt.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[xt.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[xt.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[xt.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[xt.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},kt=["anonymous_id","customer_id"];function Pt(e,t){return e.length?e.map((e=>`${e}:${t}`)).join(" "):""}class At{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=>!kt.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 o=t?.split(" ");if(!Array.isArray(o)||0===o.length)return;const r=o.find((t=>t.slice(0,e.length+1)===`${e}:`));return r?r.slice(e.length+1):void 0}}var Ut;function jt(e){return!e.isAxiosError||!e.request||!e.response||it.includes(e.response.status)}function Bt(e){return e.isAxiosError?bt.fromAxiosError(e):e}function $t(e){const t=ct(e.httpsAgent),o={"User-Agent":wt(e.systemIdentifier)};return r=>{const n={...o,...r.headers};return async function(e){const{retry:t,onBeforeRequest:o,onAfterResponse:r,axiosInstance:n}=e,s=e.timeoutMs??5e3,a={};let i,c=yt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=wt());let p,d,h=0;do{if(p=null,d=null,u>0){a["X-Retry-Count"]=`${u}`;const e=ut(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(o){const e=await o(c);e&&(c=e)}p=Date.now();const e=await n({...c,headers:{...c.headers,...a},timeout:s});return d=Date.now(),h+=d-p,r&&r(ot(e,{accumulativeDurationMs:h,durationMs:d-p,retries:u})),e.data}catch(e){if(d=Date.now(),h+=p?d-p:0,r){const t=tt(e,{accumulativeDurationMs:h,durationMs:p?d-p:0,retries:u});t&&r(t)}if(!jt(e))throw Bt(e);i=e}u++}while(u<=t.maxRetries);throw Bt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...r,headers:n},retry:{...at,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(Ut||(Ut={}));class _t{constructor(e){this.config=e,this.endpoints=It[this.config.region],this.requestExecutor=$t({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:Ut.CLIENT_CREDENTIALS,scope:Pt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:Ut.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:Ut.PASSWORD,scope:Pt(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 bt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:Ut.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=Pt(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 o;const r={Authorization:`Basic ${n=this.config.clientId,s=this.config.clientSecret,btoa(`${n}:${s}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var n,s;return e.correlationId&&""!==e.correlationId&&(r["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(o=new URLSearchParams(e.body).toString()),{method:"POST",data:o,url:t,headers:r}}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 Nt={refreshIfWithinSecs:1800,timeoutMs:5e3};class Dt{constructor(e){if(this.grantPromise=null,this.config={...Nt,...e},!this.config.clientScopes.length)throw new bt("`config.clientScopes` must contain at least one scope");this.api=new _t(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 At(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new At({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new bt("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.login({...e,scopes:t});return new At(o)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,o=e?.anonymousId;if(!t)throw new bt("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.getAnonymousGrant({scopes:t,anonymousId:o});return new At(r)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class Kt{constructor(e){Kt.validateConfig(e),this.config=e,this.auth=new Dt(e),this.endpoints=It[this.config.region],this.requestExecutor=$t({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStoreById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/channels/${encodeURIComponent(e.id)}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${encodeURIComponent(e.key)}"`,limit:1}});if(!t?.count)throw new bt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new bt("Either an id, key or slug must be provided");return e.id?(pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(e.key??"")}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new bt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!o.count)throw new bt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.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[*]"}}),o=t.ancestors.map((e=>e.obj));return o.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),o}getProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"GET"})}getProductProjectionById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new bt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=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(!o.count)throw new bt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${encodeURIComponent(e.key)}&version=${encodeURIComponent(e.version)}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${encodeURIComponent(e.storeKey??"")}/product-selection-assignments`,method:"GET"})}queryInventory(e){return this.request({...this.extractCommonRequestOptions(e),path:"/inventory",method:"GET"})}getCartById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(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 updateMyCart(e){return pt({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(e.cartId)}`,e.storeKey),method:"POST",data:{version:e.cartVersion,actions:e.actions},accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(t.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){pt({value:e.cartId,name:"cartId"});const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(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/${encodeURIComponent(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 pt({value:e.id,name:"id"}),await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}getPaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"GET"})}deleteOrderById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(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=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}async deleteProductById(e){pt({value:e.id,name:"id"});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/${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCategoryById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(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=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customers/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}getProductTypeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${encodeURIComponent(e.id)}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/types/${encodeURIComponent(e.id)}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${encodeURIComponent(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/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"GET"})}getCustomObjectById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${encodeURIComponent(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/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"DELETE"})}getShippingMethodById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${encodeURIComponent(e.id)}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${encodeURIComponent(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"})}getShippingMethodsForCart(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId}}),path:"/shipping-methods/matching-cart",method:"GET"})}getShippingMethodsForCartAndLocation(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId,country:e.country,state:e.state}}),path:"/shipping-methods/matching-cart-location",method:"GET"})}queryShippingMethods(e){return this.request({...this.extractCommonRequestOptions(e),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(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=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/states/${encodeURIComponent(e.id)}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(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 pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return pt({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(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,o=e.accessToken;const r=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;o||(o=(await this.auth.getClientGrant()).accessToken);const n={...e.headers,Authorization:`Bearer ${o}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(n["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:r,headers:n,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"),e.region?"string"!=typeof e.region?t.push("The `region` property must be a string"):Object.prototype.hasOwnProperty.call(It,e.region)||t.push(`The \`region\` property value is not valid: ${e.region}. Must be one of: ${Object.keys(It).join(", ")}`):t.push("The `region` property is empty")):t.push("The config object missing or empty"),t.length)throw new bt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var n=r.A9,s=r.M_,a=r.Mq,i=r.h4,c=r.Eh,u=r.eJ,p=r.yp,d=r.hw,h=r.Xp,m=r.dI,l=r.gO,y=r.qX,f=r.jF,g=r.as,C=r.e1,R=r.cY,O=r.Vl,E=r.kD,T=r.KD,S=r.Jy,q=r.s9,v=r.iS;export{n as CommercetoolsApi,s as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,p as Region,d as SENSITIVE_HEADER_NAMES,h as SENSITIVE_PROPERTY_NAMES,m as buildUserAgent,l as calculateDelay,y as convertAxiosError,f as convertAxiosResponse,g as createAxiosInstance,C as ensureNonEmptyString,R as extractAxiosHeaders,O as formatAsKey,E as getAttributeValue,T as maskSensitiveData,S as maskSensitiveHeaders,q as maskSensitiveInput,v as retryOnConflict};
|
|
2
2
|
//# sourceMappingURL=ge-commercetools-utils-browser.esm.js.map
|