UNPKG

@selldone/sdk-storefront

Version:

A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.

1 lines 190 kB
var storefront=function(e){"use strict";function t(){const e=window.GAPI.GET_COUNTRIES();return this.getNow(e)}function o(e,t){return function(){return e.apply(t,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:a}=Object,n=(s=Object.create(null),e=>{const t=r.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const i=e=>(e=e.toLowerCase(),t=>n(t)===e),l=e=>t=>typeof t===e,{isArray:c}=Array,u=l("undefined");const d=i("ArrayBuffer");const _=l("string"),f=l("function"),p=l("number"),g=e=>null!==e&&"object"==typeof e,h=e=>{if("object"!==n(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=i("Date"),y=i("File"),b=i("Blob"),S=i("FileList"),E=i("URLSearchParams"),[T,A,O,R]=["ReadableStream","Request","Response","Headers"].map(i);function w(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let r,a;if("object"!=typeof e&&(e=[e]),c(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{const a=o?Object.getOwnPropertyNames(e):Object.keys(e),n=a.length;let s;for(r=0;r<n;r++)s=a[r],t.call(null,e[s],s,e)}}function P(e,t){t=t.toLowerCase();const o=Object.keys(e);let r,a=o.length;for(;a-- >0;)if(r=o[a],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,I=e=>!u(e)&&e!==C;const $=(v="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>v&&e instanceof v);var v;const D=i("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),G=i("RegExp"),M=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};w(o,((o,a)=>{let n;!1!==(n=t(o,a,e))&&(r[a]=n||o)})),Object.defineProperties(e,r)};const L=i("AsyncFunction"),k=(U="function"==typeof setImmediate,x=f(C.postMessage),U?setImmediate:x?(B=`axios@${Math.random()}`,F=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===B&&F.length&&F.shift()()}),!1),e=>{F.push(e),C.postMessage(B,"*")}):e=>setTimeout(e));var U,x,B,F;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||k;var V={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=n(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:_,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:h,isReadableStream:T,isRequest:A,isResponse:O,isHeaders:R,isUndefined:u,isDate:m,isFile:y,isBlob:b,isRegExp:G,isFunction:f,isStream:e=>g(e)&&f(e.pipe),isURLSearchParams:E,isTypedArray:$,isFileList:S,forEach:w,merge:function e(){const{caseless:t}=I(this)&&this||{},o={},r=(r,a)=>{const n=t&&P(o,a)||a;h(o[n])&&h(r)?o[n]=e(o[n],r):h(r)?o[n]=e({},r):c(r)?o[n]=r.slice():o[n]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&w(arguments[e],r);return o},extend:(e,t,r,{allOwnKeys:a}={})=>(w(t,((t,a)=>{r&&f(t)?e[a]=o(t,r):e[a]=t}),{allOwnKeys:a}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,r)=>{let n,s,i;const l={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],r&&!r(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==o&&a(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:n,kindOfTest:i,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return-1!==r&&r===o},toArray:e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!p(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=o.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const r=[];for(;null!==(o=e.exec(t));)r.push(o);return r},isHTMLForm:D,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:M,freezeMethods:e=>{M(e,((t,o)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=e[o];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(e,t)=>{const o={},r=e=>{e.forEach((e=>{o[e]=!0}))};return c(e)?r(e):r(String(e).split(t)),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,o){return t.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:C,isContextDefined:I,isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),o=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const a=c(e)?[]:{};return w(e,((e,t)=>{const n=o(e,r+1);!u(n)&&(a[t]=n)})),t[r]=void 0,a}}return e};return o(e,0)},isAsyncFn:L,isThenable:e=>e&&(g(e)||f(e))&&f(e.then)&&f(e.catch),setImmediate:k,asap:H};function K(e,t,o,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),o&&(this.config=o),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}V.inherits(K,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const W=K.prototype,Y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Y[e]={value:e}})),Object.defineProperties(K,Y),Object.defineProperty(W,"isAxiosError",{value:!0}),K.from=(e,t,o,r,a,n)=>{const s=Object.create(W);return V.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),K.call(s,e.message,t,o,r,a),s.cause=e,s.name=e.name,n&&Object.assign(s,n),s};function j(e){return V.isPlainObject(e)||V.isArray(e)}function X(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,o){return e?e.concat(t).map((function(e,t){return e=X(e),!o&&t?"["+e+"]":e})).join(o?".":""):t}const z=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Z(e,t,o){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(o=V.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,a=o.visitor||c,n=o.dots,s=o.indexes,i=(o.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(!i&&V.isBlob(e))throw new K("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,o,a){let i=e;if(e&&!a&&"object"==typeof e)if(V.endsWith(o,"{}"))o=r?o:o.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(j)}(e)||(V.isFileList(e)||V.endsWith(o,"[]"))&&(i=V.toArray(e)))return o=X(o),i.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?q([o],r,n):null===s?o:o+"[]",l(e))})),!1;return!!j(e)||(t.append(q(a,o,n),l(e)),!1)}const u=[],d=Object.assign(z,{defaultVisitor:c,convertValue:l,isVisitable:j});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(o,r){if(!V.isUndefined(o)){if(-1!==u.indexOf(o))throw Error("Circular reference detected in "+r.join("."));u.push(o),V.forEach(o,(function(o,n){!0===(!(V.isUndefined(o)||null===o)&&a.call(t,o,V.isString(n)?n.trim():n,r,d))&&e(o,r?r.concat(n):[n])})),u.pop()}}(e),t}function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Q(e,t){this._pairs=[],e&&Z(e,this,t)}const ee=Q.prototype;function te(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function oe(e,t,o){if(!t)return e;const r=o&&o.encode||te;V.isFunction(o)&&(o={serialize:o});const a=o&&o.serialize;let n;if(n=a?a(t,o):V.isURLSearchParams(t)?t.toString():new Q(t,o).toString(r),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}ee.append=function(e,t){this._pairs.push([e,t])},ee.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class re{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var ae={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ne={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const se="undefined"!=typeof window&&"undefined"!=typeof document,ie="object"==typeof navigator&&navigator||void 0,le=se&&(!ie||["ReactNative","NativeScript","NS"].indexOf(ie.product)<0),ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ue=se&&window.location.href||"http://localhost";var de={...Object.freeze({__proto__:null,hasBrowserEnv:se,hasStandardBrowserEnv:le,hasStandardBrowserWebWorkerEnv:ce,navigator:ie,origin:ue}),...ne};function _e(e){function t(e,o,r,a){let n=e[a++];if("__proto__"===n)return!0;const s=Number.isFinite(+n),i=a>=e.length;if(n=!n&&V.isArray(r)?r.length:n,i)return V.hasOwnProp(r,n)?r[n]=[r[n],o]:r[n]=o,!s;r[n]&&V.isObject(r[n])||(r[n]=[]);return t(e,o,r[n],a)&&V.isArray(r[n])&&(r[n]=function(e){const t={},o=Object.keys(e);let r;const a=o.length;let n;for(r=0;r<a;r++)n=o[r],t[n]=e[n];return t}(r[n])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const o={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,o,0)})),o}return null}const fe={transitional:ae,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const o=t.getContentType()||"",r=o.indexOf("application/json")>-1,a=V.isObject(e);a&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(_e(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(a){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Z(e,new de.classes.URLSearchParams,Object.assign({visitor:function(e,t,o,r){return de.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=V.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Z(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,o){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(o||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||fe.transitional,o=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(o&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw K.from(e,K.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{fe.headers[e]={}}));const pe=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ge=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:V.isArray(e)?e.map(me):String(e)}function ye(e,t,o,r,a){return V.isFunction(r)?r.call(this,t,o):(a&&(t=o),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}let be=class{constructor(e){e&&this.set(e)}set(e,t,o){const r=this;function a(e,t,o){const a=he(t);if(!a)throw new Error("header name must be a non-empty string");const n=V.findKey(r,a);(!n||void 0===r[n]||!0===o||void 0===o&&!1!==r[n])&&(r[n||t]=me(e))}const n=(e,t)=>V.forEach(e,((e,o)=>a(e,o,t)));if(V.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))n((e=>{const t={};let o,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),o=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!o||t[o]&&pe[o]||("set-cookie"===o?t[o]?t[o].push(r):t[o]=[r]:t[o]=t[o]?t[o]+", "+r:r)})),t})(e),t);else if(V.isHeaders(e))for(const[t,r]of e.entries())a(r,t,o);else null!=e&&a(t,e,o);return this}get(e,t){if(e=he(e)){const o=V.findKey(this,e);if(o){const e=this[o];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,o);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=he(e)){const o=V.findKey(this,e);return!(!o||void 0===this[o]||t&&!ye(0,this[o],o,t))}return!1}delete(e,t){const o=this;let r=!1;function a(e){if(e=he(e)){const a=V.findKey(o,e);!a||t&&!ye(0,o[a],a,t)||(delete o[a],r=!0)}}return V.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let o=t.length,r=!1;for(;o--;){const a=t[o];e&&!ye(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,o={};return V.forEach(this,((r,a)=>{const n=V.findKey(o,a);if(n)return t[n]=me(r),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,o)=>t.toUpperCase()+o))}(a):String(a).trim();s!==a&&delete t[a],t[s]=me(r),o[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((o,r)=>{null!=o&&!1!==o&&(t[r]=e&&V.isArray(o)?o.join(", "):o)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const o=new this(e);return t.forEach((e=>o.set(e))),o}static accessor(e){const t=(this[ge]=this[ge]={accessors:{}}).accessors,o=this.prototype;function r(e){const r=he(e);t[r]||(!function(e,t){const o=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+o,{value:function(e,o,a){return this[r].call(this,t,e,o,a)},configurable:!0})}))}(o,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}};function Se(e,t){const o=this||fe,r=t||o,a=be.from(r.headers);let n=r.data;return V.forEach(e,(function(e){n=e.call(o,n,a.normalize(),t?t.status:void 0)})),a.normalize(),n}function Ee(e){return!(!e||!e.__CANCEL__)}function Te(e,t,o){K.call(this,null==e?"canceled":e,K.ERR_CANCELED,t,o),this.name="CanceledError"}function Ae(e,t,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?t(new K("Request failed with status code "+o.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}be.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(be.prototype,(({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}})),V.freezeMethods(be),V.inherits(Te,K,{__CANCEL__:!0});const Oe=(e,t,o=3)=>{let r=0;const a=function(e,t){e=e||10;const o=new Array(e),r=new Array(e);let a,n=0,s=0;return t=void 0!==t?t:1e3,function(i){const l=Date.now(),c=r[s];a||(a=l),o[n]=i,r[n]=l;let u=s,d=0;for(;u!==n;)d+=o[u++],u%=e;if(n=(n+1)%e,n===s&&(s=(s+1)%e),l-a<t)return;const _=c&&l-c;return _?Math.round(1e3*d/_):void 0}}(50,250);return function(e,t){let o,r,a=0,n=1e3/t;const s=(t,n=Date.now())=>{a=n,o=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),i=t-a;i>=n?s(e,t):(o=e,r||(r=setTimeout((()=>{r=null,s(o)}),n-i)))},()=>o&&s(o)]}((o=>{const n=o.loaded,s=o.lengthComputable?o.total:void 0,i=n-r,l=a(i);r=n;e({loaded:n,total:s,progress:s?n/s:void 0,bytes:i,rate:l||void 0,estimated:l&&s&&n<=s?(s-n)/l:void 0,event:o,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),o)},Re=(e,t)=>{const o=null!=e;return[r=>t[0]({lengthComputable:o,total:e,loaded:r}),t[1]]},we=e=>(...t)=>V.asap((()=>e(...t)));var Pe=de.hasStandardBrowserEnv?((e,t)=>o=>(o=new URL(o,de.origin),e.protocol===o.protocol&&e.host===o.host&&(t||e.port===o.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,Ce=de.hasStandardBrowserEnv?{write(e,t,o,r,a,n){const s=[e+"="+encodeURIComponent(t)];V.isNumber(o)&&s.push("expires="+new Date(o).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(a)&&s.push("domain="+a),!0===n&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ie(e,t,o){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&r||0==o?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const $e=e=>e instanceof be?{...e}:e;function ve(e,t){t=t||{};const o={};function r(e,t,o,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function a(e,t,o,a){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function n(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(o,a,n){return n in t?r(o,a):n in e?r(void 0,o):void 0}const l={url:n,method:n,data:n,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:i,headers:(e,t,o)=>a($e(e),$e(t),0,!0)};return V.forEach(Object.keys(Object.assign({},e,t)),(function(r){const n=l[r]||a,s=n(e[r],t[r],r);V.isUndefined(s)&&n!==i||(o[r]=s)})),o}var De=e=>{const t=ve({},e);let o,{data:r,withXSRFToken:a,xsrfHeaderName:n,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=be.from(i),t.url=oe(Ie(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),V.isFormData(r))if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}if(de.hasStandardBrowserEnv&&(a&&V.isFunction(a)&&(a=a(t)),a||!1!==a&&Pe(t.url))){const e=n&&s&&Ce.read(s);e&&i.set(n,e)}return t};var Ne="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,o){const r=De(e);let a=r.data;const n=be.from(r.headers).normalize();let s,i,l,c,u,{responseType:d,onUploadProgress:_,onDownloadProgress:f}=r;function p(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function h(){if(!g)return;const r=be.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Ae((function(e){t(e),p()}),(function(e){o(e),p()}),{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=h:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(h)},g.onabort=function(){g&&(o(new K("Request aborted",K.ECONNABORTED,e,g)),g=null)},g.onerror=function(){o(new K("Network Error",K.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||ae;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),o(new K(t,a.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,e,g)),g=null},void 0===a&&n.setContentType(null),"setRequestHeader"in g&&V.forEach(n.toJSON(),(function(e,t){g.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),f&&([l,u]=Oe(f,!0),g.addEventListener("progress",l)),_&&g.upload&&([i,c]=Oe(_),g.upload.addEventListener("progress",i),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(o(!t||t.type?new Te(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===de.protocols.indexOf(m)?o(new K("Unsupported protocol "+m+":",K.ERR_BAD_REQUEST,e)):g.send(a||null)}))};const Ge=(e,t)=>{const{length:o}=e=e?e.filter(Boolean):[];if(t||o){let o,r=new AbortController;const a=function(e){if(!o){o=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof K?t:new Te(t instanceof Error?t.message:t))}};let n=t&&setTimeout((()=>{n=null,a(new K(`timeout ${t} of ms exceeded`,K.ETIMEDOUT))}),t);const s=()=>{e&&(n&&clearTimeout(n),n=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:i}=r;return i.unsubscribe=()=>V.asap(s),i}},Me=function*(e,t){let o=e.byteLength;if(o<t)return void(yield e);let r,a=0;for(;a<o;)r=a+t,yield e.slice(a,r),a=r},Le=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},ke=(e,t,o,r)=>{const a=async function*(e,t){for await(const o of Le(e))yield*Me(o,t)}(e,t);let n,s=0,i=e=>{n||(n=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return i(),void e.close();let n=r.byteLength;if(o){let e=s+=n;o(e)}e.enqueue(new Uint8Array(r))}catch(e){throw i(e),e}},cancel:e=>(i(e),a.return())},{highWaterMark:2})},Ue="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,xe=Ue&&"function"==typeof ReadableStream,Be=Ue&&("function"==typeof TextEncoder?(Fe=new TextEncoder,e=>Fe.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Fe;const He=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ve=xe&&He((()=>{let e=!1;const t=new Request(de.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Ke=xe&&He((()=>V.isReadableStream(new Response("").body))),We={stream:Ke&&(e=>e.body)};var Ye;Ue&&(Ye=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!We[e]&&(We[e]=V.isFunction(Ye[e])?t=>t[e]():(t,o)=>{throw new K(`Response type '${e}' is not supported`,K.ERR_NOT_SUPPORT,o)})})));const je=async(e,t)=>{const o=V.toFiniteNumber(e.getContentLength());return null==o?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new Request(de.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await Be(e)).byteLength:void 0)})(t):o};const Xe={http:null,xhr:Ne,fetch:Ue&&(async e=>{let{url:t,method:o,data:r,signal:a,cancelToken:n,timeout:s,onDownloadProgress:i,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:_}=De(e);c=c?(c+"").toLowerCase():"text";let f,p=Ge([a,n&&n.toAbortSignal()],s);const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let h;try{if(l&&Ve&&"get"!==o&&"head"!==o&&0!==(h=await je(u,r))){let e,o=new Request(t,{method:"POST",body:r,duplex:"half"});if(V.isFormData(r)&&(e=o.headers.get("content-type"))&&u.setContentType(e),o.body){const[e,t]=Re(h,Oe(we(l)));r=ke(o.body,65536,e,t)}}V.isString(d)||(d=d?"include":"omit");const a="credentials"in Request.prototype;f=new Request(t,{..._,signal:p,method:o.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:a?d:void 0});let n=await fetch(f);const s=Ke&&("stream"===c||"response"===c);if(Ke&&(i||s&&g)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=n[t]}));const t=V.toFiniteNumber(n.headers.get("content-length")),[o,r]=i&&Re(t,Oe(we(i),!0))||[];n=new Response(ke(n.body,65536,o,(()=>{r&&r(),g&&g()})),e)}c=c||"text";let m=await We[V.findKey(We,c)||"text"](n,e);return!s&&g&&g(),await new Promise(((t,o)=>{Ae(t,o,{data:m,headers:be.from(n.headers),status:n.status,statusText:n.statusText,config:e,request:f})}))}catch(t){if(g&&g(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,e,f),{cause:t.cause||t});throw K.from(t,t&&t.code,e,f)}})};V.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const qe=e=>`- ${e}`,ze=e=>V.isFunction(e)||null===e||!1===e;var Ze=e=>{e=V.isArray(e)?e:[e];const{length:t}=e;let o,r;const a={};for(let n=0;n<t;n++){let t;if(o=e[n],r=o,!ze(o)&&(r=Xe[(t=String(o)).toLowerCase()],void 0===r))throw new K(`Unknown adapter '${t}'`);if(r)break;a[t||"#"+n]=r}if(!r){const e=Object.entries(a).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new K("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(qe).join("\n"):" "+qe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function Qe(e){Je(e),e.headers=be.from(e.headers),e.data=Se.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ze(e.adapter||fe.adapter)(e).then((function(t){return Je(e),t.data=Se.call(e,e.transformResponse,t),t.headers=be.from(t.headers),t}),(function(t){return Ee(t)||(Je(e),t&&t.response&&(t.response.data=Se.call(e,e.transformResponse,t.response),t.response.headers=be.from(t.response.headers))),Promise.reject(t)}))}const et="1.8.1",tt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tt[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const ot={};tt.transitional=function(e,t,o){function r(e,t){return"[Axios v1.8.1] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,a,n)=>{if(!1===e)throw new K(r(a," has been removed"+(t?" in "+t:"")),K.ERR_DEPRECATED);return t&&!ot[a]&&(ot[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,a,n)}},tt.spelling=function(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};var rt={assertOptions:function(e,t,o){if("object"!=typeof e)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const n=r[a],s=t[n];if(s){const t=e[n],o=void 0===t||s(t,n,e);if(!0!==o)throw new K("option "+n+" must be "+o,K.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new K("Unknown option "+n,K.ERR_BAD_OPTION)}},validators:tt};const at=rt.validators;let nt=class{constructor(e){this.defaults=e,this.interceptors={request:new re,response:new re}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const o=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?o&&!String(e.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+o):e.stack=o}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ve(this.defaults,t);const{transitional:o,paramsSerializer:r,headers:a}=t;void 0!==o&&rt.assertOptions(o,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:at.function,serialize:at.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:at.spelling("baseURL"),withXsrfToken:at.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=a&&V.merge(a.common,a[t.method]);a&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=be.concat(n,a);const s=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!i){const e=[Qe.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=s.length;let _=t;for(d=0;d<u;){const e=s[d++],t=s[d++];try{_=e(_)}catch(e){t.call(this,e);break}}try{c=Qe.call(this,_)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return oe(Ie((e=ve(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};V.forEach(["delete","get","head","options"],(function(e){nt.prototype[e]=function(t,o){return this.request(ve(o||{},{method:e,url:t,data:(o||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(o,r,a){return this.request(ve(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}nt.prototype[e]=t(),nt.prototype[e+"Form"]=t(!0)}));const st={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(st).forEach((([e,t])=>{st[t]=e}));const it=function e(t){const r=new nt(t),a=o(nt.prototype.request,r);return V.extend(a,nt.prototype,r,{allOwnKeys:!0}),V.extend(a,r,null,{allOwnKeys:!0}),a.create=function(o){return e(ve(t,o))},a}(fe);it.Axios=nt,it.CanceledError=Te,it.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const o=this;this.promise.then((e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{o.subscribe(e),t=e})).then(e);return r.cancel=function(){o.unsubscribe(t)},r},e((function(e,r,a){o.reason||(o.reason=new Te(e,r,a),t(o.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},it.isCancel=Ee,it.VERSION=et,it.toFormData=Z,it.AxiosError=K,it.Cancel=it.CanceledError,it.all=function(e){return Promise.all(e)},it.spread=function(e){return function(t){return e.apply(null,t)}},it.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},it.mergeConfig=ve,it.AxiosHeaders=be,it.formToJSON=e=>_e(V.isHTMLForm(e)?new FormData(e):e),it.getAdapter=Ze,it.HttpStatusCode=st,it.default=it;const{Axios:lt,AxiosError:ct,CanceledError:ut,isCancel:dt,CancelToken:_t,VERSION:ft,all:pt,Cancel:gt,isAxiosError:ht,spread:mt,toFormData:yt,AxiosHeaders:bt,HttpStatusCode:St,formToJSON:Et,getAdapter:Tt,mergeConfig:At}=it;var Ot="object"==typeof global&&global&&global.Object===Object&&global,Rt="object"==typeof self&&self&&self.Object===Object&&self,wt=Ot||Rt||Function("return this")(),Pt=wt.Symbol,Ct=Object.prototype,It=Ct.hasOwnProperty,$t=Ct.toString,vt=Pt?Pt.toStringTag:void 0;var Dt=Object.prototype.toString;var Nt="[object Null]",Gt="[object Undefined]",Mt=Pt?Pt.toStringTag:void 0;function Lt(e){return null==e?void 0===e?Gt:Nt:Mt&&Mt in Object(e)?function(e){var t=It.call(e,vt),o=e[vt];try{e[vt]=void 0;var r=!0}catch(e){}var a=$t.call(e);return r&&(t?e[vt]=o:delete e[vt]),a}(e):function(e){return Dt.call(e)}(e)}function kt(e){return null!=e&&"object"==typeof e}var Ut="[object Symbol]";var xt=Array.isArray,Bt=/\s/;var Ft=/^\s+/;function Ht(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Bt.test(e.charAt(t)););return t}(e)+1).replace(Ft,""):e}function Vt(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Kt=NaN,Wt=/^[-+]0x[0-9a-f]+$/i,Yt=/^0b[01]+$/i,jt=/^0o[0-7]+$/i,Xt=parseInt;function qt(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||kt(e)&&Lt(e)==Ut}(e))return Kt;if(Vt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var o=Yt.test(e);return o||jt.test(e)?Xt(e.slice(2),o?2:8):Wt.test(e)?Kt:+e}var zt=function(){return wt.Date.now()},Zt=Math.max,Jt=Math.min;function Qt(e,t,o){var r,a,n,s,i,l,c=0,u=!1,d=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var o=r,n=a;return r=a=void 0,c=t,s=e.apply(n,o)}function p(e){var o=e-l;return void 0===l||o>=t||o<0||d&&e-c>=n}function g(){var e=zt();if(p(e))return h(e);i=setTimeout(g,function(e){var o=t-(e-l);return d?Jt(o,n-(e-c)):o}(e))}function h(e){return i=void 0,_&&r?f(e):(r=a=void 0,s)}function m(){var e=zt(),o=p(e);if(r=arguments,a=this,l=e,o){if(void 0===i)return function(e){return c=e,i=setTimeout(g,t),u?f(e):s}(l);if(d)return clearTimeout(i),i=setTimeout(g,t),f(l)}return void 0===i&&(i=setTimeout(g,t)),s}return t=qt(t)||0,Vt(o)&&(u=!!o.leading,n=(d="maxWait"in o)?Zt(qt(o.maxWait)||0,t):n,_="trailing"in o?!!o.trailing:_),m.cancel=function(){void 0!==i&&clearTimeout(i),c=0,r=l=a=i=void 0},m.flush=function(){return void 0===i?s:h(zt())},m}class eo{static hash(e){function t(e,t){let o=e[0],i=e[1],l=e[2],u=e[3];o=r(o,i,l,u,t[0],7,-680876936),u=r(u,o,i,l,t[1],12,-389564586),l=r(l,u,o,i,t[2],17,606105819),i=r(i,l,u,o,t[3],22,-1044525330),o=r(o,i,l,u,t[4],7,-176418897),u=r(u,o,i,l,t[5],12,1200080426),l=r(l,u,o,i,t[6],17,-1473231341),i=r(i,l,u,o,t[7],22,-45705983),o=r(o,i,l,u,t[8],7,1770035416),u=r(u,o,i,l,t[9],12,-1958414417),l=r(l,u,o,i,t[10],17,-42063),i=r(i,l,u,o,t[11],22,-1990404162),o=r(o,i,l,u,t[12],7,1804603682),u=r(u,o,i,l,t[13],12,-40341101),l=r(l,u,o,i,t[14],17,-1502002290),i=r(i,l,u,o,t[15],22,1236535329),o=a(o,i,l,u,t[1],5,-165796510),u=a(u,o,i,l,t[6],9,-1069501632),l=a(l,u,o,i,t[11],14,643717713),i=a(i,l,u,o,t[0],20,-373897302),o=a(o,i,l,u,t[5],5,-701558691),u=a(u,o,i,l,t[10],9,38016083),l=a(l,u,o,i,t[15],14,-660478335),i=a(i,l,u,o,t[4],20,-405537848),o=a(o,i,l,u,t[9],5,568446438),u=a(u,o,i,l,t[14],9,-1019803690),l=a(l,u,o,i,t[3],14,-187363961),i=a(i,l,u,o,t[8],20,1163531501),o=a(o,i,l,u,t[13],5,-1444681467),u=a(u,o,i,l,t[2],9,-51403784),l=a(l,u,o,i,t[7],14,1735328473),i=a(i,l,u,o,t[12],20,-1926607734),o=n(o,i,l,u,t[5],4,-378558),u=n(u,o,i,l,t[8],11,-2022574463),l=n(l,u,o,i,t[11],16,1839030562),i=n(i,l,u,o,t[14],23,-35309556),o=n(o,i,l,u,t[1],4,-1530992060),u=n(u,o,i,l,t[4],11,1272893353),l=n(l,u,o,i,t[7],16,-155497632),i=n(i,l,u,o,t[10],23,-1094730640),o=n(o,i,l,u,t[13],4,681279174),u=n(u,o,i,l,t[0],11,-358537222),l=n(l,u,o,i,t[3],16,-722521979),i=n(i,l,u,o,t[6],23,76029189),o=n(o,i,l,u,t[9],4,-640364487),u=n(u,o,i,l,t[12],11,-421815835),l=n(l,u,o,i,t[15],16,530742520),i=n(i,l,u,o,t[2],23,-995338651),o=s(o,i,l,u,t[0],6,-198630844),u=s(u,o,i,l,t[7],10,1126891415),l=s(l,u,o,i,t[14],15,-1416354905),i=s(i,l,u,o,t[5],21,-57434055),o=s(o,i,l,u,t[12],6,1700485571),u=s(u,o,i,l,t[3],10,-1894986606),l=s(l,u,o,i,t[10],15,-1051523),i=s(i,l,u,o,t[1],21,-2054922799),o=s(o,i,l,u,t[8],6,1873313359),u=s(u,o,i,l,t[15],10,-30611744),l=s(l,u,o,i,t[6],15,-1560198380),i=s(i,l,u,o,t[13],21,1309151649),o=s(o,i,l,u,t[4],6,-145523070),u=s(u,o,i,l,t[11],10,-1120210379),l=s(l,u,o,i,t[2],15,718787259),i=s(i,l,u,o,t[9],21,-343485551),e[0]=c(o,e[0]),e[1]=c(i,e[1]),e[2]=c(l,e[2]),e[3]=c(u,e[3])}function o(e,t,o,r,a,n){return t=c(c(t,e),c(r,n)),c(t<<a|t>>>32-a,o)}function r(e,t,r,a,n,s,i){return o(t&r|~t&a,e,t,n,s,i)}function a(e,t,r,a,n,s,i){return o(t&a|r&~a,e,t,n,s,i)}function n(e,t,r,a,n,s,i){return o(t^r^a,e,t,n,s,i)}function s(e,t,r,a,n,s,i){return o(r^(t|~a),e,t,n,s,i)}function i(e){const t=[];let o;for(o=0;o<64;o+=4)t[o>>2]=e.charCodeAt(o)+(e.charCodeAt(o+1)<<8)+(e.charCodeAt(o+2)<<16)+(e.charCodeAt(o+3)<<24);return t}function l(e){let t="",o=0;for(;o<4;o++)t+=u[e>>8*o+4&15]+u[e>>8*o&15];return t}const c=function(e,t){return e+t&4294967295},u="0123456789abcdef".split("");return function(e){for(let t=0;t<e.length;t++)e[t]=l(e[t]);return e.join("")}(function(e){const o=e.length,r=[1732584193,-271733879,-1732584194,271733878];let a;for(a=64;a<=e.length;a+=64)t(r,i(e.substring(a-64,a)));e=e.substring(a-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(a=0;a<e.length;a++)n[a>>2]|=e.charCodeAt(a)<<(a%4<<3);if(n[a>>2]|=128<<(a%4<<3),a>55)for(t(r,n),a=0;a<16;a++)n[a]=0;return n[14]=8*o,t(r,n),r}(e))}}class to{cache;maxSize;constructor(e=100){this.cache=new Map,this.maxSize=e}get(e){if(!this.cache.has(e))return;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e)&&this.cache.delete(e),t&&(t.__date=new Date),this.cache.set(e,t),this.cache.size>this.maxSize){const e=this.cache.keys().next().value;void 0!==e&&this.cache.delete(e)}}clear(){this.cache.clear()}entries(){return this.cache.entries()}length(){return this.cache.size}}window.axios=it;class oo{optimizer_cache_duration;has_cancellation=!1;axiosInstance;debounceTime;constructor(e){this.axiosInstance=e?.axiosInstance||window.axios,this.debounceTime=e?.debounceTime||1e3,this.axiosInstance||console.error("⚠ The Axios instance is missing! Ensure you initialize Axios before using the Selldone® APIs interface!")}optimize(e){return this.optimizer_cache_duration=void 0===e?60:e,this}force(){return this.optimizer_cache_duration=void 0,this}cancellation(e=!0){return this.has_cancellation=e,this}getDebounce(e,t,o,r,a){const{max_valid_status_code:n=null,debounce_time:s=null}=a||{};Qt((()=>{this.axiosInstance.get(e,{params:t,validateStatus:e=>e<(n||300)}).then((e=>{const t=e.data;t.error&&r?r(t):o&&o(t)})).catch((e=>{console.error(e),r&&r(e)}))}),s||this.debounceTime)()}postNow(e,t,o){const{query:r={}}=o||{},a=t instanceof FormData;return this.axiosInstance.post(e,t,{params:r,headers:a?{"Content-Type":"multipart/form-data"}:void 0}).then((e=>{const t=e.data;if(t.error)throw t;return t})).catch((e=>{throw console.error(e),e}))}getNow(e,t={},o){const r="get:"+e+JSON.stringify(oo.CleanedQuery(t)),a=eo.hash(r);if(this.optimizer_cache_duration){const e=ro.get(a);if(e&&e?.__date){if(e.__date>new Date(Date.now()-1e3*this.optimizer_cache_duration)){console.log("🏀 Turbo","Duration:",this.optimizer_cache_duration,"s");const t=Promise.resolve(e);return t.__cache_callback_disabled=a,t}}}let n;if(this.has_cancellation){n=it.CancelToken.source(),ao.get(e)?.cancel(`Request was canceled by new request to ${e}.`),ao.set(e,n)}const s=this.axiosInstance.get(e,{params:t,cancelToken:n?.token}).then((t=>{ao.set(e,null);const o=t.data;if(o.error)throw o;return a&&void 0!==ro.get(a)?(ro.set(a,o),{...o,__cache_key:a}):o})).catch((t=>{throw ao.set(e,null),it.isCancel(t)?void console.debug("❌ Request canceled:",t.message):(console.error("❌ Other errors:",t),t)}));return s.__cache_key=a,s.__deep_cache_founder_function=o,s}putNow(e,t,o){const{query:r={}}=o||{};return this.axiosInstance.put(e,t,{params:r}).then((e=>{const t=e.data;if(t.error&&!o?.accept_error_response)throw t;return t})).catch((e=>{throw console.error(e),e}))}deleteNow(e,t={}){return this.axiosInstance.delete(e,{params:t}).then((e=>{const t=e.data;if(t.error)throw t;return t})).catch((e=>{throw console.error(e),e}))}static CleanedQuery(e){return e?Object.entries(e).filter((([e,t])=>null!=t&&""!==t)).reduce(((e,[t,o])=>({...e,[t]:o})),{}):null}}const ro=new to(100),ao=new to(100);Promise.prototype.cache=function(e){if(this.__cache_callback_disabled)return this;if(!this.__cache_key)return void console.error("⚠ Always call cache() before then()! We have no idea about the cache key now.");const t=ro.get(this.__cache_key);if(t)e(t);else if(this.__deep_cache_founder_function){const t=this.__deep_cache_founder_function(ro);t&&e(t)}return ro.set(this.__cache_key,null),this};class no extends oo{constructor(){super()}fetchCountries=t}class so{static GetMetaValue(e,t){const o=document.head.querySelector(`meta[name="${e}"]`),r=window.selldone_config&&window.selldone_config[e];return o?o.content:r||t}static PWAVersion(){return this.GetMetaValue("pwa-version")}static MainServiceUrl(e){const t=this.GetMetaValue("service-url");if(!t)throw console.error("[service-url] meta tag!"),"The service url is not defined in [service-url] meta tag!";if(e&&e!==so.DefaultLanguageCode()){const o=new URL(t),r=`${e}.${o.host}`;o.host=r;let a=o.toString();return a.endsWith("/")&&(a=a.slice(0,-1)),a}return t}static GetApiSubdomain(e){const t=this.MainServiceUrl();return t?t.replace("https://",`https://${e}.`).replace("http://",`http://${e}.`):null}static ShopsDomain(){return this.GetMetaValue("domain-shops")}static EchoServer(){return this.GetMetaValue("selldone-echo")}static EchoPort(){return this.GetMetaValue("selldone-echo-port")}static LocalServiceCountry(){return this.GetMetaValue("local-service-country")}static SelldoneIframe(){const e=this.GetMetaValue("selldone-iframe");if(!e)throw"The service url is not defined in [selldone-iframe] meta tag!";return e}static DefaultLanguageCode(){return this.GetMetaValue("default-language")}static DefaultCurrency(){return this.GetMetaValue("default-currency")}static DefaultCountry(){return this.GetMetaValue("default-country")}static Contacts(){try{const e=this.GetMetaValue("contacts","{}");if(e)return JSON.parse(e)}catch(e){}return null}static Socials(){try{const e=this.GetMetaValue("socials","{}");if(e)return JSON.parse(e)}catch(e){}return null}static FooterExtraHtml(){return window.extra_footer}static GetInitialLanguage(){return this.GetMetaValue("initial-language","en")}static ColorThemeLight(){return this.GetMetaValue("color--theme-light","#70557e")}static ColorThemeDark(){return this.GetMetaValue("color--theme-dark","#3a2c41")}static ColorThemeDeepDark(){return this.GetMetaValue("color--theme-deep-dark","#261b2d")}static ColorThemeInfo(){return this.GetMetaValue("color--theme-info","#9964e3")}static SelldoneActiveButtonColor(){return this.GetMetaValue("color--theme-active-btn","#C2185B")}static GetCampaignId(){return this.GetMetaValue("campaign_id",null)}static GetCampaignLinkId(){return this.GetMetaValue("link_id",null)}static GetAffiliateId(){return this.GetMetaValue("affiliate_id",null)}static GetEmailId(){return this.GetMetaValue("email_id",null)}static GetGDPREnable(){return this.GetMetaValue("gdpr",null)}static GetSelldoneCDN_Images(){const e=this.GetMetaValue("selldone-cdn-images",null);if(!e)throw"The images CDN is not defined in [selldone-cdn-images] meta tag!";return e}static GetSelldoneCDN_Jsons(){const e=this.GetMetaValue("selldone-cdn-jsons",null);if(!e)throw"The json CDN is not defined in [selldone-cdn-jsons] meta tag!";return e}static GetSelldoneCDNTemp_Files(){const e=this.GetMetaValue("selldone-cdn-temp-files",null);if(!e)throw"The file CDN is not defined in [selldone-cdn-temp-files] meta tag!";return e}static GetSelldoneCDN_AR(){const e=this.GetMetaValue("selldone-cdn-ar",null);if(!e)throw"The AR/3D CDN is not defined in [selldone-cdn-ar] meta tag!";return e}static GetSelldoneCDN_Videos(){const e=this.GetMetaValue("selldone-cdn-videos",null);if(!e)throw"The videos CDN is not defined in [selldone-cdn-videos] meta tag!";return e}static GetSelldoneCDN_ID(){const e=this.GetMetaValue("selldone-cdn-id",null);if(!e)throw"The ID CDN is not defined in [selldone-cdn-id] meta tag!";return e}static GetStorageDirectHost(){return this.GetMetaValue("storage-redirect-host",null)}static GetStorageDirect(){return"true"==this.GetMetaValue("storage-redirect",null)}static GetStorageDirectThumbnails(){return"true"==this.GetMetaValue("storage-redirect-thumbnails",null)}static GetOfficialBotTelegram(){return this.GetMetaValue("bot:telegram",null)}static GetLoginModes(){return this.GetMetaValue("login-modes","")?.split("|")}static AndroidApp(){return this.GetMetaValue("android-app","https://play.google.com/store/apps/details?id=com.selldone.seller&utm_source=webapp")}static IosApp(){return this.GetMetaValue("ios-app","https://apps.apple.com/us/app/selldone/id1599250815")}static GetReferrerMeta(){const e="REFERRER_URL",t="REFERRER_EXPIRY",o=(new Date).getTime();let r=localStorage.getItem(e),a=localStorage.getItem(t);if(r&&a&&o<parseInt(a))return console.log("🞧 Returning stored referrer...",r),r;let n=this.GetMetaValue("http-referer",document.referrer);const s=window.location.hostname;if(n&&new URL(n).hostname===s&&(console.log("🞧 Referrer is from the same domain, ignoring...",n),n=null),!n){const e=new URLSearchParams(window.location.search).get("utm_source");e&&(console.log("🞧 GetReferrerMeta from utm_source...",e,"document:",document),n=window.location.href)}return n&&(localStorage.setItem(e,n),localStorage.setItem(t,(o+864e5).toString()),console.log("🞧 Storing new referrer...",n)),n}static ShowSelldoneCopyright(){return"false"!==this.GetMetaValue("copyright-mark","true")}static GetTemporaryAccessKey(){return this.GetMetaValue("temp_access_key","")}static GetTwitterAccount(){return this.GetMetaValue("twitter:site","")?.replace("@","")}static MapToken(){return this.GetMetaValue("map-token","pk.eyJ1IjoicGFqdWhhYW4iLCJhIjoiY2sxaHNtbnU3MDFjcjNta2V0OTZ0d2ExYiJ9.YKRh0EP7NnhbmuSil7AvSw")}static MapStyle(){return this.GetMetaValue("map-style","mapbox://styles/mapbox/streets-v11")}static GetCaptchaKey(){return this.GetMetaValue("captcha",null)}static GetLayoutOperator(){return this.GetMetaValue("layout-operator",null)}static GetLayoutImage(){return this.GetMetaValue("layout-image",null)}static GetLayoutVersion(){return this.GetMetaValue("layout-version",null)}static GetLayoutPackage(){return this.GetMetaValue("layout-package",null)}}class io{selldone_gapi_url="";constructor(){this.selldone_gapi_url=so.GetMetaValue("selldone-gapi")}GET_TERMS(){return`${this.selldone_gapi_url}/terms`}GET_PRIVACY(){return`${this.selldone_gapi_url}/privacy`}GET_ARTICLE(e,t){return`${this.selldone_gapi_url}/articles/${e}/${t}`}GET_HOME_DATA(){return`${this.selldone_gapi_url}/home`}GET_BLOG_DIGEST(e){return`${this.selldone_gapi_url}/articles/blog/${e}/digest`}GET_HELP_DIGEST(e){return`${this.selldone_gapi_url}/articles/help/${e}/digest`}GET_