commerce-sdk-isomorphic 1.8.0 → 1.10.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/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("cross-fetch"),require("nanoid")):"function"==typeof define&&define.amd?define(["exports","cross-fetch","nanoid"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).CommerceSdk={},e.crossFetch,e.nanoid)}(this,(function(e,t,r){"use strict";var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var a,o,s=function(e){return e&&e.Math==Math&&e},c=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof n&&n)||function(){return this}()||Function("return this")(),d=function(e){try{return!!e()}catch(e){return!0}},u=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),f=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),h=Function.prototype.call,p=f?h.bind(h):function(){return h.apply(h,arguments)},l={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b={f:g&&!l.call({1:2},1)?function(e){var t=g(this,e);return!!t&&t.enumerable}:l},v=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},I=Function.prototype,m=I.bind,x=I.call,k=f&&m.bind(x,x),w=f?function(e){return e&&k(e)}:function(e){return e&&function(){return x.apply(e,arguments)}},y=w({}.toString),C=w("".slice),z=function(e){return C(y(e),8,-1)},O=Object,q=w("".split),E=d((function(){return!O("z").propertyIsEnumerable(0)}))?function(e){return"String"==z(e)?q(e,""):O(e)}:O,P=TypeError,S=function(e){if(null==e)throw P("Can't call method on "+e);return e},R=function(e){return E(S(e))},j=function(e){return"function"==typeof e},T=function(e){return"object"==typeof e?null!==e:j(e)},M=function(e){return j(e)?e:void 0},U=function(e,t){return arguments.length<2?M(c[e]):c[e]&&c[e][t]},A=w({}.isPrototypeOf),B=U("navigator","userAgent")||"",_=c.process,N=c.Deno,L=_&&_.versions||N&&N.version,D=L&&L.v8;D&&(o=(a=D.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!o&&B&&(!(a=B.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=B.match(/Chrome\/(\d+)/))&&(o=+a[1]);var F=o,J=!!Object.getOwnPropertySymbols&&!d((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&F&&F<41})),G=J&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,H=Object,V=G?function(e){return"symbol"==typeof e}:function(e){var t=U("Symbol");return j(t)&&A(t.prototype,H(e))},W=String,$=function(e){try{return W(e)}catch(e){return"Object"}},Y=TypeError,K=function(e){if(j(e))return e;throw Y($(e)+" is not a function")},Q=function(e,t){var r=e[t];return null==r?void 0:K(r)},X=TypeError,Z=Object.defineProperty,ee=function(e,t){try{Z(c,e,{value:t,configurable:!0,writable:!0})}catch(r){c[e]=t}return t},te=c["__core-js_shared__"]||ee("__core-js_shared__",{}),re=i((function(e){(e.exports=function(e,t){return te[e]||(te[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),ne=Object,ie=function(e){return ne(S(e))},ae=w({}.hasOwnProperty),oe=Object.hasOwn||function(e,t){return ae(ie(e),t)},se=0,ce=Math.random(),de=w(1..toString),ue=function(e){return"Symbol("+(void 0===e?"":e)+")_"+de(++se+ce,36)},fe=re("wks"),he=c.Symbol,pe=he&&he.for,le=G?he:he&&he.withoutSetter||ue,ge=function(e){if(!oe(fe,e)||!J&&"string"!=typeof fe[e]){var t="Symbol."+e;J&&oe(he,e)?fe[e]=he[e]:fe[e]=G&&pe?pe(t):le(t)}return fe[e]},be=TypeError,ve=ge("toPrimitive"),Ie=function(e,t){if(!T(e)||V(e))return e;var r,n=Q(e,ve);if(n){if(void 0===t&&(t="default"),r=p(n,e,t),!T(r)||V(r))return r;throw be("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&j(r=e.toString)&&!T(n=p(r,e)))return n;if(j(r=e.valueOf)&&!T(n=p(r,e)))return n;if("string"!==t&&j(r=e.toString)&&!T(n=p(r,e)))return n;throw X("Can't convert object to primitive value")}(e,t)},me=function(e){var t=Ie(e,"string");return V(t)?t:t+""},xe=c.document,ke=T(xe)&&T(xe.createElement),we=function(e){return ke?xe.createElement(e):{}},ye=!u&&!d((function(){return 7!=Object.defineProperty(we("div"),"a",{get:function(){return 7}}).a})),Ce=Object.getOwnPropertyDescriptor,ze={f:u?Ce:function(e,t){if(e=R(e),t=me(t),ye)try{return Ce(e,t)}catch(e){}if(oe(e,t))return v(!p(b.f,e,t),e[t])}},Oe=u&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),qe=String,Ee=TypeError,Pe=function(e){if(T(e))return e;throw Ee(qe(e)+" is not an object")},Se=TypeError,Re=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Te={f:u?Oe?function(e,t,r){if(Pe(e),t=me(t),Pe(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=je(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Re(e,t,r)}:Re:function(e,t,r){if(Pe(e),t=me(t),Pe(r),ye)try{return Re(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Se("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Me=u?function(e,t,r){return Te.f(e,t,v(1,r))}:function(e,t,r){return e[t]=r,e},Ue=Function.prototype,Ae=u&&Object.getOwnPropertyDescriptor,Be=oe(Ue,"name"),_e={EXISTS:Be,PROPER:Be&&"something"===function(){}.name,CONFIGURABLE:Be&&(!u||u&&Ae(Ue,"name").configurable)},Ne=w(Function.toString);j(te.inspectSource)||(te.inspectSource=function(e){return Ne(e)});var Le,De,Fe,Je=te.inspectSource,Ge=c.WeakMap,He=j(Ge)&&/native code/.test(Je(Ge)),Ve=re("keys"),We=function(e){return Ve[e]||(Ve[e]=ue(e))},$e={},Ye=c.TypeError,Ke=c.WeakMap;if(He||te.state){var Qe=te.state||(te.state=new Ke),Xe=w(Qe.get),Ze=w(Qe.has),et=w(Qe.set);Le=function(e,t){if(Ze(Qe,e))throw new Ye("Object already initialized");return t.facade=e,et(Qe,e,t),t},De=function(e){return Xe(Qe,e)||{}},Fe=function(e){return Ze(Qe,e)}}else{var tt=We("state");$e[tt]=!0,Le=function(e,t){if(oe(e,tt))throw new Ye("Object already initialized");return t.facade=e,Me(e,tt,t),t},De=function(e){return oe(e,tt)?e[tt]:{}},Fe=function(e){return oe(e,tt)}}var rt={set:Le,get:De,has:Fe,enforce:function(e){return Fe(e)?De(e):Le(e,{})},getterFor:function(e){return function(t){var r;if(!T(t)||(r=De(t)).type!==e)throw Ye("Incompatible receiver, "+e+" required");return r}}},nt=i((function(e){var t=_e.CONFIGURABLE,r=rt.enforce,n=rt.get,i=Object.defineProperty,a=u&&!d((function(){return 8!==i((function(){}),"length",{value:8}).length})),o=String(String).split("String"),s=e.exports=function(e,n,s){"Symbol("===String(n).slice(0,7)&&(n="["+String(n).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),s&&s.getter&&(n="get "+n),s&&s.setter&&(n="set "+n),(!oe(e,"name")||t&&e.name!==n)&&(u?i(e,"name",{value:n,configurable:!0}):e.name=n),a&&s&&oe(s,"arity")&&e.length!==s.arity&&i(e,"length",{value:s.arity});try{s&&oe(s,"constructor")&&s.constructor?u&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=r(e);return oe(c,"source")||(c.source=o.join("string"==typeof n?n:"")),e};Function.prototype.toString=s((function(){return j(this)&&n(this).source||Je(this)}),"toString")})),it=function(e,t,r,n){n||(n={});var i=n.enumerable,a=void 0!==n.name?n.name:t;if(j(r)&&nt(r,a,n),n.global)i?e[t]=r:ee(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Te.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},at=Math.ceil,ot=Math.floor,st=Math.trunc||function(e){var t=+e;return(t>0?ot:at)(t)},ct=function(e){var t=+e;return t!=t||0===t?0:st(t)},dt=Math.max,ut=Math.min,ft=function(e,t){var r=ct(e);return r<0?dt(r+t,0):ut(r,t)},ht=Math.min,pt=function(e){return e>0?ht(ct(e),9007199254740991):0},lt=function(e){return pt(e.length)},gt=function(e){return function(t,r,n){var i,a=R(t),o=lt(a),s=ft(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},bt={includes:gt(!0),indexOf:gt(!1)},vt=bt.indexOf,It=w([].push),mt=function(e,t){var r,n=R(e),i=0,a=[];for(r in n)!oe($e,r)&&oe(n,r)&&It(a,r);for(;t.length>i;)oe(n,r=t[i++])&&(~vt(a,r)||It(a,r));return a},xt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kt=xt.concat("length","prototype"),wt={f:Object.getOwnPropertyNames||function(e){return mt(e,kt)}},yt={f:Object.getOwnPropertySymbols},Ct=w([].concat),zt=U("Reflect","ownKeys")||function(e){var t=wt.f(Pe(e)),r=yt.f;return r?Ct(t,r(e)):t},Ot=function(e,t,r){for(var n=zt(t),i=Te.f,a=ze.f,o=0;o<n.length;o++){var s=n[o];oe(e,s)||r&&oe(r,s)||i(e,s,a(t,s))}},qt=/#|\.prototype\./,Et=function(e,t){var r=St[Pt(e)];return r==jt||r!=Rt&&(j(t)?d(t):!!t)},Pt=Et.normalize=function(e){return String(e).replace(qt,".").toLowerCase()},St=Et.data={},Rt=Et.NATIVE="N",jt=Et.POLYFILL="P",Tt=Et,Mt=ze.f,Ut=function(e,t){var r,n,i,a,o,s=e.target,d=e.global,u=e.stat;if(r=d?c:u?c[s]||ee(s,{}):(c[s]||{}).prototype)for(n in t){if(a=t[n],i=e.dontCallGetSet?(o=Mt(r,n))&&o.value:r[n],!Tt(d?n:s+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ot(a,i)}(e.sham||i&&i.sham)&&Me(a,"sham",!0),it(r,n,a,e)}},At=Object.keys||function(e){return mt(e,xt)},Bt=d((function(){At(1)}));Ut({target:"Object",stat:!0,forced:Bt},{keys:function(e){return At(ie(e))}});var _t={};_t[ge("toStringTag")]="z";var Nt,Lt="[object z]"===String(_t),Dt=ge("toStringTag"),Ft=Object,Jt="Arguments"==z(function(){return arguments}()),Gt=Lt?z:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Ft(e),Dt))?r:Jt?z(t):"Object"==(n=z(t))&&j(t.callee)?"Arguments":n},Ht=String,Vt=function(e){if("Symbol"===Gt(e))throw TypeError("Cannot convert a Symbol value to a string");return Ht(e)},Wt={f:u&&!Oe?Object.defineProperties:function(e,t){Pe(e);for(var r,n=R(t),i=At(t),a=i.length,o=0;a>o;)Te.f(e,r=i[o++],n[r]);return e}},$t=U("document","documentElement"),Yt=We("IE_PROTO"),Kt=function(){},Qt=function(e){return"<script>"+e+"<\/script>"},Xt=function(e){e.write(Qt("")),e.close();var t=e.parentWindow.Object;return e=null,t},Zt=function(){try{Nt=new ActiveXObject("htmlfile")}catch(e){}var e,t;Zt="undefined"!=typeof document?document.domain&&Nt?Xt(Nt):((t=we("iframe")).style.display="none",$t.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Qt("document.F=Object")),e.close(),e.F):Xt(Nt);for(var r=xt.length;r--;)delete Zt.prototype[xt[r]];return Zt()};$e[Yt]=!0;var er=Object.create||function(e,t){var r;return null!==e?(Kt.prototype=Pe(e),r=new Kt,Kt.prototype=null,r[Yt]=e):r=Zt(),void 0===t?r:Wt.f(r,t)},tr=function(e,t,r){var n=me(t);n in e?Te.f(e,n,v(0,r)):e[n]=r},rr=Array,nr=Math.max,ir=function(e,t,r){for(var n=lt(e),i=ft(t,n),a=ft(void 0===r?n:r,n),o=rr(nr(a-i,0)),s=0;i<a;i++,s++)tr(o,s,e[i]);return o.length=s,o},ar=wt.f,or="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],sr={f:function(e){return or&&"Window"==z(e)?function(e){try{return ar(e)}catch(e){return ir(or)}}(e):ar(R(e))}},cr={f:ge},dr=c,ur=Te.f,fr=Te.f,hr=ge("toStringTag"),pr=function(e,t,r){e&&!r&&(e=e.prototype),e&&!oe(e,hr)&&fr(e,hr,{configurable:!0,value:t})},lr=w(w.bind),gr=function(e,t){return K(e),void 0===t?e:f?lr(e,t):function(){return e.apply(t,arguments)}},br=Array.isArray||function(e){return"Array"==z(e)},vr=function(){},Ir=[],mr=U("Reflect","construct"),xr=/^\s*(?:class|function)\b/,kr=w(xr.exec),wr=!xr.exec(vr),yr=function(e){if(!j(e))return!1;try{return mr(vr,Ir,e),!0}catch(e){return!1}},Cr=function(e){if(!j(e))return!1;switch(Gt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wr||!!kr(xr,Je(e))}catch(e){return!0}};Cr.sham=!0;var zr=!mr||d((function(){var e;return yr(yr.call)||!yr(Object)||!yr((function(){e=!0}))||e}))?Cr:yr,Or=ge("species"),qr=Array,Er=function(e,t){return new(function(e){var t;return br(e)&&(t=e.constructor,(zr(t)&&(t===qr||br(t.prototype))||T(t)&&null===(t=t[Or]))&&(t=void 0)),void 0===t?qr:t}(e))(0===t?0:t)},Pr=w([].push),Sr=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(c,d,u,f){for(var h,p,l=ie(c),g=E(l),b=gr(d,u),v=lt(g),I=0,m=f||Er,x=t?m(c,v):r||o?m(c,0):void 0;v>I;I++)if((s||I in g)&&(p=b(h=g[I],I,l),e))if(t)x[I]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return I;case 2:Pr(x,h)}else switch(e){case 4:return!1;case 7:Pr(x,h)}return a?-1:n||i?i:x}},Rr={forEach:Sr(0),map:Sr(1),filter:Sr(2),some:Sr(3),every:Sr(4),find:Sr(5),findIndex:Sr(6),filterReject:Sr(7)},jr=Rr.forEach,Tr=We("hidden"),Mr=rt.set,Ur=rt.getterFor("Symbol"),Ar=Object.prototype,Br=c.Symbol,_r=Br&&Br.prototype,Nr=c.TypeError,Lr=c.QObject,Dr=ze.f,Fr=Te.f,Jr=sr.f,Gr=b.f,Hr=w([].push),Vr=re("symbols"),Wr=re("op-symbols"),$r=re("wks"),Yr=!Lr||!Lr.prototype||!Lr.prototype.findChild,Kr=u&&d((function(){return 7!=er(Fr({},"a",{get:function(){return Fr(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Dr(Ar,t);n&&delete Ar[t],Fr(e,t,r),n&&e!==Ar&&Fr(Ar,t,n)}:Fr,Qr=function(e,t){var r=Vr[e]=er(_r);return Mr(r,{type:"Symbol",tag:e,description:t}),u||(r.description=t),r},Xr=function(e,t,r){e===Ar&&Xr(Wr,t,r),Pe(e);var n=me(t);return Pe(r),oe(Vr,n)?(r.enumerable?(oe(e,Tr)&&e[Tr][n]&&(e[Tr][n]=!1),r=er(r,{enumerable:v(0,!1)})):(oe(e,Tr)||Fr(e,Tr,v(1,{})),e[Tr][n]=!0),Kr(e,n,r)):Fr(e,n,r)},Zr=function(e,t){Pe(e);var r=R(t),n=At(r).concat(nn(r));return jr(n,(function(t){u&&!p(en,r,t)||Xr(e,t,r[t])})),e},en=function(e){var t=me(e),r=p(Gr,this,t);return!(this===Ar&&oe(Vr,t)&&!oe(Wr,t))&&(!(r||!oe(this,t)||!oe(Vr,t)||oe(this,Tr)&&this[Tr][t])||r)},tn=function(e,t){var r=R(e),n=me(t);if(r!==Ar||!oe(Vr,n)||oe(Wr,n)){var i=Dr(r,n);return!i||!oe(Vr,n)||oe(r,Tr)&&r[Tr][n]||(i.enumerable=!0),i}},rn=function(e){var t=Jr(R(e)),r=[];return jr(t,(function(e){oe(Vr,e)||oe($e,e)||Hr(r,e)})),r},nn=function(e){var t=e===Ar,r=Jr(t?Wr:R(e)),n=[];return jr(r,(function(e){!oe(Vr,e)||t&&!oe(Ar,e)||Hr(n,Vr[e])})),n};J||(_r=(Br=function(){if(A(_r,this))throw Nr("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Vt(arguments[0]):void 0,t=ue(e),r=function(e){this===Ar&&p(r,Wr,e),oe(this,Tr)&&oe(this[Tr],t)&&(this[Tr][t]=!1),Kr(this,t,v(1,e))};return u&&Yr&&Kr(Ar,t,{configurable:!0,set:r}),Qr(t,e)}).prototype,it(_r,"toString",(function(){return Ur(this).tag})),it(Br,"withoutSetter",(function(e){return Qr(ue(e),e)})),b.f=en,Te.f=Xr,Wt.f=Zr,ze.f=tn,wt.f=sr.f=rn,yt.f=nn,cr.f=function(e){return Qr(ge(e),e)},u&&(Fr(_r,"description",{configurable:!0,get:function(){return Ur(this).description}}),it(Ar,"propertyIsEnumerable",en,{unsafe:!0}))),Ut({global:!0,constructor:!0,wrap:!0,forced:!J,sham:!J},{Symbol:Br}),jr(At($r),(function(e){!function(e){var t=dr.Symbol||(dr.Symbol={});oe(t,e)||ur(t,e,{value:cr.f(e)})}(e)})),Ut({target:"Symbol",stat:!0,forced:!J},{useSetter:function(){Yr=!0},useSimple:function(){Yr=!1}}),Ut({target:"Object",stat:!0,forced:!J,sham:!u},{create:function(e,t){return void 0===t?er(e):Zr(er(e),t)},defineProperty:Xr,defineProperties:Zr,getOwnPropertyDescriptor:tn}),Ut({target:"Object",stat:!0,forced:!J},{getOwnPropertyNames:rn}),function(){var e=U("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=ge("toPrimitive");t&&!t[n]&&it(t,n,(function(e){return p(r,this)}),{arity:1})}(),pr(Br,"Symbol"),$e[Tr]=!0;var an=J&&!!Symbol.for&&!!Symbol.keyFor,on=re("string-to-symbol-registry"),sn=re("symbol-to-string-registry");Ut({target:"Symbol",stat:!0,forced:!an},{for:function(e){var t=Vt(e);if(oe(on,t))return on[t];var r=U("Symbol")(t);return on[t]=r,sn[r]=t,r}});var cn=re("symbol-to-string-registry");Ut({target:"Symbol",stat:!0,forced:!an},{keyFor:function(e){if(!V(e))throw TypeError($(e)+" is not a symbol");if(oe(cn,e))return cn[e]}});var dn=Function.prototype,un=dn.apply,fn=dn.call,hn="object"==typeof Reflect&&Reflect.apply||(f?fn.bind(un):function(){return fn.apply(un,arguments)}),pn=w([].slice),ln=U("JSON","stringify"),gn=w(/./.exec),bn=w("".charAt),vn=w("".charCodeAt),In=w("".replace),mn=w(1..toString),xn=/[\uD800-\uDFFF]/g,kn=/^[\uD800-\uDBFF]$/,wn=/^[\uDC00-\uDFFF]$/,yn=!J||d((function(){var e=U("Symbol")();return"[null]"!=ln([e])||"{}"!=ln({a:e})||"{}"!=ln(Object(e))})),Cn=d((function(){return'"\\udf06\\ud834"'!==ln("\udf06\ud834")||'"\\udead"'!==ln("\udead")})),zn=function(e,t){var r=pn(arguments),n=t;if((T(t)||void 0!==e)&&!V(e))return br(t)||(t=function(e,t){if(j(n)&&(t=p(n,this,e,t)),!V(t))return t}),r[1]=t,hn(ln,null,r)},On=function(e,t,r){var n=bn(r,t-1),i=bn(r,t+1);return gn(kn,e)&&!gn(wn,i)||gn(wn,e)&&!gn(kn,n)?"\\u"+mn(vn(e,0),16):e};ln&&Ut({target:"JSON",stat:!0,arity:3,forced:yn||Cn},{stringify:function(e,t,r){var n=pn(arguments),i=hn(yn?zn:ln,null,n);return Cn&&"string"==typeof i?In(i,xn,On):i}});var qn=!J||d((function(){yt.f(1)}));Ut({target:"Object",stat:!0,forced:qn},{getOwnPropertySymbols:function(e){var t=yt.f;return t?t(ie(e)):[]}});var En=ge("species"),Pn=function(e){return F>=51||!d((function(){var t=[];return(t.constructor={})[En]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Sn=Rr.filter,Rn=Pn("filter");Ut({target:"Array",proto:!0,forced:!Rn},{filter:function(e){return Sn(this,e,arguments.length>1?arguments[1]:void 0)}});var jn=Lt?{}.toString:function(){return"[object "+Gt(this)+"]"};Lt||it(Object.prototype,"toString",jn,{unsafe:!0});var Tn=ze.f,Mn=d((function(){Tn(1)}));Ut({target:"Object",stat:!0,forced:!u||Mn,sham:!u},{getOwnPropertyDescriptor:function(e,t){return Tn(R(e),t)}});var Un={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},An=we("span").classList,Bn=An&&An.constructor&&An.constructor.prototype,_n=Bn===Object.prototype?void 0:Bn,Nn=function(e,t){var r=[][e];return!!r&&d((function(){r.call(null,t||function(){return 1},1)}))},Ln=Rr.forEach,Dn=Nn("forEach")?[].forEach:function(e){return Ln(this,e,arguments.length>1?arguments[1]:void 0)},Fn=function(e){if(e&&e.forEach!==Dn)try{Me(e,"forEach",Dn)}catch(t){e.forEach=Dn}};for(var Jn in Un)Un[Jn]&&Fn(c[Jn]&&c[Jn].prototype);Fn(_n),Ut({target:"Object",stat:!0,sham:!u},{getOwnPropertyDescriptors:function(e){for(var t,r,n=R(e),i=ze.f,a=zt(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&tr(o,t,r);return o}});var Gn=Wt.f;Ut({target:"Object",stat:!0,forced:Object.defineProperties!==Gn,sham:!u},{defineProperties:Gn});var Hn=Te.f;Ut({target:"Object",stat:!0,forced:Object.defineProperty!==Hn,sham:!u},{defineProperty:Hn});var Vn=function(){var e=Pe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Wn=RegExp.prototype,$n=_e.PROPER,Yn=RegExp.prototype.toString,Kn=d((function(){return"/a/b"!=Yn.call({source:"a",flags:"b"})})),Qn=$n&&"toString"!=Yn.name;function Xn(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function Zn(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){Xn(a,n,i,o,s,"next",e)}function s(e){Xn(a,n,i,o,s,"throw",e)}o(void 0)}))}}function ei(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ri(e,t,r){return t&&ti(e.prototype,t),r&&ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ni(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(Kn||Qn)&&it(RegExp.prototype,"toString",(function(){var e=Pe(this);return"/"+Vt(e.source)+"/"+Vt(function(e){var t=e.flags;return void 0!==t||"flags"in Wn||oe(e,"flags")||!A(Wn,e)?t:p(Vn,e)}(e))}),{unsafe:!0});var ii=Object.prototype,ai=ii.hasOwnProperty,oi="function"==typeof Symbol?Symbol:{},si=oi.iterator||"@@iterator",ci=oi.asyncIterator||"@@asyncIterator",di=oi.toStringTag||"@@toStringTag";function ui(e,t,r,n){var i=t&&t.prototype instanceof pi?t:pi,a=Object.create(i.prototype),o=new Oi(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return Ei()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=yi(o,r);if(s){if(s===hi)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=fi(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===hi)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,o),a}function fi(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var hi={};function pi(){}function li(){}function gi(){}var bi={};bi[si]=function(){return this};var vi=Object.getPrototypeOf,Ii=vi&&vi(vi(qi([])));Ii&&Ii!==ii&&ai.call(Ii,si)&&(bi=Ii);var mi=gi.prototype=pi.prototype=Object.create(bi);function xi(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function ki(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===li||"GeneratorFunction"===(t.displayName||t.name))}function wi(e,t){var r;this._invoke=function(n,i){function a(){return new t((function(r,a){!function r(n,i,a,o){var s=fi(e[n],e,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&ai.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(s.arg)}(n,i,r,a)}))}return r=r?r.then(a,a):a()}}function yi(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,yi(e,t),"throw"===t.method))return hi;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return hi}var n=fi(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,hi;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,hi):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,hi)}function Ci(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function zi(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Oi(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Ci,this),this.reset(!0)}function qi(e){if(e){var t=e[si];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(ai.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:Ei}}function Ei(){return{value:void 0,done:!0}}li.prototype=mi.constructor=gi,gi.constructor=li,gi[di]=li.displayName="GeneratorFunction",xi(wi.prototype),wi.prototype[ci]=function(){return this},xi(mi),mi[di]="Generator",mi[si]=function(){return this},mi.toString=function(){return"[object Generator]"},Oi.prototype={constructor:Oi,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(zi),!e)for(var t in this)"t"===t.charAt(0)&&ai.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var o=ai.call(i,"catchLoc"),s=ai.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&ai.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,hi):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),hi},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),zi(r),hi}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;zi(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:qi(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),hi}};var Pi={wrap:ui,isGeneratorFunction:ki,AsyncIterator:wi,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,gi):(e.__proto__=gi,di in e||(e[di]="GeneratorFunction")),e.prototype=Object.create(mi),e},awrap:function(e){return{__await:e}},async:function(e,t,r,n,i){void 0===i&&(i=Promise);var a=new wi(ui(e,t,r,n),i);return ki(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},keys:function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},values:qi},Si=Te.f,Ri=ge("unscopables"),ji=Array.prototype;null==ji[Ri]&&Si(ji,Ri,{configurable:!0,value:er(null)});var Ti,Mi,Ui,Ai=function(e){ji[Ri][e]=!0},Bi={},_i=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ni=We("IE_PROTO"),Li=Object,Di=Li.prototype,Fi=_i?Li.getPrototypeOf:function(e){var t=ie(e);if(oe(t,Ni))return t[Ni];var r=t.constructor;return j(r)&&t instanceof r?r.prototype:t instanceof Li?Di:null},Ji=ge("iterator"),Gi=!1;[].keys&&("next"in(Ui=[].keys())?(Mi=Fi(Fi(Ui)))!==Object.prototype&&(Ti=Mi):Gi=!0),(null==Ti||d((function(){var e={};return Ti[Ji].call(e)!==e})))&&(Ti={}),j(Ti[Ji])||it(Ti,Ji,(function(){return this}));var Hi={IteratorPrototype:Ti,BUGGY_SAFARI_ITERATORS:Gi},Vi=Hi.IteratorPrototype,Wi=function(){return this},$i=function(e,t,r,n){var i=t+" Iterator";return e.prototype=er(Vi,{next:v(+!n,r)}),pr(e,i,!1),Bi[i]=Wi,e},Yi=String,Ki=TypeError,Qi=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=w(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Pe(r),function(e){if("object"==typeof e||j(e))return e;throw Ki("Can't set "+Yi(e)+" as a prototype")}(n),t?e(r,n):r.__proto__=n,r}}():void 0),Xi=_e.PROPER,Zi=_e.CONFIGURABLE,ea=Hi.IteratorPrototype,ta=Hi.BUGGY_SAFARI_ITERATORS,ra=ge("iterator"),na=function(){return this},ia=function(e,t,r,n,i,a,o){$i(r,t,n);var s,c,d,u=function(e){if(e===i&&b)return b;if(!ta&&e in l)return l[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},f=t+" Iterator",h=!1,l=e.prototype,g=l[ra]||l["@@iterator"]||i&&l[i],b=!ta&&g||u(i),v="Array"==t&&l.entries||g;if(v&&(s=Fi(v.call(new e)))!==Object.prototype&&s.next&&(Fi(s)!==ea&&(Qi?Qi(s,ea):j(s[ra])||it(s,ra,na)),pr(s,f,!0)),Xi&&"values"==i&&g&&"values"!==g.name&&(Zi?Me(l,"name","values"):(h=!0,b=function(){return p(g,this)})),i)if(c={values:u("values"),keys:a?b:u("keys"),entries:u("entries")},o)for(d in c)(ta||h||!(d in l))&&it(l,d,c[d]);else Ut({target:t,proto:!0,forced:ta||h},c);return l[ra]!==b&&it(l,ra,b,{name:i}),Bi[t]=b,c},aa=Te.f,oa=rt.set,sa=rt.getterFor("Array Iterator"),ca=ia(Array,"Array",(function(e,t){oa(this,{type:"Array Iterator",target:R(e),index:0,kind:t})}),(function(){var e=sa(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),da=Bi.Arguments=Bi.Array;if(Ai("keys"),Ai("values"),Ai("entries"),u&&"values"!==da.name)try{aa(da,"name",{value:"values"})}catch(e){}var ua=w("".charAt),fa=w("".charCodeAt),ha=w("".slice),pa=function(e){return function(t,r){var n,i,a=Vt(S(t)),o=ct(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=fa(a,o))<55296||n>56319||o+1===s||(i=fa(a,o+1))<56320||i>57343?e?ua(a,o):n:e?ha(a,o,o+2):i-56320+(n-55296<<10)+65536}},la={codeAt:pa(!1),charAt:pa(!0)},ga=la.charAt,ba=rt.set,va=rt.getterFor("String Iterator");ia(String,"String",(function(e){ba(this,{type:"String Iterator",string:Vt(e),index:0})}),(function(){var e,t=va(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=ga(r,n),t.index+=e.length,{value:e,done:!1})}));var Ia=ge("iterator"),ma=ge("toStringTag"),xa=ca.values,ka=function(e,t){if(e){if(e[Ia]!==xa)try{Me(e,Ia,xa)}catch(t){e[Ia]=xa}if(e[ma]||Me(e,ma,t),Un[t])for(var r in ca)if(e[r]!==ca[r])try{Me(e,r,ca[r])}catch(t){e[r]=ca[r]}}};for(var wa in Un)ka(c[wa]&&c[wa].prototype,wa);ka(_n,"DOMTokenList");var ya=ge("iterator"),Ca=!d((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ya]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),za=function(e,t,r){for(var n in t)it(e,n,t[n],r);return e},Oa=TypeError,qa=function(e,t){if(A(t,e))return e;throw Oa("Incorrect invocation")},Ea=ge("iterator"),Pa=function(e){if(null!=e)return Q(e,Ea)||Q(e,"@@iterator")||Bi[Gt(e)]},Sa=TypeError,Ra=function(e,t){var r=arguments.length<2?Pa(e):t;if(K(r))return Pe(p(r,e));throw Sa($(e)+" is not iterable")},ja=TypeError,Ta=function(e,t){if(e<t)throw ja("Not enough arguments");return e},Ma=Math.floor,Ua=function(e,t){var r=e.length,n=Ma(r/2);return r<8?Aa(e,t):Ba(e,Ua(ir(e,0,n),t),Ua(ir(e,n),t),t)},Aa=function(e,t){for(var r,n,i=e.length,a=1;a<i;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},Ba=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?n(t[o],r[s])<=0?t[o++]:r[s++]:o<i?t[o++]:r[s++];return e},_a=Ua,Na=ge("iterator"),La=rt.set,Da=rt.getterFor("URLSearchParams"),Fa=rt.getterFor("URLSearchParamsIterator"),Ja=Object.getOwnPropertyDescriptor,Ga=function(e){if(!u)return c[e];var t=Ja(c,e);return t&&t.value},Ha=Ga("fetch"),Va=Ga("Request"),Wa=Ga("Headers"),$a=Va&&Va.prototype,Ya=Wa&&Wa.prototype,Ka=c.RegExp,Qa=c.TypeError,Xa=c.decodeURIComponent,Za=c.encodeURIComponent,eo=w("".charAt),to=w([].join),ro=w([].push),no=w("".replace),io=w([].shift),ao=w([].splice),oo=w("".split),so=w("".slice),co=/\+/g,uo=Array(4),fo=function(e){return uo[e-1]||(uo[e-1]=Ka("((?:%[\\da-f]{2}){"+e+"})","gi"))},ho=function(e){try{return Xa(e)}catch(t){return e}},po=function(e){var t=no(e,co," "),r=4;try{return Xa(t)}catch(e){for(;r;)t=no(t,fo(r--),ho);return t}},lo=/[!'()~]|%20/g,go={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},bo=function(e){return go[e]},vo=function(e){return no(Za(e),lo,bo)},Io=$i((function(e,t){La(this,{type:"URLSearchParamsIterator",iterator:Ra(Da(e).entries),kind:t})}),"Iterator",(function(){var e=Fa(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),mo=function(e){this.entries=[],this.url=null,void 0!==e&&(T(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===eo(e,0)?so(e,1):e:Vt(e)))};mo.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,a,o,s,c=Pa(e);if(c)for(r=(t=Ra(e,c)).next;!(n=p(r,t)).done;){if(a=(i=Ra(Pe(n.value))).next,(o=p(a,i)).done||(s=p(a,i)).done||!p(a,i).done)throw Qa("Expected sequence with length 2");ro(this.entries,{key:Vt(o.value),value:Vt(s.value)})}else for(var d in e)oe(e,d)&&ro(this.entries,{key:d,value:Vt(e[d])})},parseQuery:function(e){if(e)for(var t,r,n=oo(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=oo(t,"="),ro(this.entries,{key:po(io(r)),value:po(to(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],ro(r,vo(e.key)+"="+vo(e.value));return to(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var xo=function(){qa(this,ko);var e=arguments.length>0?arguments[0]:void 0;La(this,new mo(e))},ko=xo.prototype;if(za(ko,{append:function(e,t){Ta(arguments.length,2);var r=Da(this);ro(r.entries,{key:Vt(e),value:Vt(t)}),r.updateURL()},delete:function(e){Ta(arguments.length,1);for(var t=Da(this),r=t.entries,n=Vt(e),i=0;i<r.length;)r[i].key===n?ao(r,i,1):i++;t.updateURL()},get:function(e){Ta(arguments.length,1);for(var t=Da(this).entries,r=Vt(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Ta(arguments.length,1);for(var t=Da(this).entries,r=Vt(e),n=[],i=0;i<t.length;i++)t[i].key===r&&ro(n,t[i].value);return n},has:function(e){Ta(arguments.length,1);for(var t=Da(this).entries,r=Vt(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Ta(arguments.length,1);for(var r,n=Da(this),i=n.entries,a=!1,o=Vt(e),s=Vt(t),c=0;c<i.length;c++)(r=i[c]).key===o&&(a?ao(i,c--,1):(a=!0,r.value=s));a||ro(i,{key:o,value:s}),n.updateURL()},sort:function(){var e=Da(this);_a(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=Da(this).entries,n=gr(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new Io(this,"keys")},values:function(){return new Io(this,"values")},entries:function(){return new Io(this,"entries")}},{enumerable:!0}),it(ko,Na,ko.entries,{name:"entries"}),it(ko,"toString",(function(){return Da(this).serialize()}),{enumerable:!0}),pr(xo,"URLSearchParams"),Ut({global:!0,constructor:!0,forced:!Ca},{URLSearchParams:xo}),!Ca&&j(Wa)){var wo=w(Ya.has),yo=w(Ya.set),Co=function(e){if(T(e)){var t,r=e.body;if("URLSearchParams"===Gt(r))return t=e.headers?new Wa(e.headers):new Wa,wo(t,"content-type")||yo(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),er(e,{body:v(0,Vt(r)),headers:v(0,t)})}return e};if(j(Ha)&&Ut({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Ha(e,arguments.length>1?Co(arguments[1]):{})}}),j(Va)){var zo=function(e){return qa(this,$a),new Va(e,arguments.length>1?Co(arguments[1]):{})};$a.constructor=zo,zo.prototype=$a,Ut({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:zo})}}var Oo={URLSearchParams:xo,getState:Da};function qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qo(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Po=ri((function e(t){if(ei(this,e),ni(this,"baseUri",void 0),ni(this,"proxy",void 0),ni(this,"headers",void 0),ni(this,"parameters",void 0),ni(this,"fetchOptions",void 0),ni(this,"transformRequest",void 0),ni(this,"throwOnBadResponse",void 0),this.headers=Eo({},t.headers),this.parameters=Eo({},t.parameters),!this.parameters.shortCode)throw new Error("Missing required parameter: shortCode");this.fetchOptions=Eo({},t.fetchOptions),this.transformRequest=t.transformRequest||e.defaults.transformRequest,t.baseUri&&(this.baseUri=t.baseUri),t.proxy&&(this.proxy=t.proxy),this.throwOnBadResponse=!!t.throwOnBadResponse}));function So(e){return(So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ni(Po,"defaults",{transformRequest:function(e,t){switch(t["Content-Type"]){case"application/json":return JSON.stringify(e);case"application/x-www-form-urlencoded":return new URLSearchParams(e);default:return e}}});var Ro="object"===("undefined"==typeof window?"undefined":So(window))&&"object"===So(window.document),jo="object"===("undefined"==typeof process?"undefined":So(process))&&"object"===So(process.versions)&&"string"==typeof process.versions.node,To=Function,Mo=w([].concat),Uo=w([].join),Ao={},Bo=function(e,t,r){if(!oe(Ao,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";Ao[t]=To("C,a","return new C("+Uo(n,",")+")")}return Ao[t](e,r)},_o=f?To.bind:function(e){var t=K(this),r=t.prototype,n=pn(arguments,1),i=function(){var r=Mo(n,pn(arguments));return this instanceof i?Bo(t,r.length,r):t.apply(e,r)};return T(r)&&(i.prototype=r),i},No=TypeError,Lo=function(e){if(zr(e))return e;throw No($(e)+" is not a constructor")},Do=U("Reflect","construct"),Fo=Object.prototype,Jo=[].push,Go=d((function(){function e(){}return!(Do((function(){}),[],e)instanceof e)})),Ho=!d((function(){Do((function(){}))})),Vo=Go||Ho;Ut({target:"Reflect",stat:!0,forced:Vo,sham:Vo},{construct:function(e,t){Lo(e),Pe(t);var r=arguments.length<3?e:Lo(arguments[2]);if(Ho&&!Go)return Do(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return hn(Jo,n,t),new(hn(_o,e,n))}var i=r.prototype,a=er(T(i)?i:Fo),o=hn(e,a,t);return T(o)?o:a}});var Wo=TypeError,$o=function(e){if(e>9007199254740991)throw Wo("Maximum allowed index exceeded");return e},Yo=ge("isConcatSpreadable"),Ko=F>=51||!d((function(){var e=[];return e[Yo]=!1,e.concat()[0]!==e})),Qo=Pn("concat"),Xo=function(e){if(!T(e))return!1;var t=e[Yo];return void 0!==t?!!t:br(e)};function Zo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function es(e,t){return(es=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ts(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&es(e,t)}function rs(e,t){if(t&&("object"===So(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zo(e)}function ns(e){return(ns=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function is(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function as(e,t,r){return(as=is()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&es(i,r.prototype),i}).apply(null,arguments)}function os(e){var t="function"==typeof Map?new Map:void 0;return(os=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return as(e,arguments,ns(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),es(n,e)})(e)}function ss(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ns(e);if(t){var i=ns(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rs(this,r)}}Ut({target:"Array",proto:!0,arity:1,forced:!Ko||!Qo},{concat:function(e){var t,r,n,i,a,o=ie(this),s=Er(o,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(Xo(a=-1===t?o:arguments[t]))for(i=lt(a),$o(c+i),r=0;r<i;r++,c++)r in a&&tr(s,c,a[r]);else $o(c+1),tr(s,c++,a);return s.length=c,s}});var cs,ds,us=function(e){ts(r,e);var t=ss(r);function r(e){var n;return ei(this,r),ni(Zo(n=t.call(this,"".concat(e.status," ").concat(e.statusText))),"response",void 0),n.response=e,n}return ri(r)}(os(Error)),fs=c.RegExp,hs=d((function(){var e=fs("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ps=hs||d((function(){return!fs("a","y").sticky})),ls={BROKEN_CARET:hs||d((function(){var e=fs("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:ps,UNSUPPORTED_Y:hs},gs=c.RegExp,bs=d((function(){var e=gs(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),vs=c.RegExp,Is=d((function(){var e=vs("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),ms=rt.get,xs=re("native-string-replace",String.prototype.replace),ks=RegExp.prototype.exec,ws=ks,ys=w("".charAt),Cs=w("".indexOf),zs=w("".replace),Os=w("".slice),qs=(ds=/b*/g,p(ks,cs=/a/,"a"),p(ks,ds,"a"),0!==cs.lastIndex||0!==ds.lastIndex),Es=ls.BROKEN_CARET,Ps=void 0!==/()??/.exec("")[1];(qs||Ps||Es||bs||Is)&&(ws=function(e){var t,r,n,i,a,o,s,c=this,d=ms(c),u=Vt(e),f=d.raw;if(f)return f.lastIndex=c.lastIndex,t=p(ws,f,u),c.lastIndex=f.lastIndex,t;var h=d.groups,l=Es&&c.sticky,g=p(Vn,c),b=c.source,v=0,I=u;if(l&&(g=zs(g,"y",""),-1===Cs(g,"g")&&(g+="g"),I=Os(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==ys(u,c.lastIndex-1))&&(b="(?: "+b+")",I=" "+I,v++),r=new RegExp("^(?:"+b+")",g)),Ps&&(r=new RegExp("^"+b+"$(?!\\s)",g)),qs&&(n=c.lastIndex),i=p(ks,l?r:c,I),l?i?(i.input=Os(i.input,v),i[0]=Os(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:qs&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),Ps&&i&&i.length>1&&p(xs,i[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&h)for(i.groups=o=er(null),a=0;a<h.length;a++)o[(s=h[a])[0]]=i[s[1]];return i});var Ss=ws;Ut({target:"RegExp",proto:!0,forced:/./.exec!==Ss},{exec:Ss});var Rs=ge("species"),js=RegExp.prototype,Ts=function(e,t,r,n){var i=ge(e),a=!d((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),o=a&&!d((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Rs]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!a||!o||r){var s=w(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var o=w(e),c=t.exec;return c===Ss||c===js.exec?a&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:o(r,t,n)}:{done:!1}}));it(String.prototype,e,c[0]),it(js,i,c[1])}n&&Me(js[i],"sham",!0)},Ms=la.charAt,Us=function(e,t,r){return t+(r?Ms(e,t).length:1)},As=Math.floor,Bs=w("".charAt),_s=w("".replace),Ns=w("".slice),Ls=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Ds=/\$([$&'`]|\d{1,2})/g,Fs=function(e,t,r,n,i,a){var o=r+e.length,s=n.length,c=Ds;return void 0!==i&&(i=ie(i),c=Ls),_s(a,c,(function(a,c){var d;switch(Bs(c,0)){case"$":return"$";case"&":return e;case"`":return Ns(t,0,r);case"'":return Ns(t,o);case"<":d=i[Ns(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var f=As(u/10);return 0===f?a:f<=s?void 0===n[f-1]?Bs(c,1):n[f-1]+Bs(c,1):a}d=n[u-1]}return void 0===d?"":d}))},Js=TypeError,Gs=function(e,t){var r=e.exec;if(j(r)){var n=p(r,e,t);return null!==n&&Pe(n),n}if("RegExp"===z(e))return p(Ss,e,t);throw Js("RegExp#exec called on incompatible receiver")},Hs=ge("replace"),Vs=Math.max,Ws=Math.min,$s=w([].concat),Ys=w([].push),Ks=w("".indexOf),Qs=w("".slice),Xs="$0"==="a".replace(/./,"$0"),Zs=!!/./[Hs]&&""===/./[Hs]("a","$0");Ts("replace",(function(e,t,r){var n=Zs?"$":"$0";return[function(e,r){var n=S(this),i=null==e?void 0:Q(e,Hs);return i?p(i,e,n,r):p(t,Vt(n),e,r)},function(e,i){var a=Pe(this),o=Vt(e);if("string"==typeof i&&-1===Ks(i,n)&&-1===Ks(i,"$<")){var s=r(t,a,o,i);if(s.done)return s.value}var c=j(i);c||(i=Vt(i));var d=a.global;if(d){var u=a.unicode;a.lastIndex=0}for(var f=[];;){var h=Gs(a,o);if(null===h)break;if(Ys(f,h),!d)break;""===Vt(h[0])&&(a.lastIndex=Us(o,pt(a.lastIndex),u))}for(var p,l="",g=0,b=0;b<f.length;b++){for(var v=Vt((h=f[b])[0]),I=Vs(Ws(ct(h.index),o.length),0),m=[],x=1;x<h.length;x++)Ys(m,void 0===(p=h[x])?p:String(p));var k=h.groups;if(c){var w=$s([v],m,I,o);void 0!==k&&Ys(w,k);var y=Vt(hn(i,void 0,w))}else y=Fs(v,o,I,m,k,i);I>=g&&(l+=Qs(o,g,I)+y,g=I+v.length)}return l+Qs(o,g)}]}),!!d((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Xs||Zs);var ec,tc=function(e,t,r){return r.get&&nt(r.get,t,{getter:!0}),r.set&&nt(r.set,t,{setter:!0}),Te.f(e,t,r)},rc=Object.assign,nc=Object.defineProperty,ic=w([].concat),ac=!rc||d((function(){if(u&&1!==rc({b:1},rc(nc({},"a",{enumerable:!0,get:function(){nc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=rc({},e)[r]||"abcdefghijklmnopqrst"!=At(rc({},t)).join("")}))?function(e,t){for(var r=ie(e),n=arguments.length,i=1,a=yt.f,o=b.f;n>i;)for(var s,c=E(arguments[i++]),d=a?ic(At(c),a(c)):At(c),f=d.length,h=0;f>h;)s=d[h++],u&&!p(o,c,s)||(r[s]=c[s]);return r}:rc,oc=function(e,t,r){var n,i;Pe(e);try{if(!(n=Q(e,"return"))){if("throw"===t)throw r;return r}n=p(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Pe(n),r},sc=function(e,t,r,n){try{return n?t(Pe(r)[0],r[1]):t(r)}catch(t){oc(e,"throw",t)}},cc=ge("iterator"),dc=Array.prototype,uc=function(e){return void 0!==e&&(Bi.Array===e||dc[cc]===e)},fc=Array,hc=function(e){var t=ie(e),r=zr(this),n=arguments.length,i=n>1?arguments[1]:void 0,a=void 0!==i;a&&(i=gr(i,n>2?arguments[2]:void 0));var o,s,c,d,u,f,h=Pa(t),l=0;if(!h||this===fc&&uc(h))for(o=lt(t),s=r?new this(o):fc(o);o>l;l++)f=a?i(t[l],l):t[l],tr(s,l,f);else for(u=(d=Ra(t,h)).next,s=r?new this:[];!(c=p(u,d)).done;l++)f=a?sc(d,i,[c.value,l],!0):c.value,tr(s,l,f);return s.length=l,s},pc=/[^\0-\u007E]/,lc=/[.\u3002\uFF0E\uFF61]/g,gc="Overflow: input needs wider integers to process",bc=RangeError,vc=w(lc.exec),Ic=Math.floor,mc=String.fromCharCode,xc=w("".charCodeAt),kc=w([].join),wc=w([].push),yc=w("".replace),Cc=w("".split),zc=w("".toLowerCase),Oc=function(e){return e+22+75*(e<26)},qc=function(e,t,r){var n=0;for(e=r?Ic(e/700):e>>1,e+=Ic(e/t);e>455;)e=Ic(e/35),n+=36;return Ic(n+36*e/(e+38))},Ec=function(e){var t,r,n=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=xc(e,r++);if(i>=55296&&i<=56319&&r<n){var a=xc(e,r++);56320==(64512&a)?wc(t,((1023&i)<<10)+(1023&a)+65536):(wc(t,i),r--)}else wc(t,i)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(r=e[t])<128&&wc(n,mc(r));var c=n.length,d=c;for(c&&wc(n,"-");d<i;){var u=2147483647;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<u&&(u=r);var f=d+1;if(u-a>Ic((2147483647-o)/f))throw bc(gc);for(o+=(u-a)*f,a=u,t=0;t<e.length;t++){if((r=e[t])<a&&++o>2147483647)throw bc(gc);if(r==a){for(var h=o,p=36;;){var l=p<=s?1:p>=s+26?26:p-s;if(h<l)break;var g=h-l,b=36-l;wc(n,mc(Oc(l+g%b))),h=Ic(g/b),p+=36}wc(n,mc(Oc(h))),s=qc(o,f,d==c),o=0,d++}}o++,a++}return kc(n,"")},Pc=la.codeAt,Sc=rt.set,Rc=rt.getterFor("URL"),jc=Oo.URLSearchParams,Tc=Oo.getState,Mc=c.URL,Uc=c.TypeError,Ac=c.parseInt,Bc=Math.floor,_c=Math.pow,Nc=w("".charAt),Lc=w(/./.exec),Dc=w([].join),Fc=w(1..toString),Jc=w([].pop),Gc=w([].push),Hc=w("".replace),Vc=w([].shift),Wc=w("".split),$c=w("".slice),Yc=w("".toLowerCase),Kc=w([].unshift),Qc=/[a-z]/i,Xc=/[\d+-.a-z]/i,Zc=/\d/,ed=/^0x/i,td=/^[0-7]+$/,rd=/^\d+$/,nd=/^[\da-f]+$/i,id=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ad=/[\0\t\n\r #/:<>?@[\\\]^|]/,od=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,sd=/[\t\n\r]/g,cd=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)Kc(t,e%256),e=Bc(e/256);return Dc(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=Fc(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},dd={},ud=ac({},dd,{" ":1,'"':1,"<":1,">":1,"`":1}),fd=ac({},ud,{"#":1,"?":1,"{":1,"}":1}),hd=ac({},fd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pd=function(e,t){var r=Pc(e,0);return r>32&&r<127&&!oe(t,e)?e:encodeURIComponent(e)},ld={ftp:21,file:null,http:80,https:443,ws:80,wss:443},gd=function(e,t){var r;return 2==e.length&&Lc(Qc,Nc(e,0))&&(":"==(r=Nc(e,1))||!t&&"|"==r)},bd=function(e){var t;return e.length>1&&gd($c(e,0,2))&&(2==e.length||"/"===(t=Nc(e,2))||"\\"===t||"?"===t||"#"===t)},vd=function(e){return"."===e||"%2e"===Yc(e)},Id={},md={},xd={},kd={},wd={},yd={},Cd={},zd={},Od={},qd={},Ed={},Pd={},Sd={},Rd={},jd={},Td={},Md={},Ud={},Ad={},Bd={},_d={},Nd=function(e,t,r){var n,i,a,o=Vt(e);if(t){if(i=this.parse(o))throw Uc(i);this.searchParams=null}else{if(void 0!==r&&(n=new Nd(r,!0)),i=this.parse(o,null,n))throw Uc(i);(a=Tc(new jc)).bindURL(this),this.searchParams=a}};Nd.prototype={type:"URL",parse:function(e,t,r){var n,i,a,o,s,c=this,d=t||Id,u=0,f="",h=!1,p=!1,l=!1;for(e=Vt(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=Hc(e,od,"")),e=Hc(e,sd,""),n=hc(e);u<=n.length;){switch(i=n[u],d){case Id:if(!i||!Lc(Qc,i)){if(t)return"Invalid scheme";d=xd;continue}f+=Yc(i),d=md;break;case md:if(i&&(Lc(Xc,i)||"+"==i||"-"==i||"."==i))f+=Yc(i);else{if(":"!=i){if(t)return"Invalid scheme";f="",d=xd,u=0;continue}if(t&&(c.isSpecial()!=oe(ld,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&ld[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?d=Rd:c.isSpecial()&&r&&r.scheme==c.scheme?d=kd:c.isSpecial()?d=zd:"/"==n[u+1]?(d=wd,u++):(c.cannotBeABaseURL=!0,Gc(c.path,""),d=Ad)}break;case xd:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=ir(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,d=_d;break}d="file"==r.scheme?Rd:yd;continue;case kd:if("/"!=i||"/"!=n[u+1]){d=yd;continue}d=Od,u++;break;case wd:if("/"==i){d=qd;break}d=Ud;continue;case yd:if(c.scheme=r.scheme,i==ec)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=ir(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())d=Cd;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=ir(r.path),c.query="",d=Bd;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=ir(r.path),c.path.length--,d=Ud;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=ir(r.path),c.query=r.query,c.fragment="",d=_d}break;case Cd:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,d=Ud;continue}d=qd}else d=Od;break;case zd:if(d=Od,"/"!=i||"/"!=Nc(f,u+1))continue;u++;break;case Od:if("/"!=i&&"\\"!=i){d=qd;continue}break;case qd:if("@"==i){h&&(f="%40"+f),h=!0,a=hc(f);for(var g=0;g<a.length;g++){var b=a[g];if(":"!=b||l){var v=pd(b,hd);l?c.password+=v:c.username+=v}else l=!0}f=""}else if(i==ec||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(h&&""==f)return"Invalid authority";u-=hc(f).length+1,f="",d=Ed}else f+=i;break;case Ed:case Pd:if(t&&"file"==c.scheme){d=Td;continue}if(":"!=i||p){if(i==ec||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==f)return"Invalid host";if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(f))return o;if(f="",d=Md,t)return;continue}"["==i?p=!0:"]"==i&&(p=!1),f+=i}else{if(""==f)return"Invalid host";if(o=c.parseHost(f))return o;if(f="",d=Sd,t==Pd)return}break;case Sd:if(!Lc(Zc,i)){if(i==ec||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=f){var I=Ac(f,10);if(I>65535)return"Invalid port";c.port=c.isSpecial()&&I===ld[c.scheme]?null:I,f=""}if(t)return;d=Md;continue}return"Invalid port"}f+=i;break;case Rd:if(c.scheme="file","/"==i||"\\"==i)d=jd;else{if(!r||"file"!=r.scheme){d=Ud;continue}if(i==ec)c.host=r.host,c.path=ir(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=ir(r.path),c.query="",d=Bd;else{if("#"!=i){bd(Dc(ir(n,u),""))||(c.host=r.host,c.path=ir(r.path),c.shortenPath()),d=Ud;continue}c.host=r.host,c.path=ir(r.path),c.query=r.query,c.fragment="",d=_d}}break;case jd:if("/"==i||"\\"==i){d=Td;break}r&&"file"==r.scheme&&!bd(Dc(ir(n,u),""))&&(gd(r.path[0],!0)?Gc(c.path,r.path[0]):c.host=r.host),d=Ud;continue;case Td:if(i==ec||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&gd(f))d=Ud;else if(""==f){if(c.host="",t)return;d=Md}else{if(o=c.parseHost(f))return o;if("localhost"==c.host&&(c.host=""),t)return;f="",d=Md}continue}f+=i;break;case Md:if(c.isSpecial()){if(d=Ud,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=ec&&(d=Ud,"/"!=i))continue}else c.fragment="",d=_d;else c.query="",d=Bd;break;case Ud:if(i==ec||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=Yc(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||Gc(c.path,"")):vd(f)?"/"==i||"\\"==i&&c.isSpecial()||Gc(c.path,""):("file"==c.scheme&&!c.path.length&&gd(f)&&(c.host&&(c.host=""),f=Nc(f,0)+":"),Gc(c.path,f)),f="","file"==c.scheme&&(i==ec||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)Vc(c.path);"?"==i?(c.query="",d=Bd):"#"==i&&(c.fragment="",d=_d)}else f+=pd(i,fd);break;case Ad:"?"==i?(c.query="",d=Bd):"#"==i?(c.fragment="",d=_d):i!=ec&&(c.path[0]+=pd(i,dd));break;case Bd:t||"#"!=i?i!=ec&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":pd(i,dd)):(c.fragment="",d=_d);break;case _d:i!=ec&&(c.fragment+=pd(i,ud))}u++}},parseHost:function(e){var t,r,n;if("["==Nc(e,0)){if("]"!=Nc(e,e.length-1))return"Invalid host";if(!(t=function(e){var t,r,n,i,a,o,s,c=[0,0,0,0,0,0,0,0],d=0,u=null,f=0,h=function(){return Nc(e,f)};if(":"==h()){if(":"!=Nc(e,1))return;f+=2,u=++d}for(;h();){if(8==d)return;if(":"!=h()){for(t=r=0;r<4&&Lc(nd,h());)t=16*t+Ac(h(),16),f++,r++;if("."==h()){if(0==r)return;if(f-=r,d>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;f++}if(!Lc(Zc,h()))return;for(;Lc(Zc,h());){if(a=Ac(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}c[d]=256*c[d]+i,2!=++n&&4!=n||d++}if(4!=n)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[d++]=t}else{if(null!==u)return;f++,u=++d}}if(null!==u)for(o=d-u,d=7;0!=d&&o>0;)s=c[d],c[d--]=c[u+o-1],c[u+--o]=s;else if(8!=d)return;return c}($c(e,1,-1))))return"Invalid host";this.host=t}else if(this.isSpecial()){if(e=function(e){var t,r,n=[],i=Cc(yc(zc(e),lc,"."),".");for(t=0;t<i.length;t++)r=i[t],wc(n,vc(pc,r)?"xn--"+Ec(r):r);return kc(n,".")}(e),Lc(id,e))return"Invalid host";if(null===(t=function(e){var t,r,n,i,a,o,s,c=Wc(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(a=10,i.length>1&&"0"==Nc(i,0)&&(a=Lc(ed,i)?16:8,i=$c(i,8==a?1:2)),""===i)o=0;else{if(!Lc(10==a?rd:8==a?td:nd,i))return e;o=Ac(i,a)}Gc(r,o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=_c(256,5-t))return null}else if(o>255)return null;for(s=Jc(r),n=0;n<r.length;n++)s+=r[n]*_c(256,3-n);return s}(e)))return"Invalid host";this.host=t}else{if(Lc(ad,e))return"Invalid host";for(t="",r=hc(e),n=0;n<r.length;n++)t+=pd(r[n],dd);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return oe(ld,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&gd(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,d=t+":";return null!==i?(d+="//",e.includesCredentials()&&(d+=r+(n?":"+n:"")+"@"),d+=cd(i),null!==a&&(d+=":"+a)):"file"==t&&(d+="//"),d+=e.cannotBeABaseURL?o[0]:o.length?"/"+Dc(o,"/"):"",null!==s&&(d+="?"+s),null!==c&&(d+="#"+c),d},setHref:function(e){var t=this.parse(e);if(t)throw Uc(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Ld(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+cd(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Vt(e)+":",Id)},getUsername:function(){return this.username},setUsername:function(e){var t=hc(Vt(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=pd(t[r],hd)}},getPassword:function(){return this.password},setPassword:function(e){var t=hc(Vt(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=pd(t[r],hd)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?cd(e):cd(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ed)},getHostname:function(){var e=this.host;return null===e?"":cd(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Pd)},getPort:function(){var e=this.port;return null===e?"":Vt(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=Vt(e))?this.port=null:this.parse(e,Sd))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Dc(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Md))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=Vt(e))?this.query=null:("?"==Nc(e,0)&&(e=$c(e,1)),this.query="",this.parse(e,Bd)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=Vt(e))?("#"==Nc(e,0)&&(e=$c(e,1)),this.fragment="",this.parse(e,_d)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ld=function(e){var t=qa(this,Dd),r=Ta(arguments.length,1)>1?arguments[1]:void 0,n=Sc(t,new Nd(e,!1,r));u||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Dd=Ld.prototype,Fd=function(e,t){return{get:function(){return Rc(this)[e]()},set:t&&function(e){return Rc(this)[t](e)},configurable:!0,enumerable:!0}};if(u&&(tc(Dd,"href",Fd("serialize","setHref")),tc(Dd,"origin",Fd("getOrigin")),tc(Dd,"protocol",Fd("getProtocol","setProtocol")),tc(Dd,"username",Fd("getUsername","setUsername")),tc(Dd,"password",Fd("getPassword","setPassword")),tc(Dd,"host",Fd("getHost","setHost")),tc(Dd,"hostname",Fd("getHostname","setHostname")),tc(Dd,"port",Fd("getPort","setPort")),tc(Dd,"pathname",Fd("getPathname","setPathname")),tc(Dd,"search",Fd("getSearch","setSearch")),tc(Dd,"searchParams",Fd("getSearchParams")),tc(Dd,"hash",Fd("getHash","setHash"))),it(Dd,"toJSON",(function(){return Rc(this).serialize()}),{enumerable:!0}),it(Dd,"toString",(function(){return Rc(this).serialize()}),{enumerable:!0}),Mc){var Jd=Mc.createObjectURL,Gd=Mc.revokeObjectURL;Jd&&it(Ld,"createObjectURL",gr(Jd,Mc)),Gd&&it(Ld,"revokeObjectURL",gr(Gd,Mc))}function Hd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ns(e);if(t){var i=ns(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rs(this,r)}}pr(Ld,"URL"),Ut({global:!0,constructor:!0,forced:!Ca,sham:!u},{URL:Ld});var Vd=function(e){ts(r,e);var t=Hd(r);function r(e,n,i){var a;return ei(this,r),(a=t.call(this,r.renderTemplateUri("".concat(n,"/").concat(e).replace(/\/\/+/g,"/"),null==i?void 0:i.pathParams))).addQueryParams(null==i?void 0:i.queryParams),null!=i&&i.origin&&a.replaceOrigin(null==i?void 0:i.origin),a}return ri(r,[{key:"replaceOrigin",value:function(e){var t=new URL(e);this.protocol=t.protocol,this.host=t.host,this.pathname="".concat(t.pathname,"/").concat(this.pathname).replace(/\/\/+/g,"/")}},{key:"addQueryParams",value:function(e){var t=this;e&&Object.keys(e).forEach((function(r){var n=e[r];if(Array.isArray(n))for(var i=0;i<n.length;i+=1)t.searchParams.append(r,String(n[i]));else t.searchParams.append(r,String(n))}))}}],[{key:"renderTemplateUri",value:function(e,t){return t?e.replace(/\{([^\}]+)\}/g,(function(e,r){return String(t[r])})):e}}]),r}(os(URL)),Wd="commerce-sdk-isomorphic@1.8.0";function $d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$d(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kd=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=Yd({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I,m,x,k,w,y,C,z,O,q,E,P,S,R,j;return ri(e,[{key:"createBasket",value:(j=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0!==i.taxMode?s.taxMode=i.taxMode:void 0!==a.taxMode&&(s.taxMode=a.taxMode),void 0===i.siteId){e.next=18;break}s.siteId=i.siteId,e.next=23;break;case 18:if(void 0===a.siteId){e.next=22;break}s.siteId=a.siteId,e.next=23;break;case 22:throw new Error("Missing required query parameter: siteId");case 23:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=30,t.fetch(u);case 30:if(f=e.sent,!n){e.next=35;break}return e.abrupt("return",f);case 35:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=39;break}throw new us(f);case 39:return e.next=41,f.text();case 41:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 43:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"transferBasket",value:(R=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0!==i.overrideExisting?s.overrideExisting=i.overrideExisting:void 0!==a.overrideExisting&&(s.overrideExisting=a.overrideExisting),void 0===i.siteId){e.next=18;break}s.siteId=i.siteId,e.next=23;break;case 18:if(void 0===a.siteId){e.next=22;break}s.siteId=a.siteId,e.next=23;break;case 22:throw new Error("Missing required query parameter: siteId");case 23:return c=new Vd("/organizations/{organizationId}/baskets/actions/transfer",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"POST"})),e.next=29,t.fetch(u);case 29:if(f=e.sent,!n){e.next=34;break}return e.abrupt("return",f);case 34:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=38;break}throw new us(f);case 38:return e.next=40,f.text();case 40:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"mergeBasket",value:(S=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0!==i.createDestinationBasket?s.createDestinationBasket=i.createDestinationBasket:void 0!==a.createDestinationBasket&&(s.createDestinationBasket=a.createDestinationBasket),void 0!==i.productItemMergeMode?s.productItemMergeMode=i.productItemMergeMode:void 0!==a.productItemMergeMode&&(s.productItemMergeMode=a.productItemMergeMode),void 0===i.siteId){e.next=19;break}s.siteId=i.siteId,e.next=24;break;case 19:if(void 0===a.siteId){e.next=23;break}s.siteId=a.siteId,e.next=24;break;case 23:throw new Error("Missing required query parameter: siteId");case 24:return c=new Vd("/organizations/{organizationId}/baskets/actions/merge",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"POST"})),e.next=30,t.fetch(u);case 30:if(f=e.sent,!n){e.next=35;break}return e.abrupt("return",f);case 35:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=39;break}throw new us(f);case 39:return e.next=41,f.text();case 41:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 43:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"deleteBasket",value:(P=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=44;break}throw new us(f);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getBasket",value:(E=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"updateBasket",value:(q=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"updateBillingAddressForBasket",value:(O=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0!==i.useAsShipping?s.useAsShipping=i.useAsShipping:void 0!==a.useAsShipping&&(s.useAsShipping=a.useAsShipping),void 0!==i.removeExternalTax?s.removeExternalTax=i.removeExternalTax:void 0!==a.removeExternalTax&&(s.removeExternalTax=a.removeExternalTax),void 0===i.siteId){e.next=28;break}s.siteId=i.siteId,e.next=33;break;case 28:if(void 0===a.siteId){e.next=32;break}s.siteId=a.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/billing-address",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=40,t.fetch(u);case 40:if(f=e.sent,!n){e.next=45;break}return e.abrupt("return",f);case 45:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=49;break}throw new us(f);case 49:return e.next=51,f.text();case 51:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"addCouponToBasket",value:(z=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/coupons",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"removeCouponFromBasket",value:(C=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.couponItemId){e.next=25;break}o.couponItemId=i.couponItemId,e.next=30;break;case 25:if(void 0===a.couponItemId){e.next=29;break}o.couponItemId=a.couponItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: couponItemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/coupons/{couponItemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"updateCustomerForBasket",value:(y=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/customer",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"addGiftCertificateItemToBasket",value:(w=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"removeGiftCertificateItemFromBasket",value:(k=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.giftCertificateItemId){e.next=25;break}o.giftCertificateItemId=i.giftCertificateItemId,e.next=30;break;case 25:if(void 0===a.giftCertificateItemId){e.next=29;break}o.giftCertificateItemId=a.giftCertificateItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: giftCertificateItemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items/{giftCertificateItemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"updateGiftCertificateItemInBasket",value:(x=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.giftCertificateItemId){e.next=25;break}o.giftCertificateItemId=i.giftCertificateItemId,e.next=30;break;case 25:if(void 0===a.giftCertificateItemId){e.next=29;break}o.giftCertificateItemId=a.giftCertificateItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: giftCertificateItemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items/{giftCertificateItemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"addItemToBasket",value:(m=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/items",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"removeItemFromBasket",value:(I=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.itemId){e.next=25;break}o.itemId=i.itemId,e.next=30;break;case 25:if(void 0===a.itemId){e.next=29;break}o.itemId=a.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"updateItemInBasket",value:(v=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.itemId){e.next=25;break}o.itemId=i.itemId,e.next=30;break;case 25:if(void 0===a.itemId){e.next=29;break}o.itemId=a.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(s={},void 0!==i.removeExternalTax?s.removeExternalTax=i.removeExternalTax:void 0!==a.removeExternalTax&&(s.removeExternalTax=a.removeExternalTax),void 0===i.siteId){e.next=36;break}s.siteId=i.siteId,e.next=41;break;case 36:if(void 0===a.siteId){e.next=40;break}s.siteId=a.siteId,e.next=41;break;case 40:throw new Error("Missing required query parameter: siteId");case 41:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=48,t.fetch(u);case 48:if(f=e.sent,!n){e.next=53;break}return e.abrupt("return",f);case 53:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=57;break}throw new us(f);case 57:return e.next=59,f.text();case 59:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"addTaxesForBasketItem",value:(b=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.itemId){e.next=25;break}o.itemId=i.itemId,e.next=30;break;case 25:if(void 0===a.itemId){e.next=29;break}o.itemId=a.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}/taxes",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=53;break}throw new us(f);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"addPaymentInstrumentToBasket",value:(g=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/payment-instruments",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"removePaymentInstrumentFromBasket",value:(l=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"updatePaymentInstrumentInBasket",value:(p=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0!==i.removeExternalTax?s.removeExternalTax=i.removeExternalTax:void 0!==a.removeExternalTax&&(s.removeExternalTax=a.removeExternalTax),void 0===i.siteId){e.next=36;break}s.siteId=i.siteId,e.next=41;break;case 36:if(void 0===a.siteId){e.next=40;break}s.siteId=a.siteId,e.next=41;break;case 40:throw new Error("Missing required query parameter: siteId");case 41:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=48,t.fetch(u);case 48:if(f=e.sent,!n){e.next=53;break}return e.abrupt("return",f);case 53:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=57;break}throw new us(f);case 57:return e.next=59,f.text();case 59:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getPaymentMethodsForBasket",value:(h=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/payment-methods",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getPriceBooksForBasket",value:(f=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/price-books",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"addPriceBooksToBasket",value:(u=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/price-books",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=44;break}throw new us(f);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"createShipmentForBasket",value:(d=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"removeShipmentFromBasket",value:(c=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.shipmentId){e.next=25;break}o.shipmentId=i.shipmentId,e.next=30;break;case 25:if(void 0===a.shipmentId){e.next=29;break}o.shipmentId=a.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"updateShipmentForBasket",value:(s=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.shipmentId){e.next=25;break}o.shipmentId=i.shipmentId,e.next=30;break;case 25:if(void 0===a.shipmentId){e.next=29;break}o.shipmentId=a.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"updateShippingAddressForShipment",value:(o=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.shipmentId){e.next=25;break}o.shipmentId=i.shipmentId,e.next=30;break;case 25:if(void 0===a.shipmentId){e.next=29;break}o.shipmentId=a.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(s={},void 0!==i.useAsBilling?s.useAsBilling=i.useAsBilling:void 0!==a.useAsBilling&&(s.useAsBilling=a.useAsBilling),void 0!==i.removeExternalTax?s.removeExternalTax=i.removeExternalTax:void 0!==a.removeExternalTax&&(s.removeExternalTax=a.removeExternalTax),void 0===i.siteId){e.next=37;break}s.siteId=i.siteId,e.next=42;break;case 37:if(void 0===a.siteId){e.next=41;break}s.siteId=a.siteId,e.next=42;break;case 41:throw new Error("Missing required query parameter: siteId");case 42:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-address",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=49,t.fetch(u);case 49:if(f=e.sent,!n){e.next=54;break}return e.abrupt("return",f);case 54:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=58;break}throw new us(f);case 58:return e.next=60,f.text();case 60:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 62:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateShippingMethodForShipment",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.shipmentId){e.next=25;break}o.shipmentId=i.shipmentId,e.next=30;break;case 25:if(void 0===a.shipmentId){e.next=29;break}o.shipmentId=a.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-method",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getShippingMethodsForShipment",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===i.shipmentId){e.next=25;break}o.shipmentId=i.shipmentId,e.next=30;break;case 25:if(void 0===a.shipmentId){e.next=29;break}o.shipmentId=a.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-methods",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getTaxesFromBasket",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/taxes",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"addTaxesForBasket",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.basketId){e.next=16;break}o.basketId=i.basketId,e.next=21;break;case 16:if(void 0===a.basketId){e.next=20;break}o.basketId=a.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/baskets/{basketId}/taxes",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Yd(Yd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Yd(Yd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=44;break}throw new us(f);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function Qd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qd(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(Kd,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-baskets/{version}");var Zd=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=Xd({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a;return ri(e,[{key:"getShopperContext",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.usid){e.next=16;break}o.usid=i.usid,e.next=21;break;case 16:if(void 0===a.usid){e.next=20;break}o.usid=a.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return s={},c=new Vd("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Xd(Xd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Xd(Xd({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"createShopperContext",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.usid){e.next=16;break}o.usid=i.usid,e.next=21;break;case 16:if(void 0===a.usid){e.next=20;break}o.usid=a.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return s={},c=new Vd("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Xd(Xd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Xd(Xd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"deleteShopperContext",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.usid){e.next=16;break}o.usid=i.usid,e.next=21;break;case 16:if(void 0===a.usid){e.next=20;break}o.usid=a.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return s={},c=new Vd("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Xd(Xd({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Xd(Xd({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=35;break}throw new us(f);case 35:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"updateShopperContext",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.usid){e.next=16;break}o.usid=i.usid,e.next=21;break;case 16:if(void 0===a.usid){e.next=20;break}o.usid=a.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return s={},c=new Vd("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Xd(Xd({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Xd(Xd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function eu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(Zd,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-context/{version}");var ru=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=tu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I,m,x,k,w,y,C,z,O,q,E,P,S,R,j,T;return ri(e,[{key:"registerCustomer",value:(T=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"invalidateCustomerAuth",value:(j=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers/actions/logout",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=35;break}throw new us(f);case 35:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"authorizeCustomer",value:(R=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.clientId){e.next=17;break}s.clientId=i.clientId,e.next=22;break;case 17:if(void 0===a.clientId){e.next=21;break}s.clientId=a.clientId,e.next=22;break;case 21:throw new Error("Missing required query parameter: clientId");case 22:if(void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/actions/login",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"authorizeTrustedSystem",value:(S=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers/trusted-system/actions/login",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"resetPassword",value:(P=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers/password/actions/reset",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=35;break}throw new us(f);case 35:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getResetPasswordToken",value:(E=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers/password/actions/create-reset-token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"registerExternalProfile",value:(q=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/customers/external-profile",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getExternalProfile",value:(O=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.externalId){e.next=17;break}s.externalId=i.externalId,e.next=22;break;case 17:if(void 0===a.externalId){e.next=21;break}s.externalId=a.externalId,e.next=22;break;case 21:throw new Error("Missing required query parameter: externalId");case 22:if(void 0===i.authenticationProviderId){e.next=26;break}s.authenticationProviderId=i.authenticationProviderId,e.next=31;break;case 26:if(void 0===a.authenticationProviderId){e.next=30;break}s.authenticationProviderId=a.authenticationProviderId,e.next=31;break;case 30:throw new Error("Missing required query parameter: authenticationProviderId");case 31:if(void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/external-profile",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getCustomer",value:(z=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"updateCustomer",value:(C=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"createCustomerAddress",value:(y=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/addresses",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"getCustomerAddress",value:(w=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.addressName){e.next=25;break}o.addressName=i.addressName,e.next=30;break;case 25:if(void 0===a.addressName){e.next=29;break}o.addressName=a.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"removeCustomerAddress",value:(k=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.addressName){e.next=25;break}o.addressName=i.addressName,e.next=30;break;case 25:if(void 0===a.addressName){e.next=29;break}o.addressName=a.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=53;break}throw new us(f);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"updateCustomerAddress",value:(x=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.addressName){e.next=25;break}o.addressName=i.addressName,e.next=30;break;case 25:if(void 0===a.addressName){e.next=29;break}o.addressName=a.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getCustomerBaskets",value:(m=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/baskets",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"getCustomerOrders",value:(I=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0!==i.crossSites?s.crossSites=i.crossSites:void 0!==a.crossSites&&(s.crossSites=a.crossSites),void 0!==i.from?s.from=i.from:void 0!==a.from&&(s.from=a.from),void 0!==i.until?s.until=i.until:void 0!==a.until&&(s.until=a.until),void 0!==i.status?s.status=i.status:void 0!==a.status&&(s.status=a.status),void 0===i.siteId){e.next=30;break}s.siteId=i.siteId,e.next=35;break;case 30:if(void 0===a.siteId){e.next=34;break}s.siteId=a.siteId,e.next=35;break;case 34:throw new Error("Missing required query parameter: siteId");case 35:return void 0!==i.offset?s.offset=i.offset:void 0!==a.offset&&(s.offset=a.offset),void 0!==i.limit?s.limit=i.limit:void 0!==a.limit&&(s.limit=a.limit),c=new Vd("/organizations/{organizationId}/customers/{customerId}/orders",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=43,t.fetch(u);case 43:if(f=e.sent,!n){e.next=48;break}return e.abrupt("return",f);case 48:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=52;break}throw new us(f);case 52:return e.next=54,f.text();case 54:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"updateCustomerPassword",value:(v=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/password",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PUT"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=44;break}throw new us(f);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"createCustomerPaymentInstrument",value:(b=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/payment-instruments",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"deleteCustomerPaymentInstrument",value:(g=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=53;break}throw new us(f);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getCustomerPaymentInstrument",value:(l=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getCustomerProductLists",value:(p=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createCustomerProductList",value:(h=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"deleteCustomerProductList",value:(f=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=53;break}throw new us(f);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getCustomerProductList",value:(u=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateCustomerProductList",value:(d=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"createCustomerProductListItem",value:(c=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"deleteCustomerProductListItem",value:(s=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===i.itemId){e.next=34;break}o.itemId=i.itemId,e.next=39;break;case 34:if(void 0===a.itemId){e.next=38;break}o.itemId=a.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(s={},void 0===i.siteId){e.next=44;break}s.siteId=i.siteId,e.next=49;break;case 44:if(void 0===a.siteId){e.next=48;break}s.siteId=a.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=55,t.fetch(u);case 55:if(f=e.sent,!n){e.next=60;break}return e.abrupt("return",f);case 60:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=62;break}throw new us(f);case 62:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getCustomerProductListItem",value:(o=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===i.itemId){e.next=34;break}o.itemId=i.itemId,e.next=39;break;case 34:if(void 0===a.itemId){e.next=38;break}o.itemId=a.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(s={},void 0===i.siteId){e.next=44;break}s.siteId=i.siteId,e.next=49;break;case 44:if(void 0===a.siteId){e.next=48;break}s.siteId=a.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=55,t.fetch(u);case 55:if(f=e.sent,!n){e.next=60;break}return e.abrupt("return",f);case 60:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=64;break}throw new us(f);case 64:return e.next=66,f.text();case 66:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 68:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateCustomerProductListItem",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.customerId){e.next=16;break}o.customerId=i.customerId,e.next=21;break;case 16:if(void 0===a.customerId){e.next=20;break}o.customerId=a.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===i.listId){e.next=25;break}o.listId=i.listId,e.next=30;break;case 25:if(void 0===a.listId){e.next=29;break}o.listId=a.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===i.itemId){e.next=34;break}o.itemId=i.itemId,e.next=39;break;case 34:if(void 0===a.itemId){e.next=38;break}o.itemId=a.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(s={},void 0===i.siteId){e.next=44;break}s.siteId=i.siteId,e.next=49;break;case 44:if(void 0===a.siteId){e.next=48;break}s.siteId=a.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return c=new Vd("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=55,t.fetch(u);case 55:if(f=e.sent,!n){e.next=60;break}return e.abrupt("return",f);case 60:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=64;break}throw new us(f);case 64:return e.next=66,f.text();case 66:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 68:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getPublicProductListsBySearchTerm",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0!==i.email?s.email=i.email:void 0!==a.email&&(s.email=a.email),void 0!==i.firstName?s.firstName=i.firstName:void 0!==a.firstName&&(s.firstName=a.firstName),void 0!==i.lastName?s.lastName=i.lastName:void 0!==a.lastName&&(s.lastName=a.lastName),void 0===i.siteId){e.next=20;break}s.siteId=i.siteId,e.next=25;break;case 20:if(void 0===a.siteId){e.next=24;break}s.siteId=a.siteId,e.next=25;break;case 24:throw new Error("Missing required query parameter: siteId");case 25:return c=new Vd("/organizations/{organizationId}/product-lists",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=31,t.fetch(u);case 31:if(f=e.sent,!n){e.next=36;break}return e.abrupt("return",f);case 36:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=40;break}throw new us(f);case 40:return e.next=42,f.text();case 42:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getPublicProductList",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.listId){e.next=16;break}o.listId=i.listId,e.next=21;break;case 16:if(void 0===a.listId){e.next=20;break}o.listId=a.listId,e.next=21;break;case 20:throw new Error("Missing required path parameter: listId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProductListItem",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.listId){e.next=16;break}o.listId=i.listId,e.next=21;break;case 16:if(void 0===a.listId){e.next=20;break}o.listId=a.listId,e.next=21;break;case 20:throw new Error("Missing required path parameter: listId");case 21:if(void 0===i.itemId){e.next=25;break}o.itemId=i.itemId,e.next=30;break;case 25:if(void 0===a.itemId){e.next=29;break}o.itemId=a.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return c=new Vd("/organizations/{organizationId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=tu(tu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),tu(tu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=46,t.fetch(u);case 46:if(f=e.sent,!n){e.next=51;break}return e.abrupt("return",f);case 51:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=55;break}throw new us(f);case 55:return e.next=57,f.text();case 57:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function nu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(ru,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/{version}");var au=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=iu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n;return ri(e,[{key:"retrieveResults",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.channelId){e.next=16;break}o.channelId=i.channelId,e.next=21;break;case 16:if(void 0===a.channelId){e.next=20;break}o.channelId=a.channelId,e.next=21;break;case 20:throw new Error("Missing required path parameter: channelId");case 21:if(s={},void 0===i.locale){e.next=26;break}s.locale=i.locale,e.next=31;break;case 26:if(void 0===a.locale){e.next=30;break}s.locale=a.locale,e.next=31;break;case 30:throw new Error("Missing required query parameter: locale");case 31:return void 0!==i.offset?s.offset=i.offset:void 0!==a.offset&&(s.offset=a.offset),void 0!==i.limit?s.limit=i.limit:void 0!==a.limit&&(s.limit=a.limit),c=new Vd("/organizations/{organizationId}/channels/{channelId}/results",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=iu(iu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),iu(iu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=39,t.fetch(u);case 39:if(f=e.sent,!n){e.next=44;break}return e.abrupt("return",f);case 44:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=48;break}throw new us(f);case 48:return e.next=50,f.text();case 50:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getSuggestions",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.channelId){e.next=16;break}o.channelId=i.channelId,e.next=21;break;case 16:if(void 0===a.channelId){e.next=20;break}o.channelId=a.channelId,e.next=21;break;case 20:throw new Error("Missing required path parameter: channelId");case 21:if(s={},void 0===i.suggestionTypes){e.next=26;break}s.suggestionTypes=i.suggestionTypes,e.next=31;break;case 26:if(void 0===a.suggestionTypes){e.next=30;break}s.suggestionTypes=a.suggestionTypes,e.next=31;break;case 30:throw new Error("Missing required query parameter: suggestionTypes");case 31:if(void 0!==i.searchText?s.searchText=i.searchText:void 0!==a.searchText&&(s.searchText=a.searchText),void 0===i.locale){e.next=36;break}s.locale=i.locale,e.next=41;break;case 36:if(void 0===a.locale){e.next=40;break}s.locale=a.locale,e.next=41;break;case 40:throw new Error("Missing required query parameter: locale");case 41:return c=new Vd("/organizations/{organizationId}/channels/{channelId}/suggestions",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=iu(iu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),iu(iu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function ou(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function su(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ou(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(au,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/discovery/query/{version}");var cu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=su({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r;return ri(e,[{key:"getGiftCertificate",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return c=new Vd("/organizations/{organizationId}/gift-certificate",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=su(su({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),su(su({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function du(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?du(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):du(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(cu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-gift-certificates/{version}");var fu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=uu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I,m;return ri(e,[{key:"retrieveCredQualityUserInfo",value:(m=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.username){e.next=17;break}s.username=i.username,e.next=22;break;case 17:if(void 0===a.username){e.next=21;break}s.username=a.username,e.next=22;break;case 21:throw new Error("Missing required query parameter: username");case 22:return c=new Vd("/organizations/{organizationId}/cred-qual/user",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=28,t.fetch(u);case 28:if(f=e.sent,!n){e.next=33;break}return e.abrupt("return",f);case 33:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=37;break}throw new us(f);case 37:return e.next=39,f.text();case 39:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"authenticateCustomer",value:(I=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/login",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=26;break}throw new us(f);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"authorizePasswordlessCustomer",value:(v=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/passwordless/login",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"logoutCustomer",value:(b=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.client_id){e.next=17;break}s.client_id=i.client_id,e.next=22;break;case 17:if(void 0===a.client_id){e.next=21;break}s.client_id=a.client_id,e.next=22;break;case 21:throw new Error("Missing required query parameter: client_id");case 22:if(void 0===i.refresh_token){e.next=26;break}s.refresh_token=i.refresh_token,e.next=31;break;case 26:if(void 0===a.refresh_token){e.next=30;break}s.refresh_token=a.refresh_token,e.next=31;break;case 30:throw new Error("Missing required query parameter: refresh_token");case 31:return void 0!==i.channel_id?s.channel_id=i.channel_id:void 0!==a.channel_id&&(s.channel_id=a.channel_id),void 0!==i.hint?s.hint=i.hint:void 0!==a.hint&&(s.hint=a.hint),c=new Vd("/organizations/{organizationId}/oauth2/logout",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=39,t.fetch(u);case 39:if(f=e.sent,!n){e.next=44;break}return e.abrupt("return",f);case 44:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=48;break}throw new us(f);case 48:return e.next=50,f.text();case 50:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"authorizeCustomer",value:(g=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.redirect_uri){e.next=17;break}s.redirect_uri=i.redirect_uri,e.next=22;break;case 17:if(void 0===a.redirect_uri){e.next=21;break}s.redirect_uri=a.redirect_uri,e.next=22;break;case 21:throw new Error("Missing required query parameter: redirect_uri");case 22:if(void 0===i.response_type){e.next=26;break}s.response_type=i.response_type,e.next=31;break;case 26:if(void 0===a.response_type){e.next=30;break}s.response_type=a.response_type,e.next=31;break;case 30:throw new Error("Missing required query parameter: response_type");case 31:if(void 0===i.client_id){e.next=35;break}s.client_id=i.client_id,e.next=40;break;case 35:if(void 0===a.client_id){e.next=39;break}s.client_id=a.client_id,e.next=40;break;case 39:throw new Error("Missing required query parameter: client_id");case 40:if(void 0!==i.scope?s.scope=i.scope:void 0!==a.scope&&(s.scope=a.scope),void 0!==i.state?s.state=i.state:void 0!==a.state&&(s.state=a.state),void 0!==i.usid?s.usid=i.usid:void 0!==a.usid&&(s.usid=a.usid),void 0!==i.hint?s.hint=i.hint:void 0!==a.hint&&(s.hint=a.hint),void 0!==i.channel_id?s.channel_id=i.channel_id:void 0!==a.channel_id&&(s.channel_id=a.channel_id),void 0===i.code_challenge){e.next=49;break}s.code_challenge=i.code_challenge,e.next=54;break;case 49:if(void 0===a.code_challenge){e.next=53;break}s.code_challenge=a.code_challenge,e.next=54;break;case 53:throw new Error("Missing required query parameter: code_challenge");case 54:return c=new Vd("/organizations/{organizationId}/oauth2/authorize",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=60,t.fetch(u);case 60:if(f=e.sent,!n){e.next=65;break}return e.abrupt("return",f);case 65:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=67;break}throw new us(f);case 67:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getAccessToken",value:(l=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getSessionBridgeAccessToken",value:(p=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/session-bridge/token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getTrustedSystemAccessToken",value:(h=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/trusted-system/token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTrustedAgentAuthorizationToken",value:(f=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.client_id){e.next=17;break}s.client_id=i.client_id,e.next=22;break;case 17:if(void 0===a.client_id){e.next=21;break}s.client_id=a.client_id,e.next=22;break;case 21:throw new Error("Missing required query parameter: client_id");case 22:if(void 0===i.channel_id){e.next=26;break}s.channel_id=i.channel_id,e.next=31;break;case 26:if(void 0===a.channel_id){e.next=30;break}s.channel_id=a.channel_id,e.next=31;break;case 30:throw new Error("Missing required query parameter: channel_id");case 31:if(void 0===i.code_challenge){e.next=35;break}s.code_challenge=i.code_challenge,e.next=40;break;case 35:if(void 0===a.code_challenge){e.next=39;break}s.code_challenge=a.code_challenge,e.next=40;break;case 39:throw new Error("Missing required query parameter: code_challenge");case 40:if(void 0===i.login_id){e.next=44;break}s.login_id=i.login_id,e.next=49;break;case 44:if(void 0===a.login_id){e.next=48;break}s.login_id=a.login_id,e.next=49;break;case 48:throw new Error("Missing required query parameter: login_id");case 49:if(void 0===i.idp_origin){e.next=53;break}s.idp_origin=i.idp_origin,e.next=58;break;case 53:if(void 0===a.idp_origin){e.next=57;break}s.idp_origin=a.idp_origin,e.next=58;break;case 57:throw new Error("Missing required query parameter: idp_origin");case 58:if(void 0===i.redirect_uri){e.next=62;break}s.redirect_uri=i.redirect_uri,e.next=67;break;case 62:if(void 0===a.redirect_uri){e.next=66;break}s.redirect_uri=a.redirect_uri,e.next=67;break;case 66:throw new Error("Missing required query parameter: redirect_uri");case 67:if(void 0===i.response_type){e.next=71;break}s.response_type=i.response_type,e.next=76;break;case 71:if(void 0===a.response_type){e.next=75;break}s.response_type=a.response_type,e.next=76;break;case 75:throw new Error("Missing required query parameter: response_type");case 76:return c=new Vd("/organizations/{organizationId}/oauth2/trusted-agent/authorize",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=82,t.fetch(u);case 82:if(f=e.sent,!n){e.next=87;break}return e.abrupt("return",f);case 87:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=89;break}throw new us(f);case 89:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getTrustedAgentAccessToken",value:(u=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/trusted-agent/token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getPasswordResetToken",value:(d=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/password/reset",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=26;break}throw new us(f);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"resetPassword",value:(c=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/password/action",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=26;break}throw new us(f);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getPasswordLessAccessToken",value:(s=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/passwordless/token",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"revokeToken",value:(o=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/revoke",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"introspectToken",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/introspect",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getUserInfo",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},void 0!==i.channel_id?s.channel_id=i.channel_id:void 0!==a.channel_id&&(s.channel_id=a.channel_id),c=new Vd("/organizations/{organizationId}/oauth2/userinfo",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=20,t.fetch(u);case 20:if(f=e.sent,!n){e.next=25;break}return e.abrupt("return",f);case 25:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=29;break}throw new us(f);case 29:return e.next=31,f.text();case 31:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getWellknownOpenidConfiguration",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/.well-known/openid-configuration",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getJwksUri",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return s={},c=new Vd("/organizations/{organizationId}/oauth2/jwks",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=uu(uu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),uu(uu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=19,t.fetch(u);case 19:if(f=e.sent,!n){e.next=24;break}return e.abrupt("return",f);case 24:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=28;break}throw new us(f);case 28:return e.next=30,f.text();case 30:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function hu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(fu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/{version}");var lu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=pu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a,o,s,c;return ri(e,[{key:"createOrder",value:(c=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=29,t.fetch(u);case 29:if(f=e.sent,!n){e.next=34;break}return e.abrupt("return",f);case 34:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=38;break}throw new us(f);case 38:return e.next=40,f.text();case 40:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getOrder",value:(s=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders/{orderNo}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"createPaymentInstrumentForOrder",value:(o=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders/{orderNo}/payment-instruments",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"POST"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"removePaymentInstrumentFromOrder",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders/{orderNo}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{headers:d,method:"DELETE"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"updatePaymentInstrumentForOrder",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(void 0===i.paymentInstrumentId){e.next=25;break}o.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 25:if(void 0===a.paymentInstrumentId){e.next=29;break}o.paymentInstrumentId=a.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(s={},void 0===i.siteId){e.next=35;break}s.siteId=i.siteId,e.next=40;break;case 35:if(void 0===a.siteId){e.next=39;break}s.siteId=a.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders/{orderNo}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({"Content-Type":"application/json"},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(r.body,d),headers:d,method:"PATCH"})),e.next=47,t.fetch(u);case 47:if(f=e.sent,!n){e.next=52;break}return e.abrupt("return",f);case 52:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=56;break}throw new us(f);case 56:return e.next=58,f.text();case 58:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getPaymentMethodsForOrder",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/orders/{orderNo}/payment-methods",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getTaxesFromOrder",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.orderNo){e.next=16;break}o.orderNo=i.orderNo,e.next=21;break;case 16:if(void 0===a.orderNo){e.next=20;break}o.orderNo=a.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return c=new Vd("/organizations/{organizationId}/orders/{orderNo}/taxes",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=pu(pu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),pu(pu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=37,t.fetch(u);case 37:if(f=e.sent,!n){e.next=42;break}return e.abrupt("return",f);case 42:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=46;break}throw new us(f);case 46:return e.next=48,f.text();case 48:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(lu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}");var vu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=bu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n,i,a;return ri(e,[{key:"getProducts",value:(a=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.ids){e.next=17;break}s.ids=i.ids,e.next=22;break;case 17:if(void 0===a.ids){e.next=21;break}s.ids=a.ids,e.next=22;break;case 21:throw new Error("Missing required query parameter: ids");case 22:if(void 0!==i.inventoryIds?s.inventoryIds=i.inventoryIds:void 0!==a.inventoryIds&&(s.inventoryIds=a.inventoryIds),void 0!==i.currency?s.currency=i.currency:void 0!==a.currency&&(s.currency=a.currency),void 0!==i.expand?s.expand=i.expand:void 0!==a.expand&&(s.expand=a.expand),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),void 0!==i.allImages?s.allImages=i.allImages:void 0!==a.allImages&&(s.allImages=a.allImages),void 0!==i.perPricebook?s.perPricebook=i.perPricebook:void 0!==a.perPricebook&&(s.perPricebook=a.perPricebook),void 0===i.siteId){e.next=32;break}s.siteId=i.siteId,e.next=37;break;case 32:if(void 0===a.siteId){e.next=36;break}s.siteId=a.siteId,e.next=37;break;case 36:throw new Error("Missing required query parameter: siteId");case 37:return c=new Vd("/organizations/{organizationId}/products",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=bu(bu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),bu(bu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=43,t.fetch(u);case 43:if(f=e.sent,!n){e.next=48;break}return e.abrupt("return",f);case 48:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=52;break}throw new us(f);case 52:return e.next=54,f.text();case 54:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getProduct",value:(i=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.id){e.next=16;break}o.id=i.id,e.next=21;break;case 16:if(void 0===a.id){e.next=20;break}o.id=a.id,e.next=21;break;case 20:throw new Error("Missing required path parameter: id");case 21:if(s={},void 0!==i.inventoryIds?s.inventoryIds=i.inventoryIds:void 0!==a.inventoryIds&&(s.inventoryIds=a.inventoryIds),void 0!==i.currency?s.currency=i.currency:void 0!==a.currency&&(s.currency=a.currency),void 0!==i.expand?s.expand=i.expand:void 0!==a.expand&&(s.expand=a.expand),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),void 0!==i.allImages?s.allImages=i.allImages:void 0!==a.allImages&&(s.allImages=a.allImages),void 0!==i.perPricebook?s.perPricebook=i.perPricebook:void 0!==a.perPricebook&&(s.perPricebook=a.perPricebook),void 0===i.siteId){e.next=32;break}s.siteId=i.siteId,e.next=37;break;case 32:if(void 0===a.siteId){e.next=36;break}s.siteId=a.siteId,e.next=37;break;case 36:throw new Error("Missing required query parameter: siteId");case 37:return c=new Vd("/organizations/{organizationId}/products/{id}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=bu(bu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),bu(bu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=43,t.fetch(u);case 43:if(f=e.sent,!n){e.next=48;break}return e.abrupt("return",f);case 48:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=52;break}throw new us(f);case 52:return e.next=54,f.text();case 54:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getCategories",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.ids){e.next=17;break}s.ids=i.ids,e.next=22;break;case 17:if(void 0===a.ids){e.next=21;break}s.ids=a.ids,e.next=22;break;case 21:throw new Error("Missing required query parameter: ids");case 22:if(void 0!==i.levels?s.levels=i.levels:void 0!==a.levels&&(s.levels=a.levels),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),void 0===i.siteId){e.next=28;break}s.siteId=i.siteId,e.next=33;break;case 28:if(void 0===a.siteId){e.next=32;break}s.siteId=a.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return c=new Vd("/organizations/{organizationId}/categories",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=bu(bu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),bu(bu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=39,t.fetch(u);case 39:if(f=e.sent,!n){e.next=44;break}return e.abrupt("return",f);case 44:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=48;break}throw new us(f);case 48:return e.next=50,f.text();case 50:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getCategory",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.id){e.next=16;break}o.id=i.id,e.next=21;break;case 16:if(void 0===a.id){e.next=20;break}o.id=a.id,e.next=21;break;case 20:throw new Error("Missing required path parameter: id");case 21:if(s={},void 0!==i.levels?s.levels=i.levels:void 0!==a.levels&&(s.levels=a.levels),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),void 0===i.siteId){e.next=28;break}s.siteId=i.siteId,e.next=33;break;case 28:if(void 0===a.siteId){e.next=32;break}s.siteId=a.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return c=new Vd("/organizations/{organizationId}/categories/{id}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=bu(bu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),bu(bu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=39,t.fetch(u);case 39:if(f=e.sent,!n){e.next=44;break}return e.abrupt("return",f);case 44:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=48;break}throw new us(f);case 48:return e.next=50,f.text();case 50:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function Iu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ni(vu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/product/shopper-products/{version}");var xu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=mu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n;return ri(e,[{key:"getPromotions",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:if(void 0===i.ids){e.next=26;break}s.ids=i.ids,e.next=31;break;case 26:if(void 0===a.ids){e.next=30;break}s.ids=a.ids,e.next=31;break;case 30:throw new Error("Missing required query parameter: ids");case 31:return void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/promotions",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=mu(mu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),mu(mu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=38,t.fetch(u);case 38:if(f=e.sent,!n){e.next=43;break}return e.abrupt("return",f);case 43:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=47;break}throw new us(f);case 47:return e.next=49,f.text();case 49:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getPromotionsForCampaign",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===i.campaignId){e.next=16;break}o.campaignId=i.campaignId,e.next=21;break;case 16:if(void 0===a.campaignId){e.next=20;break}o.campaignId=a.campaignId,e.next=21;break;case 20:throw new Error("Missing required path parameter: campaignId");case 21:if(s={},void 0===i.siteId){e.next=26;break}s.siteId=i.siteId,e.next=31;break;case 26:if(void 0===a.siteId){e.next=30;break}s.siteId=a.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==i.startDate?s.startDate=i.startDate:void 0!==a.startDate&&(s.startDate=a.startDate),void 0!==i.endDate?s.endDate=i.endDate:void 0!==a.endDate&&(s.endDate=a.endDate),void 0!==i.currency?s.currency=i.currency:void 0!==a.currency&&(s.currency=a.currency),c=new Vd("/organizations/{organizationId}/promotions/campaigns/{campaignId}",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=mu(mu({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),mu(mu({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=40,t.fetch(u);case 40:if(f=e.sent,!n){e.next=45;break}return e.abrupt("return",f);case 45:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=49;break}throw new us(f);case 49:return e.next=51,f.text();case 51:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();ni(xu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/{version}");var ku=TypeError,wu=function(e,t){if(!delete e[t])throw ku("Cannot delete property "+$(t)+" of "+$(e))},yu=B.match(/firefox\/(\d+)/i),Cu=!!yu&&+yu[1],zu=/MSIE|Trident/.test(B),Ou=B.match(/AppleWebKit\/(\d+)\./),qu=!!Ou&&+Ou[1],Eu=[],Pu=w(Eu.sort),Su=w(Eu.push),Ru=d((function(){Eu.sort(void 0)})),ju=d((function(){Eu.sort(null)})),Tu=Nn("sort"),Mu=!d((function(){if(F)return F<70;if(!(Cu&&Cu>3)){if(zu)return!0;if(qu)return qu<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Eu.push({k:t+n,v:r})}for(Eu.sort((function(e,t){return t.v-e.v})),n=0;n<Eu.length;n++)t=Eu[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));function Uu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Ut({target:"Array",proto:!0,forced:Ru||!ju||!Tu||!Mu},{sort:function(e){void 0!==e&&K(e);var t=ie(this);if(Mu)return void 0===e?Pu(t):Pu(t,e);var r,n,i=[],a=lt(t);for(n=0;n<a;n++)n in t&&Su(i,t[n]);for(_a(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Vt(t)>Vt(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<a;)wu(t,n++);return t}});var Bu=function(){function e(t){ei(this,e),ni(this,"clientConfig",void 0);var r=Au({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new Po(r)}var r,n;return ri(e,[{key:"productSearch",value:(n=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return void 0!==i.q?s.q=i.q:void 0!==a.q&&(s.q=a.q),void 0!==i.refine?s.refine=i.refine:void 0!==a.refine&&(s.refine=a.refine),void 0!==i.sort?s.sort=i.sort:void 0!==a.sort&&(s.sort=a.sort),void 0!==i.currency?s.currency=i.currency:void 0!==a.currency&&(s.currency=a.currency),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),void 0!==i.expand?s.expand=i.expand:void 0!==a.expand&&(s.expand=a.expand),void 0!==i.offset?s.offset=i.offset:void 0!==a.offset&&(s.offset=a.offset),void 0!==i.limit?s.limit=i.limit:void 0!==a.limit&&(s.limit=a.limit),c=new Vd("/organizations/{organizationId}/product-search",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Au(Au({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Au(Au({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=36,t.fetch(u);case 36:if(f=e.sent,!n){e.next=41;break}return e.abrupt("return",f);case 41:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=45;break}throw new us(f);case 45:return e.next=47,f.text();case 47:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 49:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getSearchSuggestions",value:(r=Zn(Pi.mark((function e(r,n){var i,a,o,s,c,d,u,f,h;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(null==r?void 0:r.parameters)||{},a=this.clientConfig.parameters,o={shortCode:a.shortCode,version:a.version||"v1"},void 0===i.organizationId){e.next=7;break}o.organizationId=i.organizationId,e.next=12;break;case 7:if(void 0===a.organizationId){e.next=11;break}o.organizationId=a.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(s={},void 0===i.siteId){e.next=17;break}s.siteId=i.siteId,e.next=22;break;case 17:if(void 0===a.siteId){e.next=21;break}s.siteId=a.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:if(void 0===i.q){e.next=26;break}s.q=i.q,e.next=31;break;case 26:if(void 0===a.q){e.next=30;break}s.q=a.q,e.next=31;break;case 30:throw new Error("Missing required query parameter: q");case 31:return void 0!==i.limit?s.limit=i.limit:void 0!==a.limit&&(s.limit=a.limit),void 0!==i.currency?s.currency=i.currency:void 0!==a.currency&&(s.currency=a.currency),void 0!==i.locale?s.locale=i.locale:void 0!==a.locale&&(s.locale=a.locale),c=new Vd("/organizations/{organizationId}/search-suggestions",this.clientConfig.baseUri,{pathParams:o,queryParams:s,origin:this.clientConfig.proxy}),d=Au(Au({},this.clientConfig.headers),null==r?void 0:r.headers),Ro||(d["user-agent"]=[d["user-agent"],Wd].join(" ")),u=new t.Request(c.toString(),Au(Au({},this.clientConfig.fetchOptions),{},{headers:d,method:"GET"})),e.next=40,t.fetch(u);case 40:if(f=e.sent,!n){e.next=45;break}return e.abrupt("return",f);case 45:if(!this.clientConfig.throwOnBadResponse||f.ok||304===f.status){e.next=49;break}throw new us(f);case 49:return e.next=51,f.text();case 51:return h=e.sent,e.abrupt("return",h?JSON.parse(h):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();ni(Bu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/");var _u=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};Ts("search",(function(e,t,r){return[function(t){var r=S(this),n=null==t?void 0:Q(t,e);return n?p(n,t,r):new RegExp(t)[e](Vt(r))},function(e){var n=Pe(this),i=Vt(e),a=r(t,n,i);if(a.done)return a.value;var o=n.lastIndex;_u(o,0)||(n.lastIndex=0);var s=Gs(n,i);return _u(n.lastIndex,o)||(n.lastIndex=o),null===s?-1:s.index}]}));var Nu=ge("iterator"),Lu=!1;try{var Du=0,Fu={next:function(){return{done:!!Du++}},return:function(){Lu=!0}};Fu[Nu]=function(){return this},Array.from(Fu,(function(){throw 2}))}catch(e){}var Ju,Gu,Hu,Vu=function(e,t){if(!t&&!Lu)return!1;var r=!1;try{var n={};n[Nu]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Wu="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,$u=Te.f,Yu=rt.enforce,Ku=rt.get,Qu=c.Int8Array,Xu=Qu&&Qu.prototype,Zu=c.Uint8ClampedArray,ef=Zu&&Zu.prototype,tf=Qu&&Fi(Qu),rf=Xu&&Fi(Xu),nf=Object.prototype,af=c.TypeError,of=ge("toStringTag"),sf=ue("TYPED_ARRAY_TAG"),cf=Wu&&!!Qi&&"Opera"!==Gt(c.opera),df=!1,uf={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ff={BigInt64Array:8,BigUint64Array:8},hf=function(e){var t=Fi(e);if(T(t)){var r=Ku(t);return r&&oe(r,"TypedArrayConstructor")?r.TypedArrayConstructor:hf(t)}},pf=function(e){if(!T(e))return!1;var t=Gt(e);return oe(uf,t)||oe(ff,t)};for(Ju in uf)(Hu=(Gu=c[Ju])&&Gu.prototype)?Yu(Hu).TypedArrayConstructor=Gu:cf=!1;for(Ju in ff)(Hu=(Gu=c[Ju])&&Gu.prototype)&&(Yu(Hu).TypedArrayConstructor=Gu);if((!cf||!j(tf)||tf===Function.prototype)&&(tf=function(){throw af("Incorrect invocation")},cf))for(Ju in uf)c[Ju]&&Qi(c[Ju],tf);if((!cf||!rf||rf===nf)&&(rf=tf.prototype,cf))for(Ju in uf)c[Ju]&&Qi(c[Ju].prototype,rf);if(cf&&Fi(ef)!==rf&&Qi(ef,rf),u&&!oe(rf,of))for(Ju in df=!0,$u(rf,of,{get:function(){return T(this)?this[sf]:void 0}}),uf)c[Ju]&&Me(c[Ju],sf,Ju);var lf={NATIVE_ARRAY_BUFFER_VIEWS:cf,TYPED_ARRAY_TAG:df&&sf,aTypedArray:function(e){if(pf(e))return e;throw af("Target is not a typed array")},aTypedArrayConstructor:function(e){if(j(e)&&(!Qi||A(tf,e)))return e;throw af($(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(u){if(r)for(var i in uf){var a=c[i];if(a&&oe(a.prototype,e))try{delete a.prototype[e]}catch(r){try{a.prototype[e]=t}catch(e){}}}rf[e]&&!r||it(rf,e,r?t:cf&&Xu[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(u){if(Qi){if(r)for(n in uf)if((i=c[n])&&oe(i,e))try{delete i[e]}catch(e){}if(tf[e]&&!r)return;try{return it(tf,e,r?t:cf&&tf[e]||t)}catch(e){}}for(n in uf)!(i=c[n])||i[e]&&!r||it(i,e,t)}},getTypedArrayConstructor:hf,isView:function(e){if(!T(e))return!1;var t=Gt(e);return"DataView"===t||oe(uf,t)||oe(ff,t)},isTypedArray:pf,TypedArray:tf,TypedArrayPrototype:rf},gf=lf.NATIVE_ARRAY_BUFFER_VIEWS,bf=c.ArrayBuffer,vf=c.Int8Array,If=!gf||!d((function(){vf(1)}))||!d((function(){new vf(-1)}))||!Vu((function(e){new vf,new vf(null),new vf(1.5),new vf(e)}),!0)||d((function(){return 1!==new vf(new bf(2),1,void 0).length})),mf=RangeError,xf=function(e){if(void 0===e)return 0;var t=ct(e),r=pt(t);if(t!==r)throw mf("Wrong length or index");return r},kf=Array,wf=Math.abs,yf=Math.pow,Cf=Math.floor,zf=Math.log,Of=Math.LN2,qf=function(e,t,r){var n,i,a,o=kf(r),s=8*r-t-1,c=(1<<s)-1,d=c>>1,u=23===t?yf(2,-24)-yf(2,-77):0,f=e<0||0===e&&1/e<0?1:0,h=0;for((e=wf(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=Cf(zf(e)/Of),e*(a=yf(2,-n))<1&&(n--,a*=2),(e+=n+d>=1?u/a:u*yf(2,1-d))*a>=2&&(n++,a/=2),n+d>=c?(i=0,n=c):n+d>=1?(i=(e*a-1)*yf(2,t),n+=d):(i=e*yf(2,d-1)*yf(2,t),n=0));t>=8;)o[h++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)o[h++]=255&n,n/=256,s-=8;return o[--h]|=128*f,o},Ef=function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,c=n-1,d=e[c--],u=127&d;for(d>>=7;s>0;)u=256*u+e[c--],s-=8;for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===u)u=1-o;else{if(u===a)return r?NaN:d?-1/0:1/0;r+=yf(2,t),u-=o}return(d?-1:1)*r*yf(2,u-t)},Pf=function(e){for(var t=ie(this),r=lt(t),n=arguments.length,i=ft(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:ft(a,r);o>i;)t[i++]=e;return t},Sf=wt.f,Rf=Te.f,jf=_e.PROPER,Tf=_e.CONFIGURABLE,Mf=rt.get,Uf=rt.set,Af=c.ArrayBuffer,Bf=Af,_f=Bf&&Bf.prototype,Nf=c.DataView,Lf=Nf&&Nf.prototype,Df=Object.prototype,Ff=c.Array,Jf=c.RangeError,Gf=w(Pf),Hf=w([].reverse),Vf=qf,Wf=Ef,$f=function(e){return[255&e]},Yf=function(e){return[255&e,e>>8&255]},Kf=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Qf=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Xf=function(e){return Vf(e,23,4)},Zf=function(e){return Vf(e,52,8)},eh=function(e,t){Rf(e.prototype,t,{get:function(){return Mf(this)[t]}})},th=function(e,t,r,n){var i=xf(r),a=Mf(e);if(i+t>a.byteLength)throw Jf("Wrong index");var o=Mf(a.buffer).bytes,s=i+a.byteOffset,c=ir(o,s,s+t);return n?c:Hf(c)},rh=function(e,t,r,n,i,a){var o=xf(r),s=Mf(e);if(o+t>s.byteLength)throw Jf("Wrong index");for(var c=Mf(s.buffer).bytes,d=o+s.byteOffset,u=n(+i),f=0;f<t;f++)c[d+f]=u[a?f:t-f-1]};if(Wu){var nh=jf&&"ArrayBuffer"!==Af.name;if(d((function(){Af(1)}))&&d((function(){new Af(-1)}))&&!d((function(){return new Af,new Af(1.5),new Af(NaN),nh&&!Tf})))nh&&Tf&&Me(Af,"name","ArrayBuffer");else{(Bf=function(e){return qa(this,_f),new Af(xf(e))}).prototype=_f;for(var ih,ah=Sf(Af),oh=0;ah.length>oh;)(ih=ah[oh++])in Bf||Me(Bf,ih,Af[ih]);_f.constructor=Bf}Qi&&Fi(Lf)!==Df&&Qi(Lf,Df);var sh=new Nf(new Bf(2)),ch=w(Lf.setInt8);sh.setInt8(0,2147483648),sh.setInt8(1,2147483649),!sh.getInt8(0)&&sh.getInt8(1)||za(Lf,{setInt8:function(e,t){ch(this,e,t<<24>>24)},setUint8:function(e,t){ch(this,e,t<<24>>24)}},{unsafe:!0})}else _f=(Bf=function(e){qa(this,_f);var t=xf(e);Uf(this,{bytes:Gf(Ff(t),0),byteLength:t}),u||(this.byteLength=t)}).prototype,Lf=(Nf=function(e,t,r){qa(this,Lf),qa(e,_f);var n=Mf(e).byteLength,i=ct(t);if(i<0||i>n)throw Jf("Wrong offset");if(i+(r=void 0===r?n-i:pt(r))>n)throw Jf("Wrong length");Uf(this,{buffer:e,byteLength:r,byteOffset:i}),u||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,u&&(eh(Bf,"byteLength"),eh(Nf,"buffer"),eh(Nf,"byteLength"),eh(Nf,"byteOffset")),za(Lf,{getInt8:function(e){return th(this,1,e)[0]<<24>>24},getUint8:function(e){return th(this,1,e)[0]},getInt16:function(e){var t=th(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=th(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Qf(th(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Qf(th(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Wf(th(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Wf(th(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){rh(this,1,e,$f,t)},setUint8:function(e,t){rh(this,1,e,$f,t)},setInt16:function(e,t){rh(this,2,e,Yf,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){rh(this,2,e,Yf,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){rh(this,4,e,Kf,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){rh(this,4,e,Kf,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){rh(this,4,e,Xf,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){rh(this,8,e,Zf,t,arguments.length>2?arguments[2]:void 0)}});pr(Bf,"ArrayBuffer"),pr(Nf,"DataView");var dh={ArrayBuffer:Bf,DataView:Nf},uh=Math.floor,fh=Number.isInteger||function(e){return!T(e)&&isFinite(e)&&uh(e)===e},hh=RangeError,ph=RangeError,lh=function(e,t){var r=function(e){var t=ct(e);if(t<0)throw hh("The argument can't be less than 0");return t}(e);if(r%t)throw ph("Wrong offset");return r},gh=lf.aTypedArrayConstructor,bh=function(e){var t,r,n,i,a,o,s=Lo(this),c=ie(e),d=arguments.length,u=d>1?arguments[1]:void 0,f=void 0!==u,h=Pa(c);if(h&&!uc(h))for(o=(a=Ra(c,h)).next,c=[];!(i=p(o,a)).done;)c.push(i.value);for(f&&d>2&&(u=gr(u,arguments[2])),r=lt(c),n=new(gh(s))(r),t=0;r>t;t++)n[t]=f?u(c[t],t):c[t];return n},vh=ge("species"),Ih=function(e){var t=U(e),r=Te.f;u&&t&&!t[vh]&&r(t,vh,{configurable:!0,get:function(){return this}})};i((function(e){var t=wt.f,r=Rr.forEach,n=rt.get,i=rt.set,a=rt.enforce,o=Te.f,s=ze.f,d=Math.round,f=c.RangeError,h=dh.ArrayBuffer,l=h.prototype,g=dh.DataView,b=lf.NATIVE_ARRAY_BUFFER_VIEWS,I=lf.TYPED_ARRAY_TAG,m=lf.TypedArray,x=lf.TypedArrayPrototype,k=lf.aTypedArrayConstructor,w=lf.isTypedArray,y=function(e,t){k(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},C=function(e,t){o(e,t,{get:function(){return n(this)[t]}})},z=function(e){var t;return A(l,e)||"ArrayBuffer"==(t=Gt(e))||"SharedArrayBuffer"==t},O=function(e,t){return w(e)&&!V(t)&&t in e&&fh(+t)&&t>=0},q=function(e,t){return t=me(t),O(e,t)?v(2,e[t]):s(e,t)},E=function(e,t,r){return t=me(t),!(O(e,t)&&T(r)&&oe(r,"value"))||oe(r,"get")||oe(r,"set")||r.configurable||oe(r,"writable")&&!r.writable||oe(r,"enumerable")&&!r.enumerable?o(e,t,r):(e[t]=r.value,e)};u?(b||(ze.f=q,Te.f=E,C(x,"buffer"),C(x,"byteOffset"),C(x,"byteLength"),C(x,"length")),Ut({target:"Object",stat:!0,forced:!b},{getOwnPropertyDescriptor:q,defineProperty:E}),e.exports=function(e,s,u){var l=e.match(/\d+$/)[0]/8,v=e+(u?"Clamped":"")+"Array",k="get"+e,C="set"+e,O=c[v],q=O,E=q&&q.prototype,P={},S=function(e,t){o(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[k](t*l+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=n(e);u&&(r=(r=d(r))<0?0:r>255?255:255&r),i.view[C](t*l+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};b?If&&(q=s((function(e,t,r,n){return qa(e,E),function(e,t,r){var n,i;return Qi&&j(n=t.constructor)&&n!==r&&T(i=n.prototype)&&i!==r.prototype&&Qi(e,i),e}(T(t)?z(t)?void 0!==n?new O(t,lh(r,l),n):void 0!==r?new O(t,lh(r,l)):new O(t):w(t)?y(q,t):p(bh,q,t):new O(xf(t)),e,q)})),Qi&&Qi(q,m),r(t(O),(function(e){e in q||Me(q,e,O[e])})),q.prototype=E):(q=s((function(e,t,r,n){qa(e,E);var a,o,s,c=0,d=0;if(T(t)){if(!z(t))return w(t)?y(q,t):p(bh,q,t);a=t,d=lh(r,l);var u=t.byteLength;if(void 0===n){if(u%l)throw f("Wrong length");if((o=u-d)<0)throw f("Wrong length")}else if((o=pt(n)*l)+d>u)throw f("Wrong length");s=o/l}else s=xf(t),a=new h(o=s*l);for(i(e,{buffer:a,byteOffset:d,byteLength:o,length:s,view:new g(a)});c<s;)S(e,c++)})),Qi&&Qi(q,m),E=q.prototype=er(x)),E.constructor!==q&&Me(E,"constructor",q),a(E).TypedArrayConstructor=q,I&&Me(E,I,v);var R=q!=O;P[v]=q,Ut({global:!0,constructor:!0,forced:R,sham:!b},P),"BYTES_PER_ELEMENT"in q||Me(q,"BYTES_PER_ELEMENT",l),"BYTES_PER_ELEMENT"in E||Me(E,"BYTES_PER_ELEMENT",l),Ih(v)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var mh=Math.min,xh=w([].copyWithin||function(e,t){var r=ie(this),n=lt(r),i=ft(e,n),a=ft(t,n),o=arguments.length>2?arguments[2]:void 0,s=mh((void 0===o?n:ft(o,n))-a,n-i),c=1;for(a<i&&i<a+s&&(c=-1,a+=s-1,i+=s-1);s-- >0;)a in r?r[i]=r[a]:wu(r,i),i+=c,a+=c;return r}),kh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("copyWithin",(function(e,t){return xh(kh(this),e,t,arguments.length>2?arguments[2]:void 0)}));var wh=Rr.every,yh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("every",(function(e){return wh(yh(this),e,arguments.length>1?arguments[1]:void 0)}));var Ch=TypeError,zh=function(e){var t=Ie(e,"number");if("number"==typeof t)throw Ch("Can't convert number to bigint");return BigInt(t)},Oh=lf.aTypedArray,qh=lf.exportTypedArrayMethod,Eh=w("".slice);qh("fill",(function(e){var t=arguments.length;Oh(this);var r="Big"===Eh(Gt(this),0,3)?zh(e):+e;return p(Pf,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),d((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var Ph=ge("species"),Sh=function(e,t){var r,n=Pe(e).constructor;return void 0===n||null==(r=Pe(n)[Ph])?t:Lo(r)},Rh=lf.aTypedArrayConstructor,jh=lf.getTypedArrayConstructor,Th=function(e){return Rh(Sh(e,jh(e)))},Mh=function(e,t){return function(e,t){for(var r=0,n=lt(t),i=new e(n);n>r;)i[r]=t[r++];return i}(Th(e),t)},Uh=Rr.filter,Ah=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("filter",(function(e){var t=Uh(Ah(this),e,arguments.length>1?arguments[1]:void 0);return Mh(this,t)}));var Bh=Rr.find,_h=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("find",(function(e){return Bh(_h(this),e,arguments.length>1?arguments[1]:void 0)}));var Nh=Rr.findIndex,Lh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("findIndex",(function(e){return Nh(Lh(this),e,arguments.length>1?arguments[1]:void 0)}));var Dh=Rr.forEach,Fh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("forEach",(function(e){Dh(Fh(this),e,arguments.length>1?arguments[1]:void 0)}));var Jh=bt.includes,Gh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("includes",(function(e){return Jh(Gh(this),e,arguments.length>1?arguments[1]:void 0)}));var Hh=bt.indexOf,Vh=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("indexOf",(function(e){return Hh(Vh(this),e,arguments.length>1?arguments[1]:void 0)}));var Wh=ge("iterator"),$h=c.Uint8Array,Yh=w(ca.values),Kh=w(ca.keys),Qh=w(ca.entries),Xh=lf.aTypedArray,Zh=lf.exportTypedArrayMethod,ep=$h&&$h.prototype,tp=!d((function(){ep[Wh].call([1])})),rp=!!ep&&ep.values&&ep[Wh]===ep.values&&"values"===ep.values.name,np=function(){return Yh(Xh(this))};Zh("entries",(function(){return Qh(Xh(this))}),tp),Zh("keys",(function(){return Kh(Xh(this))}),tp),Zh("values",np,tp||!rp,{name:"values"}),Zh(Wh,np,tp||!rp,{name:"values"});var ip=lf.aTypedArray,ap=lf.exportTypedArrayMethod,op=w([].join);ap("join",(function(e){return op(ip(this),e)}));var sp=Math.min,cp=[].lastIndexOf,dp=!!cp&&1/[1].lastIndexOf(1,-0)<0,up=Nn("lastIndexOf"),fp=dp||!up?function(e){if(dp)return hn(cp,this,arguments)||0;var t=R(this),r=lt(t),n=r-1;for(arguments.length>1&&(n=sp(n,ct(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:cp,hp=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return hn(fp,hp(this),t>1?[e,arguments[1]]:[e])}));var pp=Rr.map,lp=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("map",(function(e){return pp(lp(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Th(e))(t)}))}));var gp=TypeError,bp=function(e){return function(t,r,n,i){K(r);var a=ie(t),o=E(a),s=lt(a),c=e?s-1:0,d=e?-1:1;if(n<2)for(;;){if(c in o){i=o[c],c+=d;break}if(c+=d,e?c<0:s<=c)throw gp("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=d)c in o&&(i=r(i,o[c],c,a));return i}},vp={left:bp(!1),right:bp(!0)},Ip=vp.left,mp=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return Ip(mp(this),e,t,t>1?arguments[1]:void 0)}));var xp=vp.right,kp=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return xp(kp(this),e,t,t>1?arguments[1]:void 0)}));var wp=lf.aTypedArray,yp=lf.exportTypedArrayMethod,Cp=Math.floor;yp("reverse",(function(){for(var e,t=wp(this).length,r=Cp(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this}));var zp=c.RangeError,Op=c.Int8Array,qp=Op&&Op.prototype,Ep=qp&&qp.set,Pp=lf.aTypedArray,Sp=lf.exportTypedArrayMethod,Rp=!d((function(){var e=new Uint8ClampedArray(2);return p(Ep,e,{length:1,0:3},1),3!==e[1]})),jp=Rp&&lf.NATIVE_ARRAY_BUFFER_VIEWS&&d((function(){var e=new Op(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));Sp("set",(function(e){Pp(this);var t=lh(arguments.length>1?arguments[1]:void 0,1),r=ie(e);if(Rp)return p(Ep,this,r,t);var n=this.length,i=lt(r),a=0;if(i+t>n)throw zp("Wrong length");for(;a<i;)this[t+a]=r[a++]}),!Rp||jp);var Tp=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("slice",(function(e,t){for(var r=pn(Tp(this),e,t),n=Th(this),i=0,a=r.length,o=new n(a);a>i;)o[i]=r[i++];return o}),d((function(){new Int8Array(1).slice()})));var Mp=Rr.some,Up=lf.aTypedArray;(0,lf.exportTypedArrayMethod)("some",(function(e){return Mp(Up(this),e,arguments.length>1?arguments[1]:void 0)}));var Ap=lf.aTypedArray,Bp=lf.exportTypedArrayMethod,_p=c.Uint16Array,Np=_p&&w(_p.prototype.sort),Lp=!(!Np||d((function(){Np(new _p(2),null)}))&&d((function(){Np(new _p(2),{})}))),Dp=!!Np&&!d((function(){if(F)return F<74;if(Cu)return Cu<67;if(zu)return!0;if(qu)return qu<602;var e,t,r=new _p(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(Np(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));Bp("sort",(function(e){return void 0!==e&&K(e),Dp?Np(this,e):_a(Ap(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!Dp||Lp);var Fp=c.Int8Array,Jp=lf.aTypedArray,Gp=lf.exportTypedArrayMethod,Hp=[].toLocaleString,Vp=!!Fp&&d((function(){Hp.call(new Fp(1))}));Gp("toLocaleString",(function(){return hn(Hp,Vp?pn(Jp(this)):Jp(this),pn(arguments))}),d((function(){return[1,2].toLocaleString()!=new Fp([1,2]).toLocaleString()}))||!d((function(){Fp.prototype.toLocaleString.call([1,2])})));var Wp=lf.exportTypedArrayMethod,$p=c.Uint8Array,Yp=$p&&$p.prototype||{},Kp=[].toString,Qp=w([].join);d((function(){Kp.call({})}))&&(Kp=function(){return Qp(this)});var Xp=Yp.toString!=Kp;Wp("toString",Kp,Xp);var Zp,el,tl,rl,nl="process"==z(c.process),il=/(?:ipad|iphone|ipod).*applewebkit/i.test(B),al=c.setImmediate,ol=c.clearImmediate,sl=c.process,cl=c.Dispatch,dl=c.Function,ul=c.MessageChannel,fl=c.String,hl=0,pl={};try{Zp=c.location}catch(e){}var ll=function(e){if(oe(pl,e)){var t=pl[e];delete pl[e],t()}},gl=function(e){return function(){ll(e)}},bl=function(e){ll(e.data)},vl=function(e){c.postMessage(fl(e),Zp.protocol+"//"+Zp.host)};al&&ol||(al=function(e){Ta(arguments.length,1);var t=j(e)?e:dl(e),r=pn(arguments,1);return pl[++hl]=function(){hn(t,void 0,r)},el(hl),hl},ol=function(e){delete pl[e]},nl?el=function(e){sl.nextTick(gl(e))}:cl&&cl.now?el=function(e){cl.now(gl(e))}:ul&&!il?(rl=(tl=new ul).port2,tl.port1.onmessage=bl,el=gr(rl.postMessage,rl)):c.addEventListener&&j(c.postMessage)&&!c.importScripts&&Zp&&"file:"!==Zp.protocol&&!d(vl)?(el=vl,c.addEventListener("message",bl,!1)):el="onreadystatechange"in we("script")?function(e){$t.appendChild(we("script")).onreadystatechange=function(){$t.removeChild(this),ll(e)}}:function(e){setTimeout(gl(e),0)});var Il,ml,xl,kl,wl,yl,Cl,zl,Ol={set:al,clear:ol},ql=/ipad|iphone|ipod/i.test(B)&&void 0!==c.Pebble,El=/web0s(?!.*chrome)/i.test(B),Pl=ze.f,Sl=Ol.set,Rl=c.MutationObserver||c.WebKitMutationObserver,jl=c.document,Tl=c.process,Ml=c.Promise,Ul=Pl(c,"queueMicrotask"),Al=Ul&&Ul.value;Al||(Il=function(){var e,t;for(nl&&(e=Tl.domain)&&e.exit();ml;){t=ml.fn,ml=ml.next;try{t()}catch(e){throw ml?kl():xl=void 0,e}}xl=void 0,e&&e.enter()},il||nl||El||!Rl||!jl?!ql&&Ml&&Ml.resolve?((Cl=Ml.resolve(void 0)).constructor=Ml,zl=gr(Cl.then,Cl),kl=function(){zl(Il)}):nl?kl=function(){Tl.nextTick(Il)}:(Sl=gr(Sl,c),kl=function(){Sl(Il)}):(wl=!0,yl=jl.createTextNode(""),new Rl(Il).observe(yl,{characterData:!0}),kl=function(){yl.data=wl=!wl}));var Bl=Al||function(e){var t={fn:e,next:void 0};xl&&(xl.next=t),ml||(ml=t,kl()),xl=t},_l=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Nl=function(){this.head=null,this.tail=null};Nl.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Ll=Nl,Dl=c.Promise,Fl="object"==typeof window&&"object"!=typeof Deno;Dl&&Dl.prototype;var Jl,Gl,Hl,Vl=ge("species"),Wl=!1,$l=j(c.PromiseRejectionEvent),Yl={CONSTRUCTOR:Tt("Promise",(function(){var e=Je(Dl),t=e!==String(Dl);if(!t&&66===F)return!0;if(F>=51&&/native code/.test(e))return!1;var r=new Dl((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[Vl]=n,!(Wl=r.then((function(){}))instanceof n)||!t&&Fl&&!$l})),REJECTION_EVENT:$l,SUBCLASSING:Wl},Kl=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=K(t),this.reject=K(r)},Ql={f:function(e){return new Kl(e)}},Xl=Ol.set,Zl=Yl.CONSTRUCTOR,eg=Yl.REJECTION_EVENT,tg=Yl.SUBCLASSING,rg=rt.getterFor("Promise"),ng=rt.set,ig=Dl&&Dl.prototype,ag=Dl,og=ig,sg=c.TypeError,cg=c.document,dg=c.process,ug=Ql.f,fg=ug,hg=!!(cg&&cg.createEvent&&c.dispatchEvent),pg=function(e){var t;return!(!T(e)||!j(t=e.then))&&t},lg=function(e,t){var r,n,i,a=t.value,o=1==t.state,s=o?e.ok:e.fail,c=e.resolve,d=e.reject,u=e.domain;try{s?(o||(2===t.rejection&&mg(t),t.rejection=1),!0===s?r=a:(u&&u.enter(),r=s(a),u&&(u.exit(),i=!0)),r===e.promise?d(sg("Promise-chain cycle")):(n=pg(r))?p(n,r,c,d):c(r)):d(a)}catch(e){u&&!i&&u.exit(),d(e)}},gg=function(e,t){e.notified||(e.notified=!0,Bl((function(){for(var r,n=e.reactions;r=n.get();)lg(r,e);e.notified=!1,t&&!e.rejection&&vg(e)})))},bg=function(e,t,r){var n,i;hg?((n=cg.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!eg&&(i=c["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=c.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},vg=function(e){p(Xl,c,(function(){var t,r=e.facade,n=e.value;if(Ig(e)&&(t=_l((function(){nl?dg.emit("unhandledRejection",n,r):bg("unhandledrejection",r,n)})),e.rejection=nl||Ig(e)?2:1,t.error))throw t.value}))},Ig=function(e){return 1!==e.rejection&&!e.parent},mg=function(e){p(Xl,c,(function(){var t=e.facade;nl?dg.emit("rejectionHandled",t):bg("rejectionhandled",t,e.value)}))},xg=function(e,t,r){return function(n){e(t,n,r)}},kg=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,gg(e,!0))},wg=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw sg("Promise can't be resolved itself");var n=pg(t);n?Bl((function(){var r={done:!1};try{p(n,t,xg(wg,r,e),xg(kg,r,e))}catch(t){kg(r,t,e)}})):(e.value=t,e.state=1,gg(e,!1))}catch(t){kg({done:!1},t,e)}}};if(Zl&&(og=(ag=function(e){qa(this,og),K(e),p(Jl,this);var t=rg(this);try{e(xg(wg,t),xg(kg,t))}catch(e){kg(t,e)}}).prototype,(Jl=function(e){ng(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Ll,rejection:!1,state:0,value:void 0})}).prototype=it(og,"then",(function(e,t){var r=rg(this),n=ug(Sh(this,ag));return r.parent=!0,n.ok=!j(e)||e,n.fail=j(t)&&t,n.domain=nl?dg.domain:void 0,0==r.state?r.reactions.add(n):Bl((function(){lg(n,r)})),n.promise})),Gl=function(){var e=new Jl,t=rg(e);this.promise=e,this.resolve=xg(wg,t),this.reject=xg(kg,t)},Ql.f=ug=function(e){return e===ag||void 0===e?new Gl(e):fg(e)},j(Dl)&&ig!==Object.prototype)){Hl=ig.then,tg||it(ig,"then",(function(e,t){var r=this;return new ag((function(e,t){p(Hl,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete ig.constructor}catch(e){}Qi&&Qi(ig,og)}Ut({global:!0,constructor:!0,wrap:!0,forced:Zl},{Promise:ag}),pr(ag,"Promise",!1),Ih("Promise");var yg=TypeError,Cg=function(e,t){this.stopped=e,this.result=t},zg=Cg.prototype,Og=function(e,t,r){var n,i,a,o,s,c,d,u=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),l=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),b=gr(t,u),v=function(e){return n&&oc(n,"normal",e),new Cg(!0,e)},I=function(e){return f?(Pe(e),g?b(e[0],e[1],v):b(e[0],e[1])):g?b(e,v):b(e)};if(h)n=e.iterator;else if(l)n=e;else{if(!(i=Pa(e)))throw yg($(e)+" is not iterable");if(uc(i)){for(a=0,o=lt(e);o>a;a++)if((s=I(e[a]))&&A(zg,s))return s;return new Cg(!1)}n=Ra(e,i)}for(c=h?e.next:n.next;!(d=p(c,n)).done;){try{s=I(d.value)}catch(e){oc(n,"throw",e)}if("object"==typeof s&&s&&A(zg,s))return s}return new Cg(!1)},qg=Yl.CONSTRUCTOR||!Vu((function(e){Dl.all(e).then(void 0,(function(){}))}));Ut({target:"Promise",stat:!0,forced:qg},{all:function(e){var t=this,r=Ql.f(t),n=r.resolve,i=r.reject,a=_l((function(){var r=K(t.resolve),a=[],o=0,s=1;Og(e,(function(e){var c=o++,d=!1;s++,p(r,t,e).then((function(e){d||(d=!0,a[c]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise}});var Eg=Yl.CONSTRUCTOR,Pg=Dl&&Dl.prototype;if(Ut({target:"Promise",proto:!0,forced:Eg,real:!0},{catch:function(e){return this.then(void 0,e)}}),j(Dl)){var Sg=U("Promise").prototype.catch;Pg.catch!==Sg&&it(Pg,"catch",Sg,{unsafe:!0})}Ut({target:"Promise",stat:!0,forced:qg},{race:function(e){var t=this,r=Ql.f(t),n=r.reject,i=_l((function(){var i=K(t.resolve);Og(e,(function(e){p(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),Ut({target:"Promise",stat:!0,forced:Yl.CONSTRUCTOR},{reject:function(e){var t=Ql.f(this);return p(t.reject,void 0,e),t.promise}});var Rg=Yl.CONSTRUCTOR;function jg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tg(e){return function(e){if(Array.isArray(e))return jg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return jg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jg(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ug(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(r),!0).forEach((function(t){ni(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}U("Promise"),Ut({target:"Promise",stat:!0,forced:Rg},{resolve:function(e){return function(e,t){if(Pe(e),T(t)&&t.constructor===e)return t;var r=Ql.f(e);return(0,r.resolve)(t),r.promise}(this,e)}}),Ut({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Og(e,(function(e,r){tr(t,e,r)}),{AS_ENTRIES:!0}),t}});var Ag=Ro?btoa:function(e){return Buffer.from(e).toString("base64")},Bg=function(e){var t,r,n=new URL(e),i=new URLSearchParams(n.search),a=null!==(t=i.get("usid"))&&void 0!==t?t:"";return{code:null!==(r=i.get("code"))&&void 0!==r?r:"",usid:a}},_g=function(){return r.nanoid(128)},Ng=function(){var e=Zn(Pi.mark((function e(t){var r,n,i,a,o,s,c;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},n="",!Ro||!window.crypto){e.next=12;break}return i=new TextEncoder,a=i.encode(t),e.next=7,window.crypto.subtle.digest("SHA-256",a);case 7:o=e.sent,s=btoa(String.fromCharCode.apply(String,Tg(new Uint8Array(o)))),n=r(s),e.next=16;break;case 12:return e.next=14,import("crypto");case 14:c=e.sent,n=r(c.default.createHash("sha256").update(t).digest("base64"));case 16:if(0!==n.length){e.next=18;break}throw new Error("Problem generating code challenge");case 18:return e.abrupt("return",n);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Lg(e,t,r){return Dg.apply(this,arguments)}function Dg(){return(Dg=Zn(Pi.mark((function e(t,r,n){var i,a,o,s,c,d,u,f;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ng(r);case 2:return a=e.sent,(o=new fu(t.clientConfig)).clientConfig.fetchOptions=Ug(Ug({},t.clientConfig.fetchOptions),{},{redirect:Ro?"follow":"manual"}),s={parameters:Ug(Ug({client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code_challenge:a},n.hint&&{hint:n.hint}),{},{organizationId:t.clientConfig.parameters.organizationId,redirect_uri:n.redirectURI,response_type:"code"},n.usid&&{usid:n.usid})},e.next=8,o.authorizeCustomer(s,!0);case 8:if(c=e.sent,d=(null===(i=c.headers)||void 0===i?void 0:i.get("location"))||c.url,u=new URL(d),f=Object.fromEntries(u.searchParams.entries()),!(c.status>=400||f.error)){e.next=14;break}throw new us(c);case 14:return e.abrupt("return",Ug({url:d},Bg(d)));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fg(){return(Fg=Zn(Pi.mark((function e(t,r){var n,i,a;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_g(),e.next=3,Lg(t,n,Ug({redirectURI:r.redirectURI,hint:"guest"},r.usid&&{usid:r.usid}));case 3:return i=e.sent,a={client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code:i.code,code_verifier:n,grant_type:"authorization_code_pkce",redirect_uri:r.redirectURI,usid:i.usid},e.abrupt("return",t.getAccessToken({body:a}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jg(){return(Jg=Zn(Pi.mark((function e(t,r,n){var i,a,o,s,c,d,u,f,h,p,l,g;return Pi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=_g(),e.next=3,Ng(a);case 3:return o=e.sent,(s=new fu(t.clientConfig)).clientConfig.fetchOptions=Ug(Ug({},t.clientConfig.fetchOptions),{},{redirect:Ro?"follow":"manual"}),c="Basic ".concat(Ag("".concat(r.username,":").concat(r.password))),d={headers:{Authorization:c},parameters:{organizationId:t.clientConfig.parameters.organizationId},body:Ug({redirect_uri:n.redirectURI,client_id:t.clientConfig.parameters.clientId,code_challenge:o,channel_id:t.clientConfig.parameters.siteId},n.usid&&{usid:n.usid})},e.next=10,s.authenticateCustomer(d,!0);case 10:if(u=e.sent,f=(null===(i=u.headers)||void 0===i?void 0:i.get("location"))||u.url,h=new URL(f),p=Object.fromEntries(h.searchParams.entries()),!(u.status>=400||p.error)){e.next=16;break}throw new us(u);case 16:return l=Bg(f),g={client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code:l.code,code_verifier:a,grant_type:"authorization_code_pkce",organizationId:t.clientConfig.parameters.organizationId,redirect_uri:n.redirectURI,usid:l.usid},e.abrupt("return",t.getAccessToken({body:g}));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Gg=Object.freeze({__proto__:null,isBrowser:Ro,isNode:jo,stringToBase64:Ag,getCodeAndUsidFromUrl:Bg,createCodeVerifier:_g,generateCodeChallenge:Ng,authorize:Lg,loginGuestUser:function(e,t){return Fg.apply(this,arguments)},loginRegisteredUserB2C:function(e,t,r){return Jg.apply(this,arguments)},refreshAccessToken:function(e,t){var r={grant_type:"refresh_token",refresh_token:t.refreshToken,client_id:e.clientConfig.parameters.clientId,channel_id:e.clientConfig.parameters.siteId};return e.getAccessToken({body:r})},logout:function(e,t){return e.logoutCustomer({headers:{Authorization:"Bearer ".concat(t.accessToken)},parameters:{refresh_token:t.refreshToken,client_id:e.clientConfig.parameters.clientId,channel_id:e.clientConfig.parameters.siteId}})}});e.ClientConfig=Po,e.ShopperBaskets=Kd,e.ShopperContexts=Zd,e.ShopperCustomers=ru,e.ShopperDiscoverySearch=au,e.ShopperGiftCertificates=cu,e.ShopperLogin=fu,e.ShopperOrders=lu,e.ShopperProducts=vu,e.ShopperPromotions=xu,e.ShopperSearch=Bu,e.TemplateURL=Vd,e.helpers=Gg,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("nanoid")):"function"==typeof define&&define.amd?define(["exports","nanoid"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).CommerceSdk={},e.nanoid)}(this,(function(e,t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var i,a,o=function(e){return e&&e.Math==Math&&e},s=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof r&&r)||function(){return this}()||Function("return this")(),c=function(e){try{return!!e()}catch(e){return!0}},d=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!c((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),f=Function.prototype.call,h=u?f.bind(f):function(){return f.apply(f,arguments)},p={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,g={f:l&&!p.call({1:2},1)?function(e){var t=l(this,e);return!!t&&t.enumerable}:p},b=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=Function.prototype,I=v.bind,x=v.call,k=u&&I.bind(x,x),m=u?function(e){return e&&k(e)}:function(e){return e&&function(){return x.apply(e,arguments)}},w=m({}.toString),y=m("".slice),C=function(e){return y(w(e),8,-1)},z=Object,O=m("".split),E=c((function(){return!z("z").propertyIsEnumerable(0)}))?function(e){return"String"==C(e)?O(e,""):z(e)}:z,q=TypeError,P=function(e){if(null==e)throw q("Can't call method on "+e);return e},S=function(e){return E(P(e))},j=function(e){return"function"==typeof e},T=function(e){return"object"==typeof e?null!==e:j(e)},M=function(e){return j(e)?e:void 0},R=function(e,t){return arguments.length<2?M(s[e]):s[e]&&s[e][t]},A=m({}.isPrototypeOf),U=R("navigator","userAgent")||"",B=s.process,N=s.Deno,_=B&&B.versions||N&&N.version,L=_&&_.v8;L&&(a=(i=L.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!a&&U&&(!(i=U.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=U.match(/Chrome\/(\d+)/))&&(a=+i[1]);var D=a,J=!!Object.getOwnPropertySymbols&&!c((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&D&&D<41})),F=J&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,G=Object,H=F?function(e){return"symbol"==typeof e}:function(e){var t=R("Symbol");return j(t)&&A(t.prototype,G(e))},V=String,W=function(e){try{return V(e)}catch(e){return"Object"}},$=TypeError,Y=function(e){if(j(e))return e;throw $(W(e)+" is not a function")},K=function(e,t){var r=e[t];return null==r?void 0:Y(r)},Q=TypeError,X=Object.defineProperty,Z=function(e,t){try{X(s,e,{value:t,configurable:!0,writable:!0})}catch(r){s[e]=t}return t},ee=s["__core-js_shared__"]||Z("__core-js_shared__",{}),te=n((function(e){(e.exports=function(e,t){return ee[e]||(ee[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),re=Object,ne=function(e){return re(P(e))},ie=m({}.hasOwnProperty),ae=Object.hasOwn||function(e,t){return ie(ne(e),t)},oe=0,se=Math.random(),ce=m(1..toString),de=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ce(++oe+se,36)},ue=te("wks"),fe=s.Symbol,he=fe&&fe.for,pe=F?fe:fe&&fe.withoutSetter||de,le=function(e){if(!ae(ue,e)||!J&&"string"!=typeof ue[e]){var t="Symbol."+e;J&&ae(fe,e)?ue[e]=fe[e]:ue[e]=F&&he?he(t):pe(t)}return ue[e]},ge=TypeError,be=le("toPrimitive"),ve=function(e,t){if(!T(e)||H(e))return e;var r,n=K(e,be);if(n){if(void 0===t&&(t="default"),r=h(n,e,t),!T(r)||H(r))return r;throw ge("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&j(r=e.toString)&&!T(n=h(r,e)))return n;if(j(r=e.valueOf)&&!T(n=h(r,e)))return n;if("string"!==t&&j(r=e.toString)&&!T(n=h(r,e)))return n;throw Q("Can't convert object to primitive value")}(e,t)},Ie=function(e){var t=ve(e,"string");return H(t)?t:t+""},xe=s.document,ke=T(xe)&&T(xe.createElement),me=function(e){return ke?xe.createElement(e):{}},we=!d&&!c((function(){return 7!=Object.defineProperty(me("div"),"a",{get:function(){return 7}}).a})),ye=Object.getOwnPropertyDescriptor,Ce={f:d?ye:function(e,t){if(e=S(e),t=Ie(t),we)try{return ye(e,t)}catch(e){}if(ae(e,t))return b(!h(g.f,e,t),e[t])}},ze=d&&c((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Oe=String,Ee=TypeError,qe=function(e){if(T(e))return e;throw Ee(Oe(e)+" is not an object")},Pe=TypeError,Se=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Te={f:d?ze?function(e,t,r){if(qe(e),t=Ie(t),qe(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=je(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Se(e,t,r)}:Se:function(e,t,r){if(qe(e),t=Ie(t),qe(r),we)try{return Se(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Pe("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Me=d?function(e,t,r){return Te.f(e,t,b(1,r))}:function(e,t,r){return e[t]=r,e},Re=Function.prototype,Ae=d&&Object.getOwnPropertyDescriptor,Ue=ae(Re,"name"),Be={EXISTS:Ue,PROPER:Ue&&"something"===function(){}.name,CONFIGURABLE:Ue&&(!d||d&&Ae(Re,"name").configurable)},Ne=m(Function.toString);j(ee.inspectSource)||(ee.inspectSource=function(e){return Ne(e)});var _e,Le,De,Je=ee.inspectSource,Fe=s.WeakMap,Ge=j(Fe)&&/native code/.test(Je(Fe)),He=te("keys"),Ve=function(e){return He[e]||(He[e]=de(e))},We={},$e=s.TypeError,Ye=s.WeakMap;if(Ge||ee.state){var Ke=ee.state||(ee.state=new Ye),Qe=m(Ke.get),Xe=m(Ke.has),Ze=m(Ke.set);_e=function(e,t){if(Xe(Ke,e))throw new $e("Object already initialized");return t.facade=e,Ze(Ke,e,t),t},Le=function(e){return Qe(Ke,e)||{}},De=function(e){return Xe(Ke,e)}}else{var et=Ve("state");We[et]=!0,_e=function(e,t){if(ae(e,et))throw new $e("Object already initialized");return t.facade=e,Me(e,et,t),t},Le=function(e){return ae(e,et)?e[et]:{}},De=function(e){return ae(e,et)}}var tt={set:_e,get:Le,has:De,enforce:function(e){return De(e)?Le(e):_e(e,{})},getterFor:function(e){return function(t){var r;if(!T(t)||(r=Le(t)).type!==e)throw $e("Incompatible receiver, "+e+" required");return r}}},rt=n((function(e){var t=Be.CONFIGURABLE,r=tt.enforce,n=tt.get,i=Object.defineProperty,a=d&&!c((function(){return 8!==i((function(){}),"length",{value:8}).length})),o=String(String).split("String"),s=e.exports=function(e,n,s){"Symbol("===String(n).slice(0,7)&&(n="["+String(n).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),s&&s.getter&&(n="get "+n),s&&s.setter&&(n="set "+n),(!ae(e,"name")||t&&e.name!==n)&&(d?i(e,"name",{value:n,configurable:!0}):e.name=n),a&&s&&ae(s,"arity")&&e.length!==s.arity&&i(e,"length",{value:s.arity});try{s&&ae(s,"constructor")&&s.constructor?d&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=r(e);return ae(c,"source")||(c.source=o.join("string"==typeof n?n:"")),e};Function.prototype.toString=s((function(){return j(this)&&n(this).source||Je(this)}),"toString")})),nt=function(e,t,r,n){n||(n={});var i=n.enumerable,a=void 0!==n.name?n.name:t;if(j(r)&&rt(r,a,n),n.global)i?e[t]=r:Z(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Te.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},it=Math.ceil,at=Math.floor,ot=Math.trunc||function(e){var t=+e;return(t>0?at:it)(t)},st=function(e){var t=+e;return t!=t||0===t?0:ot(t)},ct=Math.max,dt=Math.min,ut=function(e,t){var r=st(e);return r<0?ct(r+t,0):dt(r,t)},ft=Math.min,ht=function(e){return e>0?ft(st(e),9007199254740991):0},pt=function(e){return ht(e.length)},lt=function(e){return function(t,r,n){var i,a=S(t),o=pt(a),s=ut(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},gt={includes:lt(!0),indexOf:lt(!1)},bt=gt.indexOf,vt=m([].push),It=function(e,t){var r,n=S(e),i=0,a=[];for(r in n)!ae(We,r)&&ae(n,r)&&vt(a,r);for(;t.length>i;)ae(n,r=t[i++])&&(~bt(a,r)||vt(a,r));return a},xt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kt=xt.concat("length","prototype"),mt={f:Object.getOwnPropertyNames||function(e){return It(e,kt)}},wt={f:Object.getOwnPropertySymbols},yt=m([].concat),Ct=R("Reflect","ownKeys")||function(e){var t=mt.f(qe(e)),r=wt.f;return r?yt(t,r(e)):t},zt=function(e,t,r){for(var n=Ct(t),i=Te.f,a=Ce.f,o=0;o<n.length;o++){var s=n[o];ae(e,s)||r&&ae(r,s)||i(e,s,a(t,s))}},Ot=/#|\.prototype\./,Et=function(e,t){var r=Pt[qt(e)];return r==jt||r!=St&&(j(t)?c(t):!!t)},qt=Et.normalize=function(e){return String(e).replace(Ot,".").toLowerCase()},Pt=Et.data={},St=Et.NATIVE="N",jt=Et.POLYFILL="P",Tt=Et,Mt=Ce.f,Rt=function(e,t){var r,n,i,a,o,c=e.target,d=e.global,u=e.stat;if(r=d?s:u?s[c]||Z(c,{}):(s[c]||{}).prototype)for(n in t){if(a=t[n],i=e.dontCallGetSet?(o=Mt(r,n))&&o.value:r[n],!Tt(d?n:c+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;zt(a,i)}(e.sham||i&&i.sham)&&Me(a,"sham",!0),nt(r,n,a,e)}},At=Object.keys||function(e){return It(e,xt)},Ut=c((function(){At(1)}));Rt({target:"Object",stat:!0,forced:Ut},{keys:function(e){return At(ne(e))}});var Bt={};Bt[le("toStringTag")]="z";var Nt,_t="[object z]"===String(Bt),Lt=le("toStringTag"),Dt=Object,Jt="Arguments"==C(function(){return arguments}()),Ft=_t?C:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Dt(e),Lt))?r:Jt?C(t):"Object"==(n=C(t))&&j(t.callee)?"Arguments":n},Gt=String,Ht=function(e){if("Symbol"===Ft(e))throw TypeError("Cannot convert a Symbol value to a string");return Gt(e)},Vt={f:d&&!ze?Object.defineProperties:function(e,t){qe(e);for(var r,n=S(t),i=At(t),a=i.length,o=0;a>o;)Te.f(e,r=i[o++],n[r]);return e}},Wt=R("document","documentElement"),$t=Ve("IE_PROTO"),Yt=function(){},Kt=function(e){return"<script>"+e+"<\/script>"},Qt=function(e){e.write(Kt("")),e.close();var t=e.parentWindow.Object;return e=null,t},Xt=function(){try{Nt=new ActiveXObject("htmlfile")}catch(e){}var e,t;Xt="undefined"!=typeof document?document.domain&&Nt?Qt(Nt):((t=me("iframe")).style.display="none",Wt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Kt("document.F=Object")),e.close(),e.F):Qt(Nt);for(var r=xt.length;r--;)delete Xt.prototype[xt[r]];return Xt()};We[$t]=!0;var Zt=Object.create||function(e,t){var r;return null!==e?(Yt.prototype=qe(e),r=new Yt,Yt.prototype=null,r[$t]=e):r=Xt(),void 0===t?r:Vt.f(r,t)},er=function(e,t,r){var n=Ie(t);n in e?Te.f(e,n,b(0,r)):e[n]=r},tr=Array,rr=Math.max,nr=function(e,t,r){for(var n=pt(e),i=ut(t,n),a=ut(void 0===r?n:r,n),o=tr(rr(a-i,0)),s=0;i<a;i++,s++)er(o,s,e[i]);return o.length=s,o},ir=mt.f,ar="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],or={f:function(e){return ar&&"Window"==C(e)?function(e){try{return ir(e)}catch(e){return nr(ar)}}(e):ir(S(e))}},sr={f:le},cr=s,dr=Te.f,ur=Te.f,fr=le("toStringTag"),hr=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ae(e,fr)&&ur(e,fr,{configurable:!0,value:t})},pr=m(m.bind),lr=function(e,t){return Y(e),void 0===t?e:u?pr(e,t):function(){return e.apply(t,arguments)}},gr=Array.isArray||function(e){return"Array"==C(e)},br=function(){},vr=[],Ir=R("Reflect","construct"),xr=/^\s*(?:class|function)\b/,kr=m(xr.exec),mr=!xr.exec(br),wr=function(e){if(!j(e))return!1;try{return Ir(br,vr,e),!0}catch(e){return!1}},yr=function(e){if(!j(e))return!1;switch(Ft(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return mr||!!kr(xr,Je(e))}catch(e){return!0}};yr.sham=!0;var Cr=!Ir||c((function(){var e;return wr(wr.call)||!wr(Object)||!wr((function(){e=!0}))||e}))?yr:wr,zr=le("species"),Or=Array,Er=function(e,t){return new(function(e){var t;return gr(e)&&(t=e.constructor,(Cr(t)&&(t===Or||gr(t.prototype))||T(t)&&null===(t=t[zr]))&&(t=void 0)),void 0===t?Or:t}(e))(0===t?0:t)},qr=m([].push),Pr=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=7==e,s=5==e||a;return function(c,d,u,f){for(var h,p,l=ne(c),g=E(l),b=lr(d,u),v=pt(g),I=0,x=f||Er,k=t?x(c,v):r||o?x(c,0):void 0;v>I;I++)if((s||I in g)&&(p=b(h=g[I],I,l),e))if(t)k[I]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return I;case 2:qr(k,h)}else switch(e){case 4:return!1;case 7:qr(k,h)}return a?-1:n||i?i:k}},Sr={forEach:Pr(0),map:Pr(1),filter:Pr(2),some:Pr(3),every:Pr(4),find:Pr(5),findIndex:Pr(6),filterReject:Pr(7)},jr=Sr.forEach,Tr=Ve("hidden"),Mr=tt.set,Rr=tt.getterFor("Symbol"),Ar=Object.prototype,Ur=s.Symbol,Br=Ur&&Ur.prototype,Nr=s.TypeError,_r=s.QObject,Lr=Ce.f,Dr=Te.f,Jr=or.f,Fr=g.f,Gr=m([].push),Hr=te("symbols"),Vr=te("op-symbols"),Wr=te("wks"),$r=!_r||!_r.prototype||!_r.prototype.findChild,Yr=d&&c((function(){return 7!=Zt(Dr({},"a",{get:function(){return Dr(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Lr(Ar,t);n&&delete Ar[t],Dr(e,t,r),n&&e!==Ar&&Dr(Ar,t,n)}:Dr,Kr=function(e,t){var r=Hr[e]=Zt(Br);return Mr(r,{type:"Symbol",tag:e,description:t}),d||(r.description=t),r},Qr=function(e,t,r){e===Ar&&Qr(Vr,t,r),qe(e);var n=Ie(t);return qe(r),ae(Hr,n)?(r.enumerable?(ae(e,Tr)&&e[Tr][n]&&(e[Tr][n]=!1),r=Zt(r,{enumerable:b(0,!1)})):(ae(e,Tr)||Dr(e,Tr,b(1,{})),e[Tr][n]=!0),Yr(e,n,r)):Dr(e,n,r)},Xr=function(e,t){qe(e);var r=S(t),n=At(r).concat(rn(r));return jr(n,(function(t){d&&!h(Zr,r,t)||Qr(e,t,r[t])})),e},Zr=function(e){var t=Ie(e),r=h(Fr,this,t);return!(this===Ar&&ae(Hr,t)&&!ae(Vr,t))&&(!(r||!ae(this,t)||!ae(Hr,t)||ae(this,Tr)&&this[Tr][t])||r)},en=function(e,t){var r=S(e),n=Ie(t);if(r!==Ar||!ae(Hr,n)||ae(Vr,n)){var i=Lr(r,n);return!i||!ae(Hr,n)||ae(r,Tr)&&r[Tr][n]||(i.enumerable=!0),i}},tn=function(e){var t=Jr(S(e)),r=[];return jr(t,(function(e){ae(Hr,e)||ae(We,e)||Gr(r,e)})),r},rn=function(e){var t=e===Ar,r=Jr(t?Vr:S(e)),n=[];return jr(r,(function(e){!ae(Hr,e)||t&&!ae(Ar,e)||Gr(n,Hr[e])})),n};J||(Br=(Ur=function(){if(A(Br,this))throw Nr("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?Ht(arguments[0]):void 0,t=de(e),r=function(e){this===Ar&&h(r,Vr,e),ae(this,Tr)&&ae(this[Tr],t)&&(this[Tr][t]=!1),Yr(this,t,b(1,e))};return d&&$r&&Yr(Ar,t,{configurable:!0,set:r}),Kr(t,e)}).prototype,nt(Br,"toString",(function(){return Rr(this).tag})),nt(Ur,"withoutSetter",(function(e){return Kr(de(e),e)})),g.f=Zr,Te.f=Qr,Vt.f=Xr,Ce.f=en,mt.f=or.f=tn,wt.f=rn,sr.f=function(e){return Kr(le(e),e)},d&&(Dr(Br,"description",{configurable:!0,get:function(){return Rr(this).description}}),nt(Ar,"propertyIsEnumerable",Zr,{unsafe:!0}))),Rt({global:!0,constructor:!0,wrap:!0,forced:!J,sham:!J},{Symbol:Ur}),jr(At(Wr),(function(e){!function(e){var t=cr.Symbol||(cr.Symbol={});ae(t,e)||dr(t,e,{value:sr.f(e)})}(e)})),Rt({target:"Symbol",stat:!0,forced:!J},{useSetter:function(){$r=!0},useSimple:function(){$r=!1}}),Rt({target:"Object",stat:!0,forced:!J,sham:!d},{create:function(e,t){return void 0===t?Zt(e):Xr(Zt(e),t)},defineProperty:Qr,defineProperties:Xr,getOwnPropertyDescriptor:en}),Rt({target:"Object",stat:!0,forced:!J},{getOwnPropertyNames:tn}),function(){var e=R("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,n=le("toPrimitive");t&&!t[n]&&nt(t,n,(function(e){return h(r,this)}),{arity:1})}(),hr(Ur,"Symbol"),We[Tr]=!0;var nn=J&&!!Symbol.for&&!!Symbol.keyFor,an=te("string-to-symbol-registry"),on=te("symbol-to-string-registry");Rt({target:"Symbol",stat:!0,forced:!nn},{for:function(e){var t=Ht(e);if(ae(an,t))return an[t];var r=R("Symbol")(t);return an[t]=r,on[r]=t,r}});var sn=te("symbol-to-string-registry");Rt({target:"Symbol",stat:!0,forced:!nn},{keyFor:function(e){if(!H(e))throw TypeError(W(e)+" is not a symbol");if(ae(sn,e))return sn[e]}});var cn=Function.prototype,dn=cn.apply,un=cn.call,fn="object"==typeof Reflect&&Reflect.apply||(u?un.bind(dn):function(){return un.apply(dn,arguments)}),hn=m([].slice),pn=R("JSON","stringify"),ln=m(/./.exec),gn=m("".charAt),bn=m("".charCodeAt),vn=m("".replace),In=m(1..toString),xn=/[\uD800-\uDFFF]/g,kn=/^[\uD800-\uDBFF]$/,mn=/^[\uDC00-\uDFFF]$/,wn=!J||c((function(){var e=R("Symbol")();return"[null]"!=pn([e])||"{}"!=pn({a:e})||"{}"!=pn(Object(e))})),yn=c((function(){return'"\\udf06\\ud834"'!==pn("\udf06\ud834")||'"\\udead"'!==pn("\udead")})),Cn=function(e,t){var r=hn(arguments),n=t;if((T(t)||void 0!==e)&&!H(e))return gr(t)||(t=function(e,t){if(j(n)&&(t=h(n,this,e,t)),!H(t))return t}),r[1]=t,fn(pn,null,r)},zn=function(e,t,r){var n=gn(r,t-1),i=gn(r,t+1);return ln(kn,e)&&!ln(mn,i)||ln(mn,e)&&!ln(kn,n)?"\\u"+In(bn(e,0),16):e};pn&&Rt({target:"JSON",stat:!0,arity:3,forced:wn||yn},{stringify:function(e,t,r){var n=hn(arguments),i=fn(wn?Cn:pn,null,n);return yn&&"string"==typeof i?vn(i,xn,zn):i}});var On=!J||c((function(){wt.f(1)}));Rt({target:"Object",stat:!0,forced:On},{getOwnPropertySymbols:function(e){var t=wt.f;return t?t(ne(e)):[]}});var En=le("species"),qn=function(e){return D>=51||!c((function(){var t=[];return(t.constructor={})[En]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Pn=Sr.filter,Sn=qn("filter");Rt({target:"Array",proto:!0,forced:!Sn},{filter:function(e){return Pn(this,e,arguments.length>1?arguments[1]:void 0)}});var jn=_t?{}.toString:function(){return"[object "+Ft(this)+"]"};_t||nt(Object.prototype,"toString",jn,{unsafe:!0});var Tn=Ce.f,Mn=c((function(){Tn(1)}));Rt({target:"Object",stat:!0,forced:!d||Mn,sham:!d},{getOwnPropertyDescriptor:function(e,t){return Tn(S(e),t)}});var Rn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},An=me("span").classList,Un=An&&An.constructor&&An.constructor.prototype,Bn=Un===Object.prototype?void 0:Un,Nn=function(e,t){var r=[][e];return!!r&&c((function(){r.call(null,t||function(){return 1},1)}))},_n=Sr.forEach,Ln=Nn("forEach")?[].forEach:function(e){return _n(this,e,arguments.length>1?arguments[1]:void 0)},Dn=function(e){if(e&&e.forEach!==Ln)try{Me(e,"forEach",Ln)}catch(t){e.forEach=Ln}};for(var Jn in Rn)Rn[Jn]&&Dn(s[Jn]&&s[Jn].prototype);Dn(Bn),Rt({target:"Object",stat:!0,sham:!d},{getOwnPropertyDescriptors:function(e){for(var t,r,n=S(e),i=Ce.f,a=Ct(n),o={},s=0;a.length>s;)void 0!==(r=i(n,t=a[s++]))&&er(o,t,r);return o}});var Fn=Vt.f;Rt({target:"Object",stat:!0,forced:Object.defineProperties!==Fn,sham:!d},{defineProperties:Fn});var Gn=Te.f;Rt({target:"Object",stat:!0,forced:Object.defineProperty!==Gn,sham:!d},{defineProperty:Gn});var Hn=function(){var e=qe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Vn=RegExp.prototype,Wn=Be.PROPER,$n=RegExp.prototype.toString,Yn=c((function(){return"/a/b"!=$n.call({source:"a",flags:"b"})})),Kn=Wn&&"toString"!=$n.name;function Qn(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function Xn(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){Qn(a,n,i,o,s,"next",e)}function s(e){Qn(a,n,i,o,s,"throw",e)}o(void 0)}))}}function Zn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ei(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ti(e,t,r){return t&&ei(e.prototype,t),r&&ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ri(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(Yn||Kn)&&nt(RegExp.prototype,"toString",(function(){var e=qe(this);return"/"+Ht(e.source)+"/"+Ht(function(e){var t=e.flags;return void 0!==t||"flags"in Vn||ae(e,"flags")||!A(Vn,e)?t:h(Hn,e)}(e))}),{unsafe:!0});var ni=Object.prototype,ii=ni.hasOwnProperty,ai="function"==typeof Symbol?Symbol:{},oi=ai.iterator||"@@iterator",si=ai.asyncIterator||"@@asyncIterator",ci=ai.toStringTag||"@@toStringTag";function di(e,t,r,n){var i=t&&t.prototype instanceof hi?t:hi,a=Object.create(i.prototype),o=new zi(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return Ei()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=wi(o,r);if(s){if(s===fi)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=ui(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===fi)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,o),a}function ui(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var fi={};function hi(){}function pi(){}function li(){}var gi={};gi[oi]=function(){return this};var bi=Object.getPrototypeOf,vi=bi&&bi(bi(Oi([])));vi&&vi!==ni&&ii.call(vi,oi)&&(gi=vi);var Ii=li.prototype=hi.prototype=Object.create(gi);function xi(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function ki(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===pi||"GeneratorFunction"===(t.displayName||t.name))}function mi(e,t){var r;this._invoke=function(n,i){function a(){return new t((function(r,a){!function r(n,i,a,o){var s=ui(e[n],e,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&ii.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,o)}))}o(s.arg)}(n,i,r,a)}))}return r=r?r.then(a,a):a()}}function wi(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,wi(e,t),"throw"===t.method))return fi;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return fi}var n=ui(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,fi;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,fi):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,fi)}function yi(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Ci(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function zi(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(yi,this),this.reset(!0)}function Oi(e){if(e){var t=e[oi];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(ii.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:Ei}}function Ei(){return{value:void 0,done:!0}}pi.prototype=Ii.constructor=li,li.constructor=pi,li[ci]=pi.displayName="GeneratorFunction",xi(mi.prototype),mi.prototype[si]=function(){return this},xi(Ii),Ii[ci]="Generator",Ii[oi]=function(){return this},Ii.toString=function(){return"[object Generator]"},zi.prototype={constructor:zi,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(Ci),!e)for(var t in this)"t"===t.charAt(0)&&ii.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var o=ii.call(i,"catchLoc"),s=ii.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&ii.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,fi):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),fi},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),Ci(r),fi}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;Ci(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:Oi(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),fi}};var qi={wrap:di,isGeneratorFunction:ki,AsyncIterator:mi,mark:function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,li):(e.__proto__=li,ci in e||(e[ci]="GeneratorFunction")),e.prototype=Object.create(Ii),e},awrap:function(e){return{__await:e}},async:function(e,t,r,n,i){void 0===i&&(i=Promise);var a=new mi(di(e,t,r,n),i);return ki(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},keys:function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},values:Oi},Pi=Te.f,Si=le("unscopables"),ji=Array.prototype;null==ji[Si]&&Pi(ji,Si,{configurable:!0,value:Zt(null)});var Ti,Mi,Ri,Ai=function(e){ji[Si][e]=!0},Ui={},Bi=!c((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ni=Ve("IE_PROTO"),_i=Object,Li=_i.prototype,Di=Bi?_i.getPrototypeOf:function(e){var t=ne(e);if(ae(t,Ni))return t[Ni];var r=t.constructor;return j(r)&&t instanceof r?r.prototype:t instanceof _i?Li:null},Ji=le("iterator"),Fi=!1;[].keys&&("next"in(Ri=[].keys())?(Mi=Di(Di(Ri)))!==Object.prototype&&(Ti=Mi):Fi=!0),(null==Ti||c((function(){var e={};return Ti[Ji].call(e)!==e})))&&(Ti={}),j(Ti[Ji])||nt(Ti,Ji,(function(){return this}));var Gi={IteratorPrototype:Ti,BUGGY_SAFARI_ITERATORS:Fi},Hi=Gi.IteratorPrototype,Vi=function(){return this},Wi=function(e,t,r,n){var i=t+" Iterator";return e.prototype=Zt(Hi,{next:b(+!n,r)}),hr(e,i,!1),Ui[i]=Vi,e},$i=String,Yi=TypeError,Ki=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=m(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return qe(r),function(e){if("object"==typeof e||j(e))return e;throw Yi("Can't set "+$i(e)+" as a prototype")}(n),t?e(r,n):r.__proto__=n,r}}():void 0),Qi=Be.PROPER,Xi=Be.CONFIGURABLE,Zi=Gi.IteratorPrototype,ea=Gi.BUGGY_SAFARI_ITERATORS,ta=le("iterator"),ra=function(){return this},na=function(e,t,r,n,i,a,o){Wi(r,t,n);var s,c,d,u=function(e){if(e===i&&b)return b;if(!ea&&e in l)return l[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},f=t+" Iterator",p=!1,l=e.prototype,g=l[ta]||l["@@iterator"]||i&&l[i],b=!ea&&g||u(i),v="Array"==t&&l.entries||g;if(v&&(s=Di(v.call(new e)))!==Object.prototype&&s.next&&(Di(s)!==Zi&&(Ki?Ki(s,Zi):j(s[ta])||nt(s,ta,ra)),hr(s,f,!0)),Qi&&"values"==i&&g&&"values"!==g.name&&(Xi?Me(l,"name","values"):(p=!0,b=function(){return h(g,this)})),i)if(c={values:u("values"),keys:a?b:u("keys"),entries:u("entries")},o)for(d in c)(ea||p||!(d in l))&&nt(l,d,c[d]);else Rt({target:t,proto:!0,forced:ea||p},c);return l[ta]!==b&&nt(l,ta,b,{name:i}),Ui[t]=b,c},ia=Te.f,aa=tt.set,oa=tt.getterFor("Array Iterator"),sa=na(Array,"Array",(function(e,t){aa(this,{type:"Array Iterator",target:S(e),index:0,kind:t})}),(function(){var e=oa(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),ca=Ui.Arguments=Ui.Array;if(Ai("keys"),Ai("values"),Ai("entries"),d&&"values"!==ca.name)try{ia(ca,"name",{value:"values"})}catch(e){}var da=m("".charAt),ua=m("".charCodeAt),fa=m("".slice),ha=function(e){return function(t,r){var n,i,a=Ht(P(t)),o=st(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=ua(a,o))<55296||n>56319||o+1===s||(i=ua(a,o+1))<56320||i>57343?e?da(a,o):n:e?fa(a,o,o+2):i-56320+(n-55296<<10)+65536}},pa={codeAt:ha(!1),charAt:ha(!0)},la=pa.charAt,ga=tt.set,ba=tt.getterFor("String Iterator");na(String,"String",(function(e){ga(this,{type:"String Iterator",string:Ht(e),index:0})}),(function(){var e,t=ba(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=la(r,n),t.index+=e.length,{value:e,done:!1})}));var va=le("iterator"),Ia=le("toStringTag"),xa=sa.values,ka=function(e,t){if(e){if(e[va]!==xa)try{Me(e,va,xa)}catch(t){e[va]=xa}if(e[Ia]||Me(e,Ia,t),Rn[t])for(var r in sa)if(e[r]!==sa[r])try{Me(e,r,sa[r])}catch(t){e[r]=sa[r]}}};for(var ma in Rn)ka(s[ma]&&s[ma].prototype,ma);ka(Bn,"DOMTokenList");var wa=le("iterator"),ya=!c((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[wa]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),Ca=function(e,t,r){for(var n in t)nt(e,n,t[n],r);return e},za=TypeError,Oa=function(e,t){if(A(t,e))return e;throw za("Incorrect invocation")},Ea=le("iterator"),qa=function(e){if(null!=e)return K(e,Ea)||K(e,"@@iterator")||Ui[Ft(e)]},Pa=TypeError,Sa=function(e,t){var r=arguments.length<2?qa(e):t;if(Y(r))return qe(h(r,e));throw Pa(W(e)+" is not iterable")},ja=TypeError,Ta=function(e,t){if(e<t)throw ja("Not enough arguments");return e},Ma=Math.floor,Ra=function(e,t){var r=e.length,n=Ma(r/2);return r<8?Aa(e,t):Ua(e,Ra(nr(e,0,n),t),Ra(nr(e,n),t),t)},Aa=function(e,t){for(var r,n,i=e.length,a=1;a<i;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},Ua=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?n(t[o],r[s])<=0?t[o++]:r[s++]:o<i?t[o++]:r[s++];return e},Ba=Ra,Na=le("iterator"),_a=tt.set,La=tt.getterFor("URLSearchParams"),Da=tt.getterFor("URLSearchParamsIterator"),Ja=Object.getOwnPropertyDescriptor,Fa=function(e){if(!d)return s[e];var t=Ja(s,e);return t&&t.value},Ga=Fa("fetch"),Ha=Fa("Request"),Va=Fa("Headers"),Wa=Ha&&Ha.prototype,$a=Va&&Va.prototype,Ya=s.RegExp,Ka=s.TypeError,Qa=s.decodeURIComponent,Xa=s.encodeURIComponent,Za=m("".charAt),eo=m([].join),to=m([].push),ro=m("".replace),no=m([].shift),io=m([].splice),ao=m("".split),oo=m("".slice),so=/\+/g,co=Array(4),uo=function(e){return co[e-1]||(co[e-1]=Ya("((?:%[\\da-f]{2}){"+e+"})","gi"))},fo=function(e){try{return Qa(e)}catch(t){return e}},ho=function(e){var t=ro(e,so," "),r=4;try{return Qa(t)}catch(e){for(;r;)t=ro(t,uo(r--),fo);return t}},po=/[!'()~]|%20/g,lo={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},go=function(e){return lo[e]},bo=function(e){return ro(Xa(e),po,go)},vo=Wi((function(e,t){_a(this,{type:"URLSearchParamsIterator",iterator:Sa(La(e).entries),kind:t})}),"Iterator",(function(){var e=Da(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),Io=function(e){this.entries=[],this.url=null,void 0!==e&&(T(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Za(e,0)?oo(e,1):e:Ht(e)))};Io.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,a,o,s,c=qa(e);if(c)for(r=(t=Sa(e,c)).next;!(n=h(r,t)).done;){if(a=(i=Sa(qe(n.value))).next,(o=h(a,i)).done||(s=h(a,i)).done||!h(a,i).done)throw Ka("Expected sequence with length 2");to(this.entries,{key:Ht(o.value),value:Ht(s.value)})}else for(var d in e)ae(e,d)&&to(this.entries,{key:d,value:Ht(e[d])})},parseQuery:function(e){if(e)for(var t,r,n=ao(e,"&"),i=0;i<n.length;)(t=n[i++]).length&&(r=ao(t,"="),to(this.entries,{key:ho(no(r)),value:ho(eo(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],to(r,bo(e.key)+"="+bo(e.value));return eo(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var xo=function(){Oa(this,ko);var e=arguments.length>0?arguments[0]:void 0;_a(this,new Io(e))},ko=xo.prototype;if(Ca(ko,{append:function(e,t){Ta(arguments.length,2);var r=La(this);to(r.entries,{key:Ht(e),value:Ht(t)}),r.updateURL()},delete:function(e){Ta(arguments.length,1);for(var t=La(this),r=t.entries,n=Ht(e),i=0;i<r.length;)r[i].key===n?io(r,i,1):i++;t.updateURL()},get:function(e){Ta(arguments.length,1);for(var t=La(this).entries,r=Ht(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Ta(arguments.length,1);for(var t=La(this).entries,r=Ht(e),n=[],i=0;i<t.length;i++)t[i].key===r&&to(n,t[i].value);return n},has:function(e){Ta(arguments.length,1);for(var t=La(this).entries,r=Ht(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Ta(arguments.length,1);for(var r,n=La(this),i=n.entries,a=!1,o=Ht(e),s=Ht(t),c=0;c<i.length;c++)(r=i[c]).key===o&&(a?io(i,c--,1):(a=!0,r.value=s));a||to(i,{key:o,value:s}),n.updateURL()},sort:function(){var e=La(this);Ba(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=La(this).entries,n=lr(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new vo(this,"keys")},values:function(){return new vo(this,"values")},entries:function(){return new vo(this,"entries")}},{enumerable:!0}),nt(ko,Na,ko.entries,{name:"entries"}),nt(ko,"toString",(function(){return La(this).serialize()}),{enumerable:!0}),hr(xo,"URLSearchParams"),Rt({global:!0,constructor:!0,forced:!ya},{URLSearchParams:xo}),!ya&&j(Va)){var mo=m($a.has),wo=m($a.set),yo=function(e){if(T(e)){var t,r=e.body;if("URLSearchParams"===Ft(r))return t=e.headers?new Va(e.headers):new Va,mo(t,"content-type")||wo(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Zt(e,{body:b(0,Ht(r)),headers:b(0,t)})}return e};if(j(Ga)&&Rt({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Ga(e,arguments.length>1?yo(arguments[1]):{})}}),j(Ha)){var Co=function(e){return Oa(this,Wa),new Ha(e,arguments.length>1?yo(arguments[1]):{})};Wa.constructor=Co,Co.prototype=Wa,Rt({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Co})}}var zo={URLSearchParams:xo,getState:La};function Oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oo(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qo=ti((function e(t){if(Zn(this,e),ri(this,"baseUri",void 0),ri(this,"proxy",void 0),ri(this,"headers",void 0),ri(this,"parameters",void 0),ri(this,"fetchOptions",void 0),ri(this,"transformRequest",void 0),ri(this,"throwOnBadResponse",void 0),this.headers=Eo({},t.headers),this.parameters=Eo({},t.parameters),!this.parameters.shortCode)throw new Error("Missing required parameter: shortCode");this.fetchOptions=Eo({credentials:"omit"},t.fetchOptions),this.transformRequest=t.transformRequest||e.defaults.transformRequest,t.baseUri&&(this.baseUri=t.baseUri),t.proxy&&(this.proxy=t.proxy),this.throwOnBadResponse=!!t.throwOnBadResponse}));function Po(e){return(Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ri(qo,"defaults",{transformRequest:function(e,t){switch(t["Content-Type"]){case"application/json":return JSON.stringify(e);case"application/x-www-form-urlencoded":return new URLSearchParams(e);default:return e}}}),Rt({global:!0},{globalThis:s});var So="object"===("undefined"==typeof window?"undefined":Po(window))&&"object"===Po(window.document),jo="object"===("undefined"==typeof process?"undefined":Po(process))&&"object"===Po(process.versions)&&"string"==typeof process.versions.node,To=So?window:globalThis,Mo="function"==typeof To.fetch,Ro=function(){if(jo)return require("node-fetch");if(!Mo)throw new Error("Bad environment: it is not a node environment but fetch is not defined");return To.fetch}(),Ao=Function,Uo=m([].concat),Bo=m([].join),No={},_o=function(e,t,r){if(!ae(No,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";No[t]=Ao("C,a","return new C("+Bo(n,",")+")")}return No[t](e,r)},Lo=u?Ao.bind:function(e){var t=Y(this),r=t.prototype,n=hn(arguments,1),i=function(){var r=Uo(n,hn(arguments));return this instanceof i?_o(t,r.length,r):t.apply(e,r)};return T(r)&&(i.prototype=r),i},Do=TypeError,Jo=function(e){if(Cr(e))return e;throw Do(W(e)+" is not a constructor")},Fo=R("Reflect","construct"),Go=Object.prototype,Ho=[].push,Vo=c((function(){function e(){}return!(Fo((function(){}),[],e)instanceof e)})),Wo=!c((function(){Fo((function(){}))})),$o=Vo||Wo;Rt({target:"Reflect",stat:!0,forced:$o,sham:$o},{construct:function(e,t){Jo(e),qe(t);var r=arguments.length<3?e:Jo(arguments[2]);if(Wo&&!Vo)return Fo(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return fn(Ho,n,t),new(fn(Lo,e,n))}var i=r.prototype,a=Zt(T(i)?i:Go),o=fn(e,a,t);return T(o)?o:a}});var Yo=TypeError,Ko=function(e){if(e>9007199254740991)throw Yo("Maximum allowed index exceeded");return e},Qo=le("isConcatSpreadable"),Xo=D>=51||!c((function(){var e=[];return e[Qo]=!1,e.concat()[0]!==e})),Zo=qn("concat"),es=function(e){if(!T(e))return!1;var t=e[Qo];return void 0!==t?!!t:gr(e)};function ts(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rs(e,t){return(rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ns(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rs(e,t)}function is(e,t){if(t&&("object"===Po(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ts(e)}function as(e){return(as=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function os(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ss(e,t,r){return(ss=os()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&rs(i,r.prototype),i}).apply(null,arguments)}function cs(e){var t="function"==typeof Map?new Map:void 0;return(cs=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ss(e,arguments,as(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),rs(n,e)})(e)}function ds(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=as(e);if(t){var i=as(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return is(this,r)}}Rt({target:"Array",proto:!0,arity:1,forced:!Xo||!Zo},{concat:function(e){var t,r,n,i,a,o=ne(this),s=Er(o,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(es(a=-1===t?o:arguments[t]))for(i=pt(a),Ko(c+i),r=0;r<i;r++,c++)r in a&&er(s,c,a[r]);else Ko(c+1),er(s,c++,a);return s.length=c,s}});var us,fs,hs=function(e){ns(r,e);var t=ds(r);function r(e){var n;return Zn(this,r),ri(ts(n=t.call(this,"".concat(e.status," ").concat(e.statusText))),"response",void 0),n.response=e,n}return ti(r)}(cs(Error)),ps=s.RegExp,ls=c((function(){var e=ps("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),gs=ls||c((function(){return!ps("a","y").sticky})),bs={BROKEN_CARET:ls||c((function(){var e=ps("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:gs,UNSUPPORTED_Y:ls},vs=s.RegExp,Is=c((function(){var e=vs(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),xs=s.RegExp,ks=c((function(){var e=xs("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),ms=tt.get,ws=te("native-string-replace",String.prototype.replace),ys=RegExp.prototype.exec,Cs=ys,zs=m("".charAt),Os=m("".indexOf),Es=m("".replace),qs=m("".slice),Ps=(fs=/b*/g,h(ys,us=/a/,"a"),h(ys,fs,"a"),0!==us.lastIndex||0!==fs.lastIndex),Ss=bs.BROKEN_CARET,js=void 0!==/()??/.exec("")[1];(Ps||js||Ss||Is||ks)&&(Cs=function(e){var t,r,n,i,a,o,s,c=this,d=ms(c),u=Ht(e),f=d.raw;if(f)return f.lastIndex=c.lastIndex,t=h(Cs,f,u),c.lastIndex=f.lastIndex,t;var p=d.groups,l=Ss&&c.sticky,g=h(Hn,c),b=c.source,v=0,I=u;if(l&&(g=Es(g,"y",""),-1===Os(g,"g")&&(g+="g"),I=qs(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==zs(u,c.lastIndex-1))&&(b="(?: "+b+")",I=" "+I,v++),r=new RegExp("^(?:"+b+")",g)),js&&(r=new RegExp("^"+b+"$(?!\\s)",g)),Ps&&(n=c.lastIndex),i=h(ys,l?r:c,I),l?i?(i.input=qs(i.input,v),i[0]=qs(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Ps&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),js&&i&&i.length>1&&h(ws,i[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&p)for(i.groups=o=Zt(null),a=0;a<p.length;a++)o[(s=p[a])[0]]=i[s[1]];return i});var Ts=Cs;Rt({target:"RegExp",proto:!0,forced:/./.exec!==Ts},{exec:Ts});var Ms=le("species"),Rs=RegExp.prototype,As=function(e,t,r,n){var i=le(e),a=!c((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),o=a&&!c((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Ms]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!a||!o||r){var s=m(/./[i]),d=t(i,""[e],(function(e,t,r,n,i){var o=m(e),c=t.exec;return c===Ts||c===Rs.exec?a&&!i?{done:!0,value:s(t,r,n)}:{done:!0,value:o(r,t,n)}:{done:!1}}));nt(String.prototype,e,d[0]),nt(Rs,i,d[1])}n&&Me(Rs[i],"sham",!0)},Us=pa.charAt,Bs=function(e,t,r){return t+(r?Us(e,t).length:1)},Ns=Math.floor,_s=m("".charAt),Ls=m("".replace),Ds=m("".slice),Js=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Fs=/\$([$&'`]|\d{1,2})/g,Gs=function(e,t,r,n,i,a){var o=r+e.length,s=n.length,c=Fs;return void 0!==i&&(i=ne(i),c=Js),Ls(a,c,(function(a,c){var d;switch(_s(c,0)){case"$":return"$";case"&":return e;case"`":return Ds(t,0,r);case"'":return Ds(t,o);case"<":d=i[Ds(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var f=Ns(u/10);return 0===f?a:f<=s?void 0===n[f-1]?_s(c,1):n[f-1]+_s(c,1):a}d=n[u-1]}return void 0===d?"":d}))},Hs=TypeError,Vs=function(e,t){var r=e.exec;if(j(r)){var n=h(r,e,t);return null!==n&&qe(n),n}if("RegExp"===C(e))return h(Ts,e,t);throw Hs("RegExp#exec called on incompatible receiver")},Ws=le("replace"),$s=Math.max,Ys=Math.min,Ks=m([].concat),Qs=m([].push),Xs=m("".indexOf),Zs=m("".slice),ec="$0"==="a".replace(/./,"$0"),tc=!!/./[Ws]&&""===/./[Ws]("a","$0");As("replace",(function(e,t,r){var n=tc?"$":"$0";return[function(e,r){var n=P(this),i=null==e?void 0:K(e,Ws);return i?h(i,e,n,r):h(t,Ht(n),e,r)},function(e,i){var a=qe(this),o=Ht(e);if("string"==typeof i&&-1===Xs(i,n)&&-1===Xs(i,"$<")){var s=r(t,a,o,i);if(s.done)return s.value}var c=j(i);c||(i=Ht(i));var d=a.global;if(d){var u=a.unicode;a.lastIndex=0}for(var f=[];;){var h=Vs(a,o);if(null===h)break;if(Qs(f,h),!d)break;""===Ht(h[0])&&(a.lastIndex=Bs(o,ht(a.lastIndex),u))}for(var p,l="",g=0,b=0;b<f.length;b++){for(var v=Ht((h=f[b])[0]),I=$s(Ys(st(h.index),o.length),0),x=[],k=1;k<h.length;k++)Qs(x,void 0===(p=h[k])?p:String(p));var m=h.groups;if(c){var w=Ks([v],x,I,o);void 0!==m&&Qs(w,m);var y=Ht(fn(i,void 0,w))}else y=Gs(v,o,I,x,m,i);I>=g&&(l+=Zs(o,g,I)+y,g=I+v.length)}return l+Zs(o,g)}]}),!!c((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ec||tc);var rc,nc=function(e,t,r){return r.get&&rt(r.get,t,{getter:!0}),r.set&&rt(r.set,t,{setter:!0}),Te.f(e,t,r)},ic=Object.assign,ac=Object.defineProperty,oc=m([].concat),sc=!ic||c((function(){if(d&&1!==ic({b:1},ic(ac({},"a",{enumerable:!0,get:function(){ac(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=ic({},e)[r]||"abcdefghijklmnopqrst"!=At(ic({},t)).join("")}))?function(e,t){for(var r=ne(e),n=arguments.length,i=1,a=wt.f,o=g.f;n>i;)for(var s,c=E(arguments[i++]),u=a?oc(At(c),a(c)):At(c),f=u.length,p=0;f>p;)s=u[p++],d&&!h(o,c,s)||(r[s]=c[s]);return r}:ic,cc=function(e,t,r){var n,i;qe(e);try{if(!(n=K(e,"return"))){if("throw"===t)throw r;return r}n=h(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return qe(n),r},dc=function(e,t,r,n){try{return n?t(qe(r)[0],r[1]):t(r)}catch(t){cc(e,"throw",t)}},uc=le("iterator"),fc=Array.prototype,hc=function(e){return void 0!==e&&(Ui.Array===e||fc[uc]===e)},pc=Array,lc=function(e){var t=ne(e),r=Cr(this),n=arguments.length,i=n>1?arguments[1]:void 0,a=void 0!==i;a&&(i=lr(i,n>2?arguments[2]:void 0));var o,s,c,d,u,f,p=qa(t),l=0;if(!p||this===pc&&hc(p))for(o=pt(t),s=r?new this(o):pc(o);o>l;l++)f=a?i(t[l],l):t[l],er(s,l,f);else for(u=(d=Sa(t,p)).next,s=r?new this:[];!(c=h(u,d)).done;l++)f=a?dc(d,i,[c.value,l],!0):c.value,er(s,l,f);return s.length=l,s},gc=/[^\0-\u007E]/,bc=/[.\u3002\uFF0E\uFF61]/g,vc="Overflow: input needs wider integers to process",Ic=RangeError,xc=m(bc.exec),kc=Math.floor,mc=String.fromCharCode,wc=m("".charCodeAt),yc=m([].join),Cc=m([].push),zc=m("".replace),Oc=m("".split),Ec=m("".toLowerCase),qc=function(e){return e+22+75*(e<26)},Pc=function(e,t,r){var n=0;for(e=r?kc(e/700):e>>1,e+=kc(e/t);e>455;)e=kc(e/35),n+=36;return kc(n+36*e/(e+38))},Sc=function(e){var t,r,n=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=wc(e,r++);if(i>=55296&&i<=56319&&r<n){var a=wc(e,r++);56320==(64512&a)?Cc(t,((1023&i)<<10)+(1023&a)+65536):(Cc(t,i),r--)}else Cc(t,i)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(r=e[t])<128&&Cc(n,mc(r));var c=n.length,d=c;for(c&&Cc(n,"-");d<i;){var u=2147483647;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<u&&(u=r);var f=d+1;if(u-a>kc((2147483647-o)/f))throw Ic(vc);for(o+=(u-a)*f,a=u,t=0;t<e.length;t++){if((r=e[t])<a&&++o>2147483647)throw Ic(vc);if(r==a){for(var h=o,p=36;;){var l=p<=s?1:p>=s+26?26:p-s;if(h<l)break;var g=h-l,b=36-l;Cc(n,mc(qc(l+g%b))),h=kc(g/b),p+=36}Cc(n,mc(qc(h))),s=Pc(o,f,d==c),o=0,d++}}o++,a++}return yc(n,"")},jc=pa.codeAt,Tc=tt.set,Mc=tt.getterFor("URL"),Rc=zo.URLSearchParams,Ac=zo.getState,Uc=s.URL,Bc=s.TypeError,Nc=s.parseInt,_c=Math.floor,Lc=Math.pow,Dc=m("".charAt),Jc=m(/./.exec),Fc=m([].join),Gc=m(1..toString),Hc=m([].pop),Vc=m([].push),Wc=m("".replace),$c=m([].shift),Yc=m("".split),Kc=m("".slice),Qc=m("".toLowerCase),Xc=m([].unshift),Zc=/[a-z]/i,ed=/[\d+-.a-z]/i,td=/\d/,rd=/^0x/i,nd=/^[0-7]+$/,id=/^\d+$/,ad=/^[\da-f]+$/i,od=/[\0\t\n\r #%/:<>?@[\\\]^|]/,sd=/[\0\t\n\r #/:<>?@[\\\]^|]/,cd=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,dd=/[\t\n\r]/g,ud=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)Xc(t,e%256),e=_c(e/256);return Fc(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=Gc(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},fd={},hd=sc({},fd,{" ":1,'"':1,"<":1,">":1,"`":1}),pd=sc({},hd,{"#":1,"?":1,"{":1,"}":1}),ld=sc({},pd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),gd=function(e,t){var r=jc(e,0);return r>32&&r<127&&!ae(t,e)?e:encodeURIComponent(e)},bd={ftp:21,file:null,http:80,https:443,ws:80,wss:443},vd=function(e,t){var r;return 2==e.length&&Jc(Zc,Dc(e,0))&&(":"==(r=Dc(e,1))||!t&&"|"==r)},Id=function(e){var t;return e.length>1&&vd(Kc(e,0,2))&&(2==e.length||"/"===(t=Dc(e,2))||"\\"===t||"?"===t||"#"===t)},xd=function(e){return"."===e||"%2e"===Qc(e)},kd={},md={},wd={},yd={},Cd={},zd={},Od={},Ed={},qd={},Pd={},Sd={},jd={},Td={},Md={},Rd={},Ad={},Ud={},Bd={},Nd={},_d={},Ld={},Dd=function(e,t,r){var n,i,a,o=Ht(e);if(t){if(i=this.parse(o))throw Bc(i);this.searchParams=null}else{if(void 0!==r&&(n=new Dd(r,!0)),i=this.parse(o,null,n))throw Bc(i);(a=Ac(new Rc)).bindURL(this),this.searchParams=a}};Dd.prototype={type:"URL",parse:function(e,t,r){var n,i,a,o,s,c=this,d=t||kd,u=0,f="",h=!1,p=!1,l=!1;for(e=Ht(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=Wc(e,cd,"")),e=Wc(e,dd,""),n=lc(e);u<=n.length;){switch(i=n[u],d){case kd:if(!i||!Jc(Zc,i)){if(t)return"Invalid scheme";d=wd;continue}f+=Qc(i),d=md;break;case md:if(i&&(Jc(ed,i)||"+"==i||"-"==i||"."==i))f+=Qc(i);else{if(":"!=i){if(t)return"Invalid scheme";f="",d=wd,u=0;continue}if(t&&(c.isSpecial()!=ae(bd,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&bd[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?d=Md:c.isSpecial()&&r&&r.scheme==c.scheme?d=yd:c.isSpecial()?d=Ed:"/"==n[u+1]?(d=Cd,u++):(c.cannotBeABaseURL=!0,Vc(c.path,""),d=Nd)}break;case wd:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=nr(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,d=Ld;break}d="file"==r.scheme?Md:zd;continue;case yd:if("/"!=i||"/"!=n[u+1]){d=zd;continue}d=qd,u++;break;case Cd:if("/"==i){d=Pd;break}d=Bd;continue;case zd:if(c.scheme=r.scheme,i==rc)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=nr(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())d=Od;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=nr(r.path),c.query="",d=_d;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=nr(r.path),c.path.length--,d=Bd;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=nr(r.path),c.query=r.query,c.fragment="",d=Ld}break;case Od:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,d=Bd;continue}d=Pd}else d=qd;break;case Ed:if(d=qd,"/"!=i||"/"!=Dc(f,u+1))continue;u++;break;case qd:if("/"!=i&&"\\"!=i){d=Pd;continue}break;case Pd:if("@"==i){h&&(f="%40"+f),h=!0,a=lc(f);for(var g=0;g<a.length;g++){var b=a[g];if(":"!=b||l){var v=gd(b,ld);l?c.password+=v:c.username+=v}else l=!0}f=""}else if(i==rc||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(h&&""==f)return"Invalid authority";u-=lc(f).length+1,f="",d=Sd}else f+=i;break;case Sd:case jd:if(t&&"file"==c.scheme){d=Ad;continue}if(":"!=i||p){if(i==rc||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==f)return"Invalid host";if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(f))return o;if(f="",d=Ud,t)return;continue}"["==i?p=!0:"]"==i&&(p=!1),f+=i}else{if(""==f)return"Invalid host";if(o=c.parseHost(f))return o;if(f="",d=Td,t==jd)return}break;case Td:if(!Jc(td,i)){if(i==rc||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=f){var I=Nc(f,10);if(I>65535)return"Invalid port";c.port=c.isSpecial()&&I===bd[c.scheme]?null:I,f=""}if(t)return;d=Ud;continue}return"Invalid port"}f+=i;break;case Md:if(c.scheme="file","/"==i||"\\"==i)d=Rd;else{if(!r||"file"!=r.scheme){d=Bd;continue}if(i==rc)c.host=r.host,c.path=nr(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=nr(r.path),c.query="",d=_d;else{if("#"!=i){Id(Fc(nr(n,u),""))||(c.host=r.host,c.path=nr(r.path),c.shortenPath()),d=Bd;continue}c.host=r.host,c.path=nr(r.path),c.query=r.query,c.fragment="",d=Ld}}break;case Rd:if("/"==i||"\\"==i){d=Ad;break}r&&"file"==r.scheme&&!Id(Fc(nr(n,u),""))&&(vd(r.path[0],!0)?Vc(c.path,r.path[0]):c.host=r.host),d=Bd;continue;case Ad:if(i==rc||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&vd(f))d=Bd;else if(""==f){if(c.host="",t)return;d=Ud}else{if(o=c.parseHost(f))return o;if("localhost"==c.host&&(c.host=""),t)return;f="",d=Ud}continue}f+=i;break;case Ud:if(c.isSpecial()){if(d=Bd,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=rc&&(d=Bd,"/"!=i))continue}else c.fragment="",d=Ld;else c.query="",d=_d;break;case Bd:if(i==rc||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(s=Qc(s=f))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||Vc(c.path,"")):xd(f)?"/"==i||"\\"==i&&c.isSpecial()||Vc(c.path,""):("file"==c.scheme&&!c.path.length&&vd(f)&&(c.host&&(c.host=""),f=Dc(f,0)+":"),Vc(c.path,f)),f="","file"==c.scheme&&(i==rc||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)$c(c.path);"?"==i?(c.query="",d=_d):"#"==i&&(c.fragment="",d=Ld)}else f+=gd(i,pd);break;case Nd:"?"==i?(c.query="",d=_d):"#"==i?(c.fragment="",d=Ld):i!=rc&&(c.path[0]+=gd(i,fd));break;case _d:t||"#"!=i?i!=rc&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":gd(i,fd)):(c.fragment="",d=Ld);break;case Ld:i!=rc&&(c.fragment+=gd(i,hd))}u++}},parseHost:function(e){var t,r,n;if("["==Dc(e,0)){if("]"!=Dc(e,e.length-1))return"Invalid host";if(!(t=function(e){var t,r,n,i,a,o,s,c=[0,0,0,0,0,0,0,0],d=0,u=null,f=0,h=function(){return Dc(e,f)};if(":"==h()){if(":"!=Dc(e,1))return;f+=2,u=++d}for(;h();){if(8==d)return;if(":"!=h()){for(t=r=0;r<4&&Jc(ad,h());)t=16*t+Nc(h(),16),f++,r++;if("."==h()){if(0==r)return;if(f-=r,d>6)return;for(n=0;h();){if(i=null,n>0){if(!("."==h()&&n<4))return;f++}if(!Jc(td,h()))return;for(;Jc(td,h());){if(a=Nc(h(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}c[d]=256*c[d]+i,2!=++n&&4!=n||d++}if(4!=n)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[d++]=t}else{if(null!==u)return;f++,u=++d}}if(null!==u)for(o=d-u,d=7;0!=d&&o>0;)s=c[d],c[d--]=c[u+o-1],c[u+--o]=s;else if(8!=d)return;return c}(Kc(e,1,-1))))return"Invalid host";this.host=t}else if(this.isSpecial()){if(e=function(e){var t,r,n=[],i=Oc(zc(Ec(e),bc,"."),".");for(t=0;t<i.length;t++)r=i[t],Cc(n,xc(gc,r)?"xn--"+Sc(r):r);return yc(n,".")}(e),Jc(od,e))return"Invalid host";if(null===(t=function(e){var t,r,n,i,a,o,s,c=Yc(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(a=10,i.length>1&&"0"==Dc(i,0)&&(a=Jc(rd,i)?16:8,i=Kc(i,8==a?1:2)),""===i)o=0;else{if(!Jc(10==a?id:8==a?nd:ad,i))return e;o=Nc(i,a)}Vc(r,o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=Lc(256,5-t))return null}else if(o>255)return null;for(s=Hc(r),n=0;n<r.length;n++)s+=r[n]*Lc(256,3-n);return s}(e)))return"Invalid host";this.host=t}else{if(Jc(sd,e))return"Invalid host";for(t="",r=lc(e),n=0;n<r.length;n++)t+=gd(r[n],fd);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return ae(bd,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&vd(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,d=t+":";return null!==i?(d+="//",e.includesCredentials()&&(d+=r+(n?":"+n:"")+"@"),d+=ud(i),null!==a&&(d+=":"+a)):"file"==t&&(d+="//"),d+=e.cannotBeABaseURL?o[0]:o.length?"/"+Fc(o,"/"):"",null!==s&&(d+="?"+s),null!==c&&(d+="#"+c),d},setHref:function(e){var t=this.parse(e);if(t)throw Bc(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Jd(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+ud(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ht(e)+":",kd)},getUsername:function(){return this.username},setUsername:function(e){var t=lc(Ht(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=gd(t[r],ld)}},getPassword:function(){return this.password},setPassword:function(e){var t=lc(Ht(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=gd(t[r],ld)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ud(e):ud(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Sd)},getHostname:function(){var e=this.host;return null===e?"":ud(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,jd)},getPort:function(){var e=this.port;return null===e?"":Ht(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=Ht(e))?this.port=null:this.parse(e,Td))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Fc(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ud))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=Ht(e))?this.query=null:("?"==Dc(e,0)&&(e=Kc(e,1)),this.query="",this.parse(e,_d)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=Ht(e))?("#"==Dc(e,0)&&(e=Kc(e,1)),this.fragment="",this.parse(e,Ld)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Jd=function(e){var t=Oa(this,Fd),r=Ta(arguments.length,1)>1?arguments[1]:void 0,n=Tc(t,new Dd(e,!1,r));d||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Fd=Jd.prototype,Gd=function(e,t){return{get:function(){return Mc(this)[e]()},set:t&&function(e){return Mc(this)[t](e)},configurable:!0,enumerable:!0}};if(d&&(nc(Fd,"href",Gd("serialize","setHref")),nc(Fd,"origin",Gd("getOrigin")),nc(Fd,"protocol",Gd("getProtocol","setProtocol")),nc(Fd,"username",Gd("getUsername","setUsername")),nc(Fd,"password",Gd("getPassword","setPassword")),nc(Fd,"host",Gd("getHost","setHost")),nc(Fd,"hostname",Gd("getHostname","setHostname")),nc(Fd,"port",Gd("getPort","setPort")),nc(Fd,"pathname",Gd("getPathname","setPathname")),nc(Fd,"search",Gd("getSearch","setSearch")),nc(Fd,"searchParams",Gd("getSearchParams")),nc(Fd,"hash",Gd("getHash","setHash"))),nt(Fd,"toJSON",(function(){return Mc(this).serialize()}),{enumerable:!0}),nt(Fd,"toString",(function(){return Mc(this).serialize()}),{enumerable:!0}),Uc){var Hd=Uc.createObjectURL,Vd=Uc.revokeObjectURL;Hd&&nt(Jd,"createObjectURL",lr(Hd,Uc)),Vd&&nt(Jd,"revokeObjectURL",lr(Vd,Uc))}function Wd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=as(e);if(t){var i=as(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return is(this,r)}}hr(Jd,"URL"),Rt({global:!0,constructor:!0,forced:!ya,sham:!d},{URL:Jd});var $d=function(e){ns(r,e);var t=Wd(r);function r(e,n,i){var a;return Zn(this,r),(a=t.call(this,r.renderTemplateUri("".concat(n,"/").concat(e).replace(/\/\/+/g,"/"),null==i?void 0:i.pathParams))).addQueryParams(null==i?void 0:i.queryParams),null!=i&&i.origin&&a.replaceOrigin(null==i?void 0:i.origin),a}return ti(r,[{key:"replaceOrigin",value:function(e){var t=new URL(e);this.protocol=t.protocol,this.host=t.host,this.pathname="".concat(t.pathname,"/").concat(this.pathname).replace(/\/\/+/g,"/")}},{key:"addQueryParams",value:function(e){var t=this;e&&Object.keys(e).forEach((function(r){var n=e[r];if(Array.isArray(n))for(var i=0;i<n.length;i+=1)t.searchParams.append(r,String(n[i]));else t.searchParams.append(r,String(n))}))}}],[{key:"renderTemplateUri",value:function(e,t){return t?e.replace(/\{([^\}]+)\}/g,(function(e,r){return String(t[r])})):e}}]),r}(cs(URL)),Yd="commerce-sdk-isomorphic@1.10.0";function Kd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xd=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=Qd({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I,x,k,m,w,y,C,z,O,E,q,P,S,j,T,M,R,A,U;return ti(e,[{key:"createBasket",value:(U=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0!==n.taxMode?o.taxMode=n.taxMode:void 0!==i.taxMode&&(o.taxMode=i.taxMode),void 0===n.siteId){e.next=18;break}o.siteId=n.siteId,e.next=23;break;case 18:if(void 0===i.siteId){e.next=22;break}o.siteId=i.siteId,e.next=23;break;case 22:throw new Error("Missing required query parameter: siteId");case 23:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=30,Ro(s.toString(),d);case 30:if(u=e.sent,!r){e.next=35;break}return e.abrupt("return",u);case 35:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=39;break}throw new hs(u);case 39:return e.next=41,u.text();case 41:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 43:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"transferBasket",value:(A=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0!==n.overrideExisting?o.overrideExisting=n.overrideExisting:void 0!==i.overrideExisting&&(o.overrideExisting=i.overrideExisting),void 0===n.siteId){e.next=18;break}o.siteId=n.siteId,e.next=23;break;case 18:if(void 0===i.siteId){e.next=22;break}o.siteId=i.siteId,e.next=23;break;case 22:throw new Error("Missing required query parameter: siteId");case 23:return s=new $d("/organizations/{organizationId}/baskets/actions/transfer",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"POST"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=38;break}throw new hs(u);case 38:return e.next=40,u.text();case 40:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"mergeBasket",value:(R=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0!==n.createDestinationBasket?o.createDestinationBasket=n.createDestinationBasket:void 0!==i.createDestinationBasket&&(o.createDestinationBasket=i.createDestinationBasket),void 0!==n.productItemMergeMode?o.productItemMergeMode=n.productItemMergeMode:void 0!==i.productItemMergeMode&&(o.productItemMergeMode=i.productItemMergeMode),void 0===n.siteId){e.next=19;break}o.siteId=n.siteId,e.next=24;break;case 19:if(void 0===i.siteId){e.next=23;break}o.siteId=i.siteId,e.next=24;break;case 23:throw new Error("Missing required query parameter: siteId");case 24:return s=new $d("/organizations/{organizationId}/baskets/actions/merge",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"POST"}),e.next=30,Ro(s.toString(),d);case 30:if(u=e.sent,!r){e.next=35;break}return e.abrupt("return",u);case 35:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=39;break}throw new hs(u);case 39:return e.next=41,u.text();case 41:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 43:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"deleteBasket",value:(M=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=44;break}throw new hs(u);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return M.apply(this,arguments)})},{key:"getBasket",value:(T=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"updateBasket",value:(j=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"updateAsAgentBasket",value:(S=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/agent",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"PUT"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"updateBillingAddressForBasket",value:(P=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0!==n.useAsShipping?o.useAsShipping=n.useAsShipping:void 0!==i.useAsShipping&&(o.useAsShipping=i.useAsShipping),void 0!==n.removeExternalTax?o.removeExternalTax=n.removeExternalTax:void 0!==i.removeExternalTax&&(o.removeExternalTax=i.removeExternalTax),void 0===n.siteId){e.next=28;break}o.siteId=n.siteId,e.next=33;break;case 28:if(void 0===i.siteId){e.next=32;break}o.siteId=i.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/billing-address",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=40,Ro(s.toString(),d);case 40:if(u=e.sent,!r){e.next=45;break}return e.abrupt("return",u);case 45:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=49;break}throw new hs(u);case 49:return e.next=51,u.text();case 51:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"addCouponToBasket",value:(q=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/coupons",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"removeCouponFromBasket",value:(E=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.couponItemId){e.next=25;break}a.couponItemId=n.couponItemId,e.next=30;break;case 25:if(void 0===i.couponItemId){e.next=29;break}a.couponItemId=i.couponItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: couponItemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/coupons/{couponItemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"updateCustomerForBasket",value:(O=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/customer",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"addGiftCertificateItemToBasket",value:(z=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"removeGiftCertificateItemFromBasket",value:(C=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.giftCertificateItemId){e.next=25;break}a.giftCertificateItemId=n.giftCertificateItemId,e.next=30;break;case 25:if(void 0===i.giftCertificateItemId){e.next=29;break}a.giftCertificateItemId=i.giftCertificateItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: giftCertificateItemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items/{giftCertificateItemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"updateGiftCertificateItemInBasket",value:(y=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.giftCertificateItemId){e.next=25;break}a.giftCertificateItemId=n.giftCertificateItemId,e.next=30;break;case 25:if(void 0===i.giftCertificateItemId){e.next=29;break}a.giftCertificateItemId=i.giftCertificateItemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: giftCertificateItemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/gift-certificate-items/{giftCertificateItemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"addItemToBasket",value:(w=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/items",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"removeItemFromBasket",value:(m=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.itemId){e.next=25;break}a.itemId=n.itemId,e.next=30;break;case 25:if(void 0===i.itemId){e.next=29;break}a.itemId=i.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"updateItemInBasket",value:(k=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.itemId){e.next=25;break}a.itemId=n.itemId,e.next=30;break;case 25:if(void 0===i.itemId){e.next=29;break}a.itemId=i.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(o={},void 0!==n.removeExternalTax?o.removeExternalTax=n.removeExternalTax:void 0!==i.removeExternalTax&&(o.removeExternalTax=i.removeExternalTax),void 0===n.siteId){e.next=36;break}o.siteId=n.siteId,e.next=41;break;case 36:if(void 0===i.siteId){e.next=40;break}o.siteId=i.siteId,e.next=41;break;case 40:throw new Error("Missing required query parameter: siteId");case 41:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=48,Ro(s.toString(),d);case 48:if(u=e.sent,!r){e.next=53;break}return e.abrupt("return",u);case 53:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=57;break}throw new hs(u);case 57:return e.next=59,u.text();case 59:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"addTaxesForBasketItem",value:(x=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.itemId){e.next=25;break}a.itemId=n.itemId,e.next=30;break;case 25:if(void 0===i.itemId){e.next=29;break}a.itemId=i.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/items/{itemId}/taxes",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=53;break}throw new hs(u);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"addPaymentInstrumentToBasket",value:(I=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/payment-instruments",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"removePaymentInstrumentFromBasket",value:(v=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"updatePaymentInstrumentInBasket",value:(b=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0!==n.removeExternalTax?o.removeExternalTax=n.removeExternalTax:void 0!==i.removeExternalTax&&(o.removeExternalTax=i.removeExternalTax),void 0===n.siteId){e.next=36;break}o.siteId=n.siteId,e.next=41;break;case 36:if(void 0===i.siteId){e.next=40;break}o.siteId=i.siteId,e.next=41;break;case 40:throw new Error("Missing required query parameter: siteId");case 41:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=48,Ro(s.toString(),d);case 48:if(u=e.sent,!r){e.next=53;break}return e.abrupt("return",u);case 53:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=57;break}throw new hs(u);case 57:return e.next=59,u.text();case 59:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"getPaymentMethodsForBasket",value:(g=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/payment-methods",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"addPriceAdjustmentToBasket",value:(l=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/price-adjustments",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"removePriceAdjustmentFromBasket",value:(p=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.priceAdjustmentId){e.next=25;break}a.priceAdjustmentId=n.priceAdjustmentId,e.next=30;break;case 25:if(void 0===i.priceAdjustmentId){e.next=29;break}a.priceAdjustmentId=i.priceAdjustmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: priceAdjustmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/price-adjustments/{priceAdjustmentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"updatePriceAdjustmentInBasket",value:(h=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.priceAdjustmentId){e.next=25;break}a.priceAdjustmentId=n.priceAdjustmentId,e.next=30;break;case 25:if(void 0===i.priceAdjustmentId){e.next=29;break}a.priceAdjustmentId=i.priceAdjustmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: priceAdjustmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/price-adjustments/{priceAdjustmentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getPriceBooksForBasket",value:(f=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/price-books",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"addPriceBooksToBasket",value:(u=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/price-books",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=44;break}throw new hs(u);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"createShipmentForBasket",value:(d=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"removeShipmentFromBasket",value:(c=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.shipmentId){e.next=25;break}a.shipmentId=n.shipmentId,e.next=30;break;case 25:if(void 0===i.shipmentId){e.next=29;break}a.shipmentId=i.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"updateShipmentForBasket",value:(s=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.shipmentId){e.next=25;break}a.shipmentId=n.shipmentId,e.next=30;break;case 25:if(void 0===i.shipmentId){e.next=29;break}a.shipmentId=i.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"updateShippingAddressForShipment",value:(o=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.shipmentId){e.next=25;break}a.shipmentId=n.shipmentId,e.next=30;break;case 25:if(void 0===i.shipmentId){e.next=29;break}a.shipmentId=i.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(o={},void 0!==n.useAsBilling?o.useAsBilling=n.useAsBilling:void 0!==i.useAsBilling&&(o.useAsBilling=i.useAsBilling),void 0!==n.removeExternalTax?o.removeExternalTax=n.removeExternalTax:void 0!==i.removeExternalTax&&(o.removeExternalTax=i.removeExternalTax),void 0===n.siteId){e.next=37;break}o.siteId=n.siteId,e.next=42;break;case 37:if(void 0===i.siteId){e.next=41;break}o.siteId=i.siteId,e.next=42;break;case 41:throw new Error("Missing required query parameter: siteId");case 42:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-address",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=49,Ro(s.toString(),d);case 49:if(u=e.sent,!r){e.next=54;break}return e.abrupt("return",u);case 54:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=58;break}throw new hs(u);case 58:return e.next=60,u.text();case 60:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 62:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateShippingMethodForShipment",value:(a=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.shipmentId){e.next=25;break}a.shipmentId=n.shipmentId,e.next=30;break;case 25:if(void 0===i.shipmentId){e.next=29;break}a.shipmentId=i.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-method",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"getShippingMethodsForShipment",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(void 0===n.shipmentId){e.next=25;break}a.shipmentId=n.shipmentId,e.next=30;break;case 25:if(void 0===i.shipmentId){e.next=29;break}a.shipmentId=i.shipmentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: shipmentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/shipments/{shipmentId}/shipping-methods",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"updateAsStorefrontBasket",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0!==n.exchange?o.exchange=n.exchange:void 0!==i.exchange&&(o.exchange=i.exchange),void 0===n.siteId){e.next=27;break}o.siteId=n.siteId,e.next=32;break;case 27:if(void 0===i.siteId){e.next=31;break}o.siteId=i.siteId,e.next=32;break;case 31:throw new Error("Missing required query parameter: siteId");case 32:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/baskets/{basketId}/storefront",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"PUT"}),e.next=39,Ro(s.toString(),d);case 39:if(u=e.sent,!r){e.next=44;break}return e.abrupt("return",u);case 44:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=48;break}throw new hs(u);case 48:return e.next=50,u.text();case 50:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getTaxesFromBasket",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/taxes",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"addTaxesForBasket",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.basketId){e.next=16;break}a.basketId=n.basketId,e.next=21;break;case 16:if(void 0===i.basketId){e.next=20;break}a.basketId=i.basketId,e.next=21;break;case 20:throw new Error("Missing required path parameter: basketId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/baskets/{basketId}/taxes",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Qd(Qd({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Qd(Qd({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=44;break}throw new hs(u);case 44:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function Zd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zd(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(Xd,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-baskets/{version}");var tu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=eu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i;return ti(e,[{key:"getShopperContext",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.usid){e.next=16;break}a.usid=n.usid,e.next=21;break;case 16:if(void 0===i.usid){e.next=20;break}a.usid=i.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return o={},void 0!==n.siteId?o.siteId=n.siteId:void 0!==i.siteId&&(o.siteId=i.siteId),s=new $d("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=eu(eu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=eu(eu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=38;break}throw new hs(u);case 38:return e.next=40,u.text();case 40:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"createShopperContext",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.usid){e.next=16;break}a.usid=n.usid,e.next=21;break;case 16:if(void 0===i.usid){e.next=20;break}a.usid=i.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return o={},void 0!==n.siteId?o.siteId=n.siteId:void 0!==i.siteId&&(o.siteId=i.siteId),s=new $d("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=eu(eu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=eu(eu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=38;break}throw new hs(u);case 38:return e.next=40,u.text();case 40:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"deleteShopperContext",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.usid){e.next=16;break}a.usid=n.usid,e.next=21;break;case 16:if(void 0===i.usid){e.next=20;break}a.usid=i.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return o={},void 0!==n.siteId?o.siteId=n.siteId:void 0!==i.siteId&&(o.siteId=i.siteId),s=new $d("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=eu(eu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=eu(eu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=36;break}throw new hs(u);case 36:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateShopperContext",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.usid){e.next=16;break}a.usid=n.usid,e.next=21;break;case 16:if(void 0===i.usid){e.next=20;break}a.usid=i.usid,e.next=21;break;case 20:throw new Error("Missing required path parameter: usid");case 21:return o={},void 0!==n.siteId?o.siteId=n.siteId:void 0!==i.siteId&&(o.siteId=i.siteId),s=new $d("/organizations/{organizationId}/shopper-context/{usid}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=eu(eu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=eu(eu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=38;break}throw new hs(u);case 38:return e.next=40,u.text();case 40:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function ru(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ru(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ru(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(tu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-context/{version}");var iu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=nu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I,x,k,m,w,y,C,z,O,E,q,P,S,j,T;return ti(e,[{key:"registerCustomer",value:(T=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"invalidateCustomerAuth",value:(j=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers/actions/logout",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=35;break}throw new hs(u);case 35:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"authorizeCustomer",value:(S=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.clientId){e.next=17;break}o.clientId=n.clientId,e.next=22;break;case 17:if(void 0===i.clientId){e.next=21;break}o.clientId=i.clientId,e.next=22;break;case 21:throw new Error("Missing required query parameter: clientId");case 22:if(void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/actions/login",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"authorizeTrustedSystem",value:(P=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers/trusted-system/actions/login",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"resetPassword",value:(q=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers/password/actions/reset",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=35;break}throw new hs(u);case 35:case"end":return e.stop()}}),e,this)}))),function(e,t){return q.apply(this,arguments)})},{key:"getResetPasswordToken",value:(E=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers/password/actions/create-reset-token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"registerExternalProfile",value:(O=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/customers/external-profile",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"getExternalProfile",value:(z=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.externalId){e.next=17;break}o.externalId=n.externalId,e.next=22;break;case 17:if(void 0===i.externalId){e.next=21;break}o.externalId=i.externalId,e.next=22;break;case 21:throw new Error("Missing required query parameter: externalId");case 22:if(void 0===n.authenticationProviderId){e.next=26;break}o.authenticationProviderId=n.authenticationProviderId,e.next=31;break;case 26:if(void 0===i.authenticationProviderId){e.next=30;break}o.authenticationProviderId=i.authenticationProviderId,e.next=31;break;case 30:throw new Error("Missing required query parameter: authenticationProviderId");case 31:if(void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/external-profile",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return z.apply(this,arguments)})},{key:"getCustomer",value:(C=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return C.apply(this,arguments)})},{key:"updateCustomer",value:(y=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"createCustomerAddress",value:(w=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/addresses",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"getCustomerAddress",value:(m=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.addressName){e.next=25;break}a.addressName=n.addressName,e.next=30;break;case 25:if(void 0===i.addressName){e.next=29;break}a.addressName=i.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"removeCustomerAddress",value:(k=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.addressName){e.next=25;break}a.addressName=n.addressName,e.next=30;break;case 25:if(void 0===i.addressName){e.next=29;break}a.addressName=i.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=53;break}throw new hs(u);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"updateCustomerAddress",value:(x=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.addressName){e.next=25;break}a.addressName=n.addressName,e.next=30;break;case 25:if(void 0===i.addressName){e.next=29;break}a.addressName=i.addressName,e.next=30;break;case 29:throw new Error("Missing required path parameter: addressName");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/addresses/{addressName}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"getCustomerBaskets",value:(I=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/baskets",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"getCustomerOrders",value:(v=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0!==n.crossSites?o.crossSites=n.crossSites:void 0!==i.crossSites&&(o.crossSites=i.crossSites),void 0!==n.from?o.from=n.from:void 0!==i.from&&(o.from=i.from),void 0!==n.until?o.until=n.until:void 0!==i.until&&(o.until=i.until),void 0!==n.status?o.status=n.status:void 0!==i.status&&(o.status=i.status),void 0===n.siteId){e.next=30;break}o.siteId=n.siteId,e.next=35;break;case 30:if(void 0===i.siteId){e.next=34;break}o.siteId=i.siteId,e.next=35;break;case 34:throw new Error("Missing required query parameter: siteId");case 35:return void 0!==n.offset?o.offset=n.offset:void 0!==i.offset&&(o.offset=i.offset),void 0!==n.limit?o.limit=n.limit:void 0!==i.limit&&(o.limit=i.limit),s=new $d("/organizations/{organizationId}/customers/{customerId}/orders",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=43,Ro(s.toString(),d);case 43:if(u=e.sent,!r){e.next=48;break}return e.abrupt("return",u);case 48:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=52;break}throw new hs(u);case 52:return e.next=54,u.text();case 54:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"updateCustomerPassword",value:(b=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/password",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PUT"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=44;break}throw new hs(u);case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"createCustomerPaymentInstrument",value:(g=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/payment-instruments",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"deleteCustomerPaymentInstrument",value:(l=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=53;break}throw new hs(u);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getCustomerPaymentInstrument",value:(p=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getCustomerProductLists",value:(h=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"createCustomerProductList",value:(f=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"deleteCustomerProductList",value:(u=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=53;break}throw new hs(u);case 53:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getCustomerProductList",value:(d=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"updateCustomerProductList",value:(c=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"createCustomerProductListItem",value:(s=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"deleteCustomerProductListItem",value:(o=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===n.itemId){e.next=34;break}a.itemId=n.itemId,e.next=39;break;case 34:if(void 0===i.itemId){e.next=38;break}a.itemId=i.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(o={},void 0===n.siteId){e.next=44;break}o.siteId=n.siteId,e.next=49;break;case 44:if(void 0===i.siteId){e.next=48;break}o.siteId=i.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=55,Ro(s.toString(),d);case 55:if(u=e.sent,!r){e.next=60;break}return e.abrupt("return",u);case 60:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=62;break}throw new hs(u);case 62:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"getCustomerProductListItem",value:(a=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===n.itemId){e.next=34;break}a.itemId=n.itemId,e.next=39;break;case 34:if(void 0===i.itemId){e.next=38;break}a.itemId=i.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(o={},void 0===n.siteId){e.next=44;break}o.siteId=n.siteId,e.next=49;break;case 44:if(void 0===i.siteId){e.next=48;break}o.siteId=i.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=55,Ro(s.toString(),d);case 55:if(u=e.sent,!r){e.next=60;break}return e.abrupt("return",u);case 60:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=64;break}throw new hs(u);case 64:return e.next=66,u.text();case 66:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 68:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"updateCustomerProductListItem",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.customerId){e.next=16;break}a.customerId=n.customerId,e.next=21;break;case 16:if(void 0===i.customerId){e.next=20;break}a.customerId=i.customerId,e.next=21;break;case 20:throw new Error("Missing required path parameter: customerId");case 21:if(void 0===n.listId){e.next=25;break}a.listId=n.listId,e.next=30;break;case 25:if(void 0===i.listId){e.next=29;break}a.listId=i.listId,e.next=30;break;case 29:throw new Error("Missing required path parameter: listId");case 30:if(void 0===n.itemId){e.next=34;break}a.itemId=n.itemId,e.next=39;break;case 34:if(void 0===i.itemId){e.next=38;break}a.itemId=i.itemId,e.next=39;break;case 38:throw new Error("Missing required path parameter: itemId");case 39:if(o={},void 0===n.siteId){e.next=44;break}o.siteId=n.siteId,e.next=49;break;case 44:if(void 0===i.siteId){e.next=48;break}o.siteId=i.siteId,e.next=49;break;case 48:throw new Error("Missing required query parameter: siteId");case 49:return s=new $d("/organizations/{organizationId}/customers/{customerId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=55,Ro(s.toString(),d);case 55:if(u=e.sent,!r){e.next=60;break}return e.abrupt("return",u);case 60:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=64;break}throw new hs(u);case 64:return e.next=66,u.text();case 66:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 68:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getPublicProductListsBySearchTerm",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0!==n.email?o.email=n.email:void 0!==i.email&&(o.email=i.email),void 0!==n.firstName?o.firstName=n.firstName:void 0!==i.firstName&&(o.firstName=i.firstName),void 0!==n.lastName?o.lastName=n.lastName:void 0!==i.lastName&&(o.lastName=i.lastName),void 0===n.siteId){e.next=20;break}o.siteId=n.siteId,e.next=25;break;case 20:if(void 0===i.siteId){e.next=24;break}o.siteId=i.siteId,e.next=25;break;case 24:throw new Error("Missing required query parameter: siteId");case 25:return s=new $d("/organizations/{organizationId}/product-lists",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=31,Ro(s.toString(),d);case 31:if(u=e.sent,!r){e.next=36;break}return e.abrupt("return",u);case 36:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=40;break}throw new hs(u);case 40:return e.next=42,u.text();case 42:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getPublicProductList",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.listId){e.next=16;break}a.listId=n.listId,e.next=21;break;case 16:if(void 0===i.listId){e.next=20;break}a.listId=i.listId,e.next=21;break;case 20:throw new Error("Missing required path parameter: listId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/product-lists/{listId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProductListItem",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.listId){e.next=16;break}a.listId=n.listId,e.next=21;break;case 16:if(void 0===i.listId){e.next=20;break}a.listId=i.listId,e.next=21;break;case 20:throw new Error("Missing required path parameter: listId");case 21:if(void 0===n.itemId){e.next=25;break}a.itemId=n.itemId,e.next=30;break;case 25:if(void 0===i.itemId){e.next=29;break}a.itemId=i.itemId,e.next=30;break;case 29:throw new Error("Missing required path parameter: itemId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return s=new $d("/organizations/{organizationId}/product-lists/{listId}/items/{itemId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=nu(nu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=nu(nu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=46,Ro(s.toString(),d);case 46:if(u=e.sent,!r){e.next=51;break}return e.abrupt("return",u);case 51:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=55;break}throw new hs(u);case 55:return e.next=57,u.text();case 57:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 59:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function au(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ou(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?au(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):au(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(iu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/{version}");var su=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=ou({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r;return ti(e,[{key:"retrieveResults",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.channelId){e.next=16;break}a.channelId=n.channelId,e.next=21;break;case 16:if(void 0===i.channelId){e.next=20;break}a.channelId=i.channelId,e.next=21;break;case 20:throw new Error("Missing required path parameter: channelId");case 21:if(o={},void 0===n.locale){e.next=26;break}o.locale=n.locale,e.next=31;break;case 26:if(void 0===i.locale){e.next=30;break}o.locale=i.locale,e.next=31;break;case 30:throw new Error("Missing required query parameter: locale");case 31:return void 0!==n.offset?o.offset=n.offset:void 0!==i.offset&&(o.offset=i.offset),void 0!==n.limit?o.limit=n.limit:void 0!==i.limit&&(o.limit=i.limit),s=new $d("/organizations/{organizationId}/channels/{channelId}/results",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=ou(ou({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=ou(ou({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=39,Ro(s.toString(),d);case 39:if(u=e.sent,!r){e.next=44;break}return e.abrupt("return",u);case 44:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=48;break}throw new hs(u);case 48:return e.next=50,u.text();case 50:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getSuggestions",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.channelId){e.next=16;break}a.channelId=n.channelId,e.next=21;break;case 16:if(void 0===i.channelId){e.next=20;break}a.channelId=i.channelId,e.next=21;break;case 20:throw new Error("Missing required path parameter: channelId");case 21:if(o={},void 0===n.suggestionTypes){e.next=26;break}o.suggestionTypes=n.suggestionTypes,e.next=31;break;case 26:if(void 0===i.suggestionTypes){e.next=30;break}o.suggestionTypes=i.suggestionTypes,e.next=31;break;case 30:throw new Error("Missing required query parameter: suggestionTypes");case 31:if(void 0!==n.searchText?o.searchText=n.searchText:void 0!==i.searchText&&(o.searchText=i.searchText),void 0===n.locale){e.next=36;break}o.locale=n.locale,e.next=41;break;case 36:if(void 0===i.locale){e.next=40;break}o.locale=i.locale,e.next=41;break;case 40:throw new Error("Missing required query parameter: locale");case 41:return s=new $d("/organizations/{organizationId}/channels/{channelId}/suggestions",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=ou(ou({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=ou(ou({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function cu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(su,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/discovery/query/{version}");var uu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=du({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r;return ti(e,[{key:"getPages",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0!==n.categoryId?o.categoryId=n.categoryId:void 0!==i.categoryId&&(o.categoryId=i.categoryId),void 0!==n.productId?o.productId=n.productId:void 0!==i.productId&&(o.productId=i.productId),void 0===n.aspectTypeId){e.next=19;break}o.aspectTypeId=n.aspectTypeId,e.next=24;break;case 19:if(void 0===i.aspectTypeId){e.next=23;break}o.aspectTypeId=i.aspectTypeId,e.next=24;break;case 23:throw new Error("Missing required query parameter: aspectTypeId");case 24:if(void 0!==n.aspectAttributes?o.aspectAttributes=n.aspectAttributes:void 0!==i.aspectAttributes&&(o.aspectAttributes=i.aspectAttributes),void 0!==n.parameters?o.parameters=n.parameters:void 0!==i.parameters&&(o.parameters=i.parameters),void 0===n.siteId){e.next=30;break}o.siteId=n.siteId,e.next=35;break;case 30:if(void 0===i.siteId){e.next=34;break}o.siteId=i.siteId,e.next=35;break;case 34:throw new Error("Missing required query parameter: siteId");case 35:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/pages",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=du(du({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=du(du({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=42,Ro(s.toString(),d);case 42:if(u=e.sent,!r){e.next=47;break}return e.abrupt("return",u);case 47:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=51;break}throw new hs(u);case 51:return e.next=53,u.text();case 53:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 55:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getPage",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.pageId){e.next=16;break}a.pageId=n.pageId,e.next=21;break;case 16:if(void 0===i.pageId){e.next=20;break}a.pageId=i.pageId,e.next=21;break;case 20:throw new Error("Missing required path parameter: pageId");case 21:if(o={},void 0!==n.aspectAttributes?o.aspectAttributes=n.aspectAttributes:void 0!==i.aspectAttributes&&(o.aspectAttributes=i.aspectAttributes),void 0!==n.parameters?o.parameters=n.parameters:void 0!==i.parameters&&(o.parameters=i.parameters),void 0===n.siteId){e.next=28;break}o.siteId=n.siteId,e.next=33;break;case 28:if(void 0===i.siteId){e.next=32;break}o.siteId=i.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/pages/{pageId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=du(du({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=du(du({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=40,Ro(s.toString(),d);case 40:if(u=e.sent,!r){e.next=45;break}return e.abrupt("return",u);case 45:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=49;break}throw new hs(u);case 49:return e.next=51,u.text();case 51:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function fu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(uu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/experience/shopper-experience/{version}");var pu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=hu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t;return ti(e,[{key:"getGiftCertificate",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return s=new $d("/organizations/{organizationId}/gift-certificate",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=hu(hu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=hu(hu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(pu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-gift-certificates/{version}");var bu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=gu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i,a,o,s,c,d,u,f,h,p,l,g,b,v,I;return ti(e,[{key:"retrieveCredQualityUserInfo",value:(I=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.username){e.next=17;break}o.username=n.username,e.next=22;break;case 17:if(void 0===i.username){e.next=21;break}o.username=i.username,e.next=22;break;case 21:throw new Error("Missing required query parameter: username");case 22:return s=new $d("/organizations/{organizationId}/cred-qual/user",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=28,Ro(s.toString(),d);case 28:if(u=e.sent,!r){e.next=33;break}return e.abrupt("return",u);case 33:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=37;break}throw new hs(u);case 37:return e.next=39,u.text();case 39:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 41:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"authenticateCustomer",value:(v=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/login",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=26;break}throw new hs(u);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"authorizePasswordlessCustomer",value:(b=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/passwordless/login",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"logoutCustomer",value:(g=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.client_id){e.next=17;break}o.client_id=n.client_id,e.next=22;break;case 17:if(void 0===i.client_id){e.next=21;break}o.client_id=i.client_id,e.next=22;break;case 21:throw new Error("Missing required query parameter: client_id");case 22:if(void 0===n.refresh_token){e.next=26;break}o.refresh_token=n.refresh_token,e.next=31;break;case 26:if(void 0===i.refresh_token){e.next=30;break}o.refresh_token=i.refresh_token,e.next=31;break;case 30:throw new Error("Missing required query parameter: refresh_token");case 31:return void 0!==n.channel_id?o.channel_id=n.channel_id:void 0!==i.channel_id&&(o.channel_id=i.channel_id),void 0!==n.hint?o.hint=n.hint:void 0!==i.hint&&(o.hint=i.hint),s=new $d("/organizations/{organizationId}/oauth2/logout",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=39,Ro(s.toString(),d);case 39:if(u=e.sent,!r){e.next=44;break}return e.abrupt("return",u);case 44:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=48;break}throw new hs(u);case 48:return e.next=50,u.text();case 50:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"authorizeCustomer",value:(l=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.redirect_uri){e.next=17;break}o.redirect_uri=n.redirect_uri,e.next=22;break;case 17:if(void 0===i.redirect_uri){e.next=21;break}o.redirect_uri=i.redirect_uri,e.next=22;break;case 21:throw new Error("Missing required query parameter: redirect_uri");case 22:if(void 0===n.response_type){e.next=26;break}o.response_type=n.response_type,e.next=31;break;case 26:if(void 0===i.response_type){e.next=30;break}o.response_type=i.response_type,e.next=31;break;case 30:throw new Error("Missing required query parameter: response_type");case 31:if(void 0===n.client_id){e.next=35;break}o.client_id=n.client_id,e.next=40;break;case 35:if(void 0===i.client_id){e.next=39;break}o.client_id=i.client_id,e.next=40;break;case 39:throw new Error("Missing required query parameter: client_id");case 40:if(void 0!==n.scope?o.scope=n.scope:void 0!==i.scope&&(o.scope=i.scope),void 0!==n.state?o.state=n.state:void 0!==i.state&&(o.state=i.state),void 0!==n.usid?o.usid=n.usid:void 0!==i.usid&&(o.usid=i.usid),void 0!==n.hint?o.hint=n.hint:void 0!==i.hint&&(o.hint=i.hint),void 0!==n.channel_id?o.channel_id=n.channel_id:void 0!==i.channel_id&&(o.channel_id=i.channel_id),void 0===n.code_challenge){e.next=49;break}o.code_challenge=n.code_challenge,e.next=54;break;case 49:if(void 0===i.code_challenge){e.next=53;break}o.code_challenge=i.code_challenge,e.next=54;break;case 53:throw new Error("Missing required query parameter: code_challenge");case 54:return s=new $d("/organizations/{organizationId}/oauth2/authorize",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=60,Ro(s.toString(),d);case 60:if(u=e.sent,!r){e.next=65;break}return e.abrupt("return",u);case 65:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=67;break}throw new hs(u);case 67:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getAccessToken",value:(p=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getSessionBridgeAccessToken",value:(h=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/session-bridge/token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getTrustedSystemAccessToken",value:(f=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/trusted-system/token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getTrustedAgentAuthorizationToken",value:(u=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.client_id){e.next=17;break}o.client_id=n.client_id,e.next=22;break;case 17:if(void 0===i.client_id){e.next=21;break}o.client_id=i.client_id,e.next=22;break;case 21:throw new Error("Missing required query parameter: client_id");case 22:if(void 0===n.channel_id){e.next=26;break}o.channel_id=n.channel_id,e.next=31;break;case 26:if(void 0===i.channel_id){e.next=30;break}o.channel_id=i.channel_id,e.next=31;break;case 30:throw new Error("Missing required query parameter: channel_id");case 31:if(void 0===n.code_challenge){e.next=35;break}o.code_challenge=n.code_challenge,e.next=40;break;case 35:if(void 0===i.code_challenge){e.next=39;break}o.code_challenge=i.code_challenge,e.next=40;break;case 39:throw new Error("Missing required query parameter: code_challenge");case 40:if(void 0===n.login_id){e.next=44;break}o.login_id=n.login_id,e.next=49;break;case 44:if(void 0===i.login_id){e.next=48;break}o.login_id=i.login_id,e.next=49;break;case 48:throw new Error("Missing required query parameter: login_id");case 49:if(void 0===n.idp_origin){e.next=53;break}o.idp_origin=n.idp_origin,e.next=58;break;case 53:if(void 0===i.idp_origin){e.next=57;break}o.idp_origin=i.idp_origin,e.next=58;break;case 57:throw new Error("Missing required query parameter: idp_origin");case 58:if(void 0===n.redirect_uri){e.next=62;break}o.redirect_uri=n.redirect_uri,e.next=67;break;case 62:if(void 0===i.redirect_uri){e.next=66;break}o.redirect_uri=i.redirect_uri,e.next=67;break;case 66:throw new Error("Missing required query parameter: redirect_uri");case 67:if(void 0===n.response_type){e.next=71;break}o.response_type=n.response_type,e.next=76;break;case 71:if(void 0===i.response_type){e.next=75;break}o.response_type=i.response_type,e.next=76;break;case 75:throw new Error("Missing required query parameter: response_type");case 76:return s=new $d("/organizations/{organizationId}/oauth2/trusted-agent/authorize",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=82,Ro(s.toString(),d);case 82:if(u=e.sent,!r){e.next=87;break}return e.abrupt("return",u);case 87:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=89;break}throw new hs(u);case 89:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"getTrustedAgentAccessToken",value:(d=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/trusted-agent/token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getPasswordResetToken",value:(c=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/password/reset",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=26;break}throw new hs(u);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"resetPassword",value:(s=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/password/action",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=26;break}throw new hs(u);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getPasswordLessAccessToken",value:(o=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/passwordless/token",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"revokeToken",value:(a=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/revoke",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"introspectToken",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/introspect",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({"Content-Type":"application/x-www-form-urlencoded"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getUserInfo",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},void 0!==n.channel_id?o.channel_id=n.channel_id:void 0!==i.channel_id&&(o.channel_id=i.channel_id),s=new $d("/organizations/{organizationId}/oauth2/userinfo",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=20,Ro(s.toString(),d);case 20:if(u=e.sent,!r){e.next=25;break}return e.abrupt("return",u);case 25:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=29;break}throw new hs(u);case 29:return e.next=31,u.text();case 31:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 33:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getWellknownOpenidConfiguration",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/.well-known/openid-configuration",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getJwksUri",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:return o={},s=new $d("/organizations/{organizationId}/oauth2/jwks",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=gu(gu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=gu(gu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=19,Ro(s.toString(),d);case 19:if(u=e.sent,!r){e.next=24;break}return e.abrupt("return",u);case 24:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=28;break}throw new hs(u);case 28:return e.next=30,u.text();case 30:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 32:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function vu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Iu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(bu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/shopper/auth/{version}");var xu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=Iu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i,a,o,s;return ti(e,[{key:"createOrder",value:(s=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=29,Ro(s.toString(),d);case 29:if(u=e.sent,!r){e.next=34;break}return e.abrupt("return",u);case 34:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=38;break}throw new hs(u);case 38:return e.next=40,u.text();case 40:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 42:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"getOrder",value:(o=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders/{orderNo}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"createPaymentInstrumentForOrder",value:(a=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders/{orderNo}/payment-instruments",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"POST"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"removePaymentInstrumentFromOrder",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders/{orderNo}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{headers:c,method:"DELETE"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"updatePaymentInstrumentForOrder",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(void 0===n.paymentInstrumentId){e.next=25;break}a.paymentInstrumentId=n.paymentInstrumentId,e.next=30;break;case 25:if(void 0===i.paymentInstrumentId){e.next=29;break}a.paymentInstrumentId=i.paymentInstrumentId,e.next=30;break;case 29:throw new Error("Missing required path parameter: paymentInstrumentId");case 30:if(o={},void 0===n.siteId){e.next=35;break}o.siteId=n.siteId,e.next=40;break;case 35:if(void 0===i.siteId){e.next=39;break}o.siteId=i.siteId,e.next=40;break;case 39:throw new Error("Missing required query parameter: siteId");case 40:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders/{orderNo}/payment-instruments/{paymentInstrumentId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({"Content-Type":"application/json"},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{body:this.clientConfig.transformRequest(t.body,c),headers:c,method:"PATCH"}),e.next=47,Ro(s.toString(),d);case 47:if(u=e.sent,!r){e.next=52;break}return e.abrupt("return",u);case 52:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=56;break}throw new hs(u);case 56:return e.next=58,u.text();case 58:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 60:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getPaymentMethodsForOrder",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/orders/{orderNo}/payment-methods",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getTaxesFromOrder",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.orderNo){e.next=16;break}a.orderNo=n.orderNo,e.next=21;break;case 16:if(void 0===i.orderNo){e.next=20;break}a.orderNo=i.orderNo,e.next=21;break;case 20:throw new Error("Missing required path parameter: orderNo");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return s=new $d("/organizations/{organizationId}/orders/{orderNo}/taxes",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Iu(Iu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Iu(Iu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=37,Ro(s.toString(),d);case 37:if(u=e.sent,!r){e.next=42;break}return e.abrupt("return",u);case 42:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=46;break}throw new hs(u);case 46:return e.next=48,u.text();case 48:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 50:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function ku(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ku(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ku(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(xu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/{version}");var wu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=mu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r,n,i;return ti(e,[{key:"getProducts",value:(i=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.ids){e.next=17;break}o.ids=n.ids,e.next=22;break;case 17:if(void 0===i.ids){e.next=21;break}o.ids=i.ids,e.next=22;break;case 21:throw new Error("Missing required query parameter: ids");case 22:if(void 0!==n.inventoryIds?o.inventoryIds=n.inventoryIds:void 0!==i.inventoryIds&&(o.inventoryIds=i.inventoryIds),void 0!==n.currency?o.currency=n.currency:void 0!==i.currency&&(o.currency=i.currency),void 0!==n.expand?o.expand=n.expand:void 0!==i.expand&&(o.expand=i.expand),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),void 0!==n.allImages?o.allImages=n.allImages:void 0!==i.allImages&&(o.allImages=i.allImages),void 0!==n.perPricebook?o.perPricebook=n.perPricebook:void 0!==i.perPricebook&&(o.perPricebook=i.perPricebook),void 0===n.siteId){e.next=32;break}o.siteId=n.siteId,e.next=37;break;case 32:if(void 0===i.siteId){e.next=36;break}o.siteId=i.siteId,e.next=37;break;case 36:throw new Error("Missing required query parameter: siteId");case 37:return s=new $d("/organizations/{organizationId}/products",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=mu(mu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=mu(mu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=43,Ro(s.toString(),d);case 43:if(u=e.sent,!r){e.next=48;break}return e.abrupt("return",u);case 48:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=52;break}throw new hs(u);case 52:return e.next=54,u.text();case 54:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getProduct",value:(n=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.id){e.next=16;break}a.id=n.id,e.next=21;break;case 16:if(void 0===i.id){e.next=20;break}a.id=i.id,e.next=21;break;case 20:throw new Error("Missing required path parameter: id");case 21:if(o={},void 0!==n.inventoryIds?o.inventoryIds=n.inventoryIds:void 0!==i.inventoryIds&&(o.inventoryIds=i.inventoryIds),void 0!==n.currency?o.currency=n.currency:void 0!==i.currency&&(o.currency=i.currency),void 0!==n.expand?o.expand=n.expand:void 0!==i.expand&&(o.expand=i.expand),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),void 0!==n.allImages?o.allImages=n.allImages:void 0!==i.allImages&&(o.allImages=i.allImages),void 0!==n.perPricebook?o.perPricebook=n.perPricebook:void 0!==i.perPricebook&&(o.perPricebook=i.perPricebook),void 0===n.siteId){e.next=32;break}o.siteId=n.siteId,e.next=37;break;case 32:if(void 0===i.siteId){e.next=36;break}o.siteId=i.siteId,e.next=37;break;case 36:throw new Error("Missing required query parameter: siteId");case 37:return s=new $d("/organizations/{organizationId}/products/{id}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=mu(mu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=mu(mu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=43,Ro(s.toString(),d);case 43:if(u=e.sent,!r){e.next=48;break}return e.abrupt("return",u);case 48:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=52;break}throw new hs(u);case 52:return e.next=54,u.text();case 54:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 56:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getCategories",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.ids){e.next=17;break}o.ids=n.ids,e.next=22;break;case 17:if(void 0===i.ids){e.next=21;break}o.ids=i.ids,e.next=22;break;case 21:throw new Error("Missing required query parameter: ids");case 22:if(void 0!==n.levels?o.levels=n.levels:void 0!==i.levels&&(o.levels=i.levels),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),void 0===n.siteId){e.next=28;break}o.siteId=n.siteId,e.next=33;break;case 28:if(void 0===i.siteId){e.next=32;break}o.siteId=i.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return s=new $d("/organizations/{organizationId}/categories",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=mu(mu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=mu(mu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=39,Ro(s.toString(),d);case 39:if(u=e.sent,!r){e.next=44;break}return e.abrupt("return",u);case 44:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=48;break}throw new hs(u);case 48:return e.next=50,u.text();case 50:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getCategory",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.id){e.next=16;break}a.id=n.id,e.next=21;break;case 16:if(void 0===i.id){e.next=20;break}a.id=i.id,e.next=21;break;case 20:throw new Error("Missing required path parameter: id");case 21:if(o={},void 0!==n.levels?o.levels=n.levels:void 0!==i.levels&&(o.levels=i.levels),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),void 0===n.siteId){e.next=28;break}o.siteId=n.siteId,e.next=33;break;case 28:if(void 0===i.siteId){e.next=32;break}o.siteId=i.siteId,e.next=33;break;case 32:throw new Error("Missing required query parameter: siteId");case 33:return s=new $d("/organizations/{organizationId}/categories/{id}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=mu(mu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=mu(mu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=39,Ro(s.toString(),d);case 39:if(u=e.sent,!r){e.next=44;break}return e.abrupt("return",u);case 44:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=48;break}throw new hs(u);case 48:return e.next=50,u.text();case 50:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 52:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function yu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}ri(wu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/product/shopper-products/{version}");var zu=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=Cu({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r;return ti(e,[{key:"getPromotions",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:if(void 0===n.ids){e.next=26;break}o.ids=n.ids,e.next=31;break;case 26:if(void 0===i.ids){e.next=30;break}o.ids=i.ids,e.next=31;break;case 30:throw new Error("Missing required query parameter: ids");case 31:return void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/promotions",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Cu(Cu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Cu(Cu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=38,Ro(s.toString(),d);case 38:if(u=e.sent,!r){e.next=43;break}return e.abrupt("return",u);case 43:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=47;break}throw new hs(u);case 47:return e.next=49,u.text();case 49:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getPromotionsForCampaign",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(void 0===n.campaignId){e.next=16;break}a.campaignId=n.campaignId,e.next=21;break;case 16:if(void 0===i.campaignId){e.next=20;break}a.campaignId=i.campaignId,e.next=21;break;case 20:throw new Error("Missing required path parameter: campaignId");case 21:if(o={},void 0===n.siteId){e.next=26;break}o.siteId=n.siteId,e.next=31;break;case 26:if(void 0===i.siteId){e.next=30;break}o.siteId=i.siteId,e.next=31;break;case 30:throw new Error("Missing required query parameter: siteId");case 31:return void 0!==n.startDate?o.startDate=n.startDate:void 0!==i.startDate&&(o.startDate=i.startDate),void 0!==n.endDate?o.endDate=n.endDate:void 0!==i.endDate&&(o.endDate=i.endDate),void 0!==n.currency?o.currency=n.currency:void 0!==i.currency&&(o.currency=i.currency),s=new $d("/organizations/{organizationId}/promotions/campaigns/{campaignId}",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Cu(Cu({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Cu(Cu({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=40,Ro(s.toString(),d);case 40:if(u=e.sent,!r){e.next=45;break}return e.abrupt("return",u);case 45:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=49;break}throw new hs(u);case 49:return e.next=51,u.text();case 51:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();ri(zu,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/{version}");var Ou=TypeError,Eu=function(e,t){if(!delete e[t])throw Ou("Cannot delete property "+W(t)+" of "+W(e))},qu=U.match(/firefox\/(\d+)/i),Pu=!!qu&&+qu[1],Su=/MSIE|Trident/.test(U),ju=U.match(/AppleWebKit\/(\d+)\./),Tu=!!ju&&+ju[1],Mu=[],Ru=m(Mu.sort),Au=m(Mu.push),Uu=c((function(){Mu.sort(void 0)})),Bu=c((function(){Mu.sort(null)})),Nu=Nn("sort"),_u=!c((function(){if(D)return D<70;if(!(Pu&&Pu>3)){if(Su)return!0;if(Tu)return Tu<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)Mu.push({k:t+n,v:r})}for(Mu.sort((function(e,t){return t.v-e.v})),n=0;n<Mu.length;n++)t=Mu[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));function Lu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lu(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Rt({target:"Array",proto:!0,forced:Uu||!Bu||!Nu||!_u},{sort:function(e){void 0!==e&&Y(e);var t=ne(this);if(_u)return void 0===e?Ru(t):Ru(t,e);var r,n,i=[],a=pt(t);for(n=0;n<a;n++)n in t&&Au(i,t[n]);for(Ba(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:Ht(t)>Ht(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<a;)Eu(t,n++);return t}});var Ju=function(){function e(t){Zn(this,e),ri(this,"clientConfig",void 0);var r=Du({},t);r.baseUri||(r.baseUri=(this instanceof e?this.constructor:void 0).defaultBaseUri),this.clientConfig=new qo(r)}var t,r;return ti(e,[{key:"productSearch",value:(r=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:return void 0!==n.q?o.q=n.q:void 0!==i.q&&(o.q=i.q),void 0!==n.refine?o.refine=n.refine:void 0!==i.refine&&(o.refine=i.refine),void 0!==n.sort?o.sort=n.sort:void 0!==i.sort&&(o.sort=i.sort),void 0!==n.currency?o.currency=n.currency:void 0!==i.currency&&(o.currency=i.currency),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),void 0!==n.expand?o.expand=n.expand:void 0!==i.expand&&(o.expand=i.expand),void 0!==n.offset?o.offset=n.offset:void 0!==i.offset&&(o.offset=i.offset),void 0!==n.limit?o.limit=n.limit:void 0!==i.limit&&(o.limit=i.limit),s=new $d("/organizations/{organizationId}/product-search",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Du(Du({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Du(Du({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=36,Ro(s.toString(),d);case 36:if(u=e.sent,!r){e.next=41;break}return e.abrupt("return",u);case 41:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=45;break}throw new hs(u);case 45:return e.next=47,u.text();case 47:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 49:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getSearchSuggestions",value:(t=Xn(qi.mark((function e(t,r){var n,i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null==t?void 0:t.parameters)||{},i=this.clientConfig.parameters,a={shortCode:i.shortCode,version:i.version||"v1"},void 0===n.organizationId){e.next=7;break}a.organizationId=n.organizationId,e.next=12;break;case 7:if(void 0===i.organizationId){e.next=11;break}a.organizationId=i.organizationId,e.next=12;break;case 11:throw new Error("Missing required path parameter: organizationId");case 12:if(o={},void 0===n.siteId){e.next=17;break}o.siteId=n.siteId,e.next=22;break;case 17:if(void 0===i.siteId){e.next=21;break}o.siteId=i.siteId,e.next=22;break;case 21:throw new Error("Missing required query parameter: siteId");case 22:if(void 0===n.q){e.next=26;break}o.q=n.q,e.next=31;break;case 26:if(void 0===i.q){e.next=30;break}o.q=i.q,e.next=31;break;case 30:throw new Error("Missing required query parameter: q");case 31:return void 0!==n.limit?o.limit=n.limit:void 0!==i.limit&&(o.limit=i.limit),void 0!==n.currency?o.currency=n.currency:void 0!==i.currency&&(o.currency=i.currency),void 0!==n.locale?o.locale=n.locale:void 0!==i.locale&&(o.locale=i.locale),s=new $d("/organizations/{organizationId}/search-suggestions",this.clientConfig.baseUri,{pathParams:a,queryParams:o,origin:this.clientConfig.proxy}),c=Du(Du({},this.clientConfig.headers),null==t?void 0:t.headers),So||(c["user-agent"]=[c["user-agent"],Yd].join(" ")),d=Du(Du({},this.clientConfig.fetchOptions),{},{headers:c,method:"GET"}),e.next=40,Ro(s.toString(),d);case 40:if(u=e.sent,!r){e.next=45;break}return e.abrupt("return",u);case 45:if(!this.clientConfig.throwOnBadResponse||u.ok||304===u.status){e.next=49;break}throw new hs(u);case 49:return e.next=51,u.text();case 51:return f=e.sent,e.abrupt("return",f?JSON.parse(f):{});case 53:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();ri(Ju,"defaultBaseUri","https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/");var Fu=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};As("search",(function(e,t,r){return[function(t){var r=P(this),n=null==t?void 0:K(t,e);return n?h(n,t,r):new RegExp(t)[e](Ht(r))},function(e){var n=qe(this),i=Ht(e),a=r(t,n,i);if(a.done)return a.value;var o=n.lastIndex;Fu(o,0)||(n.lastIndex=0);var s=Vs(n,i);return Fu(n.lastIndex,o)||(n.lastIndex=o),null===s?-1:s.index}]}));var Gu=le("iterator"),Hu=!1;try{var Vu=0,Wu={next:function(){return{done:!!Vu++}},return:function(){Hu=!0}};Wu[Gu]=function(){return this},Array.from(Wu,(function(){throw 2}))}catch(e){}var $u,Yu,Ku,Qu=function(e,t){if(!t&&!Hu)return!1;var r=!1;try{var n={};n[Gu]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Xu="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Zu=Te.f,ef=tt.enforce,tf=tt.get,rf=s.Int8Array,nf=rf&&rf.prototype,af=s.Uint8ClampedArray,of=af&&af.prototype,sf=rf&&Di(rf),cf=nf&&Di(nf),df=Object.prototype,uf=s.TypeError,ff=le("toStringTag"),hf=de("TYPED_ARRAY_TAG"),pf=Xu&&!!Ki&&"Opera"!==Ft(s.opera),lf=!1,gf={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},bf={BigInt64Array:8,BigUint64Array:8},vf=function(e){var t=Di(e);if(T(t)){var r=tf(t);return r&&ae(r,"TypedArrayConstructor")?r.TypedArrayConstructor:vf(t)}},If=function(e){if(!T(e))return!1;var t=Ft(e);return ae(gf,t)||ae(bf,t)};for($u in gf)(Ku=(Yu=s[$u])&&Yu.prototype)?ef(Ku).TypedArrayConstructor=Yu:pf=!1;for($u in bf)(Ku=(Yu=s[$u])&&Yu.prototype)&&(ef(Ku).TypedArrayConstructor=Yu);if((!pf||!j(sf)||sf===Function.prototype)&&(sf=function(){throw uf("Incorrect invocation")},pf))for($u in gf)s[$u]&&Ki(s[$u],sf);if((!pf||!cf||cf===df)&&(cf=sf.prototype,pf))for($u in gf)s[$u]&&Ki(s[$u].prototype,cf);if(pf&&Di(of)!==cf&&Ki(of,cf),d&&!ae(cf,ff))for($u in lf=!0,Zu(cf,ff,{get:function(){return T(this)?this[hf]:void 0}}),gf)s[$u]&&Me(s[$u],hf,$u);var xf={NATIVE_ARRAY_BUFFER_VIEWS:pf,TYPED_ARRAY_TAG:lf&&hf,aTypedArray:function(e){if(If(e))return e;throw uf("Target is not a typed array")},aTypedArrayConstructor:function(e){if(j(e)&&(!Ki||A(sf,e)))return e;throw uf(W(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(d){if(r)for(var i in gf){var a=s[i];if(a&&ae(a.prototype,e))try{delete a.prototype[e]}catch(r){try{a.prototype[e]=t}catch(e){}}}cf[e]&&!r||nt(cf,e,r?t:pf&&nf[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(d){if(Ki){if(r)for(n in gf)if((i=s[n])&&ae(i,e))try{delete i[e]}catch(e){}if(sf[e]&&!r)return;try{return nt(sf,e,r?t:pf&&sf[e]||t)}catch(e){}}for(n in gf)!(i=s[n])||i[e]&&!r||nt(i,e,t)}},getTypedArrayConstructor:vf,isView:function(e){if(!T(e))return!1;var t=Ft(e);return"DataView"===t||ae(gf,t)||ae(bf,t)},isTypedArray:If,TypedArray:sf,TypedArrayPrototype:cf},kf=xf.NATIVE_ARRAY_BUFFER_VIEWS,mf=s.ArrayBuffer,wf=s.Int8Array,yf=!kf||!c((function(){wf(1)}))||!c((function(){new wf(-1)}))||!Qu((function(e){new wf,new wf(null),new wf(1.5),new wf(e)}),!0)||c((function(){return 1!==new wf(new mf(2),1,void 0).length})),Cf=RangeError,zf=function(e){if(void 0===e)return 0;var t=st(e),r=ht(t);if(t!==r)throw Cf("Wrong length or index");return r},Of=Array,Ef=Math.abs,qf=Math.pow,Pf=Math.floor,Sf=Math.log,jf=Math.LN2,Tf=function(e,t,r){var n,i,a,o=Of(r),s=8*r-t-1,c=(1<<s)-1,d=c>>1,u=23===t?qf(2,-24)-qf(2,-77):0,f=e<0||0===e&&1/e<0?1:0,h=0;for((e=Ef(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=Pf(Sf(e)/jf),e*(a=qf(2,-n))<1&&(n--,a*=2),(e+=n+d>=1?u/a:u*qf(2,1-d))*a>=2&&(n++,a/=2),n+d>=c?(i=0,n=c):n+d>=1?(i=(e*a-1)*qf(2,t),n+=d):(i=e*qf(2,d-1)*qf(2,t),n=0));t>=8;)o[h++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)o[h++]=255&n,n/=256,s-=8;return o[--h]|=128*f,o},Mf=function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,c=n-1,d=e[c--],u=127&d;for(d>>=7;s>0;)u=256*u+e[c--],s-=8;for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;)r=256*r+e[c--],s-=8;if(0===u)u=1-o;else{if(u===a)return r?NaN:d?-1/0:1/0;r+=qf(2,t),u-=o}return(d?-1:1)*r*qf(2,u-t)},Rf=function(e){for(var t=ne(this),r=pt(t),n=arguments.length,i=ut(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:ut(a,r);o>i;)t[i++]=e;return t},Af=mt.f,Uf=Te.f,Bf=Be.PROPER,Nf=Be.CONFIGURABLE,_f=tt.get,Lf=tt.set,Df=s.ArrayBuffer,Jf=Df,Ff=Jf&&Jf.prototype,Gf=s.DataView,Hf=Gf&&Gf.prototype,Vf=Object.prototype,Wf=s.Array,$f=s.RangeError,Yf=m(Rf),Kf=m([].reverse),Qf=Tf,Xf=Mf,Zf=function(e){return[255&e]},eh=function(e){return[255&e,e>>8&255]},th=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},rh=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},nh=function(e){return Qf(e,23,4)},ih=function(e){return Qf(e,52,8)},ah=function(e,t){Uf(e.prototype,t,{get:function(){return _f(this)[t]}})},oh=function(e,t,r,n){var i=zf(r),a=_f(e);if(i+t>a.byteLength)throw $f("Wrong index");var o=_f(a.buffer).bytes,s=i+a.byteOffset,c=nr(o,s,s+t);return n?c:Kf(c)},sh=function(e,t,r,n,i,a){var o=zf(r),s=_f(e);if(o+t>s.byteLength)throw $f("Wrong index");for(var c=_f(s.buffer).bytes,d=o+s.byteOffset,u=n(+i),f=0;f<t;f++)c[d+f]=u[a?f:t-f-1]};if(Xu){var ch=Bf&&"ArrayBuffer"!==Df.name;if(c((function(){Df(1)}))&&c((function(){new Df(-1)}))&&!c((function(){return new Df,new Df(1.5),new Df(NaN),ch&&!Nf})))ch&&Nf&&Me(Df,"name","ArrayBuffer");else{(Jf=function(e){return Oa(this,Ff),new Df(zf(e))}).prototype=Ff;for(var dh,uh=Af(Df),fh=0;uh.length>fh;)(dh=uh[fh++])in Jf||Me(Jf,dh,Df[dh]);Ff.constructor=Jf}Ki&&Di(Hf)!==Vf&&Ki(Hf,Vf);var hh=new Gf(new Jf(2)),ph=m(Hf.setInt8);hh.setInt8(0,2147483648),hh.setInt8(1,2147483649),!hh.getInt8(0)&&hh.getInt8(1)||Ca(Hf,{setInt8:function(e,t){ph(this,e,t<<24>>24)},setUint8:function(e,t){ph(this,e,t<<24>>24)}},{unsafe:!0})}else Ff=(Jf=function(e){Oa(this,Ff);var t=zf(e);Lf(this,{bytes:Yf(Wf(t),0),byteLength:t}),d||(this.byteLength=t)}).prototype,Hf=(Gf=function(e,t,r){Oa(this,Hf),Oa(e,Ff);var n=_f(e).byteLength,i=st(t);if(i<0||i>n)throw $f("Wrong offset");if(i+(r=void 0===r?n-i:ht(r))>n)throw $f("Wrong length");Lf(this,{buffer:e,byteLength:r,byteOffset:i}),d||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,d&&(ah(Jf,"byteLength"),ah(Gf,"buffer"),ah(Gf,"byteLength"),ah(Gf,"byteOffset")),Ca(Hf,{getInt8:function(e){return oh(this,1,e)[0]<<24>>24},getUint8:function(e){return oh(this,1,e)[0]},getInt16:function(e){var t=oh(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=oh(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return rh(oh(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return rh(oh(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Xf(oh(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Xf(oh(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){sh(this,1,e,Zf,t)},setUint8:function(e,t){sh(this,1,e,Zf,t)},setInt16:function(e,t){sh(this,2,e,eh,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){sh(this,2,e,eh,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){sh(this,4,e,th,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){sh(this,4,e,th,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){sh(this,4,e,nh,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){sh(this,8,e,ih,t,arguments.length>2?arguments[2]:void 0)}});hr(Jf,"ArrayBuffer"),hr(Gf,"DataView");var lh={ArrayBuffer:Jf,DataView:Gf},gh=Math.floor,bh=Number.isInteger||function(e){return!T(e)&&isFinite(e)&&gh(e)===e},vh=RangeError,Ih=RangeError,xh=function(e,t){var r=function(e){var t=st(e);if(t<0)throw vh("The argument can't be less than 0");return t}(e);if(r%t)throw Ih("Wrong offset");return r},kh=xf.aTypedArrayConstructor,mh=function(e){var t,r,n,i,a,o,s=Jo(this),c=ne(e),d=arguments.length,u=d>1?arguments[1]:void 0,f=void 0!==u,p=qa(c);if(p&&!hc(p))for(o=(a=Sa(c,p)).next,c=[];!(i=h(o,a)).done;)c.push(i.value);for(f&&d>2&&(u=lr(u,arguments[2])),r=pt(c),n=new(kh(s))(r),t=0;r>t;t++)n[t]=f?u(c[t],t):c[t];return n},wh=le("species"),yh=function(e){var t=R(e),r=Te.f;d&&t&&!t[wh]&&r(t,wh,{configurable:!0,get:function(){return this}})};n((function(e){var t=mt.f,r=Sr.forEach,n=tt.get,i=tt.set,a=tt.enforce,o=Te.f,c=Ce.f,u=Math.round,f=s.RangeError,p=lh.ArrayBuffer,l=p.prototype,g=lh.DataView,v=xf.NATIVE_ARRAY_BUFFER_VIEWS,I=xf.TYPED_ARRAY_TAG,x=xf.TypedArray,k=xf.TypedArrayPrototype,m=xf.aTypedArrayConstructor,w=xf.isTypedArray,y=function(e,t){m(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},C=function(e,t){o(e,t,{get:function(){return n(this)[t]}})},z=function(e){var t;return A(l,e)||"ArrayBuffer"==(t=Ft(e))||"SharedArrayBuffer"==t},O=function(e,t){return w(e)&&!H(t)&&t in e&&bh(+t)&&t>=0},E=function(e,t){return t=Ie(t),O(e,t)?b(2,e[t]):c(e,t)},q=function(e,t,r){return t=Ie(t),!(O(e,t)&&T(r)&&ae(r,"value"))||ae(r,"get")||ae(r,"set")||r.configurable||ae(r,"writable")&&!r.writable||ae(r,"enumerable")&&!r.enumerable?o(e,t,r):(e[t]=r.value,e)};d?(v||(Ce.f=E,Te.f=q,C(k,"buffer"),C(k,"byteOffset"),C(k,"byteLength"),C(k,"length")),Rt({target:"Object",stat:!0,forced:!v},{getOwnPropertyDescriptor:E,defineProperty:q}),e.exports=function(e,c,d){var l=e.match(/\d+$/)[0]/8,b=e+(d?"Clamped":"")+"Array",m="get"+e,C="set"+e,O=s[b],E=O,q=E&&E.prototype,P={},S=function(e,t){o(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[m](t*l+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=n(e);d&&(r=(r=u(r))<0?0:r>255?255:255&r),i.view[C](t*l+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};v?yf&&(E=c((function(e,t,r,n){return Oa(e,q),function(e,t,r){var n,i;return Ki&&j(n=t.constructor)&&n!==r&&T(i=n.prototype)&&i!==r.prototype&&Ki(e,i),e}(T(t)?z(t)?void 0!==n?new O(t,xh(r,l),n):void 0!==r?new O(t,xh(r,l)):new O(t):w(t)?y(E,t):h(mh,E,t):new O(zf(t)),e,E)})),Ki&&Ki(E,x),r(t(O),(function(e){e in E||Me(E,e,O[e])})),E.prototype=q):(E=c((function(e,t,r,n){Oa(e,q);var a,o,s,c=0,d=0;if(T(t)){if(!z(t))return w(t)?y(E,t):h(mh,E,t);a=t,d=xh(r,l);var u=t.byteLength;if(void 0===n){if(u%l)throw f("Wrong length");if((o=u-d)<0)throw f("Wrong length")}else if((o=ht(n)*l)+d>u)throw f("Wrong length");s=o/l}else s=zf(t),a=new p(o=s*l);for(i(e,{buffer:a,byteOffset:d,byteLength:o,length:s,view:new g(a)});c<s;)S(e,c++)})),Ki&&Ki(E,x),q=E.prototype=Zt(k)),q.constructor!==E&&Me(q,"constructor",E),a(q).TypedArrayConstructor=E,I&&Me(q,I,b);var M=E!=O;P[b]=E,Rt({global:!0,constructor:!0,forced:M,sham:!v},P),"BYTES_PER_ELEMENT"in E||Me(E,"BYTES_PER_ELEMENT",l),"BYTES_PER_ELEMENT"in q||Me(q,"BYTES_PER_ELEMENT",l),yh(b)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var Ch=Math.min,zh=m([].copyWithin||function(e,t){var r=ne(this),n=pt(r),i=ut(e,n),a=ut(t,n),o=arguments.length>2?arguments[2]:void 0,s=Ch((void 0===o?n:ut(o,n))-a,n-i),c=1;for(a<i&&i<a+s&&(c=-1,a+=s-1,i+=s-1);s-- >0;)a in r?r[i]=r[a]:Eu(r,i),i+=c,a+=c;return r}),Oh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("copyWithin",(function(e,t){return zh(Oh(this),e,t,arguments.length>2?arguments[2]:void 0)}));var Eh=Sr.every,qh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("every",(function(e){return Eh(qh(this),e,arguments.length>1?arguments[1]:void 0)}));var Ph=TypeError,Sh=function(e){var t=ve(e,"number");if("number"==typeof t)throw Ph("Can't convert number to bigint");return BigInt(t)},jh=xf.aTypedArray,Th=xf.exportTypedArrayMethod,Mh=m("".slice);Th("fill",(function(e){var t=arguments.length;jh(this);var r="Big"===Mh(Ft(this),0,3)?Sh(e):+e;return h(Rf,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var Rh=le("species"),Ah=function(e,t){var r,n=qe(e).constructor;return void 0===n||null==(r=qe(n)[Rh])?t:Jo(r)},Uh=xf.aTypedArrayConstructor,Bh=xf.getTypedArrayConstructor,Nh=function(e){return Uh(Ah(e,Bh(e)))},_h=function(e,t){return function(e,t){for(var r=0,n=pt(t),i=new e(n);n>r;)i[r]=t[r++];return i}(Nh(e),t)},Lh=Sr.filter,Dh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("filter",(function(e){var t=Lh(Dh(this),e,arguments.length>1?arguments[1]:void 0);return _h(this,t)}));var Jh=Sr.find,Fh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("find",(function(e){return Jh(Fh(this),e,arguments.length>1?arguments[1]:void 0)}));var Gh=Sr.findIndex,Hh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("findIndex",(function(e){return Gh(Hh(this),e,arguments.length>1?arguments[1]:void 0)}));var Vh=Sr.forEach,Wh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("forEach",(function(e){Vh(Wh(this),e,arguments.length>1?arguments[1]:void 0)}));var $h=gt.includes,Yh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("includes",(function(e){return $h(Yh(this),e,arguments.length>1?arguments[1]:void 0)}));var Kh=gt.indexOf,Qh=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("indexOf",(function(e){return Kh(Qh(this),e,arguments.length>1?arguments[1]:void 0)}));var Xh=le("iterator"),Zh=s.Uint8Array,ep=m(sa.values),tp=m(sa.keys),rp=m(sa.entries),np=xf.aTypedArray,ip=xf.exportTypedArrayMethod,ap=Zh&&Zh.prototype,op=!c((function(){ap[Xh].call([1])})),sp=!!ap&&ap.values&&ap[Xh]===ap.values&&"values"===ap.values.name,cp=function(){return ep(np(this))};ip("entries",(function(){return rp(np(this))}),op),ip("keys",(function(){return tp(np(this))}),op),ip("values",cp,op||!sp,{name:"values"}),ip(Xh,cp,op||!sp,{name:"values"});var dp=xf.aTypedArray,up=xf.exportTypedArrayMethod,fp=m([].join);up("join",(function(e){return fp(dp(this),e)}));var hp=Math.min,pp=[].lastIndexOf,lp=!!pp&&1/[1].lastIndexOf(1,-0)<0,gp=Nn("lastIndexOf"),bp=lp||!gp?function(e){if(lp)return fn(pp,this,arguments)||0;var t=S(this),r=pt(t),n=r-1;for(arguments.length>1&&(n=hp(n,st(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:pp,vp=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return fn(bp,vp(this),t>1?[e,arguments[1]]:[e])}));var Ip=Sr.map,xp=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("map",(function(e){return Ip(xp(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Nh(e))(t)}))}));var kp=TypeError,mp=function(e){return function(t,r,n,i){Y(r);var a=ne(t),o=E(a),s=pt(a),c=e?s-1:0,d=e?-1:1;if(n<2)for(;;){if(c in o){i=o[c],c+=d;break}if(c+=d,e?c<0:s<=c)throw kp("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=d)c in o&&(i=r(i,o[c],c,a));return i}},wp={left:mp(!1),right:mp(!0)},yp=wp.left,Cp=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return yp(Cp(this),e,t,t>1?arguments[1]:void 0)}));var zp=wp.right,Op=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return zp(Op(this),e,t,t>1?arguments[1]:void 0)}));var Ep=xf.aTypedArray,qp=xf.exportTypedArrayMethod,Pp=Math.floor;qp("reverse",(function(){for(var e,t=Ep(this).length,r=Pp(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this}));var Sp=s.RangeError,jp=s.Int8Array,Tp=jp&&jp.prototype,Mp=Tp&&Tp.set,Rp=xf.aTypedArray,Ap=xf.exportTypedArrayMethod,Up=!c((function(){var e=new Uint8ClampedArray(2);return h(Mp,e,{length:1,0:3},1),3!==e[1]})),Bp=Up&&xf.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new jp(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));Ap("set",(function(e){Rp(this);var t=xh(arguments.length>1?arguments[1]:void 0,1),r=ne(e);if(Up)return h(Mp,this,r,t);var n=this.length,i=pt(r),a=0;if(i+t>n)throw Sp("Wrong length");for(;a<i;)this[t+a]=r[a++]}),!Up||Bp);var Np=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("slice",(function(e,t){for(var r=hn(Np(this),e,t),n=Nh(this),i=0,a=r.length,o=new n(a);a>i;)o[i]=r[i++];return o}),c((function(){new Int8Array(1).slice()})));var _p=Sr.some,Lp=xf.aTypedArray;(0,xf.exportTypedArrayMethod)("some",(function(e){return _p(Lp(this),e,arguments.length>1?arguments[1]:void 0)}));var Dp=xf.aTypedArray,Jp=xf.exportTypedArrayMethod,Fp=s.Uint16Array,Gp=Fp&&m(Fp.prototype.sort),Hp=!(!Gp||c((function(){Gp(new Fp(2),null)}))&&c((function(){Gp(new Fp(2),{})}))),Vp=!!Gp&&!c((function(){if(D)return D<74;if(Pu)return Pu<67;if(Su)return!0;if(Tu)return Tu<602;var e,t,r=new Fp(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(Gp(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));Jp("sort",(function(e){return void 0!==e&&Y(e),Vp?Gp(this,e):Ba(Dp(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!Vp||Hp);var Wp=s.Int8Array,$p=xf.aTypedArray,Yp=xf.exportTypedArrayMethod,Kp=[].toLocaleString,Qp=!!Wp&&c((function(){Kp.call(new Wp(1))}));Yp("toLocaleString",(function(){return fn(Kp,Qp?hn($p(this)):$p(this),hn(arguments))}),c((function(){return[1,2].toLocaleString()!=new Wp([1,2]).toLocaleString()}))||!c((function(){Wp.prototype.toLocaleString.call([1,2])})));var Xp=xf.exportTypedArrayMethod,Zp=s.Uint8Array,el=Zp&&Zp.prototype||{},tl=[].toString,rl=m([].join);c((function(){tl.call({})}))&&(tl=function(){return rl(this)});var nl=el.toString!=tl;Xp("toString",tl,nl);var il,al,ol,sl,cl="process"==C(s.process),dl=/(?:ipad|iphone|ipod).*applewebkit/i.test(U),ul=s.setImmediate,fl=s.clearImmediate,hl=s.process,pl=s.Dispatch,ll=s.Function,gl=s.MessageChannel,bl=s.String,vl=0,Il={};try{il=s.location}catch(e){}var xl=function(e){if(ae(Il,e)){var t=Il[e];delete Il[e],t()}},kl=function(e){return function(){xl(e)}},ml=function(e){xl(e.data)},wl=function(e){s.postMessage(bl(e),il.protocol+"//"+il.host)};ul&&fl||(ul=function(e){Ta(arguments.length,1);var t=j(e)?e:ll(e),r=hn(arguments,1);return Il[++vl]=function(){fn(t,void 0,r)},al(vl),vl},fl=function(e){delete Il[e]},cl?al=function(e){hl.nextTick(kl(e))}:pl&&pl.now?al=function(e){pl.now(kl(e))}:gl&&!dl?(sl=(ol=new gl).port2,ol.port1.onmessage=ml,al=lr(sl.postMessage,sl)):s.addEventListener&&j(s.postMessage)&&!s.importScripts&&il&&"file:"!==il.protocol&&!c(wl)?(al=wl,s.addEventListener("message",ml,!1)):al="onreadystatechange"in me("script")?function(e){Wt.appendChild(me("script")).onreadystatechange=function(){Wt.removeChild(this),xl(e)}}:function(e){setTimeout(kl(e),0)});var yl,Cl,zl,Ol,El,ql,Pl,Sl,jl={set:ul,clear:fl},Tl=/ipad|iphone|ipod/i.test(U)&&void 0!==s.Pebble,Ml=/web0s(?!.*chrome)/i.test(U),Rl=Ce.f,Al=jl.set,Ul=s.MutationObserver||s.WebKitMutationObserver,Bl=s.document,Nl=s.process,_l=s.Promise,Ll=Rl(s,"queueMicrotask"),Dl=Ll&&Ll.value;Dl||(yl=function(){var e,t;for(cl&&(e=Nl.domain)&&e.exit();Cl;){t=Cl.fn,Cl=Cl.next;try{t()}catch(e){throw Cl?Ol():zl=void 0,e}}zl=void 0,e&&e.enter()},dl||cl||Ml||!Ul||!Bl?!Tl&&_l&&_l.resolve?((Pl=_l.resolve(void 0)).constructor=_l,Sl=lr(Pl.then,Pl),Ol=function(){Sl(yl)}):cl?Ol=function(){Nl.nextTick(yl)}:(Al=lr(Al,s),Ol=function(){Al(yl)}):(El=!0,ql=Bl.createTextNode(""),new Ul(yl).observe(ql,{characterData:!0}),Ol=function(){ql.data=El=!El}));var Jl=Dl||function(e){var t={fn:e,next:void 0};zl&&(zl.next=t),Cl||(Cl=t,Ol()),zl=t},Fl=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Gl=function(){this.head=null,this.tail=null};Gl.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Hl=Gl,Vl=s.Promise,Wl="object"==typeof window&&"object"!=typeof Deno;Vl&&Vl.prototype;var $l,Yl,Kl,Ql=le("species"),Xl=!1,Zl=j(s.PromiseRejectionEvent),eg={CONSTRUCTOR:Tt("Promise",(function(){var e=Je(Vl),t=e!==String(Vl);if(!t&&66===D)return!0;if(D>=51&&/native code/.test(e))return!1;var r=new Vl((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[Ql]=n,!(Xl=r.then((function(){}))instanceof n)||!t&&Wl&&!Zl})),REJECTION_EVENT:Zl,SUBCLASSING:Xl},tg=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=Y(t),this.reject=Y(r)},rg={f:function(e){return new tg(e)}},ng=jl.set,ig=eg.CONSTRUCTOR,ag=eg.REJECTION_EVENT,og=eg.SUBCLASSING,sg=tt.getterFor("Promise"),cg=tt.set,dg=Vl&&Vl.prototype,ug=Vl,fg=dg,hg=s.TypeError,pg=s.document,lg=s.process,gg=rg.f,bg=gg,vg=!!(pg&&pg.createEvent&&s.dispatchEvent),Ig=function(e){var t;return!(!T(e)||!j(t=e.then))&&t},xg=function(e,t){var r,n,i,a=t.value,o=1==t.state,s=o?e.ok:e.fail,c=e.resolve,d=e.reject,u=e.domain;try{s?(o||(2===t.rejection&&Cg(t),t.rejection=1),!0===s?r=a:(u&&u.enter(),r=s(a),u&&(u.exit(),i=!0)),r===e.promise?d(hg("Promise-chain cycle")):(n=Ig(r))?h(n,r,c,d):c(r)):d(a)}catch(e){u&&!i&&u.exit(),d(e)}},kg=function(e,t){e.notified||(e.notified=!0,Jl((function(){for(var r,n=e.reactions;r=n.get();)xg(r,e);e.notified=!1,t&&!e.rejection&&wg(e)})))},mg=function(e,t,r){var n,i;vg?((n=pg.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),s.dispatchEvent(n)):n={promise:t,reason:r},!ag&&(i=s["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=s.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},wg=function(e){h(ng,s,(function(){var t,r=e.facade,n=e.value;if(yg(e)&&(t=Fl((function(){cl?lg.emit("unhandledRejection",n,r):mg("unhandledrejection",r,n)})),e.rejection=cl||yg(e)?2:1,t.error))throw t.value}))},yg=function(e){return 1!==e.rejection&&!e.parent},Cg=function(e){h(ng,s,(function(){var t=e.facade;cl?lg.emit("rejectionHandled",t):mg("rejectionhandled",t,e.value)}))},zg=function(e,t,r){return function(n){e(t,n,r)}},Og=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,kg(e,!0))},Eg=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw hg("Promise can't be resolved itself");var n=Ig(t);n?Jl((function(){var r={done:!1};try{h(n,t,zg(Eg,r,e),zg(Og,r,e))}catch(t){Og(r,t,e)}})):(e.value=t,e.state=1,kg(e,!1))}catch(t){Og({done:!1},t,e)}}};if(ig&&(fg=(ug=function(e){Oa(this,fg),Y(e),h($l,this);var t=sg(this);try{e(zg(Eg,t),zg(Og,t))}catch(e){Og(t,e)}}).prototype,($l=function(e){cg(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Hl,rejection:!1,state:0,value:void 0})}).prototype=nt(fg,"then",(function(e,t){var r=sg(this),n=gg(Ah(this,ug));return r.parent=!0,n.ok=!j(e)||e,n.fail=j(t)&&t,n.domain=cl?lg.domain:void 0,0==r.state?r.reactions.add(n):Jl((function(){xg(n,r)})),n.promise})),Yl=function(){var e=new $l,t=sg(e);this.promise=e,this.resolve=zg(Eg,t),this.reject=zg(Og,t)},rg.f=gg=function(e){return e===ug||void 0===e?new Yl(e):bg(e)},j(Vl)&&dg!==Object.prototype)){Kl=dg.then,og||nt(dg,"then",(function(e,t){var r=this;return new ug((function(e,t){h(Kl,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete dg.constructor}catch(e){}Ki&&Ki(dg,fg)}Rt({global:!0,constructor:!0,wrap:!0,forced:ig},{Promise:ug}),hr(ug,"Promise",!1),yh("Promise");var qg=TypeError,Pg=function(e,t){this.stopped=e,this.result=t},Sg=Pg.prototype,jg=function(e,t,r){var n,i,a,o,s,c,d,u=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),l=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),b=lr(t,u),v=function(e){return n&&cc(n,"normal",e),new Pg(!0,e)},I=function(e){return f?(qe(e),g?b(e[0],e[1],v):b(e[0],e[1])):g?b(e,v):b(e)};if(p)n=e.iterator;else if(l)n=e;else{if(!(i=qa(e)))throw qg(W(e)+" is not iterable");if(hc(i)){for(a=0,o=pt(e);o>a;a++)if((s=I(e[a]))&&A(Sg,s))return s;return new Pg(!1)}n=Sa(e,i)}for(c=p?e.next:n.next;!(d=h(c,n)).done;){try{s=I(d.value)}catch(e){cc(n,"throw",e)}if("object"==typeof s&&s&&A(Sg,s))return s}return new Pg(!1)},Tg=eg.CONSTRUCTOR||!Qu((function(e){Vl.all(e).then(void 0,(function(){}))}));Rt({target:"Promise",stat:!0,forced:Tg},{all:function(e){var t=this,r=rg.f(t),n=r.resolve,i=r.reject,a=Fl((function(){var r=Y(t.resolve),a=[],o=0,s=1;jg(e,(function(e){var c=o++,d=!1;s++,h(r,t,e).then((function(e){d||(d=!0,a[c]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise}});var Mg=eg.CONSTRUCTOR,Rg=Vl&&Vl.prototype;if(Rt({target:"Promise",proto:!0,forced:Mg,real:!0},{catch:function(e){return this.then(void 0,e)}}),j(Vl)){var Ag=R("Promise").prototype.catch;Rg.catch!==Ag&&nt(Rg,"catch",Ag,{unsafe:!0})}Rt({target:"Promise",stat:!0,forced:Tg},{race:function(e){var t=this,r=rg.f(t),n=r.reject,i=Fl((function(){var i=Y(t.resolve);jg(e,(function(e){h(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),Rt({target:"Promise",stat:!0,forced:eg.CONSTRUCTOR},{reject:function(e){var t=rg.f(this);return h(t.reject,void 0,e),t.promise}});var Ug=eg.CONSTRUCTOR;function Bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ng(e){return function(e){if(Array.isArray(e))return Bg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Bg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bg(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_g(Object(r),!0).forEach((function(t){ri(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}R("Promise"),Rt({target:"Promise",stat:!0,forced:Ug},{resolve:function(e){return function(e,t){if(qe(e),T(t)&&t.constructor===e)return t;var r=rg.f(e);return(0,r.resolve)(t),r.promise}(this,e)}}),Rt({target:"Object",stat:!0},{fromEntries:function(e){var t={};return jg(e,(function(e,r){er(t,e,r)}),{AS_ENTRIES:!0}),t}});var Dg=So?btoa:function(e){return Buffer.from(e).toString("base64")},Jg=function(e){var t,r,n=new URL(e),i=new URLSearchParams(n.search),a=null!==(t=i.get("usid"))&&void 0!==t?t:"";return{code:null!==(r=i.get("code"))&&void 0!==r?r:"",usid:a}},Fg=function(){return t.nanoid(128)},Gg=function(){var e=Xn(qi.mark((function e(t){var r,n,i,a,o,s,c;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},n="",!So||!window.crypto){e.next=12;break}return i=new TextEncoder,a=i.encode(t),e.next=7,window.crypto.subtle.digest("SHA-256",a);case 7:o=e.sent,s=btoa(String.fromCharCode.apply(String,Ng(new Uint8Array(o)))),n=r(s),e.next=16;break;case 12:return e.next=14,import("crypto");case 14:c=e.sent,n=r(c.default.createHash("sha256").update(t).digest("base64"));case 16:if(0!==n.length){e.next=18;break}throw new Error("Problem generating code challenge");case 18:return e.abrupt("return",n);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Hg(e,t,r){return Vg.apply(this,arguments)}function Vg(){return(Vg=Xn(qi.mark((function e(t,r,n){var i,a,o,s,c,d,u,f;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Gg(r);case 2:return a=e.sent,(o=new bu(t.clientConfig)).clientConfig.fetchOptions=Lg(Lg({},t.clientConfig.fetchOptions),{},{redirect:So?"follow":"manual"}),s={parameters:Lg(Lg({client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code_challenge:a},n.hint&&{hint:n.hint}),{},{organizationId:t.clientConfig.parameters.organizationId,redirect_uri:n.redirectURI,response_type:"code"},n.usid&&{usid:n.usid})},e.next=8,o.authorizeCustomer(s,!0);case 8:if(c=e.sent,d=(null===(i=c.headers)||void 0===i?void 0:i.get("location"))||c.url,u=new URL(d),f=Object.fromEntries(u.searchParams.entries()),!(c.status>=400||f.error)){e.next=14;break}throw new hs(c);case 14:return e.abrupt("return",Lg({url:d},Jg(d)));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wg(){return(Wg=Xn(qi.mark((function e(t,r){var n,i,a;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Fg(),e.next=3,Hg(t,n,Lg({redirectURI:r.redirectURI,hint:"guest"},r.usid&&{usid:r.usid}));case 3:return i=e.sent,a={client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code:i.code,code_verifier:n,grant_type:"authorization_code_pkce",redirect_uri:r.redirectURI,usid:i.usid},e.abrupt("return",t.getAccessToken({body:a}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $g(){return($g=Xn(qi.mark((function e(t,r,n){var i,a,o,s,c,d,u,f,h,p,l,g;return qi.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Fg(),e.next=3,Gg(a);case 3:return o=e.sent,(s=new bu(t.clientConfig)).clientConfig.fetchOptions=Lg(Lg({},t.clientConfig.fetchOptions),{},{redirect:So?"follow":"manual"}),c="Basic ".concat(Dg("".concat(r.username,":").concat(r.password))),d={headers:{Authorization:c},parameters:{organizationId:t.clientConfig.parameters.organizationId},body:Lg({redirect_uri:n.redirectURI,client_id:t.clientConfig.parameters.clientId,code_challenge:o,channel_id:t.clientConfig.parameters.siteId},n.usid&&{usid:n.usid})},e.next=10,s.authenticateCustomer(d,!0);case 10:if(u=e.sent,f=(null===(i=u.headers)||void 0===i?void 0:i.get("location"))||u.url,h=new URL(f),p=Object.fromEntries(h.searchParams.entries()),!(u.status>=400||p.error)){e.next=16;break}throw new hs(u);case 16:return l=Jg(f),g={client_id:t.clientConfig.parameters.clientId,channel_id:t.clientConfig.parameters.siteId,code:l.code,code_verifier:a,grant_type:"authorization_code_pkce",organizationId:t.clientConfig.parameters.organizationId,redirect_uri:n.redirectURI,usid:l.usid},e.abrupt("return",t.getAccessToken({body:g}));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Yg=Object.freeze({__proto__:null,isBrowser:So,isNode:jo,globalObject:To,hasFetchAvailable:Mo,fetch:Ro,stringToBase64:Dg,getCodeAndUsidFromUrl:Jg,createCodeVerifier:Fg,generateCodeChallenge:Gg,authorize:Hg,loginGuestUser:function(e,t){return Wg.apply(this,arguments)},loginRegisteredUserB2C:function(e,t,r){return $g.apply(this,arguments)},refreshAccessToken:function(e,t){var r={grant_type:"refresh_token",refresh_token:t.refreshToken,client_id:e.clientConfig.parameters.clientId,channel_id:e.clientConfig.parameters.siteId};return e.getAccessToken({body:r})},logout:function(e,t){return e.logoutCustomer({headers:{Authorization:"Bearer ".concat(t.accessToken)},parameters:{refresh_token:t.refreshToken,client_id:e.clientConfig.parameters.clientId,channel_id:e.clientConfig.parameters.siteId}})}});e.ClientConfig=qo,e.ShopperBaskets=Xd,e.ShopperContexts=tu,e.ShopperCustomers=iu,e.ShopperDiscoverySearch=su,e.ShopperExperience=uu,e.ShopperGiftCertificates=pu,e.ShopperLogin=bu,e.ShopperOrders=xu,e.ShopperProducts=wu,e.ShopperPromotions=zu,e.ShopperSearch=Ju,e.TemplateURL=$d,e.helpers=Yg,Object.defineProperty(e,"__esModule",{value:!0})}));