diff --git a/auto-post-facebook-extensions_1.0/assets/popup.js b/auto-post-facebook-extensions_1.0/assets/popup.js index d06cb0e..eb528ca 100644 --- a/auto-post-facebook-extensions_1.0/assets/popup.js +++ b/auto-post-facebook-extensions_1.0/assets/popup.js @@ -1 +1 @@ -import{R as c,j as s,Q as u,q as l,P as d}from"./popup-BMz864nQ.js";import"./base64-BbJB1hmJ.js";import"./product-api.service-PLptzR9s.js";import"./app-C7VSS-q9.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();c.createRoot(document.getElementById("root")).render(s.jsx(u,{client:l,children:s.jsx(d,{})})); +import{R as c,j as s,Q as u,q as l,P as d}from"./popup-D--aKLqS.js";import"./base64-BbJB1hmJ.js";import"./product-api.service-DR0CE0o9.js";import"./app-C7VSS-q9.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();c.createRoot(document.getElementById("root")).render(s.jsx(u,{client:l,children:s.jsx(d,{})})); diff --git a/auto-post-facebook-extensions_1.0/content/content.js b/auto-post-facebook-extensions_1.0/content/content.js index f04e19a..954fbe1 100644 --- a/auto-post-facebook-extensions_1.0/content/content.js +++ b/auto-post-facebook-extensions_1.0/content/content.js @@ -1,6 +1,6 @@ -(function(){"use strict";function Ee(t,e){return function(){return t.apply(e,arguments)}}const{toString:it}=Object.prototype,{getPrototypeOf:ce}=Object,{iterator:W,toStringTag:ve}=Symbol,Z=(t=>e=>{const n=it.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=t=>(t=t.toLowerCase(),e=>Z(e)===t),G=t=>e=>typeof e===t,{isArray:q}=Array,$=G("undefined");function z(t){return t!==null&&!$(t)&&t.constructor!==null&&!$(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Se=C("ArrayBuffer");function st(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Se(t.buffer),e}const at=G("string"),O=G("function"),Te=G("number"),J=t=>t!==null&&typeof t=="object",ct=t=>t===!0||t===!1,Y=t=>{if(Z(t)!=="object")return!1;const e=ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ve in t)&&!(W in t)},lt=t=>{if(!J(t)||z(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ut=C("Date"),dt=C("File"),ft=C("Blob"),ht=C("FileList"),pt=t=>J(t)&&O(t.pipe),mt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||O(t.append)&&((e=Z(t))==="formdata"||e==="object"&&O(t.toString)&&t.toString()==="[object FormData]"))},wt=C("URLSearchParams"),[yt,bt,gt,Et]=["ReadableStream","Request","Response","Headers"].map(C),vt=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),q(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ke=t=>!$(t)&&t!==F;function le(){const{caseless:t}=ke(this)&&this||{},e={},n=(r,o)=>{const i=t&&Re(e,o)||o;Y(e[i])&&Y(r)?e[i]=le(e[i],r):Y(r)?e[i]=le({},r):q(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r(V(e,(o,i)=>{n&&O(o)?t[i]=Ee(o,n):t[i]=o},{allOwnKeys:r}),t),Tt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Rt=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},kt=(t,e,n,r)=>{let o,i,s;const c={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!c[s]&&(e[s]=t[s],c[s]=!0);t=n!==!1&&ce(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ot=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Pt=t=>{if(!t)return null;if(q(t))return t;let e=t.length;if(!Te(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},At=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ce(Uint8Array)),_t=(t,e)=>{const r=(t&&t[W]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},xt=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Ct=C("HTMLFormElement"),Nt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Oe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),It=C("RegExp"),Pe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};V(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},Bt=t=>{Pe(t,(e,n)=>{if(O(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(O(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Lt=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return q(t)?r(t):r(String(t).split(e)),n},Ft=()=>{},Ut=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Dt(t){return!!(t&&O(t.append)&&t[ve]==="FormData"&&t[W])}const Mt=t=>{const e=new Array(10),n=(r,o)=>{if(J(r)){if(e.indexOf(r)>=0)return;if(z(r))return r;if(!("toJSON"in r)){e[o]=r;const i=q(r)?[]:{};return V(r,(s,c)=>{const d=n(s,o+1);!$(d)&&(i[c]=d)}),e[o]=void 0,i}}return r};return n(t,0)},qt=C("AsyncFunction"),jt=t=>t&&(J(t)||O(t))&&O(t.then)&&O(t.catch),Ae=((t,e)=>t?setImmediate:e?((n,r)=>(F.addEventListener("message",({source:o,data:i})=>{o===F&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(F.postMessage)),Ht=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ae,a={isArray:q,isArrayBuffer:Se,isBuffer:z,isFormData:mt,isArrayBufferView:st,isString:at,isNumber:Te,isBoolean:ct,isObject:J,isPlainObject:Y,isEmptyObject:lt,isReadableStream:yt,isRequest:bt,isResponse:gt,isHeaders:Et,isUndefined:$,isDate:ut,isFile:dt,isBlob:ft,isRegExp:It,isFunction:O,isStream:pt,isURLSearchParams:wt,isTypedArray:At,isFileList:ht,forEach:V,merge:le,extend:St,trim:vt,stripBOM:Tt,inherits:Rt,toFlatObject:kt,kindOf:Z,kindOfTest:C,endsWith:Ot,toArray:Pt,forEachEntry:_t,matchAll:xt,isHTMLForm:Ct,hasOwnProperty:Oe,hasOwnProp:Oe,reduceDescriptors:Pe,freezeMethods:Bt,toObjectSet:Lt,toCamelCase:Nt,noop:Ft,toFiniteNumber:Ut,findKey:Re,global:F,isContextDefined:ke,isSpecCompliantForm:Dt,toJSONObject:Mt,isAsyncFn:qt,isThenable:jt,setImmediate:Ae,asap:Ht,isIterable:t=>t!=null&&O(t[W])};function m(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(m,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 _e=m.prototype,xe={};["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(t=>{xe[t]={value:t}}),Object.defineProperties(m,xe),Object.defineProperty(_e,"isAxiosError",{value:!0}),m.from=(t,e,n,r,o,i)=>{const s=Object.create(_e);return a.toFlatObject(t,s,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),m.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const $t=null;function ue(t){return a.isPlainObject(t)||a.isArray(t)}function Ce(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,e,n){return t?t.concat(e).map(function(o,i){return o=Ce(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function zt(t){return a.isArray(t)&&!t.some(ue)}const Jt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!d&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,p){let v=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&zt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(v=a.toArray(h)))return y=Ce(y),v.forEach(function(R,I){!(a.isUndefined(R)||R===null)&&e.append(s===!0?Ne([y],I,i):s===null?y:y+"[]",l(R))}),!1}return ue(h)?!0:(e.append(Ne(p,y,i),l(h)),!1)}const f=[],g=Object.assign(Jt,{defaultVisitor:u,convertValue:l,isVisitable:ue});function S(h,y){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),a.forEach(h,function(v,T){(!(a.isUndefined(v)||v===null)&&o.call(e,v,a.isString(T)?T.trim():T,y,g))===!0&&S(v,y?y.concat(T):[T])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return S(t),e}function Ie(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function de(t,e){this._pairs=[],t&&Q(t,this,e)}const Be=de.prototype;Be.append=function(e,n){this._pairs.push([e,n])},Be.toString=function(e){const n=e?function(r){return e.call(this,r,Ie)}:Ie;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Vt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Vt;a.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(e,n):i=a.isURLSearchParams(e)?e.toString():new de(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Fe{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:de,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,Kt=fe&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),Wt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zt=fe&&window.location.href||"http://localhost",k={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Kt,hasStandardBrowserWebWorkerEnv:Wt,navigator:he,origin:Zt},Symbol.toStringTag,{value:"Module"})),...Xt};function Gt(t,e){return Q(t,new k.classes.URLSearchParams,{visitor:function(n,r,o,i){return k.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Yt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Qt(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&a.isArray(o)?o.length:s,d?(a.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!c):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&a.isArray(o[s])&&(o[s]=Qt(o[s])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,o)=>{e(Yt(r),o,n,0)}),n}return null}function en(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const X={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return o?JSON.stringify(De(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Q(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),en(e)):e}],transformResponse:[function(e){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(c){if(s)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{X.headers[t]={}});const tn=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"]),nn=t=>{const e={};let n,r,o;return t&&t.split(` -`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&tn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Me=Symbol("internals");function K(t){return t&&String(t).trim().toLowerCase()}function ee(t){return t===!1||t==null?t:a.isArray(t)?t.map(ee):String(t)}function rn(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const on=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pe(t,e,n,r,o){if(a.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function sn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function an(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}let P=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(c,d,l){const u=K(d);if(!u)throw new Error("header name must be a non-empty string");const f=a.findKey(o,u);(!f||o[f]===void 0||l===!0||l===void 0&&o[f]!==!1)&&(o[f||d]=ee(c))}const s=(c,d)=>a.forEach(c,(l,u)=>i(l,u,d));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(a.isString(e)&&(e=e.trim())&&!on(e))s(nn(e),n);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,l;for(const u of e){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(d=c[l])?a.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(c,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=K(e),e){const r=a.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return rn(o);if(a.isFunction(n))return n.call(this,o,r);if(a.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=K(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=K(s),s){const c=a.findKey(r,s);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],o=!0)}}return a.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||pe(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return a.forEach(this,(o,i)=>{const s=a.findKey(r,i);if(s){n[s]=ee(o),delete n[i];return}const c=e?sn(i):String(i).trim();c!==i&&delete n[i],n[c]=ee(o),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return a.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Me]=this[Me]={accessors:{}}).accessors,o=this.prototype;function i(s){const c=K(s);r[c]||(an(o,s),r[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(P.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(P);function me(t,e){const n=this||X,r=e||n,o=P.from(r.headers);let i=r.data;return a.forEach(t,function(c){i=c.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function qe(t){return!!(t&&t.__CANCEL__)}function j(t,e,n){m.call(this,t??"canceled",m.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(j,m,{__CANCEL__:!0});function je(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ln(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(d){const l=Date.now(),u=r[i];s||(s=l),n[o]=d,r[o]=l;let f=i,g=0;for(;f!==o;)g+=n[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s{n=u,o=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const u=Date.now(),f=u-n;f>=r?s(l,u):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const te=(t,e,n=3)=>{let r=0;const o=ln(50,250);return un(i=>{const s=i.loaded,c=i.lengthComputable?i.total:void 0,d=s-r,l=o(d),u=s<=c;r=s;const f={loaded:s,total:c,progress:c?s/c:void 0,bytes:d,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},He=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},$e=t=>(...e)=>a.asap(()=>t(...e)),dn=k.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,k.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(k.origin),k.navigator&&/(msie|trident)/i.test(k.navigator.userAgent)):()=>!0,fn=k.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),a.isString(r)&&s.push("path="+r),a.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function pn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ze(t,e,n){let r=!hn(e);return t&&(r||n==!1)?pn(t,e):e}const Je=t=>t instanceof P?{...t}:t;function U(t,e){e=e||{};const n={};function r(l,u,f,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(l,u,f,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,f,g)}else return r(l,u,f,g)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,f){if(f in e)return r(l,u);if(f in t)return r(void 0,l)}const d={url:i,method:i,data:i,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:c,headers:(l,u,f)=>o(Je(l),Je(u),f,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const f=d[u]||o,g=f(t[u],e[u],u);a.isUndefined(g)&&f!==c||(n[u]=g)}),n}const Ve=t=>{const e=U({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:c}=e;e.headers=s=P.from(s),e.url=Le(ze(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(n)){if(k.hasStandardBrowserEnv||k.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((d=s.getContentType())!==!1){const[l,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(k.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&dn(e.url))){const l=o&&i&&fn.read(i);l&&s.set(o,l)}return e},mn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ve(t);let i=o.data;const s=P.from(o.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:l}=o,u,f,g,S,h;function y(){S&&S(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(o.method.toUpperCase(),o.url,!0),p.timeout=o.timeout;function v(){if(!p)return;const R=P.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:t,request:p};je(function(M){n(M),y()},function(M){r(M),y()},_),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let I=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||Ue;o.timeoutErrorMessage&&(I=o.timeoutErrorMessage),r(new m(I,_.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},i===void 0&&s.setContentType(null),"setRequestHeader"in p&&a.forEach(s.toJSON(),function(I,_){p.setRequestHeader(_,I)}),a.isUndefined(o.withCredentials)||(p.withCredentials=!!o.withCredentials),c&&c!=="json"&&(p.responseType=o.responseType),l&&([g,h]=te(l,!0),p.addEventListener("progress",g)),d&&p.upload&&([f,S]=te(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(u=R=>{p&&(r(!R||R.type?new j(null,t,p):R),p.abort(),p=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const T=cn(o.url);if(T&&k.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,t));return}p.send(i||null)})},wn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const i=function(l){if(!o){o=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof m?u:new j(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,i(new m(`timeout ${e} of ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},yn=function*(t,e){let n=t.byteLength;if(n{const o=bn(t,e);let i=0,s,c=d=>{s||(s=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:l,value:u}=await o.next();if(l){c(),d.close();return}let f=u.byteLength;if(n){let g=i+=f;n(g)}d.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(d){return c(d),o.return()}},{highWaterMark:2})},ne=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ke=ne&&typeof ReadableStream=="function",En=ne&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),We=(t,...e)=>{try{return!!t(...e)}catch{return!1}},vn=Ke&&We(()=>{let t=!1;const e=new Request(k.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ze=64*1024,we=Ke&&We(()=>a.isReadableStream(new Response("").body)),re={stream:we&&(t=>t.body)};ne&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!re[e]&&(re[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Sn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(k.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await En(t)).byteLength},Tn=async(t,e)=>{const n=a.toFiniteNumber(t.getContentLength());return n??Sn(e)},ye={http:$t,xhr:mn,fetch:ne&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:c,onUploadProgress:d,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:g}=Ve(t);l=l?(l+"").toLowerCase():"text";let S=wn([o,i&&i.toAbortSignal()],s),h;const y=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let p;try{if(d&&vn&&n!=="get"&&n!=="head"&&(p=await Tn(u,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(a.isFormData(r)&&(L=_.headers.get("content-type"))&&u.setContentType(L),_.body){const[M,ae]=He(p,te($e(d)));r=Xe(_.body,Ze,M,ae)}}a.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;h=new Request(e,{...g,signal:S,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?f:void 0});let T=await fetch(h,g);const R=we&&(l==="stream"||l==="response");if(we&&(c||R&&y)){const _={};["status","statusText","headers"].forEach(rt=>{_[rt]=T[rt]});const L=a.toFiniteNumber(T.headers.get("content-length")),[M,ae]=c&&He(L,te($e(c),!0))||[];T=new Response(Xe(T.body,Ze,M,()=>{ae&&ae(),y&&y()}),_)}l=l||"text";let I=await re[a.findKey(re,l)||"text"](T,t);return!R&&y&&y(),await new Promise((_,L)=>{je(_,L,{data:I,headers:P.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:h})})}catch(v){throw y&&y(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,h),{cause:v.cause||v}):m.from(v,v&&v.code,t,h)}})};a.forEach(ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ge=t=>`- ${t}`,Rn=t=>a.isFunction(t)||t===null||t===!1,Ye={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since : -`+i.map(Ge).join(` -`):" "+Ge(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ye};function be(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new j(null,t)}function Qe(t){return be(t),t.headers=P.from(t.headers),t.data=me.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ye.getAdapter(t.adapter||X.adapter)(t).then(function(r){return be(t),r.data=me.call(t,t.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return qe(r)||(be(t),r&&r.response&&(r.response.data=me.call(t,t.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const et="1.11.0",oe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{oe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tt={};oe.transitional=function(e,n,r){function o(i,s){return"[Axios v"+et+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,c)=>{if(e===!1)throw new m(o(s," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!tt[s]&&(tt[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,c):!0}},oe.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function kn(t,e,n){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const c=t[i],d=c===void 0||s(c,i,t);if(d!==!0)throw new m("option "+i+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const ie={assertOptions:kn,validators:oe},N=ie.validators;let D=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=U(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),o!=null&&(a.isFunction(o)?n.paramsSerializer={serialize:o}:ie.assertOptions(o,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ie.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=P.concat(s,i);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,f=0,g;if(!d){const h=[Qe.bind(this),void 0];for(h.unshift(...c),h.push(...l),g=h.length,u=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(c=>{r.subscribe(c),i=c}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,c){r.reason||(r.reason=new j(i,s,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ot(function(o){e=o}),cancel:e}}};function Pn(t){return function(n){return t.apply(null,n)}}function An(t){return a.isObject(t)&&t.isAxiosError===!0}const ge={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(ge).forEach(([t,e])=>{ge[e]=t});function nt(t){const e=new D(t),n=Ee(D.prototype.request,e);return a.extend(n,D.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return nt(U(t,o))},n}const E=nt(X);E.Axios=D,E.CanceledError=j,E.CancelToken=On,E.isCancel=qe,E.VERSION=et,E.toFormData=Q,E.AxiosError=m,E.Cancel=E.CanceledError,E.all=function(e){return Promise.all(e)},E.spread=Pn,E.isAxiosError=An,E.mergeConfig=U,E.AxiosHeaders=P,E.formToJSON=t=>De(a.isHTMLForm(t)?new FormData(t):t),E.getAdapter=Ye.getAdapter,E.HttpStatusCode=ge,E.default=E;const{Axios:Hn,AxiosError:$n,CanceledError:zn,isCancel:Jn,CancelToken:Vn,VERSION:Xn,all:Kn,Cancel:Wn,isAxiosError:Zn,spread:Gn,toFormData:Yn,AxiosHeaders:Qn,HttpStatusCode:er,formToJSON:tr,getAdapter:nr,mergeConfig:rr}=E,se=E.create({baseURL:"http://localhost:3000/",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2ludC5pcHN1cHBseS5jb20uYXUvYXBpL2xvZ2luIiwiaWF0IjoxNzIxNjA5MTEzLCJleHAiOjMyMzUzMzcxMTMsIm5iZiI6MTcyMTYwOTExMywianRpIjoiWHpCZkZPc0ZJUlFxaEZvaiIsInN1YiI6MSwicHJ2IjoiYzhlZTFmYzg5ZTc3NWVjNGM3Mzg2NjdlNWJlMTdhNTkwYjZkNDBmYyJ9.kFFEPpdmNUp-kn_G3cIIc26bivO6tbfcvkpG9I8Im7M"}});class _n{item_per_page=10;async index(e){const n={skip:0,limit:10,order:"updatedAt desc",where:{account:"prology_net",status:"Updated"}};return se({method:"POST",data:{urlAPI:"/api/ebay-listing/listing-get-list",filter:{...n,...e,where:{...n.where,...e?.where}}}})}async get(e){return se({method:"POST",data:{filter:{where:{account:"prology_net",condition:e.raw_condition,productModelCode:e.sku}},pageCurrent:"/ebaytools/listing-ebay",urlAPI:"/api/ebay-listing/get-image-listing"}})}async sync(e){return se({url:"sync",method:"POST",data:e})}async getPublistedProducts(){return se({url:"data"})}async apiRequest(e,n){return new Promise((r,o)=>{const i="req_"+Date.now()+"_"+Math.random();function s(c){c.data.type==="API_RESPONSE"&&c.data.requestId===i&&(window.removeEventListener("message",s),c.data.error?o(c.data.error):r(c.data.payload))}window.addEventListener("message",s),window.postMessage({type:"API_REQUEST",requestId:i,payload:n,fn:e},"*")})}}const H=new _n;function B(t){return new Promise(e=>setTimeout(e,t))}function b(t,e){const n=Math.floor(Math.random()*(e-t+1))+t;return B(n)}class xn{static ID_EXTENSION="ex-root"}class Cn{base64ToFile(e,n,r){const o=e.includes(",")?e.split(",")[1]:e,i=atob(o),s=new ArrayBuffer(i.length),c=new Uint8Array(s);for(let l=0;l{let s=0,c=!1;const d=()=>{const l=document.evaluate(c&&o?o:e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(l instanceof HTMLElement){i(l);return}s++,s{const s=new FileReader;s.onloadend=()=>{typeof s.result=="string"?o(s.result.split(",")[1]):i("Không thể đọc dữ liệu ảnh")},s.onerror=i,s.readAsDataURL(r)})}getImageExtension(e){try{const r=new URL(e).pathname.match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}catch{const o=e.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return o?o[1].toLowerCase():null}}imageLocalToBase64(e){return new Promise((n,r)=>{try{const o=chrome.runtime.getURL(`${e}`);fetch(o).then(i=>i.blob()).then(i=>{const s=new FileReader;s.onloadend=()=>n(s.result),s.onerror=r,s.readAsDataURL(i)}).catch(r)}catch(o){r(o)}})}scrollToElement(e,n="smooth"){e&&e.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(e){if(!e)return null;const n=e.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2;return{x:r,y:o}}setInputValue(e,n){e&&(e.value=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(e,n)=>{let r;if(typeof n=="string"?r=await this.getElementByXPath(n):r=n,!r)throw new Error("Xpath is not found with value: "+e);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,e)};pressEnter(e){if(!e)throw new Error("Textarea not found:",e);e.focus(),["keydown","keypress","keyup"].forEach(n=>{e.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(e,n,r){const o=document.querySelector(e);if(!o)return null;const i=o.querySelectorAll(n);for(const s of i)if(s.innerText.trim().toLowerCase()===r.toLowerCase())return s;return null}findNestedIcElement(e,n,r){let o=null;if(typeof e=="string"){if(document.querySelector(e),!o)return null}else o=e;const i=o.querySelectorAll(n);for(const s of i)if(s.innerText.trim().toLowerCase().includes(r.toLowerCase()))return s;return null}findElInParent(e,n){return e&&e.parentElement?.querySelector(n)||null}waitForElement(e,n=100){return new Promise(r=>{const o=d=>d.offsetParent!==null&&(d.childElementCount>0||d.innerText.trim().length>0),i=()=>{const d=document.querySelector(e);d&&o(d)&&(s.disconnect(),clearInterval(c),r(d))},s=new MutationObserver(i);s.observe(document.body,{childList:!0,subtree:!0});const c=setInterval(i,n);i()})}}const w=new Cn;class Nn{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',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",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/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",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/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[3]/div[2]/div",description_edit_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/div/textarea",sku_edit_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[1]/label/div/input",new_item_btn:"/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]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(e,n="input"){const r=w.findNestedElement(this.selectors.market_container,"span",e);if(!r)throw new Error("Not found input by title: "+e);return w.findElInParent(r,n)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(e=>e?.click())};uploadImages=async e=>{const n=new DataTransfer;for(const o of e.images){const i=await w.imageUrlToBase64(o);console.log("Base64:",o.slice(0,50)+"...");const s=w.base64ToFile(i,e.sku,w.getImageExtension(o)||"jpg");n.items.add(s)}const r=document.querySelector(this.selectors.file__image_input);r?(r.files=n.files,r.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(e,n,r='[aria-label="Dropdown menu"]')=>{const o=w.findNestedElement(this.selectors.market_container,"span",n);w.scrollToElement(o),await b(500,600),o?.click(),await b(500,600);const i=w.findNestedElement(r,"span",e);if(await b(500,600),!i)throw new Error(`No child found with text "${e}"`);w.scrollToElement(i),await b(500,600),i.click(),await b(500,600)};chooseLocation=async e=>{const n=this.findInputByTitle("location");await w.writeToInput(e,n),await B(600);const r=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],o=Array.from(r).find(i=>i.innerHTML.trim().toLowerCase().includes(e.toLowerCase()));if(console.log(o),!o)throw new Error(`No child found with text "${e}"`);w.scrollToElement(o),await B(400),w.clickByPoint(o)};writeTags=async e=>{const n=this.findInputByTitle("product tags","textarea");if(!n)throw new Error("Input is not found");w.scrollToElement(n),await B(500);for(const r of e)await w.writeToInput(r,n),await B(300),w.pressEnter(n)};clickNext=async()=>{const e=await w.getElementByXPath(this.selectors.next_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickUpdate=async()=>{const e=await w.getElementByXPath(this.selectors.update_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickPublist=async()=>{const e=await w.getElementByXPath(this.selectors.publish_btn);if(!e)throw new Error("Publist button is not found");w.clickByPoint(e)};handlePublist=async e=>{console.log({item:e}),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const n=this.findInputByTitle("title");w.writeToInput(e.title,n),await b(600,1e3);const r=this.findInputByTitle("price");if(w.writeToInput(String(e.price),r),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),e.brand){await b(600,1e3);const s=this.findInputByTitle("brand");await w.writeToInput(e.brand,s)}await b(600,1e3);const o=this.findInputByTitle("description","textarea");await w.writeToInput(e.description,o),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3);const i=this.findInputByTitle("sku");return await w.writeToInput(e.sku,i),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),await b(300,500),await this.clickNext(),!0};handleRePublist=async e=>{console.log({item:e}),await w.waitForElement('[aria-label="Collection of your Marketplace items"]');const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"edit"),await B(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await b(1e3,2e3),await this.clearImages(),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const r=this.findInputByTitle("title");w.writeToInput(e.title,r),await b(600,1e3);const o=this.findInputByTitle("price");w.writeToInput(String(e.price),o),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),await b(600,1e3);const i=this.findInputByTitle("description","textarea");return await w.writeToInput(e.description,i),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),!0};getProducts=async()=>{const e=await w.getElementByXPath(this.selectors.products),n=await w.getElementByXPath(this.selectors.products_fallback);console.log({products1:e,products2:n});const r=[e,n].filter(Boolean);return r.length===0?[]:r.flatMap(o=>this.extractListings(o))};extractListings(e){return Array.from(e.children).map(r=>{const i=r.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",s=document.querySelectorAll(`[aria-label="${i}"]`),c=Array.from(s).filter(f=>!f.querySelector("img"))[0],l=w.findNestedIcElement(c,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),u=l?parseFloat(l[0].replace(/,/g,"")):0;return{title:i,price:u,el:e}})}closeTab=async e=>{chrome.runtime.sendMessage({type:"close-tab",payload:e})};clickOptionOfProduct(e){const n=document.querySelector(`[aria-label="More options for ${e.title}"]`);if(!n)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${e.title}"]`}, ID: ${e.id}`);w.scrollToElement(n),n.click?.()}async getOptionEls(e){return this.clickOptionOfProduct(e),await B(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(e,n){const r=e.find(o=>o.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);r.click?.()}getItemInList(e,n){const r=e.find(o=>o.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);return r}handleDelete=async e=>{const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"delete"),await B(1e3);const r=await w.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:r}),r?.click(),(await w.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(e,n=1e4){return new Promise((r,o)=>{const i=Date.now(),s=()=>{window.location.href.includes(e)?r():Date.now()-i>n?o(new Error("Timeout waiting for URL change")):setTimeout(s,500)};s()})}waitForPageReady(e,n,r=15e3){return new Promise((o,i)=>{const s=Date.now(),c=async()=>{window.location.href.includes(e)&&document.querySelector(n)?o():Date.now()-s>r?i(new Error("Timeout waiting for selling page ready")):setTimeout(c,500)};c()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await A.getProducts()};extractMarketplaceItemId(e){const n=e.match(/\/marketplace\/item\/(\d+)/);return n?n[1]:null}handleGetPublistID=async e=>{const n=await A.getProducts(),r=n.find(c=>c.title==e.title&&c.price==e.price);if(console.log({payload:e,product:r,products:n}),!r)return;r.el;const o=await this.getOptionEls(e),i=this.getItemInList(o,"view listing"),s=this.extractMarketplaceItemId(i.href);return this.clickOptionOfProduct(e),s};async gotoPublist(){(await w.getElementByXPath(this.selectors.new_item_btn))?.click(),await b(400,800),(await w.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const A=new Nn;class In{role;listeners;constructor(e){this.role=e,this.listeners=new Map,chrome.runtime.onMessage.addListener((n,r,o)=>{if(n?.type&&this.listeners.has(n.type))return this.listeners.get(n.type)(n.payload,r,o),!0})}on(e,n){this.listeners.set(e,n)}send(e,n,r){const o={from:this.role,to:e,type:n,payload:r};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(o),this.role==="background"&&(e==="content"?chrome.tabs.query({active:!0,currentWindow:!0},i=>{i[0]?.id&&chrome.tabs.sendMessage(i[0].id,o,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):e==="popup"&&chrome.runtime.sendMessage(o,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(e,n,r){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const o={from:this.role,to:"content",type:n,payload:r};chrome.tabs.sendMessage(e,o,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${e}:`,chrome.runtime.lastError.message)})}waitForMessage(e,n=3e4){return new Promise((r,o)=>{let i;const s=c=>{clearTimeout(i),this.off(e,s),r(c)};i=setTimeout(()=>{this.off(e,s),o(new Error(`Timeout khi chờ message: ${e}`))},n),this.on(e,s)})}off(e,n){this.listeners.get(e)===n&&this.listeners.delete(e)}}const x=new In("content"),Bn=()=>{const t=xn.ID_EXTENSION;if(document.getElementById(t))return;const e=document.createElement("div");e.id=t,document.body.appendChild(e);const n=document.createElement("script");n.src=chrome.runtime.getURL("content/inject-ui.js"),n.type="module",document.body.appendChild(n);const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=chrome.runtime.getURL("assets/style.css"),document.head.appendChild(r)};x.on("background-to-content-publish",async t=>{try{console.log("[publish] Content nhận:",t),await b(800,1e3),await A.handlePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-publish",{msg:t})}}),x.on("background-to-content-unlist",async t=>{try{console.log("[unlist] Content nhận:",t),await b(800,1e3),await A.gotoSell(),await b(800,1e3),await A.handleDelete(t.data),await b(800,1e3);const e=await A.getProducts();await b(800,1e3),H.sync(e)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-unlist",{msg:t})}}),x.on("background-to-content-re-publist",async t=>{try{console.log("[re-publist] Content nhận:",t),await b(800,1e3),await A.gotoSell(),await b(800,1e3),await A.handleRePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-re-publist",{msg:t})}}),window.addEventListener("message",async t=>{if(t.source===window&&t.data.type==="API_REQUEST"){const e=t.data.payload,n=t.data.fn,{requestId:r}=t.data;console.log({requestId:r,event:t,body:e});try{let o=null;switch(n){case"index":{o=(await H.index(e)).data;break}case"getPublistedProducts":{o=(await H.getPublistedProducts()).data;break}case"get":{o=(await H.get(e)).data,console.log({data:o,body:e});break}case"createBlobUrl":{x.send("background","content-to-background-create-blod-urls",e),o=await x.waitForMessage("background-to-content-create-blod-urls"),console.log({data:o});break}case"publist":{x.send("background","content-to-background-actions",{type:"publist",data:e}),o=await x.waitForMessage("background-to-content-actions");break}case"unlist":{x.send("background","content-to-background-actions",{type:"unlist",data:e}),console.log({body:e}),o=await x.waitForMessage("background-to-content-actions"),console.log({unlisted:o});break}case"sync":{const i=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",i),await A.waitForPageReady(A.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const s=await A.getProducts();console.log({products:s}),await H.sync(s);break}}window.postMessage({type:"API_RESPONSE",requestId:r,payload:o},"*")}catch(o){window.postMessage({type:"API_RESPONSE",requestId:r,error:o.message},"*")}}}),(async()=>(await b(800,1e3),w.waitForElement('[aria-label="Collection of your Marketplace items"]').then(async t=>{console.log("Element đã xuất hiện:",t),await A.waitForPageReady(A.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const e=await A.getProducts();console.log({products:e}),H.sync(e),Bn()}).catch(t=>{console.error(t)})))()})(); +(function(){"use strict";function Ee(t,e){return function(){return t.apply(e,arguments)}}const{toString:st}=Object.prototype,{getPrototypeOf:ce}=Object,{iterator:W,toStringTag:ve}=Symbol,Z=(t=>e=>{const n=st.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=t=>(t=t.toLowerCase(),e=>Z(e)===t),G=t=>e=>typeof e===t,{isArray:q}=Array,$=G("undefined");function z(t){return t!==null&&!$(t)&&t.constructor!==null&&!$(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Se=C("ArrayBuffer");function at(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Se(t.buffer),e}const ct=G("string"),O=G("function"),Te=G("number"),J=t=>t!==null&&typeof t=="object",lt=t=>t===!0||t===!1,Y=t=>{if(Z(t)!=="object")return!1;const e=ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ve in t)&&!(W in t)},ut=t=>{if(!J(t)||z(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},dt=C("Date"),ft=C("File"),ht=C("Blob"),pt=C("FileList"),mt=t=>J(t)&&O(t.pipe),wt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||O(t.append)&&((e=Z(t))==="formdata"||e==="object"&&O(t.toString)&&t.toString()==="[object FormData]"))},yt=C("URLSearchParams"),[bt,gt,Et,vt]=["ReadableStream","Request","Response","Headers"].map(C),St=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),q(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ke=t=>!$(t)&&t!==F;function le(){const{caseless:t}=ke(this)&&this||{},e={},n=(r,i)=>{const o=t&&Re(e,i)||i;Y(e[o])&&Y(r)?e[o]=le(e[o],r):Y(r)?e[o]=le({},r):q(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r(V(e,(i,o)=>{n&&O(i)?t[o]=Ee(i,n):t[o]=i},{allOwnKeys:r}),t),Rt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),kt=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Pt=(t,e,n,r)=>{let i,o,s;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!c[s]&&(e[s]=t[s],c[s]=!0);t=n!==!1&&ce(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ot=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},At=t=>{if(!t)return null;if(q(t))return t;let e=t.length;if(!Te(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},_t=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ce(Uint8Array)),xt=(t,e)=>{const r=(t&&t[W]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},Ct=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Nt=C("HTMLFormElement"),It=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Bt=C("RegExp"),Oe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};V(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},Lt=t=>{Oe(t,(e,n)=>{if(O(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(O(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return q(t)?r(t):r(String(t).split(e)),n},Ut=()=>{},Dt=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Mt(t){return!!(t&&O(t.append)&&t[ve]==="FormData"&&t[W])}const qt=t=>{const e=new Array(10),n=(r,i)=>{if(J(r)){if(e.indexOf(r)>=0)return;if(z(r))return r;if(!("toJSON"in r)){e[i]=r;const o=q(r)?[]:{};return V(r,(s,c)=>{const d=n(s,i+1);!$(d)&&(o[c]=d)}),e[i]=void 0,o}}return r};return n(t,0)},jt=C("AsyncFunction"),Ht=t=>t&&(J(t)||O(t))&&O(t.then)&&O(t.catch),Ae=((t,e)=>t?setImmediate:e?((n,r)=>(F.addEventListener("message",({source:i,data:o})=>{i===F&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(F.postMessage)),$t=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ae,a={isArray:q,isArrayBuffer:Se,isBuffer:z,isFormData:wt,isArrayBufferView:at,isString:ct,isNumber:Te,isBoolean:lt,isObject:J,isPlainObject:Y,isEmptyObject:ut,isReadableStream:bt,isRequest:gt,isResponse:Et,isHeaders:vt,isUndefined:$,isDate:dt,isFile:ft,isBlob:ht,isRegExp:Bt,isFunction:O,isStream:mt,isURLSearchParams:yt,isTypedArray:_t,isFileList:pt,forEach:V,merge:le,extend:Tt,trim:St,stripBOM:Rt,inherits:kt,toFlatObject:Pt,kindOf:Z,kindOfTest:C,endsWith:Ot,toArray:At,forEachEntry:xt,matchAll:Ct,isHTMLForm:Nt,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:Oe,freezeMethods:Lt,toObjectSet:Ft,toCamelCase:It,noop:Ut,toFiniteNumber:Dt,findKey:Re,global:F,isContextDefined:ke,isSpecCompliantForm:Mt,toJSONObject:qt,isAsyncFn:jt,isThenable:Ht,setImmediate:Ae,asap:$t,isIterable:t=>t!=null&&O(t[W])};function m(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}a.inherits(m,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 _e=m.prototype,xe={};["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(t=>{xe[t]={value:t}}),Object.defineProperties(m,xe),Object.defineProperty(_e,"isAxiosError",{value:!0}),m.from=(t,e,n,r,i,o)=>{const s=Object.create(_e);return a.toFlatObject(t,s,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),m.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const zt=null;function ue(t){return a.isPlainObject(t)||a.isArray(t)}function Ce(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,e,n){return t?t.concat(e).map(function(i,o){return i=Ce(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function Jt(t){return a.isArray(t)&&!t.some(ue)}const Vt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!d&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,p){let v=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&Jt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(v=a.toArray(h)))return y=Ce(y),v.forEach(function(R,I){!(a.isUndefined(R)||R===null)&&e.append(s===!0?Ne([y],I,o):s===null?y:y+"[]",l(R))}),!1}return ue(h)?!0:(e.append(Ne(p,y,o),l(h)),!1)}const f=[],g=Object.assign(Vt,{defaultVisitor:u,convertValue:l,isVisitable:ue});function S(h,y){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),a.forEach(h,function(v,T){(!(a.isUndefined(v)||v===null)&&i.call(e,v,a.isString(T)?T.trim():T,y,g))===!0&&S(v,y?y.concat(T):[T])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return S(t),e}function Ie(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function de(t,e){this._pairs=[],t&&Q(t,this,e)}const Be=de.prototype;Be.append=function(e,n){this._pairs.push([e,n])},Be.toString=function(e){const n=e?function(r){return e.call(this,r,Ie)}:Ie;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Xt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Xt;a.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(e,n):o=a.isURLSearchParams(e)?e.toString():new de(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Fe{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Kt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:de,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,Wt=fe&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),Zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gt=fe&&window.location.href||"http://localhost",k={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:Zt,navigator:he,origin:Gt},Symbol.toStringTag,{value:"Module"})),...Kt};function Yt(t,e){return Q(t,new k.classes.URLSearchParams,{visitor:function(n,r,i,o){return k.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Qt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function en(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&a.isArray(i)?i.length:s,d?(a.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!c):((!i[s]||!a.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&a.isArray(i[s])&&(i[s]=en(i[s])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,i)=>{e(Qt(r),i,n,0)}),n}return null}function tn(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const X={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return i?JSON.stringify(De(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Yt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Q(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),tn(e)):e}],transformResponse:[function(e){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(s)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{X.headers[t]={}});const nn=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"]),rn=t=>{const e={};let n,r,i;return t&&t.split(` +`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&nn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Me=Symbol("internals");function K(t){return t&&String(t).trim().toLowerCase()}function ee(t){return t===!1||t==null?t:a.isArray(t)?t.map(ee):String(t)}function on(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const sn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pe(t,e,n,r,i){if(a.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function an(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function cn(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}let A=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(c,d,l){const u=K(d);if(!u)throw new Error("header name must be a non-empty string");const f=a.findKey(i,u);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||d]=ee(c))}const s=(c,d)=>a.forEach(c,(l,u)=>o(l,u,d));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(a.isString(e)&&(e=e.trim())&&!sn(e))s(rn(e),n);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,l;for(const u of e){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(d=c[l])?a.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(c,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=K(e),e){const r=a.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return on(i);if(a.isFunction(n))return n.call(this,i,r);if(a.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=K(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=K(s),s){const c=a.findKey(r,s);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],i=!0)}}return a.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||pe(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return a.forEach(this,(i,o)=>{const s=a.findKey(r,o);if(s){n[s]=ee(i),delete n[o];return}const c=e?an(o):String(o).trim();c!==o&&delete n[o],n[c]=ee(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return a.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Me]=this[Me]={accessors:{}}).accessors,i=this.prototype;function o(s){const c=K(s);r[c]||(cn(i,s),r[c]=!0)}return a.isArray(e)?e.forEach(o):o(e),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(A.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(A);function me(t,e){const n=this||X,r=e||n,i=A.from(r.headers);let o=r.data;return a.forEach(t,function(c){o=c.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function qe(t){return!!(t&&t.__CANCEL__)}function j(t,e,n){m.call(this,t??"canceled",m.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(j,m,{__CANCEL__:!0});function je(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ln(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function un(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(d){const l=Date.now(),u=r[o];s||(s=l),n[i]=d,r[i]=l;let f=o,g=0;for(;f!==i;)g+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),l-s{n=u,i=null,o&&(clearTimeout(o),o=null),t(...l)};return[(...l)=>{const u=Date.now(),f=u-n;f>=r?s(l,u):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const te=(t,e,n=3)=>{let r=0;const i=un(50,250);return dn(o=>{const s=o.loaded,c=o.lengthComputable?o.total:void 0,d=s-r,l=i(d),u=s<=c;r=s;const f={loaded:s,total:c,progress:c?s/c:void 0,bytes:d,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},He=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},$e=t=>(...e)=>a.asap(()=>t(...e)),fn=k.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,k.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(k.origin),k.navigator&&/(msie|trident)/i.test(k.navigator.userAgent)):()=>!0,hn=k.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),a.isString(r)&&s.push("path="+r),a.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function mn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ze(t,e,n){let r=!pn(e);return t&&(r||n==!1)?mn(t,e):e}const Je=t=>t instanceof A?{...t}:t;function U(t,e){e=e||{};const n={};function r(l,u,f,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function i(l,u,f,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,f,g)}else return r(l,u,f,g)}function o(l,u){if(!a.isUndefined(u))return r(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,f){if(f in e)return r(l,u);if(f in t)return r(void 0,l)}const d={url:o,method:o,data:o,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:c,headers:(l,u,f)=>i(Je(l),Je(u),f,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const f=d[u]||i,g=f(t[u],e[u],u);a.isUndefined(g)&&f!==c||(n[u]=g)}),n}const Ve=t=>{const e=U({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:c}=e;e.headers=s=A.from(s),e.url=Le(ze(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(n)){if(k.hasStandardBrowserEnv||k.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((d=s.getContentType())!==!1){const[l,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(k.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&fn(e.url))){const l=i&&o&&hn.read(o);l&&s.set(i,l)}return e},wn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=Ve(t);let o=i.data;const s=A.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:l}=i,u,f,g,S,h;function y(){S&&S(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const R=A.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:t,request:p};je(function(M){n(M),y()},function(M){r(M),y()},_),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||Ue;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new m(I,_.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},o===void 0&&s.setContentType(null),"setRequestHeader"in p&&a.forEach(s.toJSON(),function(I,_){p.setRequestHeader(_,I)}),a.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),c&&c!=="json"&&(p.responseType=i.responseType),l&&([g,h]=te(l,!0),p.addEventListener("progress",g)),d&&p.upload&&([f,S]=te(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(u=R=>{p&&(r(!R||R.type?new j(null,t,p):R),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const T=ln(i.url);if(T&&k.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,t));return}p.send(o||null)})},yn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(l){if(!i){i=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof m?u:new j(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,o(new m(`timeout ${e} of ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),t=null)};t.forEach(l=>l.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},bn=function*(t,e){let n=t.byteLength;if(n{const i=gn(t,e);let o=0,s,c=d=>{s||(s=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:l,value:u}=await i.next();if(l){c(),d.close();return}let f=u.byteLength;if(n){let g=o+=f;n(g)}d.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},ne=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ke=ne&&typeof ReadableStream=="function",vn=ne&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),We=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Sn=Ke&&We(()=>{let t=!1;const e=new Request(k.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ze=64*1024,we=Ke&&We(()=>a.isReadableStream(new Response("").body)),re={stream:we&&(t=>t.body)};ne&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!re[e]&&(re[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Tn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(k.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await vn(t)).byteLength},Rn=async(t,e)=>{const n=a.toFiniteNumber(t.getContentLength());return n??Tn(e)},ye={http:zt,xhr:wn,fetch:ne&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:c,onUploadProgress:d,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:g}=Ve(t);l=l?(l+"").toLowerCase():"text";let S=yn([i,o&&o.toAbortSignal()],s),h;const y=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let p;try{if(d&&Sn&&n!=="get"&&n!=="head"&&(p=await Rn(u,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(a.isFormData(r)&&(L=_.headers.get("content-type"))&&u.setContentType(L),_.body){const[M,ae]=He(p,te($e(d)));r=Xe(_.body,Ze,M,ae)}}a.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;h=new Request(e,{...g,signal:S,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?f:void 0});let T=await fetch(h,g);const R=we&&(l==="stream"||l==="response");if(we&&(c||R&&y)){const _={};["status","statusText","headers"].forEach(it=>{_[it]=T[it]});const L=a.toFiniteNumber(T.headers.get("content-length")),[M,ae]=c&&He(L,te($e(c),!0))||[];T=new Response(Xe(T.body,Ze,M,()=>{ae&&ae(),y&&y()}),_)}l=l||"text";let I=await re[a.findKey(re,l)||"text"](T,t);return!R&&y&&y(),await new Promise((_,L)=>{je(_,L,{data:I,headers:A.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:h})})}catch(v){throw y&&y(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,h),{cause:v.cause||v}):m.from(v,v&&v.code,t,h)}})};a.forEach(ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ge=t=>`- ${t}`,kn=t=>a.isFunction(t)||t===null||t===!1,Ye={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since : +`+o.map(Ge).join(` +`):" "+Ge(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ye};function be(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new j(null,t)}function Qe(t){return be(t),t.headers=A.from(t.headers),t.data=me.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ye.getAdapter(t.adapter||X.adapter)(t).then(function(r){return be(t),r.data=me.call(t,t.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return qe(r)||(be(t),r&&r.response&&(r.response.data=me.call(t,t.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const et="1.11.0",ie={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ie[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tt={};ie.transitional=function(e,n,r){function i(o,s){return"[Axios v"+et+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,c)=>{if(e===!1)throw new m(i(s," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!tt[s]&&(tt[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,c):!0}},ie.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Pn(t,e,n){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const c=t[o],d=c===void 0||s(c,o,t);if(d!==!0)throw new m("option "+o+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const oe={assertOptions:Pn,validators:ie},N=oe.validators;let D=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=U(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&oe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),i!=null&&(a.isFunction(i)?n.paramsSerializer={serialize:i}:oe.assertOptions(i,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),oe.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=A.concat(s,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,f=0,g;if(!d){const h=[Qe.bind(this),void 0];for(h.unshift(...c),h.push(...l),g=h.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(c=>{r.subscribe(c),o=c}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,c){r.reason||(r.reason=new j(o,s,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ot(function(i){e=i}),cancel:e}}};function An(t){return function(n){return t.apply(null,n)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const ge={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(ge).forEach(([t,e])=>{ge[e]=t});function nt(t){const e=new D(t),n=Ee(D.prototype.request,e);return a.extend(n,D.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return nt(U(t,i))},n}const E=nt(X);E.Axios=D,E.CanceledError=j,E.CancelToken=On,E.isCancel=qe,E.VERSION=et,E.toFormData=Q,E.AxiosError=m,E.Cancel=E.CanceledError,E.all=function(e){return Promise.all(e)},E.spread=An,E.isAxiosError=_n,E.mergeConfig=U,E.AxiosHeaders=A,E.formToJSON=t=>De(a.isHTMLForm(t)?new FormData(t):t),E.getAdapter=Ye.getAdapter,E.HttpStatusCode=ge,E.default=E;const{Axios:Hn,AxiosError:$n,CanceledError:zn,isCancel:Jn,CancelToken:Vn,VERSION:Xn,all:Kn,Cancel:Wn,isAxiosError:Zn,spread:Gn,toFormData:Yn,AxiosHeaders:Qn,HttpStatusCode:er,formToJSON:tr,getAdapter:nr,mergeConfig:rr}=E,se=E.create({baseURL:"https://aitool.danielvu.com/auto-list/",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2ludC5pcHN1cHBseS5jb20uYXUvYXBpL2xvZ2luIiwiaWF0IjoxNzIxNjA5MTEzLCJleHAiOjMyMzUzMzcxMTMsIm5iZiI6MTcyMTYwOTExMywianRpIjoiWHpCZkZPc0ZJUlFxaEZvaiIsInN1YiI6MSwicHJ2IjoiYzhlZTFmYzg5ZTc3NWVjNGM3Mzg2NjdlNWJlMTdhNTkwYjZkNDBmYyJ9.kFFEPpdmNUp-kn_G3cIIc26bivO6tbfcvkpG9I8Im7M"}});class xn{item_per_page=10;async index(e){const n={skip:0,limit:10,order:"updatedAt desc",where:{account:"prology_net",status:"Updated"}};return se({method:"POST",data:{urlAPI:"/api/ebay-listing/listing-get-list",filter:{...n,...e,where:{...n.where,...e?.where}}}})}async get(e){return se({method:"POST",data:{filter:{where:{account:"prology_net",condition:e.raw_condition,productModelCode:e.sku}},pageCurrent:"/ebaytools/listing-ebay",urlAPI:"/api/ebay-listing/get-image-listing"}})}async sync(e){return se({url:"sync",method:"POST",data:e})}async getPublistedProducts(){return se({url:"data"})}async apiRequest(e,n){return new Promise((r,i)=>{const o="req_"+Date.now()+"_"+Math.random();function s(c){c.data.type==="API_RESPONSE"&&c.data.requestId===o&&(window.removeEventListener("message",s),c.data.error?i(c.data.error):r(c.data.payload))}window.addEventListener("message",s),window.postMessage({type:"API_REQUEST",requestId:o,payload:n,fn:e},"*")})}}const H=new xn;function B(t){return new Promise(e=>setTimeout(e,t))}function b(t,e){const n=Math.floor(Math.random()*(e-t+1))+t;return B(n)}class Cn{static ID_EXTENSION="ex-root"}class Nn{base64ToFile(e,n,r){const i=e.includes(",")?e.split(",")[1]:e,o=atob(i),s=new ArrayBuffer(o.length),c=new Uint8Array(s);for(let l=0;l{let s=0,c=!1;const d=()=>{const l=document.evaluate(c&&i?i:e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(l instanceof HTMLElement){o(l);return}s++,s{const s=new FileReader;s.onloadend=()=>{typeof s.result=="string"?i(s.result.split(",")[1]):o("Không thể đọc dữ liệu ảnh")},s.onerror=o,s.readAsDataURL(r)})}getImageExtension(e){try{const r=new URL(e).pathname.match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}catch{const i=e.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}}imageLocalToBase64(e){return new Promise((n,r)=>{try{const i=chrome.runtime.getURL(`${e}`);fetch(i).then(o=>o.blob()).then(o=>{const s=new FileReader;s.onloadend=()=>n(s.result),s.onerror=r,s.readAsDataURL(o)}).catch(r)}catch(i){r(i)}})}scrollToElement(e,n="smooth"){e&&e.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(e){if(!e)return null;const n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;return{x:r,y:i}}setInputValue(e,n){e&&(e.value=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(e,n)=>{let r;if(typeof n=="string"?r=await this.getElementByXPath(n):r=n,!r)throw new Error("Xpath is not found with value: "+e);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,e)};pressEnter(e){if(!e)throw new Error("Textarea not found:",e);e.focus(),["keydown","keypress","keyup"].forEach(n=>{e.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(e,n,r){const i=document.querySelector(e);if(!i)return null;const o=i.querySelectorAll(n);for(const s of o)if(s.innerText.trim().toLowerCase()===r.toLowerCase())return s;return null}findNestedIcElement(e,n,r){let i=null;if(typeof e=="string"){if(document.querySelector(e),!i)return null}else i=e;const o=i.querySelectorAll(n);for(const s of o)if(s.innerText.trim().toLowerCase().includes(r.toLowerCase()))return s;return null}findElInParent(e,n){return e&&e.parentElement?.querySelector(n)||null}waitForElement(e,n=100){return new Promise(r=>{const i=d=>d.offsetParent!==null&&(d.childElementCount>0||d.innerText.trim().length>0),o=()=>{const d=document.querySelector(e);d&&i(d)&&(s.disconnect(),clearInterval(c),r(d))},s=new MutationObserver(o);s.observe(document.body,{childList:!0,subtree:!0});const c=setInterval(o,n);o()})}}const w=new Nn;class In{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',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",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/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",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/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[3]/div[2]/div",description_edit_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/div/textarea",sku_edit_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[1]/label/div/input",new_item_btn:"/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]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(e,n="input"){const r=w.findNestedElement(this.selectors.market_container,"span",e);if(!r)throw new Error("Not found input by title: "+e);return w.findElInParent(r,n)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(e=>e?.click())};uploadImages=async e=>{const n=new DataTransfer;for(const i of e.images){const o=await w.imageUrlToBase64(i);console.log("Base64:",i.slice(0,50)+"...");const s=w.base64ToFile(o,e.sku,w.getImageExtension(i)||"jpg");n.items.add(s)}const r=document.querySelector(this.selectors.file__image_input);r?(r.files=n.files,r.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(e,n,r='[aria-label="Dropdown menu"]')=>{const i=w.findNestedElement(this.selectors.market_container,"span",n);w.scrollToElement(i),await b(500,600),i?.click(),await b(500,600);const o=w.findNestedElement(r,"span",e);if(await b(500,600),!o)throw new Error(`No child found with text "${e}"`);w.scrollToElement(o),await b(500,600),o.click(),await b(500,600)};chooseLocation=async e=>{const n=this.findInputByTitle("location");await w.writeToInput(e,n),await B(600);const r=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],i=Array.from(r).find(o=>o.innerHTML.trim().toLowerCase().includes(e.toLowerCase()));if(console.log(i),!i)throw new Error(`No child found with text "${e}"`);w.scrollToElement(i),await B(400),w.clickByPoint(i)};writeTags=async e=>{const n=this.findInputByTitle("product tags","textarea");if(!n)throw new Error("Input is not found");w.scrollToElement(n),await B(500);for(const r of e)await w.writeToInput(r,n),await B(300),w.pressEnter(n)};clickNext=async()=>{const e=await w.getElementByXPath(this.selectors.next_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickUpdate=async()=>{const e=await w.getElementByXPath(this.selectors.update_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickPublist=async()=>{const e=await w.getElementByXPath(this.selectors.publish_btn);if(!e)throw new Error("Publist button is not found");w.clickByPoint(e)};handlePublist=async e=>{console.log({item:e}),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const n=this.findInputByTitle("title");w.writeToInput(e.title,n),await b(600,1e3);const r=this.findInputByTitle("price");if(w.writeToInput(String(e.price),r),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),e.brand){await b(600,1e3);const s=this.findInputByTitle("brand");await w.writeToInput(e.brand,s)}await b(600,1e3);const i=this.findInputByTitle("description","textarea");await w.writeToInput(e.description,i),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3);const o=this.findInputByTitle("sku");return await w.writeToInput(e.sku,o),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),await b(300,500),await this.clickNext(),!0};handleRePublist=async e=>{console.log({item:e}),await w.waitForElement('[aria-label="Collection of your Marketplace items"]');const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"edit"),await B(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await b(1e3,2e3),await this.clearImages(),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const r=this.findInputByTitle("title");w.writeToInput(e.title,r),await b(600,1e3);const i=this.findInputByTitle("price");w.writeToInput(String(e.price),i),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),await b(600,1e3);const o=this.findInputByTitle("description","textarea");return await w.writeToInput(e.description,o),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),!0};getProducts=async()=>{const e=await w.getElementByXPath(this.selectors.products),n=await w.getElementByXPath(this.selectors.products_fallback);console.log({products1:e,products2:n});const r=[e,n].filter(Boolean);return r.length===0?[]:r.flatMap(i=>this.extractListings(i))};extractListings(e){return Array.from(e.children).map(r=>{const o=r.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",s=document.querySelectorAll(`[aria-label="${o}"]`),c=Array.from(s).filter(f=>!f.querySelector("img"))[0],l=w.findNestedIcElement(c,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),u=l?parseFloat(l[0].replace(/,/g,"")):0;return{title:o,price:u,el:e}})}closeTab=async e=>{chrome.runtime.sendMessage({type:"close-tab",payload:e})};clickOptionOfProduct(e){const n=document.querySelector(`[aria-label="More options for ${e.title}"]`);if(!n)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${e.title}"]`}, ID: ${e.id}`);w.scrollToElement(n),n.click?.()}async getOptionEls(e){return this.clickOptionOfProduct(e),await B(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(e,n){const r=e.find(i=>i.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);r.click?.()}getItemInList(e,n){const r=e.find(i=>i.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);return r}handleDelete=async e=>{const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"delete"),await B(1e3);const r=await w.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:r}),r?.click(),(await w.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(e,n=1e4){return new Promise((r,i)=>{const o=Date.now(),s=()=>{window.location.href.includes(e)?r():Date.now()-o>n?i(new Error("Timeout waiting for URL change")):setTimeout(s,500)};s()})}waitForPageReady(e,n,r=15e3){return new Promise((i,o)=>{const s=Date.now(),c=async()=>{window.location.href.includes(e)&&document.querySelector(n)?i():Date.now()-s>r?o(new Error("Timeout waiting for selling page ready")):setTimeout(c,500)};c()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await P.getProducts()};extractMarketplaceItemId(e){const n=e.match(/\/marketplace\/item\/(\d+)/);return n?n[1]:null}handleGetPublistID=async e=>{const n=await P.getProducts(),r=n.find(c=>c.title==e.title&&c.price==e.price);if(console.log({payload:e,product:r,products:n}),!r)return;r.el;const i=await this.getOptionEls(e),o=this.getItemInList(i,"view listing"),s=this.extractMarketplaceItemId(o.href);return this.clickOptionOfProduct(e),s};async gotoPublist(){(await w.getElementByXPath(this.selectors.new_item_btn))?.click(),await b(400,800),(await w.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const P=new In;class Bn{role;listeners;constructor(e){this.role=e,this.listeners=new Map,chrome.runtime.onMessage.addListener((n,r,i)=>{if(n?.type&&this.listeners.has(n.type))return this.listeners.get(n.type)(n.payload,r,i),!0})}on(e,n){this.listeners.set(e,n)}send(e,n,r){const i={from:this.role,to:e,type:n,payload:r};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(i),this.role==="background"&&(e==="content"?chrome.tabs.query({active:!0,currentWindow:!0},o=>{o[0]?.id&&chrome.tabs.sendMessage(o[0].id,i,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):e==="popup"&&chrome.runtime.sendMessage(i,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(e,n,r){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const i={from:this.role,to:"content",type:n,payload:r};chrome.tabs.sendMessage(e,i,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${e}:`,chrome.runtime.lastError.message)})}waitForMessage(e,n=3e4){return new Promise((r,i)=>{let o;const s=c=>{clearTimeout(o),this.off(e,s),r(c)};o=setTimeout(()=>{this.off(e,s),i(new Error(`Timeout khi chờ message: ${e}`))},n),this.on(e,s)})}off(e,n){this.listeners.get(e)===n&&this.listeners.delete(e)}}const x=new Bn("content"),rt=()=>{const t=Cn.ID_EXTENSION;if(document.getElementById(t))return;const e=document.createElement("div");e.id=t,document.body.appendChild(e);const n=document.createElement("script");n.src=chrome.runtime.getURL("content/inject-ui.js"),n.type="module",document.body.appendChild(n);const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=chrome.runtime.getURL("assets/style.css"),document.head.appendChild(r)};x.on("background-to-content-publish",async t=>{try{console.log("[publish] Content nhận:",t),await b(800,1e3),await P.handlePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-publish",{msg:t})}}),x.on("background-to-content-unlist",async t=>{try{console.log("[unlist] Content nhận:",t),await b(800,1e3),await P.gotoSell(),await b(800,1e3),await P.handleDelete(t.data),await b(800,1e3);const e=await P.getProducts();await b(800,1e3),H.sync(e)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-unlist",{msg:t})}}),x.on("background-to-content-re-publist",async t=>{try{console.log("[re-publist] Content nhận:",t),await b(800,1e3),await P.gotoSell(),await b(800,1e3),await P.handleRePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-re-publist",{msg:t})}}),window.addEventListener("message",async t=>{if(t.source===window&&t.data.type==="API_REQUEST"){const e=t.data.payload,n=t.data.fn,{requestId:r}=t.data;console.log({requestId:r,event:t,body:e});try{let i=null;switch(n){case"index":{i=(await H.index(e)).data;break}case"getPublistedProducts":{i=(await H.getPublistedProducts()).data;break}case"get":{i=(await H.get(e)).data,console.log({data:i,body:e});break}case"createBlobUrl":{x.send("background","content-to-background-create-blod-urls",e),i=await x.waitForMessage("background-to-content-create-blod-urls"),console.log({data:i});break}case"publist":{x.send("background","content-to-background-actions",{type:"publist",data:e}),i=await x.waitForMessage("background-to-content-actions");break}case"unlist":{x.send("background","content-to-background-actions",{type:"unlist",data:e}),console.log({body:e}),i=await x.waitForMessage("background-to-content-actions"),console.log({unlisted:i});break}case"sync":{const o=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",o),await P.waitForPageReady(P.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const s=await P.getProducts();console.log({products:s}),await H.sync(s);break}}window.postMessage({type:"API_RESPONSE",requestId:r,payload:i},"*")}catch(i){window.postMessage({type:"API_RESPONSE",requestId:r,error:i.message},"*")}}}),(async()=>{if(await b(800,1e3),window.location.href.includes(P.sellingPath))try{const t=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",t),await P.waitForPageReady(P.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const e=await P.getProducts();console.log({products:e}),await H.sync(e)}catch(t){console.error(t)}finally{rt()}else rt()})()})(); diff --git a/auto-post-facebook-extensions_1.0/index.html b/auto-post-facebook-extensions_1.0/index.html index f984add..737220d 100644 --- a/auto-post-facebook-extensions_1.0/index.html +++ b/auto-post-facebook-extensions_1.0/index.html @@ -7,9 +7,9 @@ Vite + React + TS - + - + diff --git a/auto-post-facebook-extensions_1.0/manifest.json b/auto-post-facebook-extensions_1.0/manifest.json index 7dd3897..e2fa9c5 100644 --- a/auto-post-facebook-extensions_1.0/manifest.json +++ b/auto-post-facebook-extensions_1.0/manifest.json @@ -3,7 +3,12 @@ "name": "Auto post facebook extensions", "version": "1.0", "action": { - "default_popup": "index.html" + "default_popup": "index.html", + "default_icon": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } }, "background": { "service_worker": "background/background.js", @@ -23,5 +28,10 @@ "matches": ["https://www.facebook.com/*"] } ], - "permissions": ["storage", "tabs", "activeTab", "scripting"] + "permissions": ["storage", "tabs", "activeTab", "scripting"], + "icons": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } } diff --git a/public/manifest.json b/public/manifest.json index 7dd3897..3c0dd83 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,9 +1,14 @@ { "manifest_version": 3, "name": "Auto post facebook extensions", - "version": "1.0", + "version": "1.2", "action": { - "default_popup": "index.html" + "default_popup": "index.html", + "default_icon": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } }, "background": { "service_worker": "background/background.js", @@ -23,5 +28,10 @@ "matches": ["https://www.facebook.com/*"] } ], - "permissions": ["storage", "tabs", "activeTab", "scripting"] + "permissions": ["tabs", "activeTab", "scripting"], + "icons": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } } diff --git a/releases/auto-post-facebook-extensions_1.0/assets/popup.js b/releases/auto-post-facebook-extensions_1.0/assets/popup.js index d06cb0e..eb528ca 100644 --- a/releases/auto-post-facebook-extensions_1.0/assets/popup.js +++ b/releases/auto-post-facebook-extensions_1.0/assets/popup.js @@ -1 +1 @@ -import{R as c,j as s,Q as u,q as l,P as d}from"./popup-BMz864nQ.js";import"./base64-BbJB1hmJ.js";import"./product-api.service-PLptzR9s.js";import"./app-C7VSS-q9.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();c.createRoot(document.getElementById("root")).render(s.jsx(u,{client:l,children:s.jsx(d,{})})); +import{R as c,j as s,Q as u,q as l,P as d}from"./popup-D--aKLqS.js";import"./base64-BbJB1hmJ.js";import"./product-api.service-DR0CE0o9.js";import"./app-C7VSS-q9.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();c.createRoot(document.getElementById("root")).render(s.jsx(u,{client:l,children:s.jsx(d,{})})); diff --git a/releases/auto-post-facebook-extensions_1.0/content/content.js b/releases/auto-post-facebook-extensions_1.0/content/content.js index f04e19a..954fbe1 100644 --- a/releases/auto-post-facebook-extensions_1.0/content/content.js +++ b/releases/auto-post-facebook-extensions_1.0/content/content.js @@ -1,6 +1,6 @@ -(function(){"use strict";function Ee(t,e){return function(){return t.apply(e,arguments)}}const{toString:it}=Object.prototype,{getPrototypeOf:ce}=Object,{iterator:W,toStringTag:ve}=Symbol,Z=(t=>e=>{const n=it.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=t=>(t=t.toLowerCase(),e=>Z(e)===t),G=t=>e=>typeof e===t,{isArray:q}=Array,$=G("undefined");function z(t){return t!==null&&!$(t)&&t.constructor!==null&&!$(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Se=C("ArrayBuffer");function st(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Se(t.buffer),e}const at=G("string"),O=G("function"),Te=G("number"),J=t=>t!==null&&typeof t=="object",ct=t=>t===!0||t===!1,Y=t=>{if(Z(t)!=="object")return!1;const e=ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ve in t)&&!(W in t)},lt=t=>{if(!J(t)||z(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ut=C("Date"),dt=C("File"),ft=C("Blob"),ht=C("FileList"),pt=t=>J(t)&&O(t.pipe),mt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||O(t.append)&&((e=Z(t))==="formdata"||e==="object"&&O(t.toString)&&t.toString()==="[object FormData]"))},wt=C("URLSearchParams"),[yt,bt,gt,Et]=["ReadableStream","Request","Response","Headers"].map(C),vt=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),q(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ke=t=>!$(t)&&t!==F;function le(){const{caseless:t}=ke(this)&&this||{},e={},n=(r,o)=>{const i=t&&Re(e,o)||o;Y(e[i])&&Y(r)?e[i]=le(e[i],r):Y(r)?e[i]=le({},r):q(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r(V(e,(o,i)=>{n&&O(o)?t[i]=Ee(o,n):t[i]=o},{allOwnKeys:r}),t),Tt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Rt=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},kt=(t,e,n,r)=>{let o,i,s;const c={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!c[s]&&(e[s]=t[s],c[s]=!0);t=n!==!1&&ce(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ot=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Pt=t=>{if(!t)return null;if(q(t))return t;let e=t.length;if(!Te(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},At=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ce(Uint8Array)),_t=(t,e)=>{const r=(t&&t[W]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},xt=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Ct=C("HTMLFormElement"),Nt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Oe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),It=C("RegExp"),Pe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};V(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},Bt=t=>{Pe(t,(e,n)=>{if(O(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(O(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Lt=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return q(t)?r(t):r(String(t).split(e)),n},Ft=()=>{},Ut=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Dt(t){return!!(t&&O(t.append)&&t[ve]==="FormData"&&t[W])}const Mt=t=>{const e=new Array(10),n=(r,o)=>{if(J(r)){if(e.indexOf(r)>=0)return;if(z(r))return r;if(!("toJSON"in r)){e[o]=r;const i=q(r)?[]:{};return V(r,(s,c)=>{const d=n(s,o+1);!$(d)&&(i[c]=d)}),e[o]=void 0,i}}return r};return n(t,0)},qt=C("AsyncFunction"),jt=t=>t&&(J(t)||O(t))&&O(t.then)&&O(t.catch),Ae=((t,e)=>t?setImmediate:e?((n,r)=>(F.addEventListener("message",({source:o,data:i})=>{o===F&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(F.postMessage)),Ht=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ae,a={isArray:q,isArrayBuffer:Se,isBuffer:z,isFormData:mt,isArrayBufferView:st,isString:at,isNumber:Te,isBoolean:ct,isObject:J,isPlainObject:Y,isEmptyObject:lt,isReadableStream:yt,isRequest:bt,isResponse:gt,isHeaders:Et,isUndefined:$,isDate:ut,isFile:dt,isBlob:ft,isRegExp:It,isFunction:O,isStream:pt,isURLSearchParams:wt,isTypedArray:At,isFileList:ht,forEach:V,merge:le,extend:St,trim:vt,stripBOM:Tt,inherits:Rt,toFlatObject:kt,kindOf:Z,kindOfTest:C,endsWith:Ot,toArray:Pt,forEachEntry:_t,matchAll:xt,isHTMLForm:Ct,hasOwnProperty:Oe,hasOwnProp:Oe,reduceDescriptors:Pe,freezeMethods:Bt,toObjectSet:Lt,toCamelCase:Nt,noop:Ft,toFiniteNumber:Ut,findKey:Re,global:F,isContextDefined:ke,isSpecCompliantForm:Dt,toJSONObject:Mt,isAsyncFn:qt,isThenable:jt,setImmediate:Ae,asap:Ht,isIterable:t=>t!=null&&O(t[W])};function m(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(m,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 _e=m.prototype,xe={};["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(t=>{xe[t]={value:t}}),Object.defineProperties(m,xe),Object.defineProperty(_e,"isAxiosError",{value:!0}),m.from=(t,e,n,r,o,i)=>{const s=Object.create(_e);return a.toFlatObject(t,s,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),m.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const $t=null;function ue(t){return a.isPlainObject(t)||a.isArray(t)}function Ce(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,e,n){return t?t.concat(e).map(function(o,i){return o=Ce(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function zt(t){return a.isArray(t)&&!t.some(ue)}const Jt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!d&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,p){let v=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&zt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(v=a.toArray(h)))return y=Ce(y),v.forEach(function(R,I){!(a.isUndefined(R)||R===null)&&e.append(s===!0?Ne([y],I,i):s===null?y:y+"[]",l(R))}),!1}return ue(h)?!0:(e.append(Ne(p,y,i),l(h)),!1)}const f=[],g=Object.assign(Jt,{defaultVisitor:u,convertValue:l,isVisitable:ue});function S(h,y){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),a.forEach(h,function(v,T){(!(a.isUndefined(v)||v===null)&&o.call(e,v,a.isString(T)?T.trim():T,y,g))===!0&&S(v,y?y.concat(T):[T])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return S(t),e}function Ie(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function de(t,e){this._pairs=[],t&&Q(t,this,e)}const Be=de.prototype;Be.append=function(e,n){this._pairs.push([e,n])},Be.toString=function(e){const n=e?function(r){return e.call(this,r,Ie)}:Ie;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Vt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Vt;a.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(e,n):i=a.isURLSearchParams(e)?e.toString():new de(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Fe{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:de,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,Kt=fe&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),Wt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zt=fe&&window.location.href||"http://localhost",k={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Kt,hasStandardBrowserWebWorkerEnv:Wt,navigator:he,origin:Zt},Symbol.toStringTag,{value:"Module"})),...Xt};function Gt(t,e){return Q(t,new k.classes.URLSearchParams,{visitor:function(n,r,o,i){return k.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Yt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Qt(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&a.isArray(o)?o.length:s,d?(a.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!c):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&a.isArray(o[s])&&(o[s]=Qt(o[s])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,o)=>{e(Yt(r),o,n,0)}),n}return null}function en(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const X={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return o?JSON.stringify(De(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Q(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),en(e)):e}],transformResponse:[function(e){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(c){if(s)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{X.headers[t]={}});const tn=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"]),nn=t=>{const e={};let n,r,o;return t&&t.split(` -`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&tn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Me=Symbol("internals");function K(t){return t&&String(t).trim().toLowerCase()}function ee(t){return t===!1||t==null?t:a.isArray(t)?t.map(ee):String(t)}function rn(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const on=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pe(t,e,n,r,o){if(a.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function sn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function an(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}let P=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(c,d,l){const u=K(d);if(!u)throw new Error("header name must be a non-empty string");const f=a.findKey(o,u);(!f||o[f]===void 0||l===!0||l===void 0&&o[f]!==!1)&&(o[f||d]=ee(c))}const s=(c,d)=>a.forEach(c,(l,u)=>i(l,u,d));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(a.isString(e)&&(e=e.trim())&&!on(e))s(nn(e),n);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,l;for(const u of e){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(d=c[l])?a.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(c,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=K(e),e){const r=a.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return rn(o);if(a.isFunction(n))return n.call(this,o,r);if(a.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=K(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=K(s),s){const c=a.findKey(r,s);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],o=!0)}}return a.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||pe(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return a.forEach(this,(o,i)=>{const s=a.findKey(r,i);if(s){n[s]=ee(o),delete n[i];return}const c=e?sn(i):String(i).trim();c!==i&&delete n[i],n[c]=ee(o),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return a.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Me]=this[Me]={accessors:{}}).accessors,o=this.prototype;function i(s){const c=K(s);r[c]||(an(o,s),r[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};P.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(P.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(P);function me(t,e){const n=this||X,r=e||n,o=P.from(r.headers);let i=r.data;return a.forEach(t,function(c){i=c.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function qe(t){return!!(t&&t.__CANCEL__)}function j(t,e,n){m.call(this,t??"canceled",m.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(j,m,{__CANCEL__:!0});function je(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ln(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(d){const l=Date.now(),u=r[i];s||(s=l),n[o]=d,r[o]=l;let f=i,g=0;for(;f!==o;)g+=n[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),l-s{n=u,o=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const u=Date.now(),f=u-n;f>=r?s(l,u):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const te=(t,e,n=3)=>{let r=0;const o=ln(50,250);return un(i=>{const s=i.loaded,c=i.lengthComputable?i.total:void 0,d=s-r,l=o(d),u=s<=c;r=s;const f={loaded:s,total:c,progress:c?s/c:void 0,bytes:d,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},He=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},$e=t=>(...e)=>a.asap(()=>t(...e)),dn=k.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,k.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(k.origin),k.navigator&&/(msie|trident)/i.test(k.navigator.userAgent)):()=>!0,fn=k.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),a.isString(r)&&s.push("path="+r),a.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function pn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ze(t,e,n){let r=!hn(e);return t&&(r||n==!1)?pn(t,e):e}const Je=t=>t instanceof P?{...t}:t;function U(t,e){e=e||{};const n={};function r(l,u,f,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(l,u,f,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,f,g)}else return r(l,u,f,g)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,f){if(f in e)return r(l,u);if(f in t)return r(void 0,l)}const d={url:i,method:i,data:i,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:c,headers:(l,u,f)=>o(Je(l),Je(u),f,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const f=d[u]||o,g=f(t[u],e[u],u);a.isUndefined(g)&&f!==c||(n[u]=g)}),n}const Ve=t=>{const e=U({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:c}=e;e.headers=s=P.from(s),e.url=Le(ze(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(n)){if(k.hasStandardBrowserEnv||k.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((d=s.getContentType())!==!1){const[l,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(k.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&dn(e.url))){const l=o&&i&&fn.read(i);l&&s.set(o,l)}return e},mn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ve(t);let i=o.data;const s=P.from(o.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:l}=o,u,f,g,S,h;function y(){S&&S(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(o.method.toUpperCase(),o.url,!0),p.timeout=o.timeout;function v(){if(!p)return;const R=P.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:t,request:p};je(function(M){n(M),y()},function(M){r(M),y()},_),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let I=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||Ue;o.timeoutErrorMessage&&(I=o.timeoutErrorMessage),r(new m(I,_.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},i===void 0&&s.setContentType(null),"setRequestHeader"in p&&a.forEach(s.toJSON(),function(I,_){p.setRequestHeader(_,I)}),a.isUndefined(o.withCredentials)||(p.withCredentials=!!o.withCredentials),c&&c!=="json"&&(p.responseType=o.responseType),l&&([g,h]=te(l,!0),p.addEventListener("progress",g)),d&&p.upload&&([f,S]=te(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(u=R=>{p&&(r(!R||R.type?new j(null,t,p):R),p.abort(),p=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const T=cn(o.url);if(T&&k.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,t));return}p.send(i||null)})},wn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const i=function(l){if(!o){o=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof m?u:new j(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,i(new m(`timeout ${e} of ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},yn=function*(t,e){let n=t.byteLength;if(n{const o=bn(t,e);let i=0,s,c=d=>{s||(s=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:l,value:u}=await o.next();if(l){c(),d.close();return}let f=u.byteLength;if(n){let g=i+=f;n(g)}d.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(d){return c(d),o.return()}},{highWaterMark:2})},ne=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ke=ne&&typeof ReadableStream=="function",En=ne&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),We=(t,...e)=>{try{return!!t(...e)}catch{return!1}},vn=Ke&&We(()=>{let t=!1;const e=new Request(k.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ze=64*1024,we=Ke&&We(()=>a.isReadableStream(new Response("").body)),re={stream:we&&(t=>t.body)};ne&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!re[e]&&(re[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Sn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(k.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await En(t)).byteLength},Tn=async(t,e)=>{const n=a.toFiniteNumber(t.getContentLength());return n??Sn(e)},ye={http:$t,xhr:mn,fetch:ne&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:c,onUploadProgress:d,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:g}=Ve(t);l=l?(l+"").toLowerCase():"text";let S=wn([o,i&&i.toAbortSignal()],s),h;const y=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let p;try{if(d&&vn&&n!=="get"&&n!=="head"&&(p=await Tn(u,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(a.isFormData(r)&&(L=_.headers.get("content-type"))&&u.setContentType(L),_.body){const[M,ae]=He(p,te($e(d)));r=Xe(_.body,Ze,M,ae)}}a.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;h=new Request(e,{...g,signal:S,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?f:void 0});let T=await fetch(h,g);const R=we&&(l==="stream"||l==="response");if(we&&(c||R&&y)){const _={};["status","statusText","headers"].forEach(rt=>{_[rt]=T[rt]});const L=a.toFiniteNumber(T.headers.get("content-length")),[M,ae]=c&&He(L,te($e(c),!0))||[];T=new Response(Xe(T.body,Ze,M,()=>{ae&&ae(),y&&y()}),_)}l=l||"text";let I=await re[a.findKey(re,l)||"text"](T,t);return!R&&y&&y(),await new Promise((_,L)=>{je(_,L,{data:I,headers:P.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:h})})}catch(v){throw y&&y(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,h),{cause:v.cause||v}):m.from(v,v&&v.code,t,h)}})};a.forEach(ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ge=t=>`- ${t}`,Rn=t=>a.isFunction(t)||t===null||t===!1,Ye={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since : -`+i.map(Ge).join(` -`):" "+Ge(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ye};function be(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new j(null,t)}function Qe(t){return be(t),t.headers=P.from(t.headers),t.data=me.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ye.getAdapter(t.adapter||X.adapter)(t).then(function(r){return be(t),r.data=me.call(t,t.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return qe(r)||(be(t),r&&r.response&&(r.response.data=me.call(t,t.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const et="1.11.0",oe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{oe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tt={};oe.transitional=function(e,n,r){function o(i,s){return"[Axios v"+et+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,c)=>{if(e===!1)throw new m(o(s," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!tt[s]&&(tt[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,c):!0}},oe.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function kn(t,e,n){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const c=t[i],d=c===void 0||s(c,i,t);if(d!==!0)throw new m("option "+i+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const ie={assertOptions:kn,validators:oe},N=ie.validators;let D=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=U(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&ie.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),o!=null&&(a.isFunction(o)?n.paramsSerializer={serialize:o}:ie.assertOptions(o,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ie.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=P.concat(s,i);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,f=0,g;if(!d){const h=[Qe.bind(this),void 0];for(h.unshift(...c),h.push(...l),g=h.length,u=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(c=>{r.subscribe(c),i=c}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,c){r.reason||(r.reason=new j(i,s,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ot(function(o){e=o}),cancel:e}}};function Pn(t){return function(n){return t.apply(null,n)}}function An(t){return a.isObject(t)&&t.isAxiosError===!0}const ge={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(ge).forEach(([t,e])=>{ge[e]=t});function nt(t){const e=new D(t),n=Ee(D.prototype.request,e);return a.extend(n,D.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return nt(U(t,o))},n}const E=nt(X);E.Axios=D,E.CanceledError=j,E.CancelToken=On,E.isCancel=qe,E.VERSION=et,E.toFormData=Q,E.AxiosError=m,E.Cancel=E.CanceledError,E.all=function(e){return Promise.all(e)},E.spread=Pn,E.isAxiosError=An,E.mergeConfig=U,E.AxiosHeaders=P,E.formToJSON=t=>De(a.isHTMLForm(t)?new FormData(t):t),E.getAdapter=Ye.getAdapter,E.HttpStatusCode=ge,E.default=E;const{Axios:Hn,AxiosError:$n,CanceledError:zn,isCancel:Jn,CancelToken:Vn,VERSION:Xn,all:Kn,Cancel:Wn,isAxiosError:Zn,spread:Gn,toFormData:Yn,AxiosHeaders:Qn,HttpStatusCode:er,formToJSON:tr,getAdapter:nr,mergeConfig:rr}=E,se=E.create({baseURL:"http://localhost:3000/",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2ludC5pcHN1cHBseS5jb20uYXUvYXBpL2xvZ2luIiwiaWF0IjoxNzIxNjA5MTEzLCJleHAiOjMyMzUzMzcxMTMsIm5iZiI6MTcyMTYwOTExMywianRpIjoiWHpCZkZPc0ZJUlFxaEZvaiIsInN1YiI6MSwicHJ2IjoiYzhlZTFmYzg5ZTc3NWVjNGM3Mzg2NjdlNWJlMTdhNTkwYjZkNDBmYyJ9.kFFEPpdmNUp-kn_G3cIIc26bivO6tbfcvkpG9I8Im7M"}});class _n{item_per_page=10;async index(e){const n={skip:0,limit:10,order:"updatedAt desc",where:{account:"prology_net",status:"Updated"}};return se({method:"POST",data:{urlAPI:"/api/ebay-listing/listing-get-list",filter:{...n,...e,where:{...n.where,...e?.where}}}})}async get(e){return se({method:"POST",data:{filter:{where:{account:"prology_net",condition:e.raw_condition,productModelCode:e.sku}},pageCurrent:"/ebaytools/listing-ebay",urlAPI:"/api/ebay-listing/get-image-listing"}})}async sync(e){return se({url:"sync",method:"POST",data:e})}async getPublistedProducts(){return se({url:"data"})}async apiRequest(e,n){return new Promise((r,o)=>{const i="req_"+Date.now()+"_"+Math.random();function s(c){c.data.type==="API_RESPONSE"&&c.data.requestId===i&&(window.removeEventListener("message",s),c.data.error?o(c.data.error):r(c.data.payload))}window.addEventListener("message",s),window.postMessage({type:"API_REQUEST",requestId:i,payload:n,fn:e},"*")})}}const H=new _n;function B(t){return new Promise(e=>setTimeout(e,t))}function b(t,e){const n=Math.floor(Math.random()*(e-t+1))+t;return B(n)}class xn{static ID_EXTENSION="ex-root"}class Cn{base64ToFile(e,n,r){const o=e.includes(",")?e.split(",")[1]:e,i=atob(o),s=new ArrayBuffer(i.length),c=new Uint8Array(s);for(let l=0;l{let s=0,c=!1;const d=()=>{const l=document.evaluate(c&&o?o:e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(l instanceof HTMLElement){i(l);return}s++,s{const s=new FileReader;s.onloadend=()=>{typeof s.result=="string"?o(s.result.split(",")[1]):i("Không thể đọc dữ liệu ảnh")},s.onerror=i,s.readAsDataURL(r)})}getImageExtension(e){try{const r=new URL(e).pathname.match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}catch{const o=e.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return o?o[1].toLowerCase():null}}imageLocalToBase64(e){return new Promise((n,r)=>{try{const o=chrome.runtime.getURL(`${e}`);fetch(o).then(i=>i.blob()).then(i=>{const s=new FileReader;s.onloadend=()=>n(s.result),s.onerror=r,s.readAsDataURL(i)}).catch(r)}catch(o){r(o)}})}scrollToElement(e,n="smooth"){e&&e.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(e){if(!e)return null;const n=e.getBoundingClientRect(),r=n.left+n.width/2,o=n.top+n.height/2;return{x:r,y:o}}setInputValue(e,n){e&&(e.value=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(e,n)=>{let r;if(typeof n=="string"?r=await this.getElementByXPath(n):r=n,!r)throw new Error("Xpath is not found with value: "+e);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,e)};pressEnter(e){if(!e)throw new Error("Textarea not found:",e);e.focus(),["keydown","keypress","keyup"].forEach(n=>{e.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(e,n,r){const o=document.querySelector(e);if(!o)return null;const i=o.querySelectorAll(n);for(const s of i)if(s.innerText.trim().toLowerCase()===r.toLowerCase())return s;return null}findNestedIcElement(e,n,r){let o=null;if(typeof e=="string"){if(document.querySelector(e),!o)return null}else o=e;const i=o.querySelectorAll(n);for(const s of i)if(s.innerText.trim().toLowerCase().includes(r.toLowerCase()))return s;return null}findElInParent(e,n){return e&&e.parentElement?.querySelector(n)||null}waitForElement(e,n=100){return new Promise(r=>{const o=d=>d.offsetParent!==null&&(d.childElementCount>0||d.innerText.trim().length>0),i=()=>{const d=document.querySelector(e);d&&o(d)&&(s.disconnect(),clearInterval(c),r(d))},s=new MutationObserver(i);s.observe(document.body,{childList:!0,subtree:!0});const c=setInterval(i,n);i()})}}const w=new Cn;class Nn{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',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",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/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",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/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[3]/div[2]/div",description_edit_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/div/textarea",sku_edit_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[1]/label/div/input",new_item_btn:"/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]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(e,n="input"){const r=w.findNestedElement(this.selectors.market_container,"span",e);if(!r)throw new Error("Not found input by title: "+e);return w.findElInParent(r,n)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(e=>e?.click())};uploadImages=async e=>{const n=new DataTransfer;for(const o of e.images){const i=await w.imageUrlToBase64(o);console.log("Base64:",o.slice(0,50)+"...");const s=w.base64ToFile(i,e.sku,w.getImageExtension(o)||"jpg");n.items.add(s)}const r=document.querySelector(this.selectors.file__image_input);r?(r.files=n.files,r.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(e,n,r='[aria-label="Dropdown menu"]')=>{const o=w.findNestedElement(this.selectors.market_container,"span",n);w.scrollToElement(o),await b(500,600),o?.click(),await b(500,600);const i=w.findNestedElement(r,"span",e);if(await b(500,600),!i)throw new Error(`No child found with text "${e}"`);w.scrollToElement(i),await b(500,600),i.click(),await b(500,600)};chooseLocation=async e=>{const n=this.findInputByTitle("location");await w.writeToInput(e,n),await B(600);const r=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],o=Array.from(r).find(i=>i.innerHTML.trim().toLowerCase().includes(e.toLowerCase()));if(console.log(o),!o)throw new Error(`No child found with text "${e}"`);w.scrollToElement(o),await B(400),w.clickByPoint(o)};writeTags=async e=>{const n=this.findInputByTitle("product tags","textarea");if(!n)throw new Error("Input is not found");w.scrollToElement(n),await B(500);for(const r of e)await w.writeToInput(r,n),await B(300),w.pressEnter(n)};clickNext=async()=>{const e=await w.getElementByXPath(this.selectors.next_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickUpdate=async()=>{const e=await w.getElementByXPath(this.selectors.update_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickPublist=async()=>{const e=await w.getElementByXPath(this.selectors.publish_btn);if(!e)throw new Error("Publist button is not found");w.clickByPoint(e)};handlePublist=async e=>{console.log({item:e}),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const n=this.findInputByTitle("title");w.writeToInput(e.title,n),await b(600,1e3);const r=this.findInputByTitle("price");if(w.writeToInput(String(e.price),r),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),e.brand){await b(600,1e3);const s=this.findInputByTitle("brand");await w.writeToInput(e.brand,s)}await b(600,1e3);const o=this.findInputByTitle("description","textarea");await w.writeToInput(e.description,o),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3);const i=this.findInputByTitle("sku");return await w.writeToInput(e.sku,i),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),await b(300,500),await this.clickNext(),!0};handleRePublist=async e=>{console.log({item:e}),await w.waitForElement('[aria-label="Collection of your Marketplace items"]');const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"edit"),await B(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await b(1e3,2e3),await this.clearImages(),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const r=this.findInputByTitle("title");w.writeToInput(e.title,r),await b(600,1e3);const o=this.findInputByTitle("price");w.writeToInput(String(e.price),o),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),await b(600,1e3);const i=this.findInputByTitle("description","textarea");return await w.writeToInput(e.description,i),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),!0};getProducts=async()=>{const e=await w.getElementByXPath(this.selectors.products),n=await w.getElementByXPath(this.selectors.products_fallback);console.log({products1:e,products2:n});const r=[e,n].filter(Boolean);return r.length===0?[]:r.flatMap(o=>this.extractListings(o))};extractListings(e){return Array.from(e.children).map(r=>{const i=r.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",s=document.querySelectorAll(`[aria-label="${i}"]`),c=Array.from(s).filter(f=>!f.querySelector("img"))[0],l=w.findNestedIcElement(c,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),u=l?parseFloat(l[0].replace(/,/g,"")):0;return{title:i,price:u,el:e}})}closeTab=async e=>{chrome.runtime.sendMessage({type:"close-tab",payload:e})};clickOptionOfProduct(e){const n=document.querySelector(`[aria-label="More options for ${e.title}"]`);if(!n)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${e.title}"]`}, ID: ${e.id}`);w.scrollToElement(n),n.click?.()}async getOptionEls(e){return this.clickOptionOfProduct(e),await B(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(e,n){const r=e.find(o=>o.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);r.click?.()}getItemInList(e,n){const r=e.find(o=>o.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);return r}handleDelete=async e=>{const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"delete"),await B(1e3);const r=await w.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:r}),r?.click(),(await w.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(e,n=1e4){return new Promise((r,o)=>{const i=Date.now(),s=()=>{window.location.href.includes(e)?r():Date.now()-i>n?o(new Error("Timeout waiting for URL change")):setTimeout(s,500)};s()})}waitForPageReady(e,n,r=15e3){return new Promise((o,i)=>{const s=Date.now(),c=async()=>{window.location.href.includes(e)&&document.querySelector(n)?o():Date.now()-s>r?i(new Error("Timeout waiting for selling page ready")):setTimeout(c,500)};c()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await A.getProducts()};extractMarketplaceItemId(e){const n=e.match(/\/marketplace\/item\/(\d+)/);return n?n[1]:null}handleGetPublistID=async e=>{const n=await A.getProducts(),r=n.find(c=>c.title==e.title&&c.price==e.price);if(console.log({payload:e,product:r,products:n}),!r)return;r.el;const o=await this.getOptionEls(e),i=this.getItemInList(o,"view listing"),s=this.extractMarketplaceItemId(i.href);return this.clickOptionOfProduct(e),s};async gotoPublist(){(await w.getElementByXPath(this.selectors.new_item_btn))?.click(),await b(400,800),(await w.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const A=new Nn;class In{role;listeners;constructor(e){this.role=e,this.listeners=new Map,chrome.runtime.onMessage.addListener((n,r,o)=>{if(n?.type&&this.listeners.has(n.type))return this.listeners.get(n.type)(n.payload,r,o),!0})}on(e,n){this.listeners.set(e,n)}send(e,n,r){const o={from:this.role,to:e,type:n,payload:r};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(o),this.role==="background"&&(e==="content"?chrome.tabs.query({active:!0,currentWindow:!0},i=>{i[0]?.id&&chrome.tabs.sendMessage(i[0].id,o,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):e==="popup"&&chrome.runtime.sendMessage(o,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(e,n,r){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const o={from:this.role,to:"content",type:n,payload:r};chrome.tabs.sendMessage(e,o,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${e}:`,chrome.runtime.lastError.message)})}waitForMessage(e,n=3e4){return new Promise((r,o)=>{let i;const s=c=>{clearTimeout(i),this.off(e,s),r(c)};i=setTimeout(()=>{this.off(e,s),o(new Error(`Timeout khi chờ message: ${e}`))},n),this.on(e,s)})}off(e,n){this.listeners.get(e)===n&&this.listeners.delete(e)}}const x=new In("content"),Bn=()=>{const t=xn.ID_EXTENSION;if(document.getElementById(t))return;const e=document.createElement("div");e.id=t,document.body.appendChild(e);const n=document.createElement("script");n.src=chrome.runtime.getURL("content/inject-ui.js"),n.type="module",document.body.appendChild(n);const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=chrome.runtime.getURL("assets/style.css"),document.head.appendChild(r)};x.on("background-to-content-publish",async t=>{try{console.log("[publish] Content nhận:",t),await b(800,1e3),await A.handlePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-publish",{msg:t})}}),x.on("background-to-content-unlist",async t=>{try{console.log("[unlist] Content nhận:",t),await b(800,1e3),await A.gotoSell(),await b(800,1e3),await A.handleDelete(t.data),await b(800,1e3);const e=await A.getProducts();await b(800,1e3),H.sync(e)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-unlist",{msg:t})}}),x.on("background-to-content-re-publist",async t=>{try{console.log("[re-publist] Content nhận:",t),await b(800,1e3),await A.gotoSell(),await b(800,1e3),await A.handleRePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-re-publist",{msg:t})}}),window.addEventListener("message",async t=>{if(t.source===window&&t.data.type==="API_REQUEST"){const e=t.data.payload,n=t.data.fn,{requestId:r}=t.data;console.log({requestId:r,event:t,body:e});try{let o=null;switch(n){case"index":{o=(await H.index(e)).data;break}case"getPublistedProducts":{o=(await H.getPublistedProducts()).data;break}case"get":{o=(await H.get(e)).data,console.log({data:o,body:e});break}case"createBlobUrl":{x.send("background","content-to-background-create-blod-urls",e),o=await x.waitForMessage("background-to-content-create-blod-urls"),console.log({data:o});break}case"publist":{x.send("background","content-to-background-actions",{type:"publist",data:e}),o=await x.waitForMessage("background-to-content-actions");break}case"unlist":{x.send("background","content-to-background-actions",{type:"unlist",data:e}),console.log({body:e}),o=await x.waitForMessage("background-to-content-actions"),console.log({unlisted:o});break}case"sync":{const i=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",i),await A.waitForPageReady(A.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const s=await A.getProducts();console.log({products:s}),await H.sync(s);break}}window.postMessage({type:"API_RESPONSE",requestId:r,payload:o},"*")}catch(o){window.postMessage({type:"API_RESPONSE",requestId:r,error:o.message},"*")}}}),(async()=>(await b(800,1e3),w.waitForElement('[aria-label="Collection of your Marketplace items"]').then(async t=>{console.log("Element đã xuất hiện:",t),await A.waitForPageReady(A.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const e=await A.getProducts();console.log({products:e}),H.sync(e),Bn()}).catch(t=>{console.error(t)})))()})(); +(function(){"use strict";function Ee(t,e){return function(){return t.apply(e,arguments)}}const{toString:st}=Object.prototype,{getPrototypeOf:ce}=Object,{iterator:W,toStringTag:ve}=Symbol,Z=(t=>e=>{const n=st.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),C=t=>(t=t.toLowerCase(),e=>Z(e)===t),G=t=>e=>typeof e===t,{isArray:q}=Array,$=G("undefined");function z(t){return t!==null&&!$(t)&&t.constructor!==null&&!$(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Se=C("ArrayBuffer");function at(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Se(t.buffer),e}const ct=G("string"),O=G("function"),Te=G("number"),J=t=>t!==null&&typeof t=="object",lt=t=>t===!0||t===!1,Y=t=>{if(Z(t)!=="object")return!1;const e=ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ve in t)&&!(W in t)},ut=t=>{if(!J(t)||z(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},dt=C("Date"),ft=C("File"),ht=C("Blob"),pt=C("FileList"),mt=t=>J(t)&&O(t.pipe),wt=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||O(t.append)&&((e=Z(t))==="formdata"||e==="object"&&O(t.toString)&&t.toString()==="[object FormData]"))},yt=C("URLSearchParams"),[bt,gt,Et,vt]=["ReadableStream","Request","Response","Headers"].map(C),St=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),q(t))for(r=0,i=t.length;r0;)if(i=n[r],e===i.toLowerCase())return i;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ke=t=>!$(t)&&t!==F;function le(){const{caseless:t}=ke(this)&&this||{},e={},n=(r,i)=>{const o=t&&Re(e,i)||i;Y(e[o])&&Y(r)?e[o]=le(e[o],r):Y(r)?e[o]=le({},r):q(r)?e[o]=r.slice():e[o]=r};for(let r=0,i=arguments.length;r(V(e,(i,o)=>{n&&O(i)?t[o]=Ee(i,n):t[o]=i},{allOwnKeys:r}),t),Rt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),kt=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Pt=(t,e,n,r)=>{let i,o,s;const c={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],(!r||r(s,t,e))&&!c[s]&&(e[s]=t[s],c[s]=!0);t=n!==!1&&ce(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Ot=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},At=t=>{if(!t)return null;if(q(t))return t;let e=t.length;if(!Te(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},_t=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ce(Uint8Array)),xt=(t,e)=>{const r=(t&&t[W]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},Ct=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Nt=C("HTMLFormElement"),It=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Bt=C("RegExp"),Oe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};V(n,(i,o)=>{let s;(s=e(i,o,t))!==!1&&(r[o]=s||i)}),Object.defineProperties(t,r)},Lt=t=>{Oe(t,(e,n)=>{if(O(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(O(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return q(t)?r(t):r(String(t).split(e)),n},Ut=()=>{},Dt=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Mt(t){return!!(t&&O(t.append)&&t[ve]==="FormData"&&t[W])}const qt=t=>{const e=new Array(10),n=(r,i)=>{if(J(r)){if(e.indexOf(r)>=0)return;if(z(r))return r;if(!("toJSON"in r)){e[i]=r;const o=q(r)?[]:{};return V(r,(s,c)=>{const d=n(s,i+1);!$(d)&&(o[c]=d)}),e[i]=void 0,o}}return r};return n(t,0)},jt=C("AsyncFunction"),Ht=t=>t&&(J(t)||O(t))&&O(t.then)&&O(t.catch),Ae=((t,e)=>t?setImmediate:e?((n,r)=>(F.addEventListener("message",({source:i,data:o})=>{i===F&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),F.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(F.postMessage)),$t=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ae,a={isArray:q,isArrayBuffer:Se,isBuffer:z,isFormData:wt,isArrayBufferView:at,isString:ct,isNumber:Te,isBoolean:lt,isObject:J,isPlainObject:Y,isEmptyObject:ut,isReadableStream:bt,isRequest:gt,isResponse:Et,isHeaders:vt,isUndefined:$,isDate:dt,isFile:ft,isBlob:ht,isRegExp:Bt,isFunction:O,isStream:mt,isURLSearchParams:yt,isTypedArray:_t,isFileList:pt,forEach:V,merge:le,extend:Tt,trim:St,stripBOM:Rt,inherits:kt,toFlatObject:Pt,kindOf:Z,kindOfTest:C,endsWith:Ot,toArray:At,forEachEntry:xt,matchAll:Ct,isHTMLForm:Nt,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:Oe,freezeMethods:Lt,toObjectSet:Ft,toCamelCase:It,noop:Ut,toFiniteNumber:Dt,findKey:Re,global:F,isContextDefined:ke,isSpecCompliantForm:Mt,toJSONObject:qt,isAsyncFn:jt,isThenable:Ht,setImmediate:Ae,asap:$t,isIterable:t=>t!=null&&O(t[W])};function m(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}a.inherits(m,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 _e=m.prototype,xe={};["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(t=>{xe[t]={value:t}}),Object.defineProperties(m,xe),Object.defineProperty(_e,"isAxiosError",{value:!0}),m.from=(t,e,n,r,i,o)=>{const s=Object.create(_e);return a.toFlatObject(t,s,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),m.call(s,t.message,e,n,r,i),s.cause=t,s.name=t.name,o&&Object.assign(s,o),s};const zt=null;function ue(t){return a.isPlainObject(t)||a.isArray(t)}function Ce(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,e,n){return t?t.concat(e).map(function(i,o){return i=Ce(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function Jt(t){return a.isArray(t)&&!t.some(ue)}const Vt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Q(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(i))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!d&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?d&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,p){let v=h;if(h&&!p&&typeof h=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&Jt(h)||(a.isFileList(h)||a.endsWith(y,"[]"))&&(v=a.toArray(h)))return y=Ce(y),v.forEach(function(R,I){!(a.isUndefined(R)||R===null)&&e.append(s===!0?Ne([y],I,o):s===null?y:y+"[]",l(R))}),!1}return ue(h)?!0:(e.append(Ne(p,y,o),l(h)),!1)}const f=[],g=Object.assign(Vt,{defaultVisitor:u,convertValue:l,isVisitable:ue});function S(h,y){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(h),a.forEach(h,function(v,T){(!(a.isUndefined(v)||v===null)&&i.call(e,v,a.isString(T)?T.trim():T,y,g))===!0&&S(v,y?y.concat(T):[T])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return S(t),e}function Ie(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function de(t,e){this._pairs=[],t&&Q(t,this,e)}const Be=de.prototype;Be.append=function(e,n){this._pairs.push([e,n])},Be.toString=function(e){const n=e?function(r){return e.call(this,r,Ie)}:Ie;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Xt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Xt;a.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(e,n):o=a.isURLSearchParams(e)?e.toString():new de(e,n).toString(r),o){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Fe{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Kt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:de,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},fe=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,Wt=fe&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),Zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Gt=fe&&window.location.href||"http://localhost",k={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fe,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:Zt,navigator:he,origin:Gt},Symbol.toStringTag,{value:"Module"})),...Kt};function Yt(t,e){return Q(t,new k.classes.URLSearchParams,{visitor:function(n,r,i,o){return k.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Qt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function en(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&a.isArray(i)?i.length:s,d?(a.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!c):((!i[s]||!a.isObject(i[s]))&&(i[s]=[]),e(n,r,i[s],o)&&a.isArray(i[s])&&(i[s]=en(i[s])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,i)=>{e(Qt(r),i,n,0)}),n}return null}function tn(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const X={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return i?JSON.stringify(De(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Yt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Q(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),tn(e)):e}],transformResponse:[function(e){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(c){if(s)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{X.headers[t]={}});const nn=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"]),rn=t=>{const e={};let n,r,i;return t&&t.split(` +`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||e[n]&&nn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Me=Symbol("internals");function K(t){return t&&String(t).trim().toLowerCase()}function ee(t){return t===!1||t==null?t:a.isArray(t)?t.map(ee):String(t)}function on(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const sn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function pe(t,e,n,r,i){if(a.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function an(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function cn(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,s){return this[r].call(this,e,i,o,s)},configurable:!0})})}let A=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(c,d,l){const u=K(d);if(!u)throw new Error("header name must be a non-empty string");const f=a.findKey(i,u);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||d]=ee(c))}const s=(c,d)=>a.forEach(c,(l,u)=>o(l,u,d));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(a.isString(e)&&(e=e.trim())&&!sn(e))s(rn(e),n);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,l;for(const u of e){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(d=c[l])?a.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}s(c,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=K(e),e){const r=a.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return on(i);if(a.isFunction(n))return n.call(this,i,r);if(a.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=K(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(s){if(s=K(s),s){const c=a.findKey(r,s);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],i=!0)}}return a.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||pe(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return a.forEach(this,(i,o)=>{const s=a.findKey(r,o);if(s){n[s]=ee(i),delete n[o];return}const c=e?an(o):String(o).trim();c!==o&&delete n[o],n[c]=ee(i),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return a.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Me]=this[Me]={accessors:{}}).accessors,i=this.prototype;function o(s){const c=K(s);r[c]||(cn(i,s),r[c]=!0)}return a.isArray(e)?e.forEach(o):o(e),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(A.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(A);function me(t,e){const n=this||X,r=e||n,i=A.from(r.headers);let o=r.data;return a.forEach(t,function(c){o=c.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function qe(t){return!!(t&&t.__CANCEL__)}function j(t,e,n){m.call(this,t??"canceled",m.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(j,m,{__CANCEL__:!0});function je(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ln(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function un(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,s;return e=e!==void 0?e:1e3,function(d){const l=Date.now(),u=r[o];s||(s=l),n[i]=d,r[i]=l;let f=o,g=0;for(;f!==i;)g+=n[f++],f=f%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),l-s{n=u,i=null,o&&(clearTimeout(o),o=null),t(...l)};return[(...l)=>{const u=Date.now(),f=u-n;f>=r?s(l,u):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const te=(t,e,n=3)=>{let r=0;const i=un(50,250);return dn(o=>{const s=o.loaded,c=o.lengthComputable?o.total:void 0,d=s-r,l=i(d),u=s<=c;r=s;const f={loaded:s,total:c,progress:c?s/c:void 0,bytes:d,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},He=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},$e=t=>(...e)=>a.asap(()=>t(...e)),fn=k.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,k.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(k.origin),k.navigator&&/(msie|trident)/i.test(k.navigator.userAgent)):()=>!0,hn=k.hasStandardBrowserEnv?{write(t,e,n,r,i,o){const s=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),a.isString(r)&&s.push("path="+r),a.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function mn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ze(t,e,n){let r=!pn(e);return t&&(r||n==!1)?mn(t,e):e}const Je=t=>t instanceof A?{...t}:t;function U(t,e){e=e||{};const n={};function r(l,u,f,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function i(l,u,f,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,f,g)}else return r(l,u,f,g)}function o(l,u){if(!a.isUndefined(u))return r(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,f){if(f in e)return r(l,u);if(f in t)return r(void 0,l)}const d={url:o,method:o,data:o,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:c,headers:(l,u,f)=>i(Je(l),Je(u),f,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const f=d[u]||i,g=f(t[u],e[u],u);a.isUndefined(g)&&f!==c||(n[u]=g)}),n}const Ve=t=>{const e=U({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:c}=e;e.headers=s=A.from(s),e.url=Le(ze(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(n)){if(k.hasStandardBrowserEnv||k.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((d=s.getContentType())!==!1){const[l,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(k.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&fn(e.url))){const l=i&&o&&hn.read(o);l&&s.set(i,l)}return e},wn=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=Ve(t);let o=i.data;const s=A.from(i.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:l}=i,u,f,g,S,h;function y(){S&&S(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function v(){if(!p)return;const R=A.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:R,config:t,request:p};je(function(M){n(M),y()},function(M){r(M),y()},_),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let I=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||Ue;i.timeoutErrorMessage&&(I=i.timeoutErrorMessage),r(new m(I,_.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},o===void 0&&s.setContentType(null),"setRequestHeader"in p&&a.forEach(s.toJSON(),function(I,_){p.setRequestHeader(_,I)}),a.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),c&&c!=="json"&&(p.responseType=i.responseType),l&&([g,h]=te(l,!0),p.addEventListener("progress",g)),d&&p.upload&&([f,S]=te(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(u=R=>{p&&(r(!R||R.type?new j(null,t,p):R),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const T=ln(i.url);if(T&&k.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,t));return}p.send(o||null)})},yn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(l){if(!i){i=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof m?u:new j(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,o(new m(`timeout ${e} of ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),t=null)};t.forEach(l=>l.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},bn=function*(t,e){let n=t.byteLength;if(n{const i=gn(t,e);let o=0,s,c=d=>{s||(s=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:l,value:u}=await i.next();if(l){c(),d.close();return}let f=u.byteLength;if(n){let g=o+=f;n(g)}d.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(d){return c(d),i.return()}},{highWaterMark:2})},ne=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ke=ne&&typeof ReadableStream=="function",vn=ne&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),We=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Sn=Ke&&We(()=>{let t=!1;const e=new Request(k.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ze=64*1024,we=Ke&&We(()=>a.isReadableStream(new Response("").body)),re={stream:we&&(t=>t.body)};ne&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!re[e]&&(re[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const Tn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(k.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await vn(t)).byteLength},Rn=async(t,e)=>{const n=a.toFiniteNumber(t.getContentLength());return n??Tn(e)},ye={http:zt,xhr:wn,fetch:ne&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:c,onUploadProgress:d,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:g}=Ve(t);l=l?(l+"").toLowerCase():"text";let S=yn([i,o&&o.toAbortSignal()],s),h;const y=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let p;try{if(d&&Sn&&n!=="get"&&n!=="head"&&(p=await Rn(u,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),L;if(a.isFormData(r)&&(L=_.headers.get("content-type"))&&u.setContentType(L),_.body){const[M,ae]=He(p,te($e(d)));r=Xe(_.body,Ze,M,ae)}}a.isString(f)||(f=f?"include":"omit");const v="credentials"in Request.prototype;h=new Request(e,{...g,signal:S,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:v?f:void 0});let T=await fetch(h,g);const R=we&&(l==="stream"||l==="response");if(we&&(c||R&&y)){const _={};["status","statusText","headers"].forEach(it=>{_[it]=T[it]});const L=a.toFiniteNumber(T.headers.get("content-length")),[M,ae]=c&&He(L,te($e(c),!0))||[];T=new Response(Xe(T.body,Ze,M,()=>{ae&&ae(),y&&y()}),_)}l=l||"text";let I=await re[a.findKey(re,l)||"text"](T,t);return!R&&y&&y(),await new Promise((_,L)=>{je(_,L,{data:I,headers:A.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:h})})}catch(v){throw y&&y(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,h),{cause:v.cause||v}):m.from(v,v&&v.code,t,h)}})};a.forEach(ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ge=t=>`- ${t}`,kn=t=>a.isFunction(t)||t===null||t===!1,Ye={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let o=0;o`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=e?o.length>1?`since : +`+o.map(Ge).join(` +`):" "+Ge(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ye};function be(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new j(null,t)}function Qe(t){return be(t),t.headers=A.from(t.headers),t.data=me.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ye.getAdapter(t.adapter||X.adapter)(t).then(function(r){return be(t),r.data=me.call(t,t.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return qe(r)||(be(t),r&&r.response&&(r.response.data=me.call(t,t.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const et="1.11.0",ie={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ie[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tt={};ie.transitional=function(e,n,r){function i(o,s){return"[Axios v"+et+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,c)=>{if(e===!1)throw new m(i(s," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!tt[s]&&(tt[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,c):!0}},ie.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Pn(t,e,n){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],s=e[o];if(s){const c=t[o],d=c===void 0||s(c,o,t);if(d!==!0)throw new m("option "+o+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const oe={assertOptions:Pn,validators:ie},N=oe.validators;let D=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=U(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&oe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),i!=null&&(a.isFunction(i)?n.paramsSerializer={serialize:i}:oe.assertOptions(i,{encode:N.function,serialize:N.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),oe.assertOptions(n,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=A.concat(s,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,f=0,g;if(!d){const h=[Qe.bind(this),void 0];for(h.unshift(...c),h.push(...l),g=h.length,u=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(c=>{r.subscribe(c),o=c}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},e(function(o,s,c){r.reason||(r.reason=new j(o,s,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new ot(function(i){e=i}),cancel:e}}};function An(t){return function(n){return t.apply(null,n)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const ge={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(ge).forEach(([t,e])=>{ge[e]=t});function nt(t){const e=new D(t),n=Ee(D.prototype.request,e);return a.extend(n,D.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return nt(U(t,i))},n}const E=nt(X);E.Axios=D,E.CanceledError=j,E.CancelToken=On,E.isCancel=qe,E.VERSION=et,E.toFormData=Q,E.AxiosError=m,E.Cancel=E.CanceledError,E.all=function(e){return Promise.all(e)},E.spread=An,E.isAxiosError=_n,E.mergeConfig=U,E.AxiosHeaders=A,E.formToJSON=t=>De(a.isHTMLForm(t)?new FormData(t):t),E.getAdapter=Ye.getAdapter,E.HttpStatusCode=ge,E.default=E;const{Axios:Hn,AxiosError:$n,CanceledError:zn,isCancel:Jn,CancelToken:Vn,VERSION:Xn,all:Kn,Cancel:Wn,isAxiosError:Zn,spread:Gn,toFormData:Yn,AxiosHeaders:Qn,HttpStatusCode:er,formToJSON:tr,getAdapter:nr,mergeConfig:rr}=E,se=E.create({baseURL:"https://aitool.danielvu.com/auto-list/",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2ludC5pcHN1cHBseS5jb20uYXUvYXBpL2xvZ2luIiwiaWF0IjoxNzIxNjA5MTEzLCJleHAiOjMyMzUzMzcxMTMsIm5iZiI6MTcyMTYwOTExMywianRpIjoiWHpCZkZPc0ZJUlFxaEZvaiIsInN1YiI6MSwicHJ2IjoiYzhlZTFmYzg5ZTc3NWVjNGM3Mzg2NjdlNWJlMTdhNTkwYjZkNDBmYyJ9.kFFEPpdmNUp-kn_G3cIIc26bivO6tbfcvkpG9I8Im7M"}});class xn{item_per_page=10;async index(e){const n={skip:0,limit:10,order:"updatedAt desc",where:{account:"prology_net",status:"Updated"}};return se({method:"POST",data:{urlAPI:"/api/ebay-listing/listing-get-list",filter:{...n,...e,where:{...n.where,...e?.where}}}})}async get(e){return se({method:"POST",data:{filter:{where:{account:"prology_net",condition:e.raw_condition,productModelCode:e.sku}},pageCurrent:"/ebaytools/listing-ebay",urlAPI:"/api/ebay-listing/get-image-listing"}})}async sync(e){return se({url:"sync",method:"POST",data:e})}async getPublistedProducts(){return se({url:"data"})}async apiRequest(e,n){return new Promise((r,i)=>{const o="req_"+Date.now()+"_"+Math.random();function s(c){c.data.type==="API_RESPONSE"&&c.data.requestId===o&&(window.removeEventListener("message",s),c.data.error?i(c.data.error):r(c.data.payload))}window.addEventListener("message",s),window.postMessage({type:"API_REQUEST",requestId:o,payload:n,fn:e},"*")})}}const H=new xn;function B(t){return new Promise(e=>setTimeout(e,t))}function b(t,e){const n=Math.floor(Math.random()*(e-t+1))+t;return B(n)}class Cn{static ID_EXTENSION="ex-root"}class Nn{base64ToFile(e,n,r){const i=e.includes(",")?e.split(",")[1]:e,o=atob(i),s=new ArrayBuffer(o.length),c=new Uint8Array(s);for(let l=0;l{let s=0,c=!1;const d=()=>{const l=document.evaluate(c&&i?i:e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(l instanceof HTMLElement){o(l);return}s++,s{const s=new FileReader;s.onloadend=()=>{typeof s.result=="string"?i(s.result.split(",")[1]):o("Không thể đọc dữ liệu ảnh")},s.onerror=o,s.readAsDataURL(r)})}getImageExtension(e){try{const r=new URL(e).pathname.match(/\.([a-zA-Z0-9]+)$/);return r?r[1].toLowerCase():null}catch{const i=e.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}}imageLocalToBase64(e){return new Promise((n,r)=>{try{const i=chrome.runtime.getURL(`${e}`);fetch(i).then(o=>o.blob()).then(o=>{const s=new FileReader;s.onloadend=()=>n(s.result),s.onerror=r,s.readAsDataURL(o)}).catch(r)}catch(i){r(i)}})}scrollToElement(e,n="smooth"){e&&e.scrollIntoView({behavior:n,block:"center",inline:"nearest"})}getElementPointCoores(e){if(!e)return null;const n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;return{x:r,y:i}}setInputValue(e,n){e&&(e.value=n,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(e,n)=>{let r;if(typeof n=="string"?r=await this.getElementByXPath(n):r=n,!r)throw new Error("Xpath is not found with value: "+e);this.scrollToElement(r),this.clickByPoint(r),this.setInputValue(r,e)};pressEnter(e){if(!e)throw new Error("Textarea not found:",e);e.focus(),["keydown","keypress","keyup"].forEach(n=>{e.dispatchEvent(new KeyboardEvent(n,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(e,n,r){const i=document.querySelector(e);if(!i)return null;const o=i.querySelectorAll(n);for(const s of o)if(s.innerText.trim().toLowerCase()===r.toLowerCase())return s;return null}findNestedIcElement(e,n,r){let i=null;if(typeof e=="string"){if(document.querySelector(e),!i)return null}else i=e;const o=i.querySelectorAll(n);for(const s of o)if(s.innerText.trim().toLowerCase().includes(r.toLowerCase()))return s;return null}findElInParent(e,n){return e&&e.parentElement?.querySelector(n)||null}waitForElement(e,n=100){return new Promise(r=>{const i=d=>d.offsetParent!==null&&(d.childElementCount>0||d.innerText.trim().length>0),o=()=>{const d=document.querySelector(e);d&&i(d)&&(s.disconnect(),clearInterval(c),r(d))},s=new MutationObserver(o);s.observe(document.body,{childList:!0,subtree:!0});const c=setInterval(o,n);o()})}}const w=new Nn;class In{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',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",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/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",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/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[3]/div[2]/div",description_edit_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/div/textarea",sku_edit_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[1]/label/div/input",new_item_btn:"/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]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(e,n="input"){const r=w.findNestedElement(this.selectors.market_container,"span",e);if(!r)throw new Error("Not found input by title: "+e);return w.findElInParent(r,n)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(e=>e?.click())};uploadImages=async e=>{const n=new DataTransfer;for(const i of e.images){const o=await w.imageUrlToBase64(i);console.log("Base64:",i.slice(0,50)+"...");const s=w.base64ToFile(o,e.sku,w.getImageExtension(i)||"jpg");n.items.add(s)}const r=document.querySelector(this.selectors.file__image_input);r?(r.files=n.files,r.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(e,n,r='[aria-label="Dropdown menu"]')=>{const i=w.findNestedElement(this.selectors.market_container,"span",n);w.scrollToElement(i),await b(500,600),i?.click(),await b(500,600);const o=w.findNestedElement(r,"span",e);if(await b(500,600),!o)throw new Error(`No child found with text "${e}"`);w.scrollToElement(o),await b(500,600),o.click(),await b(500,600)};chooseLocation=async e=>{const n=this.findInputByTitle("location");await w.writeToInput(e,n),await B(600);const r=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],i=Array.from(r).find(o=>o.innerHTML.trim().toLowerCase().includes(e.toLowerCase()));if(console.log(i),!i)throw new Error(`No child found with text "${e}"`);w.scrollToElement(i),await B(400),w.clickByPoint(i)};writeTags=async e=>{const n=this.findInputByTitle("product tags","textarea");if(!n)throw new Error("Input is not found");w.scrollToElement(n),await B(500);for(const r of e)await w.writeToInput(r,n),await B(300),w.pressEnter(n)};clickNext=async()=>{const e=await w.getElementByXPath(this.selectors.next_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickUpdate=async()=>{const e=await w.getElementByXPath(this.selectors.update_btn);if(!e)throw new Error("Next button is not found");w.clickByPoint(e)};clickPublist=async()=>{const e=await w.getElementByXPath(this.selectors.publish_btn);if(!e)throw new Error("Publist button is not found");w.clickByPoint(e)};handlePublist=async e=>{console.log({item:e}),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const n=this.findInputByTitle("title");w.writeToInput(e.title,n),await b(600,1e3);const r=this.findInputByTitle("price");if(w.writeToInput(String(e.price),r),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),e.brand){await b(600,1e3);const s=this.findInputByTitle("brand");await w.writeToInput(e.brand,s)}await b(600,1e3);const i=this.findInputByTitle("description","textarea");await w.writeToInput(e.description,i),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3);const o=this.findInputByTitle("sku");return await w.writeToInput(e.sku,o),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),await b(300,500),await this.clickNext(),!0};handleRePublist=async e=>{console.log({item:e}),await w.waitForElement('[aria-label="Collection of your Marketplace items"]');const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"edit"),await B(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await b(1e3,2e3),await this.clearImages(),await b(600,1e3),await this.uploadImages(e),await b(600,1e3);const r=this.findInputByTitle("title");w.writeToInput(e.title,r),await b(600,1e3);const i=this.findInputByTitle("price");w.writeToInput(String(e.price),i),await b(600,1e3),await this.chooseSelect(e.category,"category"),await b(600,1e3),await this.chooseSelect(e.condition,"condition",'[aria-label="Select an option"]'),await b(600,1e3);const o=this.findInputByTitle("description","textarea");return await w.writeToInput(e.description,o),await b(600,1e3),await this.writeTags(e.tags),await b(600,1e3),e?.location&&(await b(600,1e3),await this.chooseLocation(e.location)),!0};getProducts=async()=>{const e=await w.getElementByXPath(this.selectors.products),n=await w.getElementByXPath(this.selectors.products_fallback);console.log({products1:e,products2:n});const r=[e,n].filter(Boolean);return r.length===0?[]:r.flatMap(i=>this.extractListings(i))};extractListings(e){return Array.from(e.children).map(r=>{const o=r.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",s=document.querySelectorAll(`[aria-label="${o}"]`),c=Array.from(s).filter(f=>!f.querySelector("img"))[0],l=w.findNestedIcElement(c,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),u=l?parseFloat(l[0].replace(/,/g,"")):0;return{title:o,price:u,el:e}})}closeTab=async e=>{chrome.runtime.sendMessage({type:"close-tab",payload:e})};clickOptionOfProduct(e){const n=document.querySelector(`[aria-label="More options for ${e.title}"]`);if(!n)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${e.title}"]`}, ID: ${e.id}`);w.scrollToElement(n),n.click?.()}async getOptionEls(e){return this.clickOptionOfProduct(e),await B(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(e,n){const r=e.find(i=>i.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);r.click?.()}getItemInList(e,n){const r=e.find(i=>i.textContent.toLocaleLowerCase().includes(n));if(!r)throw new Error(`Not found item ${n} in options list`);return r}handleDelete=async e=>{const n=await this.getOptionEls(e);console.log({items:n}),this.clickItemInList(n,"delete"),await B(1e3);const r=await w.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:r}),r?.click(),(await w.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(e,n=1e4){return new Promise((r,i)=>{const o=Date.now(),s=()=>{window.location.href.includes(e)?r():Date.now()-o>n?i(new Error("Timeout waiting for URL change")):setTimeout(s,500)};s()})}waitForPageReady(e,n,r=15e3){return new Promise((i,o)=>{const s=Date.now(),c=async()=>{window.location.href.includes(e)&&document.querySelector(n)?i():Date.now()-s>r?o(new Error("Timeout waiting for selling page ready")):setTimeout(c,500)};c()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await P.getProducts()};extractMarketplaceItemId(e){const n=e.match(/\/marketplace\/item\/(\d+)/);return n?n[1]:null}handleGetPublistID=async e=>{const n=await P.getProducts(),r=n.find(c=>c.title==e.title&&c.price==e.price);if(console.log({payload:e,product:r,products:n}),!r)return;r.el;const i=await this.getOptionEls(e),o=this.getItemInList(i,"view listing"),s=this.extractMarketplaceItemId(o.href);return this.clickOptionOfProduct(e),s};async gotoPublist(){(await w.getElementByXPath(this.selectors.new_item_btn))?.click(),await b(400,800),(await w.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const P=new In;class Bn{role;listeners;constructor(e){this.role=e,this.listeners=new Map,chrome.runtime.onMessage.addListener((n,r,i)=>{if(n?.type&&this.listeners.has(n.type))return this.listeners.get(n.type)(n.payload,r,i),!0})}on(e,n){this.listeners.set(e,n)}send(e,n,r){const i={from:this.role,to:e,type:n,payload:r};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(i),this.role==="background"&&(e==="content"?chrome.tabs.query({active:!0,currentWindow:!0},o=>{o[0]?.id&&chrome.tabs.sendMessage(o[0].id,i,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):e==="popup"&&chrome.runtime.sendMessage(i,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(e,n,r){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const i={from:this.role,to:"content",type:n,payload:r};chrome.tabs.sendMessage(e,i,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${e}:`,chrome.runtime.lastError.message)})}waitForMessage(e,n=3e4){return new Promise((r,i)=>{let o;const s=c=>{clearTimeout(o),this.off(e,s),r(c)};o=setTimeout(()=>{this.off(e,s),i(new Error(`Timeout khi chờ message: ${e}`))},n),this.on(e,s)})}off(e,n){this.listeners.get(e)===n&&this.listeners.delete(e)}}const x=new Bn("content"),rt=()=>{const t=Cn.ID_EXTENSION;if(document.getElementById(t))return;const e=document.createElement("div");e.id=t,document.body.appendChild(e);const n=document.createElement("script");n.src=chrome.runtime.getURL("content/inject-ui.js"),n.type="module",document.body.appendChild(n);const r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=chrome.runtime.getURL("assets/style.css"),document.head.appendChild(r)};x.on("background-to-content-publish",async t=>{try{console.log("[publish] Content nhận:",t),await b(800,1e3),await P.handlePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-publish",{msg:t})}}),x.on("background-to-content-unlist",async t=>{try{console.log("[unlist] Content nhận:",t),await b(800,1e3),await P.gotoSell(),await b(800,1e3),await P.handleDelete(t.data),await b(800,1e3);const e=await P.getProducts();await b(800,1e3),H.sync(e)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-unlist",{msg:t})}}),x.on("background-to-content-re-publist",async t=>{try{console.log("[re-publist] Content nhận:",t),await b(800,1e3),await P.gotoSell(),await b(800,1e3),await P.handleRePublist(t.data)}catch(e){console.log({error:e})}finally{x.send("background","content-to-background-re-publist",{msg:t})}}),window.addEventListener("message",async t=>{if(t.source===window&&t.data.type==="API_REQUEST"){const e=t.data.payload,n=t.data.fn,{requestId:r}=t.data;console.log({requestId:r,event:t,body:e});try{let i=null;switch(n){case"index":{i=(await H.index(e)).data;break}case"getPublistedProducts":{i=(await H.getPublistedProducts()).data;break}case"get":{i=(await H.get(e)).data,console.log({data:i,body:e});break}case"createBlobUrl":{x.send("background","content-to-background-create-blod-urls",e),i=await x.waitForMessage("background-to-content-create-blod-urls"),console.log({data:i});break}case"publist":{x.send("background","content-to-background-actions",{type:"publist",data:e}),i=await x.waitForMessage("background-to-content-actions");break}case"unlist":{x.send("background","content-to-background-actions",{type:"unlist",data:e}),console.log({body:e}),i=await x.waitForMessage("background-to-content-actions"),console.log({unlisted:i});break}case"sync":{const o=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",o),await P.waitForPageReady(P.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const s=await P.getProducts();console.log({products:s}),await H.sync(s);break}}window.postMessage({type:"API_RESPONSE",requestId:r,payload:i},"*")}catch(i){window.postMessage({type:"API_RESPONSE",requestId:r,error:i.message},"*")}}}),(async()=>{if(await b(800,1e3),window.location.href.includes(P.sellingPath))try{const t=await w.waitForElement('[aria-label="Collection of your Marketplace items"]');console.log("Element đã xuất hiện:",t),await P.waitForPageReady(P.sellingPath,'[aria-label="Collection of your Marketplace items"]'),await b(800,1e3);const e=await P.getProducts();console.log({products:e}),await H.sync(e)}catch(t){console.error(t)}finally{rt()}else rt()})()})(); diff --git a/releases/auto-post-facebook-extensions_1.0/index.html b/releases/auto-post-facebook-extensions_1.0/index.html index f984add..737220d 100644 --- a/releases/auto-post-facebook-extensions_1.0/index.html +++ b/releases/auto-post-facebook-extensions_1.0/index.html @@ -7,9 +7,9 @@ Vite + React + TS - + - + diff --git a/releases/auto-post-facebook-extensions_1.0/manifest.json b/releases/auto-post-facebook-extensions_1.0/manifest.json index 7dd3897..e2fa9c5 100644 --- a/releases/auto-post-facebook-extensions_1.0/manifest.json +++ b/releases/auto-post-facebook-extensions_1.0/manifest.json @@ -3,7 +3,12 @@ "name": "Auto post facebook extensions", "version": "1.0", "action": { - "default_popup": "index.html" + "default_popup": "index.html", + "default_icon": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } }, "background": { "service_worker": "background/background.js", @@ -23,5 +28,10 @@ "matches": ["https://www.facebook.com/*"] } ], - "permissions": ["storage", "tabs", "activeTab", "scripting"] + "permissions": ["storage", "tabs", "activeTab", "scripting"], + "icons": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } } diff --git a/releases/auto-post-facebook-extensions_1.2.zip b/releases/auto-post-facebook-extensions_1.2.zip new file mode 100644 index 0000000..c7922d2 Binary files /dev/null and b/releases/auto-post-facebook-extensions_1.2.zip differ diff --git a/releases/auto-post-facebook-extensions_1.2/assets/app-C7VSS-q9.js b/releases/auto-post-facebook-extensions_1.2/assets/app-C7VSS-q9.js new file mode 100644 index 0000000..747c617 --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/assets/app-C7VSS-q9.js @@ -0,0 +1 @@ +function a(e,r=[]){return Object.entries(e).reduce((t,[n,o])=>((o||r.includes(n))&&(t[n]=o),t),{})}function u(e){return new Promise(r=>setTimeout(r,e))}function s(e,r){const t=Math.floor(Math.random()*(r-e+1))+e;return u(t)}export{u as a,s as d,a as r}; diff --git a/releases/auto-post-facebook-extensions_1.2/assets/base64-BbJB1hmJ.js b/releases/auto-post-facebook-extensions_1.2/assets/base64-BbJB1hmJ.js new file mode 100644 index 0000000..ec78b05 --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/assets/base64-BbJB1hmJ.js @@ -0,0 +1 @@ +function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}async function l(e){return fetch(e).then(o=>o.blob()).then(o=>new Promise((n,r)=>{const t=new FileReader;t.onloadend=()=>{typeof t.result=="string"?n(t.result):r("Failed to convert blob to base64")},t.onerror=r,t.readAsDataURL(o)}))}export{a as g,l as u}; diff --git a/releases/auto-post-facebook-extensions_1.2/assets/contants-Cf0CQNSY.js b/releases/auto-post-facebook-extensions_1.2/assets/contants-Cf0CQNSY.js new file mode 100644 index 0000000..d8603cd --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/assets/contants-Cf0CQNSY.js @@ -0,0 +1 @@ +class s{static ID_EXTENSION="ex-root"}export{s as C}; diff --git a/releases/auto-post-facebook-extensions_1.2/assets/message.service-C-PcriAQ.js b/releases/auto-post-facebook-extensions_1.2/assets/message.service-C-PcriAQ.js new file mode 100644 index 0000000..2dd0c72 --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/assets/message.service-C-PcriAQ.js @@ -0,0 +1 @@ +import{d as a,a as u}from"./app-C7VSS-q9.js";class p{base64ToFile(t,e,i){const n=t.includes(",")?t.split(",")[1]:t,o=atob(n),r=new ArrayBuffer(o.length),c=new Uint8Array(r);for(let d=0;d{let r=0,c=!1;const l=()=>{const d=document.evaluate(c&&n?n:t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(d instanceof HTMLElement){o(d);return}r++,r{const r=new FileReader;r.onloadend=()=>{typeof r.result=="string"?n(r.result.split(",")[1]):o("Không thể đọc dữ liệu ảnh")},r.onerror=o,r.readAsDataURL(i)})}getImageExtension(t){try{const i=new URL(t).pathname.match(/\.([a-zA-Z0-9]+)$/);return i?i[1].toLowerCase():null}catch{const n=t.split("?")[0].match(/\.([a-zA-Z0-9]+)$/);return n?n[1].toLowerCase():null}}imageLocalToBase64(t){return new Promise((e,i)=>{try{const n=chrome.runtime.getURL(`${t}`);fetch(n).then(o=>o.blob()).then(o=>{const r=new FileReader;r.onloadend=()=>e(r.result),r.onerror=i,r.readAsDataURL(o)}).catch(i)}catch(n){i(n)}})}scrollToElement(t,e="smooth"){t&&t.scrollIntoView({behavior:e,block:"center",inline:"nearest"})}getElementPointCoores(t){if(!t)return null;const e=t.getBoundingClientRect(),i=e.left+e.width/2,n=e.top+e.height/2;return{x:i,y:n}}setInputValue(t,e){t&&(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}writeToInput=async(t,e)=>{let i;if(typeof e=="string"?i=await this.getElementByXPath(e):i=e,!i)throw new Error("Xpath is not found with value: "+t);this.scrollToElement(i),this.clickByPoint(i),this.setInputValue(i,t)};pressEnter(t){if(!t)throw new Error("Textarea not found:",t);t.focus(),["keydown","keypress","keyup"].forEach(e=>{t.dispatchEvent(new KeyboardEvent(e,{key:"Enter",code:"Enter",keyCode:13,which:13,bubbles:!0,cancelable:!0}))})}findNestedElement(t,e,i){const n=document.querySelector(t);if(!n)return null;const o=n.querySelectorAll(e);for(const r of o)if(r.innerText.trim().toLowerCase()===i.toLowerCase())return r;return null}findNestedIcElement(t,e,i){let n=null;if(typeof t=="string"){if(document.querySelector(t),!n)return null}else n=t;const o=n.querySelectorAll(e);for(const r of o)if(r.innerText.trim().toLowerCase().includes(i.toLowerCase()))return r;return null}findElInParent(t,e){return t&&t.parentElement?.querySelector(e)||null}waitForElement(t,e=100){return new Promise(i=>{const n=l=>l.offsetParent!==null&&(l.childElementCount>0||l.innerText.trim().length>0),o=()=>{const l=document.querySelector(t);l&&n(l)&&(r.disconnect(),clearInterval(c),i(l))},r=new MutationObserver(o);r.observe(document.body,{childList:!0,subtree:!0});const c=setInterval(o,e);o()})}}const s=new p;class f{sellingPath="https://www.facebook.com/marketplace/you/selling";marketPath="https://www.facebook.com/marketplace";createItem="https://www.facebook.com/marketplace/create/item";editItem="https://www.facebook.com/marketplace/edit";selectors={file__image_input:'input[type="file"]',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",update_btn:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/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",products:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",products_fallback:"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[3]/div/div/span/div[2]/div",option_btn:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div/div/div/div[3]/div/div/div/div/div[1]/div",option_btn_fallback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[3]/div[2]/div/div[2]/div[1]",close_btn_modal_feedback:"/html/body/div[1]/div/div[1]/div/div[4]/div/div/div[1]/div/div[2]/div/div/div/div[2]/div",images_container:"/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[3]/div[2]/div",description_edit_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/div/textarea",sku_edit_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[1]/label/div/input",new_item_btn:"/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]/a/div",item_for_sell:"/html/body/div[1]/div/div[1]/div/div[5]/div/div/div[3]/div[2]/div[2]/div/div/div[2]/div[1]/div/span/div/div/div[1]/div/div",market_container:'[aria-label="Marketplace"]'};findInputByTitle(t,e="input"){const i=s.findNestedElement(this.selectors.market_container,"span",t);if(!i)throw new Error("Not found input by title: "+t);return s.findElInParent(i,e)}clearImages=async()=>{document.querySelectorAll('[aria-label="Remove"]').forEach(t=>t?.click())};uploadImages=async t=>{const e=new DataTransfer;for(const n of t.images){const o=await s.imageUrlToBase64(n);console.log("Base64:",n.slice(0,50)+"...");const r=s.base64ToFile(o,t.sku,s.getImageExtension(n)||"jpg");e.items.add(r)}const i=document.querySelector(this.selectors.file__image_input);i?(i.files=e.files,i.dispatchEvent(new Event("change",{bubbles:!0}))):console.error("Không tìm thấy input[type='file']")};chooseSelect=async(t,e,i='[aria-label="Dropdown menu"]')=>{const n=s.findNestedElement(this.selectors.market_container,"span",e);s.scrollToElement(n),await a(500,600),n?.click(),await a(500,600);const o=s.findNestedElement(i,"span",t);if(await a(500,600),!o)throw new Error(`No child found with text "${t}"`);s.scrollToElement(o),await a(500,600),o.click(),await a(500,600)};chooseLocation=async t=>{const e=this.findInputByTitle("location");await s.writeToInput(t,e),await u(600);const i=document.querySelector('[role="listbox"]')?.querySelectorAll("li")||[],n=Array.from(i).find(o=>o.innerHTML.trim().toLowerCase().includes(t.toLowerCase()));if(console.log(n),!n)throw new Error(`No child found with text "${t}"`);s.scrollToElement(n),await u(400),s.clickByPoint(n)};writeTags=async t=>{const e=this.findInputByTitle("product tags","textarea");if(!e)throw new Error("Input is not found");s.scrollToElement(e),await u(500);for(const i of t)await s.writeToInput(i,e),await u(300),s.pressEnter(e)};clickNext=async()=>{const t=await s.getElementByXPath(this.selectors.next_btn);if(!t)throw new Error("Next button is not found");s.clickByPoint(t)};clickUpdate=async()=>{const t=await s.getElementByXPath(this.selectors.update_btn);if(!t)throw new Error("Next button is not found");s.clickByPoint(t)};clickPublist=async()=>{const t=await s.getElementByXPath(this.selectors.publish_btn);if(!t)throw new Error("Publist button is not found");s.clickByPoint(t)};handlePublist=async t=>{console.log({item:t}),await a(600,1e3),await this.uploadImages(t),await a(600,1e3);const e=this.findInputByTitle("title");s.writeToInput(t.title,e),await a(600,1e3);const i=this.findInputByTitle("price");if(s.writeToInput(String(t.price),i),await a(600,1e3),await this.chooseSelect(t.category,"category"),await a(600,1e3),await this.chooseSelect(t.condition,"condition",'[aria-label="Select an option"]'),t.brand){await a(600,1e3);const r=this.findInputByTitle("brand");await s.writeToInput(t.brand,r)}await a(600,1e3);const n=this.findInputByTitle("description","textarea");await s.writeToInput(t.description,n),await a(600,1e3),await this.writeTags(t.tags),await a(600,1e3);const o=this.findInputByTitle("sku");return await s.writeToInput(t.sku,o),t?.location&&(await a(600,1e3),await this.chooseLocation(t.location)),await a(300,500),await this.clickNext(),!0};handleRePublist=async t=>{console.log({item:t}),await s.waitForElement('[aria-label="Collection of your Marketplace items"]');const e=await this.getOptionEls(t);console.log({items:e}),this.clickItemInList(e,"edit"),await u(1e3),await this.waitForPageReady(this.editItem,this.selectors.market_container),await a(1e3,2e3),await this.clearImages(),await a(600,1e3),await this.uploadImages(t),await a(600,1e3);const i=this.findInputByTitle("title");s.writeToInput(t.title,i),await a(600,1e3);const n=this.findInputByTitle("price");s.writeToInput(String(t.price),n),await a(600,1e3),await this.chooseSelect(t.category,"category"),await a(600,1e3),await this.chooseSelect(t.condition,"condition",'[aria-label="Select an option"]'),await a(600,1e3);const o=this.findInputByTitle("description","textarea");return await s.writeToInput(t.description,o),await a(600,1e3),await this.writeTags(t.tags),await a(600,1e3),t?.location&&(await a(600,1e3),await this.chooseLocation(t.location)),!0};getProducts=async()=>{const t=await s.getElementByXPath(this.selectors.products),e=await s.getElementByXPath(this.selectors.products_fallback);console.log({products1:t,products2:e});const i=[t,e].filter(Boolean);return i.length===0?[]:i.flatMap(n=>this.extractListings(n))};extractListings(t){return Array.from(t.children).map(i=>{const o=i.querySelector('span[dir="auto"], div[dir="auto"]')?.textContent?.trim()||"",r=document.querySelectorAll(`[aria-label="${o}"]`),c=Array.from(r).filter(m=>!m.querySelector("img"))[0],d=s.findNestedIcElement(c,"span","AU$")?.textContent?.match(/[\d,]+(?:\.\d+)?/),w=d?parseFloat(d[0].replace(/,/g,"")):0;return{title:o,price:w,el:t}})}closeTab=async t=>{chrome.runtime.sendMessage({type:"close-tab",payload:t})};clickOptionOfProduct(t){const e=document.querySelector(`[aria-label="More options for ${t.title}"]`);if(!e)throw new Error(`Not found option buttin in product ${`[aria-label="More options for ${t.title}"]`}, ID: ${t.id}`);s.scrollToElement(e),e.click?.()}async getOptionEls(t){return this.clickOptionOfProduct(t),await u(2e3),Array.from(document.querySelectorAll('[role="menuitem"]'))}clickItemInList(t,e){const i=t.find(n=>n.textContent.toLocaleLowerCase().includes(e));if(!i)throw new Error(`Not found item ${e} in options list`);i.click?.()}getItemInList(t,e){const i=t.find(n=>n.textContent.toLocaleLowerCase().includes(e));if(!i)throw new Error(`Not found item ${e} in options list`);return i}handleDelete=async t=>{const e=await this.getOptionEls(t);console.log({items:e}),this.clickItemInList(e,"delete"),await u(1e3);const i=await s.getElementByXPath(this.selectors.option_btn,{xpathFallback:this.selectors.option_btn_fallback});console.log({confirmBtn:i}),i?.click(),(await s.getElementByXPath(this.selectors.close_btn_modal_feedback))?.click(),chrome.runtime.sendMessage({type:"delete-done"})};waitForUrlContains(t,e=1e4){return new Promise((i,n)=>{const o=Date.now(),r=()=>{window.location.href.includes(t)?i():Date.now()-o>e?n(new Error("Timeout waiting for URL change")):setTimeout(r,500)};r()})}waitForPageReady(t,e,i=15e3){return new Promise((n,o)=>{const r=Date.now(),c=async()=>{window.location.href.includes(t)&&document.querySelector(e)?n():Date.now()-r>i?o(new Error("Timeout waiting for selling page ready")):setTimeout(c,500)};c()})}syncListing=async()=>{window.location.href.includes(this.sellingPath)||(document.querySelector('a[href="/marketplace/you/selling/"]')?.click?.(),await this.waitForPageReady(this.sellingPath,this.selectors.products)),await h.getProducts()};extractMarketplaceItemId(t){const e=t.match(/\/marketplace\/item\/(\d+)/);return e?e[1]:null}handleGetPublistID=async t=>{const e=await h.getProducts(),i=e.find(c=>c.title==t.title&&c.price==t.price);if(console.log({payload:t,product:i,products:e}),!i)return;i.el;const n=await this.getOptionEls(t),o=this.getItemInList(n,"view listing"),r=this.extractMarketplaceItemId(o.href);return this.clickOptionOfProduct(t),r};async gotoPublist(){(await s.getElementByXPath(this.selectors.new_item_btn))?.click(),await a(400,800),(await s.getElementByXPath(this.selectors.item_for_sell))?.click()}async gotoSell(){document.querySelector('[href="/marketplace/you/selling/"]')?.click()}}const h=new f;class b{role;listeners;constructor(t){this.role=t,this.listeners=new Map,chrome.runtime.onMessage.addListener((e,i,n)=>{if(e?.type&&this.listeners.has(e.type))return this.listeners.get(e.type)(e.payload,i,n),!0})}on(t,e){this.listeners.set(t,e)}send(t,e,i){const n={from:this.role,to:t,type:e,payload:i};(this.role==="popup"||this.role==="content")&&chrome.runtime.sendMessage(n),this.role==="background"&&(t==="content"?chrome.tabs.query({active:!0,currentWindow:!0},o=>{o[0]?.id&&chrome.tabs.sendMessage(o[0].id,n,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới content script:",chrome.runtime.lastError.message)})}):t==="popup"&&chrome.runtime.sendMessage(n,()=>{chrome.runtime.lastError&&console.warn("Không gửi được tới popup:",chrome.runtime.lastError.message)}))}sendToTab(t,e,i){if(this.role!=="background")throw new Error("sendToTab chỉ được gọi từ background");const n={from:this.role,to:"content",type:e,payload:i};chrome.tabs.sendMessage(t,n,()=>{chrome.runtime.lastError&&console.warn(`Không gửi được tới content script ở tab ${t}:`,chrome.runtime.lastError.message)})}waitForMessage(t,e=3e4){return new Promise((i,n)=>{let o;const r=c=>{clearTimeout(o),this.off(t,r),i(c)};o=setTimeout(()=>{this.off(t,r),n(new Error(`Timeout khi chờ message: ${t}`))},e),this.on(t,r)})}off(t,e){this.listeners.get(t)===e&&this.listeners.delete(t)}}export{b as M,h as f,s as t}; diff --git a/releases/auto-post-facebook-extensions_1.2/assets/popup-D--aKLqS.js b/releases/auto-post-facebook-extensions_1.2/assets/popup-D--aKLqS.js new file mode 100644 index 0000000..6d1b17a --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/assets/popup-D--aKLqS.js @@ -0,0 +1,182 @@ +import{g as ph,u as d1}from"./base64-BbJB1hmJ.js";import{p as Sn}from"./product-api.service-DR0CE0o9.js";import{a as h1,r as m1}from"./app-C7VSS-q9.js";function p1(n,a){for(var i=0;is[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var bd={exports:{}},il={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $g;function v1(){if($g)return il;$g=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(s,o,c){var d=null;if(c!==void 0&&(d=""+c),o.key!==void 0&&(d=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:n,type:s,key:d,ref:o!==void 0?o:null,props:c}}return il.Fragment=a,il.jsx=i,il.jsxs=i,il}var Jg;function g1(){return Jg||(Jg=1,bd.exports=v1()),bd.exports}var y=g1(),ns=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Gr=typeof window>"u"||"Deno"in globalThis;function Gt(){}function y1(n,a){return typeof n=="function"?n(a):n}function Hd(n){return typeof n=="number"&&n>=0&&n!==1/0}function xb(n,a){return Math.max(n+(a||0)-Date.now(),0)}function lr(n,a){return typeof n=="function"?n(a):n}function wn(n,a){return typeof n=="function"?n(a):n}function Wg(n,a){const{type:i="all",exact:s,fetchStatus:o,predicate:c,queryKey:d,stale:h}=n;if(d){if(s){if(a.queryHash!==vh(d,a.options))return!1}else if(!ml(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||o&&o!==a.state.fetchStatus||c&&!c(a))}function ey(n,a){const{exact:i,status:s,predicate:o,mutationKey:c}=n;if(c){if(!a.options.mutationKey)return!1;if(i){if(Fr(a.options.mutationKey)!==Fr(c))return!1}else if(!ml(a.options.mutationKey,c))return!1}return!(s&&a.state.status!==s||o&&!o(a))}function vh(n,a){return(a?.queryKeyHashFn||Fr)(n)}function Fr(n){return JSON.stringify(n,(a,i)=>qd(i)?Object.keys(i).sort().reduce((s,o)=>(s[o]=i[o],s),{}):i)}function ml(n,a){return n===a?!0:typeof n!=typeof a?!1:n&&a&&typeof n=="object"&&typeof a=="object"?Object.keys(a).every(i=>ml(n[i],a[i])):!1}function _b(n,a){if(n===a)return n;const i=ty(n)&&ty(a);if(i||qd(n)&&qd(a)){const s=i?n:Object.keys(n),o=s.length,c=i?a:Object.keys(a),d=c.length,h=i?[]:{},p=new Set(s);let m=0;for(let g=0;g{setTimeout(a,n)})}function Gd(n,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,a):i.structuralSharing!==!1?_b(n,a):a}function x1(n,a,i=0){const s=[...n,a];return i&&s.length>i?s.slice(1):s}function _1(n,a,i=0){const s=[a,...n];return i&&s.length>i?s.slice(0,-1):s}var gh=Symbol();function Sb(n,a){return!n.queryFn&&a?.initialPromise?()=>a.initialPromise:!n.queryFn||n.queryFn===gh?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function wb(n,a){return typeof n=="function"?n(...a):!!n}var S1=class extends ns{#t;#e;#n;constructor(){super(),this.#n=n=>{if(!Gr&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(n){this.#t!==n&&(this.#t=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},yh=new S1,w1=class extends ns{#t=!0;#e;#n;constructor(){super(),this.#n=n=>{if(!Gr&&window.addEventListener){const a=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(this.setOnline.bind(this))}setOnline(n){this.#t!==n&&(this.#t=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#t}},bu=new w1;function Fd(){let n,a;const i=new Promise((o,c)=>{n=o,a=c});i.status="pending",i.catch(()=>{});function s(o){Object.assign(i,o),delete i.resolve,delete i.reject}return i.resolve=o=>{s({status:"fulfilled",value:o}),n(o)},i.reject=o=>{s({status:"rejected",reason:o}),a(o)},i}function E1(n){return Math.min(1e3*2**n,3e4)}function Eb(n){return(n??"online")==="online"?bu.isOnline():!0}var Cb=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Tb(n){let a=!1,i=0,s;const o=Fd(),c=()=>o.status!=="pending",d=S=>{c()||(w(new Cb(S)),n.abort?.())},h=()=>{a=!0},p=()=>{a=!1},m=()=>yh.isFocused()&&(n.networkMode==="always"||bu.isOnline())&&n.canRun(),g=()=>Eb(n.networkMode)&&n.canRun(),_=S=>{c()||(s?.(),o.resolve(S))},w=S=>{c()||(s?.(),o.reject(S))},T=()=>new Promise(S=>{s=A=>{(c()||m())&&S(A)},n.onPause?.()}).then(()=>{s=void 0,c()||n.onContinue?.()}),M=()=>{if(c())return;let S;const A=i===0?n.initialPromise:void 0;try{S=A??n.fn()}catch(L){S=Promise.reject(L)}Promise.resolve(S).then(_).catch(L=>{if(c())return;const R=n.retry??(Gr?0:3),z=n.retryDelay??E1,j=typeof z=="function"?z(i,L):z,U=R===!0||typeof R=="number"&&im()?void 0:T()).then(()=>{a?w(L):M()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(s?.(),o),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?M():T().then(M),o)}}var C1=n=>setTimeout(n,0);function T1(){let n=[],a=0,i=h=>{h()},s=h=>{h()},o=C1;const c=h=>{a?n.push(h):o(()=>{i(h)})},d=()=>{const h=n;n=[],h.length&&o(()=>{s(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{o=h}}}var Tt=T1(),Ab=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hd(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Gr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},A1=class extends Ab{#t;#e;#n;#a;#r;#s;#l;constructor(n){super(),this.#l=!1,this.#s=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#n=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=R1(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(n){this.options={...this.#s,...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,a){const i=Gd(this.state.data,n,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(n,a){this.#i({type:"setState",state:n,setStateOptions:a})}cancel(n){const a=this.#r?.promise;return this.#r?.cancel(n),a?a.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(n=>wn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>lr(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!xb(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(this.#r&&(this.#l?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(n,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(n&&this.setOptions(n),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},o=()=>{const h=Sb(this.options,a),m=(()=>{const g={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#l=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return s(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#r=Tb({initialPromise:a?.initialPromise,fn:d.fetchFn,abort:i.abort.bind(i),onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Cb){if(h.silent)return this.#r.promise;if(h.revert){if(this.setState({...this.#e,fetchStatus:"idle"}),this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(n){const a=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Rb(i.data,this.options),fetchMeta:n.meta??null};case"success":const s={...i,data:n.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=n.manual?s:void 0,s;case"error":const o=n.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=a(this.state),Tt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function Rb(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Eb(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function R1(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,i=a!==void 0,s=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var O1=class extends ns{constructor(n={}){super(),this.config=n,this.#t=new Map}#t;build(n,a,i){const s=a.queryKey,o=a.queryHash??vh(s,a);let c=this.get(o);return c||(c=new A1({client:n,queryKey:s,queryHash:o,options:n.defaultQueryOptions(a),state:i,defaultOptions:n.getQueryDefaults(s)}),this.add(c)),c}add(n){this.#t.has(n.queryHash)||(this.#t.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=this.#t.get(n.queryHash);a&&(n.destroy(),a===n&&this.#t.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Tt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#t.get(n)}getAll(){return[...this.#t.values()]}find(n){const a={exact:!0,...n};return this.getAll().find(i=>Wg(a,i))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(i=>Wg(n,i)):a}notify(n){Tt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},M1=class extends Ab{#t;#e;#n;constructor(n){super(),this.mutationId=n.mutationId,this.#e=n.mutationCache,this.#t=[],this.state=n.state||Ob(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(a=>a!==n),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(n){const a=()=>{this.#a({type:"continue"})};this.#n=Tb({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(o,c)=>{this.#a({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)a();else{this.#a({type:"pending",variables:n,isPaused:s}),await this.#e.config.onMutate?.(n,this);const c=await this.options.onMutate?.(n);c!==this.state.context&&this.#a({type:"pending",context:c,variables:n,isPaused:s})}const o=await this.#n.start();return await this.#e.config.onSuccess?.(o,n,this.state.context,this),await this.options.onSuccess?.(o,n,this.state.context),await this.#e.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,n,this.state.context),this.#a({type:"success",data:o}),o}catch(o){try{throw await this.#e.config.onError?.(o,n,this.state.context,this),await this.options.onError?.(o,n,this.state.context),await this.#e.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,n,this.state.context),o}finally{this.#a({type:"error",error:o})}}finally{this.#e.runNext(this)}}#a(n){const a=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Tt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(n)}),this.#e.notify({mutation:this,type:"updated",action:n})})}};function Ob(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var N1=class extends ns{constructor(n={}){super(),this.config=n,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(n,a,i){const s=new M1({mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(a),state:i});return this.add(s),s}add(n){this.#t.add(n);const a=nu(n);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(n):this.#e.set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#t.delete(n)){const a=nu(n);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const s=i.indexOf(n);s!==-1&&i.splice(s,1)}else i[0]===n&&this.#e.delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=nu(n);if(typeof a=="string"){const s=this.#e.get(a)?.find(o=>o.state.status==="pending");return!s||s===n}else return!0}runNext(n){const a=nu(n);return typeof a=="string"?this.#e.get(a)?.find(s=>s!==n&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Tt.batch(()=>{this.#t.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(n){const a={exact:!0,...n};return this.getAll().find(i=>ey(a,i))}findAll(n={}){return this.getAll().filter(a=>ey(n,a))}notify(n){Tt.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return Tt.batch(()=>Promise.all(n.map(a=>a.continue().catch(Gt))))}};function nu(n){return n.options.scope?.id}function ay(n){return{onFetch:(a,i)=>{const s=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const _=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},w=Sb(a.options,a.fetchOptions),T=async(M,S,A)=>{if(g)return Promise.reject();if(S==null&&M.pages.length)return Promise.resolve(M);const R=(()=>{const I={client:a.client,queryKey:a.queryKey,pageParam:S,direction:A?"backward":"forward",meta:a.options.meta};return _(I),I})(),z=await w(R),{maxPages:j}=a.options,U=A?_1:x1;return{pages:U(M.pages,z,j),pageParams:U(M.pageParams,S,j)}};if(o&&c.length){const M=o==="backward",S=M?D1:ry,A={pages:c,pageParams:d},L=S(s,A);h=await T(A,L,M)}else{const M=n??c.length;do{const S=p===0?d[0]??s.initialPageParam:ry(s,h);if(p>0&&S==null)break;h=await T(h,S),p++}while(pa.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function ry(n,{pages:a,pageParams:i}){const s=a.length-1;return a.length>0?n.getNextPageParam(a[s],a,i[s],i):void 0}function D1(n,{pages:a,pageParams:i}){return a.length>0?n.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var j1=class{#t;#e;#n;#a;#r;#s;#l;#i;constructor(n={}){this.#t=n.queryCache||new O1,this.#e=n.mutationCache||new N1,this.#n=n.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#l=yh.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=bu.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(n){return this.#t.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#e.findAll({...n,status:"pending"}).length}getQueryData(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),i=this.#t.build(this,a),s=i.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(lr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(n){return this.#t.findAll(n).map(({queryKey:a,state:i})=>{const s=i.data;return[a,s]})}setQueryData(n,a,i){const s=this.defaultQueryOptions({queryKey:n}),c=this.#t.get(s.queryHash)?.state.data,d=y1(a,c);if(d!==void 0)return this.#t.build(this,s).setData(d,{...i,manual:!0})}setQueriesData(n,a,i){return Tt.batch(()=>this.#t.findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,a,i)]))}getQueryState(n){const a=this.defaultQueryOptions({queryKey:n});return this.#t.get(a.queryHash)?.state}removeQueries(n){const a=this.#t;Tt.batch(()=>{a.findAll(n).forEach(i=>{a.remove(i)})})}resetQueries(n,a){const i=this.#t;return Tt.batch(()=>(i.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const i={revert:!0,...a},s=Tt.batch(()=>this.#t.findAll(n).map(o=>o.cancel(i)));return Promise.all(s).then(Gt).catch(Gt)}invalidateQueries(n,a={}){return Tt.batch(()=>(this.#t.findAll(n).forEach(i=>{i.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},a)))}refetchQueries(n,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},s=Tt.batch(()=>this.#t.findAll(n).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,i);return i.throwOnError||(c=c.catch(Gt)),o.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(Gt)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(lr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Gt).catch(Gt)}fetchInfiniteQuery(n){return n.behavior=ay(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Gt).catch(Gt)}ensureInfiniteQueryData(n){return n.behavior=ay(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return bu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,a){this.#a.set(Fr(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...this.#a.values()],i={};return a.forEach(s=>{ml(n,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(n,a){this.#r.set(Fr(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...this.#r.values()],i={};return a.forEach(s=>{ml(n,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const a={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=vh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===gh&&(a.enabled=!1),a}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},k1=class extends ns{constructor(n,a){super(),this.options=a,this.#t=n,this.#i=null,this.#l=Fd(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#a=void 0;#r;#s;#l;#i;#p;#d;#h;#u;#c;#o;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),iy(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zd(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zd(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#e.removeObserver(this)}setOptions(n){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),a._defaulted&&!yu(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&sy(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||lr(this.options.staleTime,this.#e)!==lr(a.staleTime,this.#e))&&this.#v();const o=this.#g();s&&(this.#e!==i||wn(this.options.enabled,this.#e)!==wn(a.enabled,this.#e)||o!==this.#o)&&this.#y(o)}getOptimisticResult(n){const a=this.#t.getQueryCache().build(this.#t,n),i=this.createResult(a,n);return U1(this,i)&&(this.#a=i,this.#s=this.options,this.#r=this.#e.state),i}getCurrentResult(){return this.#a}trackResult(n,a){return new Proxy(n,{get:(i,s)=>(this.trackProp(s),a?.(s),s==="promise"&&!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,s))})}trackProp(n){this.#m.add(n)}getCurrentQuery(){return this.#e}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=this.#t.defaultQueryOptions(n),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(n){return this.#f({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#f(n){this.#S();let a=this.#e.fetch(this.options,n);return n?.throwOnError||(a=a.catch(Gt)),a}#v(){this.#x();const n=lr(this.options.staleTime,this.#e);if(Gr||this.#a.isStale||!Hd(n))return;const i=xb(this.#a.dataUpdatedAt,n)+1;this.#u=setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(n){this.#_(),this.#o=n,!(Gr||wn(this.options.enabled,this.#e)===!1||!Hd(this.#o)||this.#o===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||yh.isFocused())&&this.#f()},this.#o))}#b(){this.#v(),this.#y(this.#g())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#_(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(n,a){const i=this.#e,s=this.options,o=this.#a,c=this.#r,d=this.#s,p=n!==i?n.state:this.#n,{state:m}=n;let g={...m},_=!1,w;if(a._optimisticResults){const G=this.hasListeners(),oe=!G&&iy(n,a),ve=G&&sy(n,i,a,s);(oe||ve)&&(g={...g,...Rb(m.data,n.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:T,errorUpdatedAt:M,status:S}=g;w=g.data;let A=!1;if(a.placeholderData!==void 0&&w===void 0&&S==="pending"){let G;o?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(G=o.data,A=!0):G=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,G!==void 0&&(S="success",w=Gd(o?.data,G,a),_=!0)}if(a.select&&w!==void 0&&!A)if(o&&w===c?.data&&a.select===this.#p)w=this.#d;else try{this.#p=a.select,w=a.select(w),w=Gd(o?.data,w,a),this.#d=w,this.#i=null}catch(G){this.#i=G}this.#i&&(T=this.#i,w=this.#d,M=Date.now(),S="error");const L=g.fetchStatus==="fetching",R=S==="pending",z=S==="error",j=R&&L,U=w!==void 0,Z={status:S,fetchStatus:g.fetchStatus,isPending:R,isSuccess:S==="success",isError:z,isInitialLoading:j,isLoading:j,data:w,dataUpdatedAt:g.dataUpdatedAt,error:T,errorUpdatedAt:M,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:L,isRefetching:L&&!R,isLoadingError:z&&!U,isPaused:g.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:z&&U,isStale:bh(n,a),refetch:this.refetch,promise:this.#l,isEnabled:wn(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const G=ge=>{Z.status==="error"?ge.reject(Z.error):Z.data!==void 0&&ge.resolve(Z.data)},oe=()=>{const ge=this.#l=Z.promise=Fd();G(ge)},ve=this.#l;switch(ve.status){case"pending":n.queryHash===i.queryHash&&G(ve);break;case"fulfilled":(Z.status==="error"||Z.data!==ve.value)&&oe();break;case"rejected":(Z.status!=="error"||Z.error!==ve.reason)&&oe();break}}return Z}updateResult(){const n=this.#a,a=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#e),yu(a,n))return;this.#a=a;const i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#m.size)return!0;const c=new Set(o??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(d=>{const h=d;return this.#a[h]!==n[h]&&c.has(h)})};this.#w({listeners:i()})}#S(){const n=this.#t.getQueryCache().build(this.#t,this.options);if(n===this.#e)return;const a=this.#e;this.#e=n,this.#n=n.state,this.hasListeners()&&(a?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(n){Tt.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function z1(n,a){return wn(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&a.retryOnMount===!1)}function iy(n,a){return z1(n,a)||n.state.data!==void 0&&Zd(n,a,a.refetchOnMount)}function Zd(n,a,i){if(wn(a.enabled,n)!==!1&&lr(a.staleTime,n)!=="static"){const s=typeof i=="function"?i(n):i;return s==="always"||s!==!1&&bh(n,a)}return!1}function sy(n,a,i,s){return(n!==a||wn(s.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&bh(n,i)}function bh(n,a){return wn(a.enabled,n)!==!1&&n.isStaleByTime(lr(a.staleTime,n))}function U1(n,a){return!yu(n.getCurrentResult(),a)}var L1=class extends ns{#t;#e=void 0;#n;#a;constructor(a,i){super(),this.#t=a,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#t.defaultMutationOptions(a),yu(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Fr(i.mutationKey)!==Fr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#r(),this.#s(a)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(a,i){return this.#a=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(a)}#r(){const a=this.#n?.state??Ob();this.#e={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#s(a){Tt.batch(()=>{if(this.#a&&this.hasListeners()){const i=this.#e.variables,s=this.#e.context;a?.type==="success"?(this.#a.onSuccess?.(a.data,i,s),this.#a.onSettled?.(a.data,null,i,s)):a?.type==="error"&&(this.#a.onError?.(a.error,i,s),this.#a.onSettled?.(void 0,a.error,i,s))}this.listeners.forEach(i=>{i(this.#e)})})}},xd={exports:{}},Ue={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ly;function V1(){if(ly)return Ue;ly=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=_&&C[_]||C["@@iterator"],typeof C=="function"?C:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,S={};function A(C,Y,ie){this.props=C,this.context=Y,this.refs=S,this.updater=ie||T}A.prototype.isReactComponent={},A.prototype.setState=function(C,Y){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,Y,"setState")},A.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function L(){}L.prototype=A.prototype;function R(C,Y,ie){this.props=C,this.context=Y,this.refs=S,this.updater=ie||T}var z=R.prototype=new L;z.constructor=R,M(z,A.prototype),z.isPureReactComponent=!0;var j=Array.isArray,U={H:null,A:null,T:null,S:null,V:null},I=Object.prototype.hasOwnProperty;function Z(C,Y,ie,ee,ue,Oe){return ie=Oe.ref,{$$typeof:n,type:C,key:Y,ref:ie!==void 0?ie:null,props:Oe}}function G(C,Y){return Z(C.type,Y,void 0,void 0,void 0,C.props)}function oe(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function ve(C){var Y={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ie){return Y[ie]})}var ge=/\/+/g;function ae(C,Y){return typeof C=="object"&&C!==null&&C.key!=null?ve(""+C.key):Y.toString(36)}function re(){}function le(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(re,re):(C.status="pending",C.then(function(Y){C.status==="pending"&&(C.status="fulfilled",C.value=Y)},function(Y){C.status==="pending"&&(C.status="rejected",C.reason=Y)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function he(C,Y,ie,ee,ue){var Oe=typeof C;(Oe==="undefined"||Oe==="boolean")&&(C=null);var _e=!1;if(C===null)_e=!0;else switch(Oe){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(C.$$typeof){case n:case a:_e=!0;break;case g:return _e=C._init,he(_e(C._payload),Y,ie,ee,ue)}}if(_e)return ue=ue(C),_e=ee===""?"."+ae(C,0):ee,j(ue)?(ie="",_e!=null&&(ie=_e.replace(ge,"$&/")+"/"),he(ue,Y,ie,"",function(Ke){return Ke})):ue!=null&&(oe(ue)&&(ue=G(ue,ie+(ue.key==null||C&&C.key===ue.key?"":(""+ue.key).replace(ge,"$&/")+"/")+_e)),Y.push(ue)),1;_e=0;var te=ee===""?".":ee+":";if(j(C))for(var Te=0;Te{const a=b.useContext(Nb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},dD=({client:n,children:a})=>(b.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),y.jsx(Nb.Provider,{value:n,children:a})),jb=b.createContext(!1),P1=()=>b.useContext(jb);jb.Provider;function B1(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var H1=b.createContext(B1()),q1=()=>b.useContext(H1),G1=(n,a)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(a.isReset()||(n.retryOnMount=!1))},F1=n=>{b.useEffect(()=>{n.clearReset()},[n])},Z1=({result:n,errorResetBoundary:a,throwOnError:i,query:s,suspense:o})=>n.isError&&!a.isReset()&&!n.isFetching&&s&&(o&&n.data===void 0||wb(i,[n.error,s])),I1=n=>{if(n.suspense){const a=s=>s==="static"?s:Math.max(s??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...s)=>a(i(...s)):a(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Y1=(n,a)=>n.isLoading&&n.isFetching&&!a,Q1=(n,a)=>n?.suspense&&a.isPending,uy=(n,a,i)=>a.fetchOptimistic(n).catch(()=>{i.clearReset()});function K1(n,a,i){const s=P1(),o=q1(),c=Db(),d=c.defaultQueryOptions(n);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=s?"isRestoring":"optimistic",I1(d),G1(d,o),F1(o);const h=!c.getQueryCache().get(d.queryHash),[p]=b.useState(()=>new a(c,d)),m=p.getOptimisticResult(d),g=!s&&n.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(_=>{const w=g?p.subscribe(Tt.batchCalls(_)):Gt;return p.updateResult(),w},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),b.useEffect(()=>{p.setOptions(d)},[d,p]),Q1(d,m))throw uy(d,p,o);if(Z1({result:m,errorResetBoundary:o,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Gr&&Y1(m,s)&&(h?uy(d,p,o):c.getQueryCache().get(d.queryHash)?.promise)?.catch(Gt).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function Id(n,a){return K1(n,k1)}function kb(n,a){const i=Db(),[s]=b.useState(()=>new L1(i,n));b.useEffect(()=>{s.setOptions(n)},[s,n]);const o=b.useSyncExternalStore(b.useCallback(d=>s.subscribe(Tt.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),c=b.useCallback((d,h)=>{s.mutate(d,h).catch(Gt)},[s]);if(o.error&&wb(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}const hD=new j1({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}});var _d={exports:{}},sl={},Sd={exports:{}},wd={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var cy;function X1(){return cy||(cy=1,(function(n){function a(D,Q){var H=D.length;D.push(Q);e:for(;0>>1,C=D[W];if(0>>1;Wo(ee,H))ueo(Oe,ee)?(D[W]=Oe,D[ue]=H,W=ue):(D[W]=ee,D[ie]=H,W=ie);else if(ueo(Oe,H))D[W]=Oe,D[ue]=H,W=ue;else break e}}return Q}function o(D,Q){var H=D.sortIndex-Q.sortIndex;return H!==0?H:D.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,_=null,w=3,T=!1,M=!1,S=!1,A=!1,L=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function j(D){for(var Q=i(m);Q!==null;){if(Q.callback===null)s(m);else if(Q.startTime<=D)s(m),Q.sortIndex=Q.expirationTime,a(p,Q);else break;Q=i(m)}}function U(D){if(S=!1,j(D),!M)if(i(p)!==null)M=!0,I||(I=!0,ae());else{var Q=i(m);Q!==null&&he(U,Q.startTime-D)}}var I=!1,Z=-1,G=5,oe=-1;function ve(){return A?!0:!(n.unstable_now()-oeD&&ve());){var W=_.callback;if(typeof W=="function"){_.callback=null,w=_.priorityLevel;var C=W(_.expirationTime<=D);if(D=n.unstable_now(),typeof C=="function"){_.callback=C,j(D),Q=!0;break t}_===i(p)&&s(p),j(D)}else s(p);_=i(p)}if(_!==null)Q=!0;else{var Y=i(m);Y!==null&&he(U,Y.startTime-D),Q=!1}}break e}finally{_=null,w=H,T=!1}Q=void 0}}finally{Q?ae():I=!1}}}var ae;if(typeof z=="function")ae=function(){z(ge)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,le=re.port2;re.port1.onmessage=ge,ae=function(){le.postMessage(null)}}else ae=function(){L(ge,0)};function he(D,Q){Z=L(function(){D(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(D){D.callback=null},n.unstable_forceFrameRate=function(D){0>D||125W?(D.sortIndex=H,a(m,D),i(p)===null&&D===i(m)&&(S?(R(Z),Z=-1):S=!0,he(U,H-W))):(D.sortIndex=C,a(p,D),M||T||(M=!0,I||(I=!0,ae()))),D},n.unstable_shouldYield=ve,n.unstable_wrapCallback=function(D){var Q=w;return function(){var H=w;w=Q;try{return D.apply(this,arguments)}finally{w=H}}}})(wd)),wd}var fy;function $1(){return fy||(fy=1,Sd.exports=X1()),Sd.exports}var Ed={exports:{}},Vt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var dy;function J1(){if(dy)return Vt;dy=1;var n=xh();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Ed.exports=J1(),Ed.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var my;function W1(){if(my)return sl;my=1;var n=$1(),a=xh(),i=zb();function s(e){var t="https://react.dev/errors/"+e;if(1C||(e.current=W[C],W[C]=null,C--)}function ee(e,t){C++,W[C]=e.current,e.current=t}var ue=Y(null),Oe=Y(null),_e=Y(null),te=Y(null);function Te(e,t){switch(ee(_e,t),ee(Oe,e),ee(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cg(t),e=Tg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ie(ue),ee(ue,e)}function Ke(){ie(ue),ie(Oe),ie(_e)}function He(e){e.memoizedState!==null&&ee(te,e);var t=ue.current,r=Tg(t,e.type);t!==r&&(ee(Oe,e),ee(ue,r))}function Ze(e){Oe.current===e&&(ie(ue),ie(Oe)),te.current===e&&(ie(te),el._currentValue=H)}var $e=Object.prototype.hasOwnProperty,At=n.unstable_scheduleCallback,Yt=n.unstable_cancelCallback,Da=n.unstable_shouldYield,br=n.unstable_requestPaint,zt=n.unstable_now,lm=n.unstable_getCurrentPriorityLevel,us=n.unstable_ImmediatePriority,O=n.unstable_UserBlockingPriority,B=n.unstable_NormalPriority,X=n.unstable_LowPriority,me=n.unstable_IdlePriority,ce=n.log,se=n.unstable_setDisableYieldValue,we=null,ke=null;function Ie(e){if(typeof ce=="function"&&se(e),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(we,e)}catch{}}var ot=Math.clz32?Math.clz32:sc,ei=Math.log,Vn=Math.LN2;function sc(e){return e>>>=0,e===0?32:31-(ei(e)/Vn|0)|0}var ja=256,ka=4194304;function aa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xr(e,t,r){var l=e.pendingLanes;if(l===0)return 0;var u=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?u=aa(l):(v&=x,v!==0?u=aa(v):r||(r=x&~e,r!==0&&(u=aa(r))))):(x=l&~f,x!==0?u=aa(x):v!==0?u=aa(v):r||(r=l&~e,r!==0&&(u=aa(r)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,r=t&-t,f>=r||f===32&&(r&4194048)!==0)?t:u}function _r(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Fl(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function om(){var e=ja;return ja<<=1,(ja&4194048)===0&&(ja=256),e}function um(){var e=ka;return ka<<=1,(ka&62914560)===0&&(ka=4194304),e}function lc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function cs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function eS(e,t,r,l,u,f){var v=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var x=e.entanglements,E=e.expirationTimes,P=e.hiddenUpdates;for(r=v&~r;0)":-1u||E[l]!==P[u]){var K=` +`+E[l].replace(" at new "," at ");return e.displayName&&K.includes("")&&(K=K.replace("",e.displayName)),K}while(1<=l&&0<=u);break}}}finally{hc=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?si(r):""}function sS(e){switch(e.tag){case 26:case 27:case 5:return si(e.type);case 16:return si("Lazy");case 13:return si("Suspense");case 19:return si("SuspenseList");case 0:case 15:return mc(e.type,!1);case 11:return mc(e.type.render,!1);case 1:return mc(e.type,!0);case 31:return si("Activity");default:return""}}function bm(e){try{var t="";do t+=sS(e),e=e.return;while(e);return t}catch(r){return` +Error generating stack: `+r.message+` +`+r.stack}}function hn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lS(e){var t=xm(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(v){l=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yl(e){e._valueTracker||(e._valueTracker=lS(e))}function _m(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=xm(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function Ql(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var oS=/[\n"\\]/g;function mn(e){return e.replace(oS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function pc(e,t,r,l,u,f,v,x){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+hn(t)):e.value!==""+hn(t)&&(e.value=""+hn(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?vc(e,v,hn(t)):r!=null?vc(e,v,hn(r)):l!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+hn(x):e.removeAttribute("name")}function Sm(e,t,r,l,u,f,v,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;r=r!=null?""+hn(r):"",t=t!=null?""+hn(t):r,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v)}function vc(e,t,r){t==="number"&&Ql(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function li(e,t,r,l){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_c=!1;if(ia)try{var ms={};Object.defineProperty(ms,"passive",{get:function(){_c=!0}}),window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{_c=!1}var Ua=null,Sc=null,Xl=null;function Om(){if(Xl)return Xl;var e,t=Sc,r=t.length,l,u="value"in Ua?Ua.value:Ua.textContent,f=u.length;for(e=0;e=gs),zm=" ",Um=!1;function Lm(e,t){switch(e){case"keyup":return US.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function VS(e,t){switch(e){case"compositionend":return Vm(t);case"keypress":return t.which!==32?null:(Um=!0,zm);case"textInput":return e=t.data,e===zm&&Um?null:e;default:return null}}function PS(e,t){if(fi)return e==="compositionend"||!Ac&&Lm(e,t)?(e=Om(),Xl=Sc=Ua=null,fi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Im(r)}}function Qm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Km(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ql(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ql(e.document)}return t}function Mc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var YS=ia&&"documentMode"in document&&11>=document.documentMode,di=null,Nc=null,_s=null,Dc=!1;function Xm(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Dc||di==null||di!==Ql(l)||(l=di,"selectionStart"in l&&Mc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),_s&&xs(_s,l)||(_s=l,l=Ho(Nc,"onSelect"),0>=v,u-=v,la=1<<32-ot(t)+u|r<f?f:8;var v=D.T,x={};D.T=x,yf(e,!1,t,r);try{var E=u(),P=D.S;if(P!==null&&P(x,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=nw(E,l);Us(e,t,K,sn(e))}else Us(e,t,l,sn(e))}catch(J){Us(e,t,{then:function(){},status:"rejected",reason:J},sn())}finally{Q.p=f,D.T=v}}function lw(){}function vf(e,t,r,l){if(e.tag!==5)throw Error(s(476));var u=$p(e).queue;Xp(e,u,t,H,r===null?lw:function(){return Jp(e),r(l)})}function $p(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:H},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jp(e){var t=$p(e).next.queue;Us(e,t,{},sn())}function gf(){return Lt(el)}function Wp(){return xt().memoizedState}function ev(){return xt().memoizedState}function ow(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=sn();e=Pa(r);var l=Ba(t,e,r);l!==null&&(ln(l,t,r),Ms(l,t,r)),t={cache:Ic()},e.payload=t;return}t=t.return}}function uw(e,t,r){var l=sn();r={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},_o(e)?nv(t,r):(r=Uc(e,t,r,l),r!==null&&(ln(r,e,l),av(r,t,l)))}function tv(e,t,r){var l=sn();Us(e,t,r,l)}function Us(e,t,r,l){var u={lane:l,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(_o(e))nv(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,x=f(v,r);if(u.hasEagerState=!0,u.eagerState=x,en(x,v))return ao(e,t,u,0),ut===null&&no(),!1}catch{}finally{}if(r=Uc(e,t,u,l),r!==null)return ln(r,e,l),av(r,t,l),!0}return!1}function yf(e,t,r,l){if(l={lane:2,revertLane:Xf(),action:l,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(t)throw Error(s(479))}else t=Uc(e,r,l,2),t!==null&&ln(t,e,2)}function _o(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function nv(e,t){Si=po=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function av(e,t,r){if((r&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,fm(e,r)}}var So={readContext:Lt,use:go,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},rv={readContext:Lt,use:go,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:Hp,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,xo(4194308,4,Zp.bind(null,t,e),r)},useLayoutEffect:function(e,t){return xo(4194308,4,e,t)},useInsertionEffect:function(e,t){xo(4,2,e,t)},useMemo:function(e,t){var r=Xt();t=t===void 0?null:t;var l=e();if(kr){Ie(!0);try{e()}finally{Ie(!1)}}return r.memoizedState=[l,t],l},useReducer:function(e,t,r){var l=Xt();if(r!==void 0){var u=r(t);if(kr){Ie(!0);try{r(t)}finally{Ie(!1)}}}else u=t;return l.memoizedState=l.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},l.queue=e,e=e.dispatch=uw.bind(null,Pe,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=df(e);var t=e.queue,r=tv.bind(null,Pe,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:mf,useDeferredValue:function(e,t){var r=Xt();return pf(r,e,t)},useTransition:function(){var e=df(!1);return e=Xp.bind(null,Pe,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var l=Pe,u=Xt();if(We){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),ut===null)throw Error(s(349));(Ye&124)!==0||Cp(l,t,r)}u.memoizedState=r;var f={value:r,getSnapshot:t};return u.queue=f,Hp(Ap.bind(null,l,f,e),[e]),l.flags|=2048,Ei(9,bo(),Tp.bind(null,l,f,r,t),null),r},useId:function(){var e=Xt(),t=ut.identifierPrefix;if(We){var r=oa,l=la;r=(l&~(1<<32-ot(l)-1)).toString(32)+r,t="«"+t+"R"+r,r=vo++,0Me?(Nt=Ce,Ce=null):Nt=Ce.sibling;var Je=q(k,Ce,V[Me],$);if(Je===null){Ce===null&&(Ce=Nt);break}e&&Ce&&Je.alternate===null&&t(k,Ce),N=f(Je,N,Me),qe===null?ye=Je:qe.sibling=Je,qe=Je,Ce=Nt}if(Me===V.length)return r(k,Ce),We&&Rr(k,Me),ye;if(Ce===null){for(;MeMe?(Nt=Ce,Ce=null):Nt=Ce.sibling;var ar=q(k,Ce,Je.value,$);if(ar===null){Ce===null&&(Ce=Nt);break}e&&Ce&&ar.alternate===null&&t(k,Ce),N=f(ar,N,Me),qe===null?ye=ar:qe.sibling=ar,qe=ar,Ce=Nt}if(Je.done)return r(k,Ce),We&&Rr(k,Me),ye;if(Ce===null){for(;!Je.done;Me++,Je=V.next())Je=J(k,Je.value,$),Je!==null&&(N=f(Je,N,Me),qe===null?ye=Je:qe.sibling=Je,qe=Je);return We&&Rr(k,Me),ye}for(Ce=l(Ce);!Je.done;Me++,Je=V.next())Je=F(Ce,k,Me,Je.value,$),Je!==null&&(e&&Je.alternate!==null&&Ce.delete(Je.key===null?Me:Je.key),N=f(Je,N,Me),qe===null?ye=Je:qe.sibling=Je,qe=Je);return e&&Ce.forEach(function(f1){return t(k,f1)}),We&&Rr(k,Me),ye}function st(k,N,V,$){if(typeof V=="object"&&V!==null&&V.type===M&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var ye=V.key;N!==null;){if(N.key===ye){if(ye=V.type,ye===M){if(N.tag===7){r(k,N.sibling),$=u(N,V.props.children),$.return=k,k=$;break e}}else if(N.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===G&&sv(ye)===N.type){r(k,N.sibling),$=u(N,V.props),Vs($,V),$.return=k,k=$;break e}r(k,N);break}else t(k,N);N=N.sibling}V.type===M?($=Tr(V.props.children,k.mode,$,V.key),$.return=k,k=$):($=io(V.type,V.key,V.props,null,k.mode,$),Vs($,V),$.return=k,k=$)}return v(k);case T:e:{for(ye=V.key;N!==null;){if(N.key===ye)if(N.tag===4&&N.stateNode.containerInfo===V.containerInfo&&N.stateNode.implementation===V.implementation){r(k,N.sibling),$=u(N,V.children||[]),$.return=k,k=$;break e}else{r(k,N);break}else t(k,N);N=N.sibling}$=Pc(V,k.mode,$),$.return=k,k=$}return v(k);case G:return ye=V._init,V=ye(V._payload),st(k,N,V,$)}if(he(V))return je(k,N,V,$);if(ae(V)){if(ye=ae(V),typeof ye!="function")throw Error(s(150));return V=ye.call(V),Re(k,N,V,$)}if(typeof V.then=="function")return st(k,N,wo(V),$);if(V.$$typeof===z)return st(k,N,uo(k,V),$);Eo(k,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,N!==null&&N.tag===6?(r(k,N.sibling),$=u(N,V),$.return=k,k=$):(r(k,N),$=Vc(V,k.mode,$),$.return=k,k=$),v(k)):r(k,N)}return function(k,N,V,$){try{Ls=0;var ye=st(k,N,V,$);return Ci=null,ye}catch(Ce){if(Ce===Rs||Ce===fo)throw Ce;var qe=tn(29,Ce,null,k.mode);return qe.lanes=$,qe.return=k,qe}finally{}}}var Ti=lv(!0),ov=lv(!1),bn=Y(null),Bn=null;function qa(e){var t=e.alternate;ee(wt,wt.current&1),ee(bn,e),Bn===null&&(t===null||_i.current!==null||t.memoizedState!==null)&&(Bn=e)}function uv(e){if(e.tag===22){if(ee(wt,wt.current),ee(bn,e),Bn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Bn=e)}}else Ga()}function Ga(){ee(wt,wt.current),ee(bn,bn.current)}function da(e){ie(bn),Bn===e&&(Bn=null),ie(wt)}var wt=Y(0);function Co(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||od(r)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function bf(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:g({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xf={enqueueSetState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Pa(l);u.payload=t,r!=null&&(u.callback=r),t=Ba(e,u,l),t!==null&&(ln(t,e,l),Ms(t,e,l))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=sn(),u=Pa(l);u.tag=1,u.payload=t,r!=null&&(u.callback=r),t=Ba(e,u,l),t!==null&&(ln(t,e,l),Ms(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=sn(),l=Pa(r);l.tag=2,t!=null&&(l.callback=t),t=Ba(e,l,r),t!==null&&(ln(t,e,r),Ms(t,e,r))}};function cv(e,t,r,l,u,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,v):t.prototype&&t.prototype.isPureReactComponent?!xs(r,l)||!xs(u,f):!0}function fv(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&xf.enqueueReplaceState(t,t.state,null)}function zr(e,t){var r=t;if("ref"in t){r={};for(var l in t)l!=="ref"&&(r[l]=t[l])}if(e=e.defaultProps){r===t&&(r=g({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}var To=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function dv(e){To(e)}function hv(e){console.error(e)}function mv(e){To(e)}function Ao(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function pv(e,t,r){try{var l=e.onCaughtError;l(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function _f(e,t,r){return r=Pa(r),r.tag=3,r.payload={element:null},r.callback=function(){Ao(e,t)},r}function vv(e){return e=Pa(e),e.tag=3,e}function gv(e,t,r,l){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=l.value;e.payload=function(){return u(f)},e.callback=function(){pv(t,r,l)}}var v=r.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){pv(t,r,l),typeof u!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function fw(e,t,r,l,u){if(r.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=r.alternate,t!==null&&Cs(t,r,u,!0),r=bn.current,r!==null){switch(r.tag){case 13:return Bn===null?Zf():r.alternate===null&&mt===0&&(mt=3),r.flags&=-257,r.flags|=65536,r.lanes=u,l===Kc?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([l]):t.add(l),Yf(e,l,u)),!1;case 22:return r.flags|=65536,l===Kc?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([l]):r.add(l)),Yf(e,l,u)),!1}throw Error(s(435,r.tag))}return Yf(e,l,u),Zf(),!1}if(We)return t=bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,l!==qc&&(e=Error(s(422),{cause:l}),Es(pn(e,r)))):(l!==qc&&(t=Error(s(423),{cause:l}),Es(pn(t,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,l=pn(l,r),u=_f(e.stateNode,l,u),Jc(e,u),mt!==4&&(mt=2)),!1;var f=Error(s(520),{cause:l});if(f=pn(f,r),Zs===null?Zs=[f]:Zs.push(f),mt!==4&&(mt=2),t===null)return!0;l=pn(l,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=_f(r.stateNode,l,e),Jc(r,e),!1;case 1:if(t=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ka===null||!Ka.has(f))))return r.flags|=65536,u&=-u,r.lanes|=u,u=vv(u),gv(u,e,r,l),Jc(r,u),!1}r=r.return}while(r!==null);return!1}var yv=Error(s(461)),Ot=!1;function Dt(e,t,r,l){t.child=e===null?ov(t,null,r,l):Ti(t,e.child,r,l)}function bv(e,t,r,l,u){r=r.render;var f=t.ref;if("ref"in l){var v={};for(var x in l)x!=="ref"&&(v[x]=l[x])}else v=l;return Dr(t),l=af(e,t,r,v,f,u),x=rf(),e!==null&&!Ot?(sf(e,t,u),ha(e,t,u)):(We&&x&&Bc(t),t.flags|=1,Dt(e,t,l,u),t.child)}function xv(e,t,r,l,u){if(e===null){var f=r.type;return typeof f=="function"&&!Lc(f)&&f.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=f,_v(e,t,f,l,u)):(e=io(r.type,null,l,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Of(e,u)){var v=f.memoizedProps;if(r=r.compare,r=r!==null?r:xs,r(v,l)&&e.ref===t.ref)return ha(e,t,u)}return t.flags|=1,e=sa(f,l),e.ref=t.ref,e.return=t,t.child=e}function _v(e,t,r,l,u){if(e!==null){var f=e.memoizedProps;if(xs(f,l)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=l=f,Of(e,u))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,ha(e,t,u)}return Sf(e,t,r,l,u)}function Sv(e,t,r){var l=t.pendingProps,u=l.children,f=e!==null?e.memoizedState:null;if(l.mode==="hidden"){if((t.flags&128)!==0){if(l=f!==null?f.baseLanes|r:r,e!==null){for(u=t.child=e.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;t.childLanes=f&~l}else t.childLanes=0,t.child=null;return wv(e,t,l,r)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&co(t,f!==null?f.cachePool:null),f!==null?_p(t,f):ef(),uv(t);else return t.lanes=t.childLanes=536870912,wv(e,t,f!==null?f.baseLanes|r:r,r)}else f!==null?(co(t,f.cachePool),_p(t,f),Ga(),t.memoizedState=null):(e!==null&&co(t,null),ef(),Ga());return Dt(e,t,u,r),t.child}function wv(e,t,r,l){var u=Qc();return u=u===null?null:{parent:St._currentValue,pool:u},t.memoizedState={baseLanes:r,cachePool:u},e!==null&&co(t,null),ef(),uv(t),e!==null&&Cs(e,t,l,!0),null}function Ro(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function Sf(e,t,r,l,u){return Dr(t),r=af(e,t,r,l,void 0,u),l=rf(),e!==null&&!Ot?(sf(e,t,u),ha(e,t,u)):(We&&l&&Bc(t),t.flags|=1,Dt(e,t,r,u),t.child)}function Ev(e,t,r,l,u,f){return Dr(t),t.updateQueue=null,r=wp(t,l,r,u),Sp(e),l=rf(),e!==null&&!Ot?(sf(e,t,f),ha(e,t,f)):(We&&l&&Bc(t),t.flags|=1,Dt(e,t,r,f),t.child)}function Cv(e,t,r,l,u){if(Dr(t),t.stateNode===null){var f=vi,v=r.contextType;typeof v=="object"&&v!==null&&(f=Lt(v)),f=new r(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=xf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},Xc(t),v=r.contextType,f.context=typeof v=="object"&&v!==null?Lt(v):vi,f.state=t.memoizedState,v=r.getDerivedStateFromProps,typeof v=="function"&&(bf(t,r,v,l),f.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&xf.enqueueReplaceState(f,f.state,null),Ds(t,l,f,u),Ns(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var x=t.memoizedProps,E=zr(r,x);f.props=E;var P=f.context,K=r.contextType;v=vi,typeof K=="object"&&K!==null&&(v=Lt(K));var J=r.getDerivedStateFromProps;K=typeof J=="function"||typeof f.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,K||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x||P!==v)&&fv(t,f,l,v),Va=!1;var q=t.memoizedState;f.state=q,Ds(t,l,f,u),Ns(),P=t.memoizedState,x||q!==P||Va?(typeof J=="function"&&(bf(t,r,J,l),P=t.memoizedState),(E=Va||cv(t,r,E,l,q,P,v))?(K||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=P),f.props=l,f.state=P,f.context=v,l=E):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,$c(e,t),v=t.memoizedProps,K=zr(r,v),f.props=K,J=t.pendingProps,q=f.context,P=r.contextType,E=vi,typeof P=="object"&&P!==null&&(E=Lt(P)),x=r.getDerivedStateFromProps,(P=typeof x=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==J||q!==E)&&fv(t,f,l,E),Va=!1,q=t.memoizedState,f.state=q,Ds(t,l,f,u),Ns();var F=t.memoizedState;v!==J||q!==F||Va||e!==null&&e.dependencies!==null&&oo(e.dependencies)?(typeof x=="function"&&(bf(t,r,x,l),F=t.memoizedState),(K=Va||cv(t,r,K,l,q,F,E)||e!==null&&e.dependencies!==null&&oo(e.dependencies))?(P||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,F,E),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,F,E)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=F),f.props=l,f.state=F,f.context=E,l=K):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,Ro(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,r=l&&typeof r.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=Ti(t,e.child,null,u),t.child=Ti(t,null,r,u)):Dt(e,t,r,u),t.memoizedState=f.state,e=t.child):e=ha(e,t,u),e}function Tv(e,t,r,l){return ws(),t.flags|=256,Dt(e,t,r,l),t.child}var wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ef(e){return{baseLanes:e,cachePool:hp()}}function Cf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=xn),e}function Av(e,t,r){var l=t.pendingProps,u=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),v&&(u=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(u?qa(t):Ga(),We){var x=ht,E;if(E=x){e:{for(E=x,x=Pn;E.nodeType!==8;){if(!x){x=null;break e}if(E=An(E.nextSibling),E===null){x=null;break e}}x=E}x!==null?(t.memoizedState={dehydrated:x,treeContext:Ar!==null?{id:la,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},E=tn(18,null,null,0),E.stateNode=x,E.return=t,t.child=E,Ht=t,ht=null,E=!0):E=!1}E||Mr(t)}if(x=t.memoizedState,x!==null&&(x=x.dehydrated,x!==null))return od(x)?t.lanes=32:t.lanes=536870912,null;da(t)}return x=l.children,l=l.fallback,u?(Ga(),u=t.mode,x=Oo({mode:"hidden",children:x},u),l=Tr(l,u,r,null),x.return=t,l.return=t,x.sibling=l,t.child=x,u=t.child,u.memoizedState=Ef(r),u.childLanes=Cf(e,v,r),t.memoizedState=wf,l):(qa(t),Tf(t,x))}if(E=e.memoizedState,E!==null&&(x=E.dehydrated,x!==null)){if(f)t.flags&256?(qa(t),t.flags&=-257,t=Af(e,t,r)):t.memoizedState!==null?(Ga(),t.child=e.child,t.flags|=128,t=null):(Ga(),u=l.fallback,x=t.mode,l=Oo({mode:"visible",children:l.children},x),u=Tr(u,x,r,null),u.flags|=2,l.return=t,u.return=t,l.sibling=u,t.child=l,Ti(t,e.child,null,r),l=t.child,l.memoizedState=Ef(r),l.childLanes=Cf(e,v,r),t.memoizedState=wf,t=u);else if(qa(t),od(x)){if(v=x.nextSibling&&x.nextSibling.dataset,v)var P=v.dgst;v=P,l=Error(s(419)),l.stack="",l.digest=v,Es({value:l,source:null,stack:null}),t=Af(e,t,r)}else if(Ot||Cs(e,t,r,!1),v=(r&e.childLanes)!==0,Ot||v){if(v=ut,v!==null&&(l=r&-r,l=(l&42)!==0?1:oc(l),l=(l&(v.suspendedLanes|r))!==0?0:l,l!==0&&l!==E.retryLane))throw E.retryLane=l,pi(e,l),ln(v,e,l),yv;x.data==="$?"||Zf(),t=Af(e,t,r)}else x.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,ht=An(x.nextSibling),Ht=t,We=!0,Or=null,Pn=!1,e!==null&&(gn[yn++]=la,gn[yn++]=oa,gn[yn++]=Ar,la=e.id,oa=e.overflow,Ar=t),t=Tf(t,l.children),t.flags|=4096);return t}return u?(Ga(),u=l.fallback,x=t.mode,E=e.child,P=E.sibling,l=sa(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,P!==null?u=sa(P,u):(u=Tr(u,x,r,null),u.flags|=2),u.return=t,l.return=t,l.sibling=u,t.child=l,l=u,u=t.child,x=e.child.memoizedState,x===null?x=Ef(r):(E=x.cachePool,E!==null?(P=St._currentValue,E=E.parent!==P?{parent:P,pool:P}:E):E=hp(),x={baseLanes:x.baseLanes|r,cachePool:E}),u.memoizedState=x,u.childLanes=Cf(e,v,r),t.memoizedState=wf,l):(qa(t),r=e.child,e=r.sibling,r=sa(r,{mode:"visible",children:l.children}),r.return=t,r.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=r,t.memoizedState=null,r)}function Tf(e,t){return t=Oo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Oo(e,t){return e=tn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Af(e,t,r){return Ti(t,e.child,null,r),e=Tf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rv(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Fc(e.return,t,r)}function Rf(e,t,r,l,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=r,f.tailMode=u)}function Ov(e,t,r){var l=t.pendingProps,u=l.revealOrder,f=l.tail;if(Dt(e,t,l.children,r),l=wt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rv(e,r,t);else if(e.tag===19)Rv(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}switch(ee(wt,l),u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&Co(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),Rf(t,!1,u,r,f);break;case"backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Co(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}Rf(t,!0,r,null,f);break;case"together":Rf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ha(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Qa|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(Cs(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=sa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=sa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Of(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&oo(e)))}function dw(e,t,r){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),La(t,St,e.memoizedState.cache),ws();break;case 27:case 5:He(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:La(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(qa(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Av(e,t,r):(qa(t),e=ha(e,t,r),e!==null?e.sibling:null);qa(t);break;case 19:var u=(e.flags&128)!==0;if(l=(r&t.childLanes)!==0,l||(Cs(e,t,r,!1),l=(r&t.childLanes)!==0),u){if(l)return Ov(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ee(wt,wt.current),l)break;return null;case 22:case 23:return t.lanes=0,Sv(e,t,r);case 24:La(t,St,e.memoizedState.cache)}return ha(e,t,r)}function Mv(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Of(e,r)&&(t.flags&128)===0)return Ot=!1,dw(e,t,r);Ot=(e.flags&131072)!==0}else Ot=!1,We&&(t.flags&1048576)!==0&&sp(t,lo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,u=l._init;if(l=u(l._payload),t.type=l,typeof l=="function")Lc(l)?(e=zr(l,e),t.tag=1,t=Cv(null,t,l,e,r)):(t.tag=0,t=Sf(null,t,l,e,r));else{if(l!=null){if(u=l.$$typeof,u===j){t.tag=11,t=bv(null,t,l,e,r);break e}else if(u===Z){t.tag=14,t=xv(null,t,l,e,r);break e}}throw t=le(l)||l,Error(s(306,t,""))}}return t;case 0:return Sf(e,t,t.type,t.pendingProps,r);case 1:return l=t.type,u=zr(l,t.pendingProps),Cv(e,t,l,u,r);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var f=t.memoizedState;u=f.element,$c(e,t),Ds(t,l,null,r);var v=t.memoizedState;if(l=v.cache,La(t,St,l),l!==f.cache&&Zc(t,[St],r,!0),Ns(),l=v.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Tv(e,t,l,r);break e}else if(l!==u){u=pn(Error(s(424)),t),Es(u),t=Tv(e,t,l,r);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ht=An(e.firstChild),Ht=t,We=!0,Or=null,Pn=!0,r=ov(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ws(),l===u){t=ha(e,t,r);break e}Dt(e,t,l,r)}t=t.child}return t;case 26:return Ro(e,t),e===null?(r=kg(t.type,null,t.pendingProps,null))?t.memoizedState=r:We||(r=t.type,e=t.pendingProps,l=Go(_e.current).createElement(r),l[Ut]=t,l[Qt]=e,kt(l,r,e),Rt(l),t.stateNode=l):t.memoizedState=kg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return He(t),e===null&&We&&(l=t.stateNode=Ng(t.type,t.pendingProps,_e.current),Ht=t,Pn=!0,u=ht,Ja(t.type)?(ud=u,ht=An(l.firstChild)):ht=u),Dt(e,t,t.pendingProps.children,r),Ro(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((u=l=ht)&&(l=Bw(l,t.type,t.pendingProps,Pn),l!==null?(t.stateNode=l,Ht=t,ht=An(l.firstChild),Pn=!1,u=!0):u=!1),u||Mr(t)),He(t),u=t.type,f=t.pendingProps,v=e!==null?e.memoizedProps:null,l=f.children,id(u,f)?l=null:v!==null&&id(u,v)&&(t.flags|=32),t.memoizedState!==null&&(u=af(e,t,rw,null,null,r),el._currentValue=u),Ro(e,t),Dt(e,t,l,r),t.child;case 6:return e===null&&We&&((e=r=ht)&&(r=Hw(r,t.pendingProps,Pn),r!==null?(t.stateNode=r,Ht=t,ht=null,e=!0):e=!1),e||Mr(t)),null;case 13:return Av(e,t,r);case 4:return Te(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ti(t,null,l,r):Dt(e,t,l,r),t.child;case 11:return bv(e,t,t.type,t.pendingProps,r);case 7:return Dt(e,t,t.pendingProps,r),t.child;case 8:return Dt(e,t,t.pendingProps.children,r),t.child;case 12:return Dt(e,t,t.pendingProps.children,r),t.child;case 10:return l=t.pendingProps,La(t,t.type,l.value),Dt(e,t,l.children,r),t.child;case 9:return u=t.type._context,l=t.pendingProps.children,Dr(t),u=Lt(u),l=l(u),t.flags|=1,Dt(e,t,l,r),t.child;case 14:return xv(e,t,t.type,t.pendingProps,r);case 15:return _v(e,t,t.type,t.pendingProps,r);case 19:return Ov(e,t,r);case 31:return l=t.pendingProps,r=t.mode,l={mode:l.mode,children:l.children},e===null?(r=Oo(l,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=sa(e.child,l),r.ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return Sv(e,t,r);case 24:return Dr(t),l=Lt(St),e===null?(u=Qc(),u===null&&(u=ut,f=Ic(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=r),u=f),t.memoizedState={parent:l,cache:u},Xc(t),La(t,St,u)):((e.lanes&r)!==0&&($c(e,t),Ds(t,null,null,r),Ns()),u=e.memoizedState,f=t.memoizedState,u.parent!==l?(u={parent:l,cache:l},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),La(t,St,l)):(l=f.cache,La(t,St,l),l!==u.cache&&Zc(t,[St],r,!0))),Dt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function ma(e){e.flags|=4}function Nv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Pg(t)){if(t=bn.current,t!==null&&((Ye&4194048)===Ye?Bn!==null:(Ye&62914560)!==Ye&&(Ye&536870912)===0||t!==Bn))throw Os=Kc,mp;e.flags|=8192}}function Mo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?um():536870912,e.lanes|=t,Mi|=t)}function Ps(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags&65011712,l|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function hw(e,t,r){var l=t.pendingProps;switch(Hc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return r=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ca(St),Ke(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ss(t)?ma(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,up())),ft(t),null;case 26:return r=t.memoizedState,e===null?(ma(t),r!==null?(ft(t),Nv(t,r)):(ft(t),t.flags&=-16777217)):r?r!==e.memoizedState?(ma(t),ft(t),Nv(t,r)):(ft(t),t.flags&=-16777217):(e.memoizedProps!==l&&ma(t),ft(t),t.flags&=-16777217),null;case 27:Ze(t),r=_e.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ma(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}e=ue.current,Ss(t)?lp(t):(e=Ng(u,l,r),t.stateNode=e,ma(t))}return ft(t),null;case 5:if(Ze(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ma(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ft(t),null}if(e=ue.current,Ss(t))lp(t);else{switch(u=Go(_e.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":e=u.createElement("div"),e.innerHTML=" + + + + + + + +
+ + diff --git a/releases/auto-post-facebook-extensions_1.2/manifest.json b/releases/auto-post-facebook-extensions_1.2/manifest.json new file mode 100644 index 0000000..3c0dd83 --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/manifest.json @@ -0,0 +1,37 @@ +{ + "manifest_version": 3, + "name": "Auto post facebook extensions", + "version": "1.2", + "action": { + "default_popup": "index.html", + "default_icon": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } + }, + "background": { + "service_worker": "background/background.js", + "type": "module" + }, + "host_permissions": ["https://www.facebook.com/*"], + "content_scripts": [ + { + "matches": ["https://www.facebook.com/*"], + "js": ["content/content.js"], + "type": "module" + } + ], + "web_accessible_resources": [ + { + "resources": ["content/inject-ui.js", "assets/*"], + "matches": ["https://www.facebook.com/*"] + } + ], + "permissions": ["tabs", "activeTab", "scripting"], + "icons": { + "16": "icons/16.png", + "32": "icons/32.png", + "128": "icons/128.png" + } +} diff --git a/releases/auto-post-facebook-extensions_1.2/vite.svg b/releases/auto-post-facebook-extensions_1.2/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/releases/auto-post-facebook-extensions_1.2/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/server.js b/server/server.js index bf05c4e..ba961e6 100644 --- a/server/server.js +++ b/server/server.js @@ -177,6 +177,11 @@ app.post("/", async (req, res) => { } }); +// Route trả về privacy policy +app.get("/policy", (req, res) => { + res.sendFile(path.join(process.cwd(), "views", "policy.html")); +}); + app.listen(3000, () => { console.log("Server chạy tại http://localhost:3000"); }); diff --git a/server/views/policy.html b/server/views/policy.html new file mode 100644 index 0000000..2ea9742 --- /dev/null +++ b/server/views/policy.html @@ -0,0 +1,250 @@ + + + + + + Privacy Policy — Bid Extension + + + + +
+
+ + + + Privacy Policy + +

Bid Extension — Privacy Policy

+

+ How the Bid Extension Chrome extension handles your data. +

+ +
+ +
+

1. Information Collection

+

+ The Bid Extension does not collect or transmit any personal or + sensitive user data. +

+

+ The extension uses the storage permission + solely to save settings and preferences + locally in your browser. This data does not leave + your device. +

+
+ +
+

2. No Third‑party Sharing

+

+ We do not share any user data with third parties. We do not use + analytics, advertising, or tracking technologies. +

+
+ +
+

3. Changes to this Policy

+

+ If we update this privacy policy, we will revise this page and update + the effective date above. +

+
+ +
+

4. Contact

+

+ If you have questions about this policy, contact us at + apactech65@gmail.com. +

+
+
+ + diff --git a/src/content/content.ts b/src/content/content.ts index e102d07..d0d31b2 100644 --- a/src/content/content.ts +++ b/src/content/content.ts @@ -230,14 +230,13 @@ window.addEventListener("message", async (event) => { }); (async () => { - // Call to inject modal - await delayRD(800, 1000); - // Sử dụng - thiefService - .waitForElement('[aria-label="Collection of your Marketplace items"]') - .then(async (el) => { + if (window.location.href.includes(facebookService.sellingPath)) { + try { + const el = await thiefService.waitForElement( + '[aria-label="Collection of your Marketplace items"]' + ); console.log("Element đã xuất hiện:", el); await facebookService.waitForPageReady( @@ -246,15 +245,17 @@ window.addEventListener("message", async (event) => { ); await delayRD(800, 1000); - const products = await facebookService.getProducts(); + const products = await facebookService.getProducts(); console.log({ products }); - productApi.sync(products); - - injectApp(); - }) - .catch((err) => { + await productApi.sync(products); + } catch (err) { console.error(err); - }); + } finally { + injectApp(); + } + } else { + injectApp(); + } })();