From 4773ffd7b0f46388e38b3c4f6106baf7edd7375d Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 13 Aug 2025 14:09:17 +0700 Subject: [PATCH] fix click published --- .../content.js | 10 ++++---- .../src/content.ts | 25 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/auto-listing-facebook-marketplace/auto-listing-facebook-marketplace/content.js b/auto-listing-facebook-marketplace/auto-listing-facebook-marketplace/content.js index 25d18f9..dfb5161 100644 --- a/auto-listing-facebook-marketplace/auto-listing-facebook-marketplace/content.js +++ b/auto-listing-facebook-marketplace/auto-listing-facebook-marketplace/content.js @@ -1,6 +1,6 @@ -function S(e){return new Promise(t=>setTimeout(t,e))}function Ne(e,t){return function(){return e.apply(t,arguments)}}const{toString:nt}=Object.prototype,{getPrototypeOf:fe}=Object,{iterator:G,toStringTag:ke}=Symbol,Z=(e=>t=>{const n=nt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Z(t)===e),Q=e=>t=>typeof t===e,{isArray:j}=Array,M=Q("undefined");function it(e){return e!==null&&!M(e)&&e.constructor!==null&&!M(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Be=P("ArrayBuffer");function rt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Be(e.buffer),t}const st=Q("string"),x=Q("function"),Le=Q("number"),Y=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,J=e=>{if(Z(e)!=="object")return!1;const t=fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ke in e)&&!(G in e)},at=P("Date"),dt=P("File"),ct=P("Blob"),lt=P("FileList"),ut=e=>Y(e)&&x(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=Z(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},pt=P("URLSearchParams"),[ht,vt,mt,wt]=["ReadableStream","Request","Response","Headers"].map(P),yt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function H(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),j(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ue=e=>!M(e)&&e!==F;function oe(){const{caseless:e}=Ue(this)&&this||{},t={},n=(i,r)=>{const s=e&&Fe(t,r)||r;J(t[s])&&J(i)?t[s]=oe(t[s],i):J(i)?t[s]=oe({},i):j(i)?t[s]=i.slice():t[s]=i};for(let i=0,r=arguments.length;i(H(t,(r,s)=>{n&&x(r)?e[s]=Ne(r,n):e[s]=r},{allOwnKeys:i}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gt=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Rt=(e,t,n,i)=>{let r,s,o;const d={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],(!i||i(o,e,t))&&!d[o]&&(t[o]=e[o],d[o]=!0);e=n!==!1&&fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},St=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},Tt=e=>{if(!e)return null;if(j(e))return e;let t=e.length;if(!Le(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&fe(Uint8Array)),At=(e,t)=>{const i=(e&&e[G]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},_t=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},xt=P("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Pt=P("RegExp"),De=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};H(n,(r,s)=>{let o;(o=t(r,s,e))!==!1&&(i[s]=o||r)}),Object.defineProperties(e,i)},Nt=e=>{De(e,(t,n)=>{if(x(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(x(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},kt=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return j(e)?i(e):i(String(e).split(t)),n},Bt=()=>{},Lt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ft(e){return!!(e&&x(e.append)&&e[ke]==="FormData"&&e[G])}const Ut=e=>{const t=new Array(10),n=(i,r)=>{if(Y(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[r]=i;const s=j(i)?[]:{};return H(i,(o,d)=>{const u=n(o,r+1);!M(u)&&(s[d]=u)}),t[r]=void 0,s}}return i};return n(e,0)},Dt=P("AsyncFunction"),jt=e=>e&&(Y(e)||x(e))&&x(e.then)&&x(e.catch),je=((e,t)=>e?setImmediate:t?((n,i)=>(F.addEventListener("message",({source:r,data:s})=>{r===F&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",x(F.postMessage)),It=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||je,qt=e=>e!=null&&x(e[G]),a={isArray:j,isArrayBuffer:Be,isBuffer:it,isFormData:ft,isArrayBufferView:rt,isString:st,isNumber:Le,isBoolean:ot,isObject:Y,isPlainObject:J,isReadableStream:ht,isRequest:vt,isResponse:mt,isHeaders:wt,isUndefined:M,isDate:at,isFile:dt,isBlob:ct,isRegExp:Pt,isFunction:x,isStream:ut,isURLSearchParams:pt,isTypedArray:Ot,isFileList:lt,forEach:H,merge:oe,extend:bt,trim:yt,stripBOM:Et,inherits:gt,toFlatObject:Rt,kindOf:Z,kindOfTest:P,endsWith:St,toArray:Tt,forEachEntry:At,matchAll:_t,isHTMLForm:xt,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:De,freezeMethods:Nt,toObjectSet:kt,toCamelCase:Ct,noop:Bt,toFiniteNumber:Lt,findKey:Fe,global:F,isContextDefined:Ue,isSpecCompliantForm:Ft,toJSONObject:Ut,isAsyncFn:Dt,isThenable:jt,setImmediate:je,asap:It,isIterable:qt};function v(e,t,n,i,r){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),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}a.inherits(v,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=v.prototype,qe={};["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=>{qe[e]={value:e}});Object.defineProperties(v,qe);Object.defineProperty(Ie,"isAxiosError",{value:!0});v.from=(e,t,n,i,r,s)=>{const o=Object.create(Ie);return a.toFlatObject(e,o,function(u){return u!==Error.prototype},d=>d!=="isAxiosError"),v.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const Mt=null;function ae(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function we(e,t,n){return e?e.concat(t).map(function(r,s){return r=Me(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function Ht(e){return a.isArray(e)&&!e.some(ae)}const $t=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ee(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const i=n.metaTokens,r=n.visitor||l,s=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!u&&a.isBlob(f))throw new v("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,m,h){let b=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(m,"{}"))m=i?m:m.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Ht(f)||(a.isFileList(f)||a.endsWith(m,"[]"))&&(b=a.toArray(f)))return m=Me(m),b.forEach(function(T,k){!(a.isUndefined(T)||T===null)&&t.append(o===!0?we([m],k,s):o===null?m:m+"[]",c(T))}),!1}return ae(f)?!0:(t.append(we(h,m,s),c(f)),!1)}const p=[],w=Object.assign($t,{defaultVisitor:l,convertValue:c,isVisitable:ae});function g(f,m){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(f),a.forEach(f,function(b,R){(!(a.isUndefined(b)||b===null)&&r.call(t,b,a.isString(R)?R.trim():R,m,w))===!0&&g(b,m?m.concat(R):[R])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ye(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function pe(e,t){this._pairs=[],e&&ee(e,this,t)}const He=pe.prototype;He.append=function(t,n){this._pairs.push([t,n])};He.toString=function(t){const n=t?function(i){return t.call(this,i,ye)}:ye;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function zt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const i=n&&n.encode||zt;a.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let s;if(r?s=r(t,n):s=a.isURLSearchParams(t)?t.toString():new pe(t,n).toString(i),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class be{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(i){i!==null&&t(i)})}}const ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt=typeof URLSearchParams<"u"?URLSearchParams:pe,Vt=typeof FormData<"u"?FormData:null,Kt=typeof Blob<"u"?Blob:null,Wt={isBrowser:!0,classes:{URLSearchParams:Jt,FormData:Vt,Blob:Kt},protocols:["http","https","file","blob","url","data"]},he=typeof window<"u"&&typeof document<"u",de=typeof navigator=="object"&&navigator||void 0,Xt=he&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),Gt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zt=he&&window.location.href||"http://localhost",Qt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:he,hasStandardBrowserEnv:Xt,hasStandardBrowserWebWorkerEnv:Gt,navigator:de,origin:Zt},Symbol.toStringTag,{value:"Module"})),O={...Qt,...Wt};function Yt(e,t){return ee(e,new O.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return O.isNode&&a.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function en(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tn(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i=n.length;return o=!o&&a.isArray(r)?r.length:o,u?(a.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!d):((!r[o]||!a.isObject(r[o]))&&(r[o]=[]),t(n,i,r[o],s)&&a.isArray(r[o])&&(r[o]=tn(r[o])),!d)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(i,r)=>{t(en(i),r,n,0)}),n}return null}function nn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const $={transitional:ze,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r?JSON.stringify(Je(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Yt(t,this.formSerializer).toString();if((d=a.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ee(d?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),nn(t)):t}],transformResponse:[function(t){const n=this.transitional||$.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(d){if(o)throw d.name==="SyntaxError"?v.from(d,v.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{$.headers[e]={}});const rn=a.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"]),sn=e=>{const t={};let n,i,r;return e&&e.split(` -`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||t[n]&&rn[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Ee=Symbol("internals");function q(e){return e&&String(e).trim().toLowerCase()}function V(e){return e===!1||e==null?e:a.isArray(e)?e.map(V):String(e)}function on(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const an=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ie(e,t,n,i,r){if(a.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(i))return t.indexOf(i)!==-1;if(a.isRegExp(i))return i.test(t)}}function dn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function cn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,o){return this[i].call(this,t,r,s,o)},configurable:!0})})}let C=class{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(d,u,c){const l=q(u);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(r,l);(!p||r[p]===void 0||c===!0||c===void 0&&r[p]!==!1)&&(r[p||u]=V(d))}const o=(d,u)=>a.forEach(d,(c,l)=>s(c,l,u));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!an(t))o(sn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let d={},u,c;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");d[c=l[0]]=(u=d[c])?a.isArray(u)?[...u,l[1]]:[u,l[1]]:l[1]}o(d,n)}else t!=null&&s(n,t,i);return this}get(t,n){if(t=q(t),t){const i=a.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return on(r);if(a.isFunction(n))return n.call(this,r,i);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=q(t),t){const i=a.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||ie(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(o){if(o=q(o),o){const d=a.findKey(i,o);d&&(!n||ie(i,i[d],d,n))&&(delete i[d],r=!0)}}return a.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||ie(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return a.forEach(this,(r,s)=>{const o=a.findKey(i,s);if(o){n[o]=V(r),delete n[s];return}const d=t?dn(s):String(s).trim();d!==s&&delete n[s],n[d]=V(r),i[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&a.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[Ee]=this[Ee]={accessors:{}}).accessors,r=this.prototype;function s(o){const d=q(o);i[d]||(cn(r,o),i[d]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};C.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(C.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});a.freezeMethods(C);function re(e,t){const n=this||$,i=t||n,r=C.from(i.headers);let s=i.data;return a.forEach(e,function(d){s=d.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function Ve(e){return!!(e&&e.__CANCEL__)}function I(e,t,n){v.call(this,e??"canceled",v.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(I,v,{__CANCEL__:!0});function Ke(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new v("Request failed with status code "+n.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ln(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function un(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=i[s];o||(o=c),n[r]=u,i[r]=c;let p=s,w=0;for(;p!==r;)w+=n[p++],p=p%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),c-o{n=l,r=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const l=Date.now(),p=l-n;p>=i?o(c,l):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-p)))},()=>r&&o(r)]}const W=(e,t,n=3)=>{let i=0;const r=un(50,250);return fn(s=>{const o=s.loaded,d=s.lengthComputable?s.total:void 0,u=o-i,c=r(u),l=o<=d;i=o;const p={loaded:o,total:d,progress:d?o/d:void 0,bytes:u,rate:c||void 0,estimated:c&&d&&l?(d-o)/c:void 0,event:s,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(p)},n)},ge=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},Re=e=>(...t)=>a.asap(()=>e(...t)),pn=O.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,O.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,hn=O.hasStandardBrowserEnv?{write(e,t,n,i,r,s){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(i)&&o.push("path="+i),a.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.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(){return null},remove(){}};function vn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function We(e,t,n){let i=!vn(t);return e&&(i||n==!1)?mn(e,t):t}const Se=e=>e instanceof C?{...e}:e;function D(e,t){t=t||{};const n={};function i(c,l,p,w){return a.isPlainObject(c)&&a.isPlainObject(l)?a.merge.call({caseless:w},c,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function r(c,l,p,w){if(a.isUndefined(l)){if(!a.isUndefined(c))return i(void 0,c,p,w)}else return i(c,l,p,w)}function s(c,l){if(!a.isUndefined(l))return i(void 0,l)}function o(c,l){if(a.isUndefined(l)){if(!a.isUndefined(c))return i(void 0,c)}else return i(void 0,l)}function d(c,l,p){if(p in t)return i(c,l);if(p in e)return i(void 0,c)}const u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:d,headers:(c,l,p)=>r(Se(c),Se(l),p,!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const p=u[l]||r,w=p(e[l],t[l],l);a.isUndefined(w)&&p!==d||(n[l]=w)}),n}const Xe=e=>{const t=D({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:d}=t;t.headers=o=C.from(o),t.url=$e(We(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&o.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let u;if(a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[c,...l]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(O.hasStandardBrowserEnv&&(i&&a.isFunction(i)&&(i=i(t)),i||i!==!1&&pn(t.url))){const c=r&&s&&hn.read(s);c&&o.set(r,c)}return t},wn=typeof XMLHttpRequest<"u",yn=wn&&function(e){return new Promise(function(n,i){const r=Xe(e);let s=r.data;const o=C.from(r.headers).normalize();let{responseType:d,onUploadProgress:u,onDownloadProgress:c}=r,l,p,w,g,f;function m(){g&&g(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function b(){if(!h)return;const T=C.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:T,config:e,request:h};Ke(function(L){n(L),m()},function(L){i(L),m()},A),h=null}"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(b)},h.onabort=function(){h&&(i(new v("Request aborted",v.ECONNABORTED,e,h)),h=null)},h.onerror=function(){i(new v("Network Error",v.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let k=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const A=r.transitional||ze;r.timeoutErrorMessage&&(k=r.timeoutErrorMessage),i(new v(k,A.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,e,h)),h=null},s===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(k,A){h.setRequestHeader(A,k)}),a.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),d&&d!=="json"&&(h.responseType=r.responseType),c&&([w,f]=W(c,!0),h.addEventListener("progress",w)),u&&h.upload&&([p,g]=W(u),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(l=T=>{h&&(i(!T||T.type?new I(null,e,h):T),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const R=ln(r.url);if(R&&O.protocols.indexOf(R)===-1){i(new v("Unsupported protocol "+R+":",v.ERR_BAD_REQUEST,e));return}h.send(s||null)})},bn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,r;const s=function(c){if(!r){r=!0,d();const l=c instanceof Error?c:this.reason;i.abort(l instanceof v?l:new I(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,s(new v(`timeout ${t} of ms exceeded`,v.ETIMEDOUT))},t);const d=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=i;return u.unsubscribe=()=>a.asap(d),u}},En=function*(e,t){let n=e.byteLength;if(n{const r=gn(e,t);let s=0,o,d=u=>{o||(o=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:c,value:l}=await r.next();if(c){d(),u.close();return}let p=l.byteLength;if(n){let w=s+=p;n(w)}u.enqueue(new Uint8Array(l))}catch(c){throw d(c),c}},cancel(u){return d(u),r.return()}},{highWaterMark:2})},te=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ge=te&&typeof ReadableStream=="function",Sn=te&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Tn=Ge&&Ze(()=>{let e=!1;const t=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Oe=64*1024,ce=Ge&&Ze(()=>a.isReadableStream(new Response("").body)),X={stream:ce&&(e=>e.body)};te&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=a.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new v(`Response type '${t}' is not supported`,v.ERR_NOT_SUPPORT,i)})})})(new Response);const On=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(O.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await Sn(e)).byteLength},An=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??On(t)},_n=te&&(async e=>{let{url:t,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:d,onUploadProgress:u,responseType:c,headers:l,withCredentials:p="same-origin",fetchOptions:w}=Xe(e);c=c?(c+"").toLowerCase():"text";let g=bn([r,s&&s.toAbortSignal()],o),f;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let h;try{if(u&&Tn&&n!=="get"&&n!=="head"&&(h=await An(l,i))!==0){let A=new Request(t,{method:"POST",body:i,duplex:"half"}),B;if(a.isFormData(i)&&(B=A.headers.get("content-type"))&&l.setContentType(B),A.body){const[L,z]=ge(h,W(Re(u)));i=Te(A.body,Oe,L,z)}}a.isString(p)||(p=p?"include":"omit");const b="credentials"in Request.prototype;f=new Request(t,{...w,signal:g,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:i,duplex:"half",credentials:b?p:void 0});let R=await fetch(f,w);const T=ce&&(c==="stream"||c==="response");if(ce&&(d||T&&m)){const A={};["status","statusText","headers"].forEach(ve=>{A[ve]=R[ve]});const B=a.toFiniteNumber(R.headers.get("content-length")),[L,z]=d&&ge(B,W(Re(d),!0))||[];R=new Response(Te(R.body,Oe,L,()=>{z&&z(),m&&m()}),A)}c=c||"text";let k=await X[a.findKey(X,c)||"text"](R,e);return!T&&m&&m(),await new Promise((A,B)=>{Ke(A,B,{data:k,headers:C.from(R.headers),status:R.status,statusText:R.statusText,config:e,request:f})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,e,f),{cause:b.cause||b}):v.from(b,b&&b.code,e,f)}}),le={http:Mt,xhr:yn,fetch:_n};a.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ae=e=>`- ${e}`,xn=e=>a.isFunction(e)||e===null||e===!1,Qe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since : +function g(e){return new Promise(t=>setTimeout(t,e))}function ke(e,t){return function(){return e.apply(t,arguments)}}const{toString:rt}=Object.prototype,{getPrototypeOf:fe}=Object,{iterator:G,toStringTag:Ne}=Symbol,Z=(e=>t=>{const n=rt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Z(t)===e),Q=e=>t=>typeof t===e,{isArray:j}=Array,M=Q("undefined");function st(e){return e!==null&&!M(e)&&e.constructor!==null&&!M(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Be=P("ArrayBuffer");function ot(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Be(e.buffer),t}const at=Q("string"),x=Q("function"),Le=Q("number"),Y=e=>e!==null&&typeof e=="object",dt=e=>e===!0||e===!1,J=e=>{if(Z(e)!=="object")return!1;const t=fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ne in e)&&!(G in e)},ct=P("Date"),lt=P("File"),ut=P("Blob"),ft=P("FileList"),pt=e=>Y(e)&&x(e.pipe),ht=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=Z(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},vt=P("URLSearchParams"),[mt,wt,bt,yt]=["ReadableStream","Request","Response","Headers"].map(P),Et=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function H(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),j(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ue=e=>!M(e)&&e!==F;function oe(){const{caseless:e}=Ue(this)&&this||{},t={},n=(i,r)=>{const s=e&&Fe(t,r)||r;J(t[s])&&J(i)?t[s]=oe(t[s],i):J(i)?t[s]=oe({},i):j(i)?t[s]=i.slice():t[s]=i};for(let i=0,r=arguments.length;i(H(t,(r,s)=>{n&&x(r)?e[s]=ke(r,n):e[s]=r},{allOwnKeys:i}),e),Rt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Tt=(e,t,n,i)=>{let r,s,o;const d={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],(!i||i(o,e,t))&&!d[o]&&(t[o]=e[o],d[o]=!0);e=n!==!1&&fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ot=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},At=e=>{if(!e)return null;if(j(e))return e;let t=e.length;if(!Le(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_t=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&fe(Uint8Array)),xt=(e,t)=>{const i=(e&&e[G]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},Ct=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Pt=P("HTMLFormElement"),kt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=P("RegExp"),De=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};H(n,(r,s)=>{let o;(o=t(r,s,e))!==!1&&(i[s]=o||r)}),Object.defineProperties(e,i)},Bt=e=>{De(e,(t,n)=>{if(x(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(x(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Lt=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return j(e)?i(e):i(String(e).split(t)),n},Ft=()=>{},Ut=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Dt(e){return!!(e&&x(e.append)&&e[Ne]==="FormData"&&e[G])}const jt=e=>{const t=new Array(10),n=(i,r)=>{if(Y(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[r]=i;const s=j(i)?[]:{};return H(i,(o,d)=>{const u=n(o,r+1);!M(u)&&(s[d]=u)}),t[r]=void 0,s}}return i};return n(e,0)},It=P("AsyncFunction"),qt=e=>e&&(Y(e)||x(e))&&x(e.then)&&x(e.catch),je=((e,t)=>e?setImmediate:t?((n,i)=>(F.addEventListener("message",({source:r,data:s})=>{r===F&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",x(F.postMessage)),Mt=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||je,Ht=e=>e!=null&&x(e[G]),a={isArray:j,isArrayBuffer:Be,isBuffer:st,isFormData:ht,isArrayBufferView:ot,isString:at,isNumber:Le,isBoolean:dt,isObject:Y,isPlainObject:J,isReadableStream:mt,isRequest:wt,isResponse:bt,isHeaders:yt,isUndefined:M,isDate:ct,isFile:lt,isBlob:ut,isRegExp:Nt,isFunction:x,isStream:pt,isURLSearchParams:vt,isTypedArray:_t,isFileList:ft,forEach:H,merge:oe,extend:gt,trim:Et,stripBOM:Rt,inherits:St,toFlatObject:Tt,kindOf:Z,kindOfTest:P,endsWith:Ot,toArray:At,forEachEntry:xt,matchAll:Ct,isHTMLForm:Pt,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:De,freezeMethods:Bt,toObjectSet:Lt,toCamelCase:kt,noop:Ft,toFiniteNumber:Ut,findKey:Fe,global:F,isContextDefined:Ue,isSpecCompliantForm:Dt,toJSONObject:jt,isAsyncFn:It,isThenable:qt,setImmediate:je,asap:Mt,isIterable:Ht};function v(e,t,n,i,r){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),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}a.inherits(v,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ie=v.prototype,qe={};["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=>{qe[e]={value:e}});Object.defineProperties(v,qe);Object.defineProperty(Ie,"isAxiosError",{value:!0});v.from=(e,t,n,i,r,s)=>{const o=Object.create(Ie);return a.toFlatObject(e,o,function(u){return u!==Error.prototype},d=>d!=="isAxiosError"),v.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const $t=null;function ae(e){return a.isPlainObject(e)||a.isArray(e)}function Me(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function we(e,t,n){return e?e.concat(t).map(function(r,s){return r=Me(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function zt(e){return a.isArray(e)&&!e.some(ae)}const Jt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ee(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,h){return!a.isUndefined(h[m])});const i=n.metaTokens,r=n.visitor||l,s=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!u&&a.isBlob(f))throw new v("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,m,h){let y=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(m,"{}"))m=i?m:m.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&zt(f)||(a.isFileList(f)||a.endsWith(m,"[]"))&&(y=a.toArray(f)))return m=Me(m),y.forEach(function(T,N){!(a.isUndefined(T)||T===null)&&t.append(o===!0?we([m],N,s):o===null?m:m+"[]",c(T))}),!1}return ae(f)?!0:(t.append(we(h,m,s),c(f)),!1)}const p=[],w=Object.assign(Jt,{defaultVisitor:l,convertValue:c,isVisitable:ae});function R(f,m){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(f),a.forEach(f,function(y,S){(!(a.isUndefined(y)||y===null)&&r.call(t,y,a.isString(S)?S.trim():S,m,w))===!0&&R(y,m?m.concat(S):[S])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return R(e),t}function be(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function pe(e,t){this._pairs=[],e&&ee(e,this,t)}const He=pe.prototype;He.append=function(t,n){this._pairs.push([t,n])};He.toString=function(t){const n=t?function(i){return t.call(this,i,be)}:be;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Vt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const i=n&&n.encode||Vt;a.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let s;if(r?s=r(t,n):s=a.isURLSearchParams(t)?t.toString():new pe(t,n).toString(i),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ye{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(i){i!==null&&t(i)})}}const ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Kt=typeof URLSearchParams<"u"?URLSearchParams:pe,Wt=typeof FormData<"u"?FormData:null,Xt=typeof Blob<"u"?Blob:null,Gt={isBrowser:!0,classes:{URLSearchParams:Kt,FormData:Wt,Blob:Xt},protocols:["http","https","file","blob","url","data"]},he=typeof window<"u"&&typeof document<"u",de=typeof navigator=="object"&&navigator||void 0,Zt=he&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),Qt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yt=he&&window.location.href||"http://localhost",en=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:he,hasStandardBrowserEnv:Zt,hasStandardBrowserWebWorkerEnv:Qt,navigator:de,origin:Yt},Symbol.toStringTag,{value:"Module"})),O={...en,...Gt};function tn(e,t){return ee(e,new O.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,s){return O.isNode&&a.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function nn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rn(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i=n.length;return o=!o&&a.isArray(r)?r.length:o,u?(a.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!d):((!r[o]||!a.isObject(r[o]))&&(r[o]=[]),t(n,i,r[o],s)&&a.isArray(r[o])&&(r[o]=rn(r[o])),!d)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(i,r)=>{t(nn(i),r,n,0)}),n}return null}function sn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const $={transitional:ze,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r?JSON.stringify(Je(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return tn(t,this.formSerializer).toString();if((d=a.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ee(d?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),sn(t)):t}],transformResponse:[function(t){const n=this.transitional||$.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(d){if(o)throw d.name==="SyntaxError"?v.from(d,v.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{$.headers[e]={}});const on=a.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"]),an=e=>{const t={};let n,i,r;return e&&e.split(` +`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||t[n]&&on[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},Ee=Symbol("internals");function q(e){return e&&String(e).trim().toLowerCase()}function V(e){return e===!1||e==null?e:a.isArray(e)?e.map(V):String(e)}function dn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const cn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ie(e,t,n,i,r){if(a.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(i))return t.indexOf(i)!==-1;if(a.isRegExp(i))return i.test(t)}}function ln(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function un(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,o){return this[i].call(this,t,r,s,o)},configurable:!0})})}let C=class{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(d,u,c){const l=q(u);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(r,l);(!p||r[p]===void 0||c===!0||c===void 0&&r[p]!==!1)&&(r[p||u]=V(d))}const o=(d,u)=>a.forEach(d,(c,l)=>s(c,l,u));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!cn(t))o(an(t),n);else if(a.isObject(t)&&a.isIterable(t)){let d={},u,c;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");d[c=l[0]]=(u=d[c])?a.isArray(u)?[...u,l[1]]:[u,l[1]]:l[1]}o(d,n)}else t!=null&&s(n,t,i);return this}get(t,n){if(t=q(t),t){const i=a.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return dn(r);if(a.isFunction(n))return n.call(this,r,i);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=q(t),t){const i=a.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||ie(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(o){if(o=q(o),o){const d=a.findKey(i,o);d&&(!n||ie(i,i[d],d,n))&&(delete i[d],r=!0)}}return a.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||ie(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return a.forEach(this,(r,s)=>{const o=a.findKey(i,s);if(o){n[o]=V(r),delete n[s];return}const d=t?ln(s):String(s).trim();d!==s&&delete n[s],n[d]=V(r),i[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&a.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[Ee]=this[Ee]={accessors:{}}).accessors,r=this.prototype;function s(o){const d=q(o);i[d]||(un(r,o),i[d]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};C.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(C.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});a.freezeMethods(C);function re(e,t){const n=this||$,i=t||n,r=C.from(i.headers);let s=i.data;return a.forEach(e,function(d){s=d.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function Ve(e){return!!(e&&e.__CANCEL__)}function I(e,t,n){v.call(this,e??"canceled",v.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(I,v,{__CANCEL__:!0});function Ke(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new v("Request failed with status code "+n.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pn(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),l=i[s];o||(o=c),n[r]=u,i[r]=c;let p=s,w=0;for(;p!==r;)w+=n[p++],p=p%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),c-o{n=l,r=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const l=Date.now(),p=l-n;p>=i?o(c,l):(r=c,s||(s=setTimeout(()=>{s=null,o(r)},i-p)))},()=>r&&o(r)]}const W=(e,t,n=3)=>{let i=0;const r=pn(50,250);return hn(s=>{const o=s.loaded,d=s.lengthComputable?s.total:void 0,u=o-i,c=r(u),l=o<=d;i=o;const p={loaded:o,total:d,progress:d?o/d:void 0,bytes:u,rate:c||void 0,estimated:c&&d&&l?(d-o)/c:void 0,event:s,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(p)},n)},ge=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},Re=e=>(...t)=>a.asap(()=>e(...t)),vn=O.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,O.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,mn=O.hasStandardBrowserEnv?{write(e,t,n,i,r,s){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(i)&&o.push("path="+i),a.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.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(){return null},remove(){}};function wn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function We(e,t,n){let i=!wn(t);return e&&(i||n==!1)?bn(e,t):t}const Se=e=>e instanceof C?{...e}:e;function D(e,t){t=t||{};const n={};function i(c,l,p,w){return a.isPlainObject(c)&&a.isPlainObject(l)?a.merge.call({caseless:w},c,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function r(c,l,p,w){if(a.isUndefined(l)){if(!a.isUndefined(c))return i(void 0,c,p,w)}else return i(c,l,p,w)}function s(c,l){if(!a.isUndefined(l))return i(void 0,l)}function o(c,l){if(a.isUndefined(l)){if(!a.isUndefined(c))return i(void 0,c)}else return i(void 0,l)}function d(c,l,p){if(p in t)return i(c,l);if(p in e)return i(void 0,c)}const u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:d,headers:(c,l,p)=>r(Se(c),Se(l),p,!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const p=u[l]||r,w=p(e[l],t[l],l);a.isUndefined(w)&&p!==d||(n[l]=w)}),n}const Xe=e=>{const t=D({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:d}=t;t.headers=o=C.from(o),t.url=$e(We(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&o.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let u;if(a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[c,...l]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(O.hasStandardBrowserEnv&&(i&&a.isFunction(i)&&(i=i(t)),i||i!==!1&&vn(t.url))){const c=r&&s&&mn.read(s);c&&o.set(r,c)}return t},yn=typeof XMLHttpRequest<"u",En=yn&&function(e){return new Promise(function(n,i){const r=Xe(e);let s=r.data;const o=C.from(r.headers).normalize();let{responseType:d,onUploadProgress:u,onDownloadProgress:c}=r,l,p,w,R,f;function m(){R&&R(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function y(){if(!h)return;const T=C.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),_={data:!d||d==="text"||d==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:T,config:e,request:h};Ke(function(L){n(L),m()},function(L){i(L),m()},_),h=null}"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(y)},h.onabort=function(){h&&(i(new v("Request aborted",v.ECONNABORTED,e,h)),h=null)},h.onerror=function(){i(new v("Network Error",v.ERR_NETWORK,e,h)),h=null},h.ontimeout=function(){let N=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const _=r.transitional||ze;r.timeoutErrorMessage&&(N=r.timeoutErrorMessage),i(new v(N,_.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,e,h)),h=null},s===void 0&&o.setContentType(null),"setRequestHeader"in h&&a.forEach(o.toJSON(),function(N,_){h.setRequestHeader(_,N)}),a.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),d&&d!=="json"&&(h.responseType=r.responseType),c&&([w,f]=W(c,!0),h.addEventListener("progress",w)),u&&h.upload&&([p,R]=W(u),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",R)),(r.cancelToken||r.signal)&&(l=T=>{h&&(i(!T||T.type?new I(null,e,h):T),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const S=fn(r.url);if(S&&O.protocols.indexOf(S)===-1){i(new v("Unsupported protocol "+S+":",v.ERR_BAD_REQUEST,e));return}h.send(s||null)})},gn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,r;const s=function(c){if(!r){r=!0,d();const l=c instanceof Error?c:this.reason;i.abort(l instanceof v?l:new I(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,s(new v(`timeout ${t} of ms exceeded`,v.ETIMEDOUT))},t);const d=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:u}=i;return u.unsubscribe=()=>a.asap(d),u}},Rn=function*(e,t){let n=e.byteLength;if(n{const r=Sn(e,t);let s=0,o,d=u=>{o||(o=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:c,value:l}=await r.next();if(c){d(),u.close();return}let p=l.byteLength;if(n){let w=s+=p;n(w)}u.enqueue(new Uint8Array(l))}catch(c){throw d(c),c}},cancel(u){return d(u),r.return()}},{highWaterMark:2})},te=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ge=te&&typeof ReadableStream=="function",On=te&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},An=Ge&&Ze(()=>{let e=!1;const t=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Oe=64*1024,ce=Ge&&Ze(()=>a.isReadableStream(new Response("").body)),X={stream:ce&&(e=>e.body)};te&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=a.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new v(`Response type '${t}' is not supported`,v.ERR_NOT_SUPPORT,i)})})})(new Response);const _n=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(O.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await On(e)).byteLength},xn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??_n(t)},Cn=te&&(async e=>{let{url:t,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:d,onUploadProgress:u,responseType:c,headers:l,withCredentials:p="same-origin",fetchOptions:w}=Xe(e);c=c?(c+"").toLowerCase():"text";let R=gn([r,s&&s.toAbortSignal()],o),f;const m=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let h;try{if(u&&An&&n!=="get"&&n!=="head"&&(h=await xn(l,i))!==0){let _=new Request(t,{method:"POST",body:i,duplex:"half"}),B;if(a.isFormData(i)&&(B=_.headers.get("content-type"))&&l.setContentType(B),_.body){const[L,z]=ge(h,W(Re(u)));i=Te(_.body,Oe,L,z)}}a.isString(p)||(p=p?"include":"omit");const y="credentials"in Request.prototype;f=new Request(t,{...w,signal:R,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:i,duplex:"half",credentials:y?p:void 0});let S=await fetch(f,w);const T=ce&&(c==="stream"||c==="response");if(ce&&(d||T&&m)){const _={};["status","statusText","headers"].forEach(ve=>{_[ve]=S[ve]});const B=a.toFiniteNumber(S.headers.get("content-length")),[L,z]=d&&ge(B,W(Re(d),!0))||[];S=new Response(Te(S.body,Oe,L,()=>{z&&z(),m&&m()}),_)}c=c||"text";let N=await X[a.findKey(X,c)||"text"](S,e);return!T&&m&&m(),await new Promise((_,B)=>{Ke(_,B,{data:N,headers:C.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:f})})}catch(y){throw m&&m(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,e,f),{cause:y.cause||y}):v.from(y,y&&y.code,e,f)}}),le={http:$t,xhr:En,fetch:Cn};a.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ae=e=>`- ${e}`,Pn=e=>a.isFunction(e)||e===null||e===!1,Qe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since : `+s.map(Ae).join(` -`):" "+Ae(s[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:le};function se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function _e(e){return se(e),e.headers=C.from(e.headers),e.data=re.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qe.getAdapter(e.adapter||$.adapter)(e).then(function(i){return se(e),i.data=re.call(e,e.transformResponse,i),i.headers=C.from(i.headers),i},function(i){return Ve(i)||(se(e),i&&i.response&&(i.response.data=re.call(e,e.transformResponse,i.response),i.response.headers=C.from(i.response.headers))),Promise.reject(i)})}const Ye="1.10.0",ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ne[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const xe={};ne.transitional=function(t,n,i){function r(s,o){return"[Axios v"+Ye+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,d)=>{if(t===!1)throw new v(r(o," has been removed"+(n?" in "+n:"")),v.ERR_DEPRECATED);return n&&!xe[o]&&(xe[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,d):!0}};ne.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function Cn(e,t,n){if(typeof e!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const d=e[s],u=d===void 0||o(d,s,e);if(u!==!0)throw new v("option "+s+" must be "+u,v.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new v("Unknown option "+s,v.ERR_BAD_OPTION)}}const K={assertOptions:Cn,validators:ne},N=K.validators;let U=class{constructor(t){this.defaults=t||{},this.interceptors={request:new be,response:new be}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` -`+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&K.assertOptions(i,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:K.assertOptions(r,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),K.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&a.merge(s.common,s[n.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),n.headers=C.concat(o,s);const d=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,d.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let l,p=0,w;if(!u){const f=[_e.bind(this),void 0];for(f.unshift.apply(f,d),f.push.apply(f,c),w=f.length,l=Promise.resolve(n);p{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(d=>{i.subscribe(d),s=d}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},t(function(s,o,d){i.reason||(i.reason=new I(s,o,d),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new et(function(r){t=r}),cancel:t}}};function Nn(e){return function(n){return e.apply(null,n)}}function kn(e){return a.isObject(e)&&e.isAxiosError===!0}const ue={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(ue).forEach(([e,t])=>{ue[t]=e});function tt(e){const t=new U(e),n=Ne(U.prototype.request,t);return a.extend(n,U.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return tt(D(e,r))},n}const E=tt($);E.Axios=U;E.CanceledError=I;E.CancelToken=Pn;E.isCancel=Ve;E.VERSION=Ye;E.toFormData=ee;E.AxiosError=v;E.Cancel=E.CanceledError;E.all=function(t){return Promise.all(t)};E.spread=Nn;E.isAxiosError=kn;E.mergeConfig=D;E.AxiosHeaders=C;E.formToJSON=e=>Je(a.isHTMLForm(e)?new FormData(e):e);E.getAdapter=Qe.getAdapter;E.HttpStatusCode=ue;E.default=E;const{Axios:zn,AxiosError:Jn,CanceledError:Vn,isCancel:Kn,CancelToken:Wn,VERSION:Xn,all:Gn,Cancel:Zn,isAxiosError:Qn,spread:Yn,toFormData:ei,AxiosHeaders:ti,HttpStatusCode:ni,formToJSON:ii,getAdapter:ri,mergeConfig:si}=E,Bn=E.create({baseURL:"http://localhost:4000/api/v1",headers:{"Content-Type":"application/json"}});class Ln{base64ToFile(t,n,i){const r=t.includes(",")?t.split(",")[1]:t,s=atob(r),o=new ArrayBuffer(s.length),d=new Uint8Array(o);for(let c=0;c{let o=0,d=!1;const u=()=>{const c=document.evaluate(d&&r?r:t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(c instanceof HTMLElement){s(c);return}o++,o{const o=new FileReader;o.onloadend=()=>{typeof o.result=="string"?r(o.result.split(",")[1]):s("Không thể đọc dữ liệu ảnh")},o.onerror=s,o.readAsDataURL(i)})}getImageExtension(t){try{const i=new URL(t).pathname.match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}catch{const r=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}}imageLocalToBase64(t){return new Promise((n,i)=>{try{const r=chrome.runtime.getURL(`${t}`);fetch(r).then(s=>s.blob()).then(s=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=i,o.readAsDataURL(s)}).catch(i)}catch(r){i(r)}})}scrollToElement(t,n="smooth"){t&&t.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(t){if(!t)return null;const n=t.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return{x:i,y:r}}setInputValue(t,n){t&&(t.value=n,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(t,n,i)=>{const r=await this.getElementByXPath(n,{xpathFallback:i});if(!r)throw new Error("Xpath is not found with value: "+t);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,t)};pressEnter(t){if(!t)throw new Error("Textarea not found:",t);t.focus(),["keydown","keypress","keyup"].forEach(n=>{t.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}}const y=new Ln,_={file__image_input:'input[type="file"]',title_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[2]/div[1]/div[2]/div/div/div[5]/div/div/div/label/div/input",price_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[6]/div/div/div/label/div/input",brand_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[2]/div/div/div/label/div/input",brand_input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[2]/div/div/div/label/div/input",description_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[3]/div/div/div/label/div/div/textarea",description_input_falback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[3]/div/div/div/label/div/div/textarea",sku_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[6]/div/div/div[1]/label/div/input",sku_input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[6]/div/div/div[1]/label/div/input",category_select:{wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[7]/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/div/div/div/div/span/div"},condition_select:{wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[8]/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/div/div/div/div[1]/div"},tags_input:{input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[5]/div/div/div/div[1]/label/div/div/div[2]/div/textarea",input_falback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[5]/div/div/div/div[1]/label/div/div/div[2]/div/textarea"},location_select:{input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[7]/div/div/div/div/div/div/div/div/label/div[2]/input",input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[7]/div/div/div/div/div/div/div/div/label/div[2]/input",wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[7]/div/div/div/div/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/ul",container_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/ul"},next_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[5]/div/div/div"},Fn=async e=>{const t=new DataTransfer;for(const i of e.images){const r=await y.imageUrlToBase64(i);console.log("Base64:",i.slice(0,50)+"...");const s=y.base64ToFile(r,e.sku,y.getImageExtension(i)||"jpg");t.items.add(s)}const n=document.querySelector(_.file__image_input);n?(n.files=t.files,n.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")},Ce=async(e,t)=>{const n=await y.getElementByXPath(t.wraper);if(!n)throw new Error("Wrapper xpath not found");y.scrollToElement(n),y.clickByPoint(n),await S(200);const i=await y.getElementByXPath(t.container);if(!i)throw new Error("Container xpath not found");const r=Array.from(i.children).find(s=>s.textContent?.trim().toLocaleLowerCase().replace(/–/g,"-").includes(e.toLocaleLowerCase()));if(!r)throw new Error(`No child found with text "${e}"`);y.scrollToElement(r),await S(200),y.clickByPoint(r)},Un=async(e,{input:t,...n})=>{await y.writeToInput(e,t,n.input_fallback),await S(200);const i=await y.getElementByXPath(n.container,{xpathFallback:n.container_fallback});if(!i)throw new Error("Container xpath not found");y.scrollToElement(i);const r=Array.from(i.children).find(s=>s.textContent?.trim().toLocaleLowerCase().includes(e.toLocaleLowerCase()));if(!r)throw new Error(`No child found with text "${e}"`);y.scrollToElement(r),await S(200),y.clickByPoint(r)},Dn=async(e,t)=>{const n=await y.getElementByXPath(t.input,{xpathFallback:t?.input_falback});if(!n)throw new Error("Input is not found");y.scrollToElement(n),await S(200);for(const i of e)await y.writeToInput(i,t.input,t?.input_falback),await S(200),y.pressEnter(n)},Pe=async(e,t)=>{const{data:n}=await Bn({url:"products/publist-finish/"+e.id,method:"POST",data:t});return n},jn=async()=>{const e=await y.getElementByXPath(_.next_btn);if(!e)throw new Error("Next button is not found");y.clickByPoint(e)},In=async e=>(console.log({item:e}),await S(1e3),await Fn(e),await S(200),y.writeToInput(e.title,_.title_input),await S(200),y.writeToInput(String(e.price),_.price_input),await S(200),await Ce(e.category,_.category_select),await S(200),await Ce(e.condition,_.condition_select),e.brand&&(await S(200),await y.writeToInput(e.brand,_.brand_input,_.brand_input_fallback)),await S(200),await y.writeToInput(e.description,_.description_input,_.description_input_falback),await S(200),await Dn(e.tags,_.tags_input),await S(200),await y.writeToInput(e.sku,_.sku_input,_.sku_input_fallback),e?.location&&(await S(200),await Un(e.location,_.location_select)),await S(200),await jn(),!0),qn=async e=>{await S(1e3),chrome.runtime.sendMessage({type:"close-tab",payload:e})},Mn=chrome.runtime.connect();Mn.onMessage.addListener(async e=>{if(e.type==="publist-event"){const t=e.payload;if(!t)return;console.log("Received new product event:",t);try{await S(500),await In(t)}catch(n){await Pe(t,{error:n.message,published:!1})}finally{await Pe(t,{published:!0}),await qn(t)}}}); +`):" "+Ae(s[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:le};function se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function _e(e){return se(e),e.headers=C.from(e.headers),e.data=re.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qe.getAdapter(e.adapter||$.adapter)(e).then(function(i){return se(e),i.data=re.call(e,e.transformResponse,i),i.headers=C.from(i.headers),i},function(i){return Ve(i)||(se(e),i&&i.response&&(i.response.data=re.call(e,e.transformResponse,i.response),i.response.headers=C.from(i.response.headers))),Promise.reject(i)})}const Ye="1.10.0",ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ne[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const xe={};ne.transitional=function(t,n,i){function r(s,o){return"[Axios v"+Ye+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,d)=>{if(t===!1)throw new v(r(o," has been removed"+(n?" in "+n:"")),v.ERR_DEPRECATED);return n&&!xe[o]&&(xe[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,d):!0}};ne.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function kn(e,t,n){if(typeof e!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const d=e[s],u=d===void 0||o(d,s,e);if(u!==!0)throw new v("option "+s+" must be "+u,v.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new v("Unknown option "+s,v.ERR_BAD_OPTION)}}const K={assertOptions:kn,validators:ne},k=K.validators;let U=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ye,response:new ye}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` +`+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&K.assertOptions(i,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:K.assertOptions(r,{encode:k.function,serialize:k.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),K.assertOptions(n,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&a.merge(s.common,s[n.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),n.headers=C.concat(o,s);const d=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,d.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let l,p=0,w;if(!u){const f=[_e.bind(this),void 0];for(f.unshift.apply(f,d),f.push.apply(f,c),w=f.length,l=Promise.resolve(n);p{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(d=>{i.subscribe(d),s=d}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},t(function(s,o,d){i.reason||(i.reason=new I(s,o,d),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new et(function(r){t=r}),cancel:t}}};function Bn(e){return function(n){return e.apply(null,n)}}function Ln(e){return a.isObject(e)&&e.isAxiosError===!0}const ue={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(ue).forEach(([e,t])=>{ue[t]=e});function tt(e){const t=new U(e),n=ke(U.prototype.request,t);return a.extend(n,U.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return tt(D(e,r))},n}const E=tt($);E.Axios=U;E.CanceledError=I;E.CancelToken=Nn;E.isCancel=Ve;E.VERSION=Ye;E.toFormData=ee;E.AxiosError=v;E.Cancel=E.CanceledError;E.all=function(t){return Promise.all(t)};E.spread=Bn;E.isAxiosError=Ln;E.mergeConfig=D;E.AxiosHeaders=C;E.formToJSON=e=>Je(a.isHTMLForm(e)?new FormData(e):e);E.getAdapter=Qe.getAdapter;E.HttpStatusCode=ue;E.default=E;const{Axios:Vn,AxiosError:Kn,CanceledError:Wn,isCancel:Xn,CancelToken:Gn,VERSION:Zn,all:Qn,Cancel:Yn,isAxiosError:ei,spread:ti,toFormData:ni,AxiosHeaders:ii,HttpStatusCode:ri,formToJSON:si,getAdapter:oi,mergeConfig:ai}=E,nt=E.create({baseURL:"http://localhost:4000/api/v1",headers:{"Content-Type":"application/json"}});class Fn{base64ToFile(t,n,i){const r=t.includes(",")?t.split(",")[1]:t,s=atob(r),o=new ArrayBuffer(s.length),d=new Uint8Array(o);for(let c=0;c{let o=0,d=!1;const u=()=>{const c=document.evaluate(d&&r?r:t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(c instanceof HTMLElement){s(c);return}o++,o{const o=new FileReader;o.onloadend=()=>{typeof o.result=="string"?r(o.result.split(",")[1]):s("Không thể đọc dữ liệu ảnh")},o.onerror=s,o.readAsDataURL(i)})}getImageExtension(t){try{const i=new URL(t).pathname.match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}catch{const r=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}}imageLocalToBase64(t){return new Promise((n,i)=>{try{const r=chrome.runtime.getURL(`${t}`);fetch(r).then(s=>s.blob()).then(s=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=i,o.readAsDataURL(s)}).catch(i)}catch(r){i(r)}})}scrollToElement(t,n="smooth"){t&&t.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(t){if(!t)return null;const n=t.getBoundingClientRect(),i=n.left+n.width/2,r=n.top+n.height/2;return{x:i,y:r}}setInputValue(t,n){t&&(t.value=n,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(t,n,i)=>{const r=await this.getElementByXPath(n,{xpathFallback:i});if(!r)throw new Error("Xpath is not found with value: "+t);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,t)};pressEnter(t){if(!t)throw new Error("Textarea not found:",t);t.focus(),["keydown","keypress","keyup"].forEach(n=>{t.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}}const b=new Fn,A={file__image_input:'input[type="file"]',title_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[2]/div[1]/div[2]/div/div/div[5]/div/div/div/label/div/input",price_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[6]/div/div/div/label/div/input",brand_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[2]/div/div/div/label/div/input",brand_input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[2]/div/div/div/label/div/input",description_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[3]/div/div/div/label/div/div/textarea",description_input_falback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[3]/div/div/div/label/div/div/textarea",sku_input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[6]/div/div/div[1]/label/div/input",sku_input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[6]/div/div/div[1]/label/div/input",category_select:{wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[7]/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/div/div/div/div/span/div"},condition_select:{wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[8]/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/div/div/div/div[1]/div"},tags_input:{input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[5]/div/div/div/div[1]/label/div/div/div[2]/div/textarea",input_falback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[5]/div/div/div/div[1]/label/div/div/div[2]/div/textarea"},location_select:{input:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[7]/div/div/div/div/div/div/div/div/label/div[2]/input",input_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[10]/div/div/div[7]/div/div/div/div/div/div/div/div/label/div[2]/input",wraper:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[3]/div[1]/div[2]/div/div/div[9]/div/div/div[7]/div/div/div/div/div/div/div/div",container:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/ul",container_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[2]/div/div/div[1]/div[1]/div/ul"},next_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[5]/div/div/div",publish_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/div[2]/div/div"},Un=async e=>{const t=new DataTransfer;for(const i of e.images){const r=await b.imageUrlToBase64(i);console.log("Base64:",i.slice(0,50)+"...");const s=b.base64ToFile(r,e.sku,b.getImageExtension(i)||"jpg");t.items.add(s)}const n=document.querySelector(A.file__image_input);n?(n.files=t.files,n.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")},Ce=async(e,t)=>{const n=await b.getElementByXPath(t.wraper);if(!n)throw new Error("Wrapper xpath not found");b.scrollToElement(n),b.clickByPoint(n),await g(200);const i=await b.getElementByXPath(t.container);if(!i)throw new Error("Container xpath not found");const r=Array.from(i.children).find(s=>s.textContent?.trim().toLocaleLowerCase().replace(/–/g,"-").includes(e.toLocaleLowerCase()));if(!r)throw new Error(`No child found with text "${e}"`);b.scrollToElement(r),await g(200),b.clickByPoint(r)},Dn=async(e,{input:t,...n})=>{await b.writeToInput(e,t,n.input_fallback),await g(200);const i=await b.getElementByXPath(n.container,{xpathFallback:n.container_fallback});if(!i)throw new Error("Container xpath not found");b.scrollToElement(i);const r=Array.from(i.children).find(s=>s.textContent?.trim().toLocaleLowerCase().includes(e.toLocaleLowerCase()));if(!r)throw new Error(`No child found with text "${e}"`);b.scrollToElement(r),await g(200),b.clickByPoint(r)},jn=async(e,t)=>{const n=await b.getElementByXPath(t.input,{xpathFallback:t?.input_falback});if(!n)throw new Error("Input is not found");b.scrollToElement(n),await g(200);for(const i of e)await b.writeToInput(i,t.input,t?.input_falback),await g(200),b.pressEnter(n)},Pe=async(e,t)=>{const{data:n}=await nt({url:"products/publist-finish/"+e.id,method:"POST",data:t});return n},In=async()=>{const e=await b.getElementByXPath(A.next_btn);if(!e)throw new Error("Next button is not found");b.clickByPoint(e)},qn=async()=>{const e=await b.getElementByXPath(A.publish_btn);if(!e)throw new Error("Publist button is not found");b.clickByPoint(e)},it=async e=>(console.log({item:e}),await g(1e3),await Un(e),await g(200),b.writeToInput(e.title,A.title_input),await g(200),b.writeToInput(String(e.price),A.price_input),await g(200),await Ce(e.category,A.category_select),await g(200),await Ce(e.condition,A.condition_select),e.brand&&(await g(200),await b.writeToInput(e.brand,A.brand_input,A.brand_input_fallback)),await g(200),await b.writeToInput(e.description,A.description_input,A.description_input_falback),await g(200),await jn(e.tags,A.tags_input),await g(200),await b.writeToInput(e.sku,A.sku_input,A.sku_input_fallback),e?.location&&(await g(200),await Dn(e.location,A.location_select)),await g(200),await In(),await g(200),await qn(),!0),Mn=async e=>{chrome.runtime.sendMessage({type:"close-tab",payload:e})},Hn=chrome.runtime.connect();Hn.onMessage.addListener(async e=>{if(e.type==="publist-event"){const t=e.payload;if(!t)return;console.log("Received new product event:",t);try{await g(500),await it(t)}catch(n){await Pe(t,{error:n.message,published:!1})}finally{await Pe(t,{published:!0}),await g(2e3),await Mn(t)}}});async function $n(){const{data:e}=await nt.get("products/27");if(!e.data)return;const t=e.data;await it(t)}$n(); diff --git a/auto-listing-facebook-marketplace/src/content.ts b/auto-listing-facebook-marketplace/src/content.ts index 10800b6..9bc60de 100644 --- a/auto-listing-facebook-marketplace/src/content.ts +++ b/auto-listing-facebook-marketplace/src/content.ts @@ -301,17 +301,14 @@ const handle = async (item: IItem) => { await clickNext(); - if (import.meta.env.ENV === "prod") { - await delay(200); - await clickPublist(); - } + await delay(200); + + await clickPublist(); return true; }; const closeTab = async (data: IItem) => { - await delay(1000); - chrome.runtime.sendMessage({ type: "close-tab", payload: data, @@ -341,19 +338,21 @@ port.onMessage.addListener(async (message) => { } finally { await finistPublist(data, { published: true }); + await delay(2000); + await closeTab(data); } } }); -// async function init() { -// const { data } = await axios.get("products/27"); +async function init() { + const { data } = await axios.get("products/27"); -// if (!data.data) return; + if (!data.data) return; -// const item = data.data as IItem; + const item = data.data as IItem; -// await handle(item); -// } + await handle(item); +} -// init(); +init();