@griddo/cx 11.1.16-rc.0 → 11.1.17-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,7 +36,7 @@ ${e}
36
36
  ${i.join(`
37
37
  `)||"---"}`)}function Ja(e){console.error(`
38
38
  `+ce.black().bgRed(" "+e+" ")+`
39
- `)}ot();var yv=z(),Ya=e=>{if(!_e.default.statSync(e).isDirectory())return;let n=_e.default.readdirSync(e);if(n.length>0){let a=n.length,r=n.filter(o=>Ke.default.extname(o).toLowerCase()===".xml").length;if(a===r){for(let o of n){let s=Ke.default.join(e,o);_e.default.rmSync(s)}n=_e.default.readdirSync(e)}for(let o of n){let s=Ke.default.join(e,o);Ya(s)}n=_e.default.readdirSync(e)}if(n.length===0){_e.default.rmdirSync(e);return}};function Gp(e,t){for(let n of e)try{me.default.existsSync(n)||(me.default.mkdirSync(n,{recursive:!0,...t}),N(`create directory: ${n}`))}catch(i){Y(Tt,i)}}function zp(e,t){try{me.default.existsSync(e)&&(me.default.renameSync(e,t),N(`rename ${e} to ${t}`))}catch(n){Y(Tt,n)}}function Ka(e,t,n,i={withBackup:!1}){let{withBackup:a}=i;for(let r of n){let o=Ke.default.join(e,r),s=Ke.default.join(t,r);if(!_e.default.existsSync(o)){console.log(`(Maybe first render) Source directory does not exist: ${o}`);continue}a&&(Wp(s),N(`create backup: ${s}`));try{_e.default.existsSync(s)&&(me.default.rmSync(s,{recursive:!0,force:!0}),N(`clean destination: ${s}`)),me.default.cpSync(o,s,{recursive:!0,preserveTimestamps:!0}),N(`copy: ${o} to ${s}`),a&&(Hp(s),N(`delete backup: ${s}`))}catch(p){a&&(Xp(s),console.log("Backup has been restored.")),Y(Tt,p)}}}function Qt(e,t,n,i){let{override:a,withBackup:r}=i||{};for(let o of n){let s=Ke.default.join(e,o),p=Ke.default.join(t,o);if(_e.default.existsSync(s)){r&&Wp(p);try{a&&_e.default.existsSync(p)&&me.default.rmSync(p,{recursive:!0,force:!0}),me.default.renameSync(s,p),N(`moved: ${s} to ${p}`),r&&Hp(p)}catch(l){r&&(Xp(p),console.log("Backup has been restored.")),Y(Tt,l)}}}}function Qa(e){for(let t of e)if(t)try{_e.default.existsSync(t)&&(me.default.rmSync(t,{recursive:!0,force:!0}),N(`removed directory: ${t}`))}catch(n){Y(Tt,n)}}function Xp(e,t="-BACKUP"){let n=e+t;try{me.default.renameSync(n,e),console.log(`Backup ${n} has been restored`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Hp(e,t="-BACKUP"){let n=e+t;if(_e.default.existsSync(n))try{me.default.rmSync(n,{recursive:!0,force:!0}),console.log(`Backup ${n} has been deleted`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Wp(e,t="-BACKUP"){let n=e+t;if(_e.default.existsSync(e)){if(_e.default.existsSync(n)){console.log(`Destination ${n} already exists`);return}try{me.default.renameSync(e,n),console.log(`Backup of ${e} has been created in ${n}`)}catch(i){console.log(`Error while coping ${e} to ${n} backup`),Y(Tt,i)}}}async function Vp(){let{__cx:e}=yv.paths(),t=Ke.default.join(e,"store");try{let n=Za(t);for(let i of n)Ke.default.basename(i).startsWith("-")&&me.default.unlinkSync(i)}catch{console.info("`store` folder does not exist. Skipping multipage or static list template cleaning.")}}function Jp(e,t){let n="";me.default.existsSync(e)&&(n=me.default.readFileSync(e,"utf8")),me.default.writeFileSync(e,t+n,"utf8")}var wt=R(require("node:path")),bn=R(Ot()),Ho=R(yl());var Ze=R(require("node:fs")),ve=R(require("node:path")),Fr=R(Ot());Ye();ot();var tn=z();async function kr(){let{__cx:e}=tn.paths(),{sitesToPublish:t,createdPages:n,buildProcessData:i}=Fr.default.readJSONSync(ve.default.join(e,"render-metadata.json"));return{buildProcessData:i,createdPages:n,sitesToPublish:t}}function wl(){let{__cx:e}=tn.paths(),t=ve.default.join(e,"store");Ze.default.existsSync(t)||(Ze.default.mkdirSync(t),Ze.default.mkdirSync(ve.default.join(t,"metadata"))),console.info("Store initialized")}function jr(e){let{__cx:t}=tn.paths();Ze.default.writeFileSync(ve.default.join(t,"render-metadata.json"),JSON.stringify(e))}function db(e){return Ze.default.readdirSync(e).filter(n=>{let i=`${e}/${n}`;if(Ze.default.statSync(i)?.isDirectory()||ve.default.extname(n)!==".json")return!1;let r=ve.default.basename(n,ve.default.extname(n));return!Number.isNaN(Number.parseInt(r))}).map(n=>{let i=ve.default.basename(n,ve.default.extname(n));return Number.parseInt(i)})}function _l(e,t){let{__cx:n}=tn.paths();try{for(let i of t){Lr(i,["editorID","parentEditorID"]);let a=`${i.context.page.id}.json`,r=ve.default.join(n,"store",e,a);Fr.default.writeJSONSync(r,i)}}catch(i){Y($p,i)}}function Sl(e,t){let{__cx:n}=tn.paths();if(t.length!==0)for(let i of t){let a=ve.default.join(n,"store",e,`${i}.json`);try{Ze.default.unlinkSync(a)}catch(r){throw console.log(r),new Error(`Error removing file ${i}`)}}}async function El(e){let{__cx:t}=tn.paths(),n=ve.default.join(t,"store"),{changedPages:i,validPagesIds:a,siteDirName:r}=e,o=ve.default.join(n,r),s=db(o),p=a.filter(f=>!s.includes(f)),l=p.concat(i),c=s.filter(f=>!a.includes(f)),u=Array.from(new Set(l)).filter(f=>!c.includes(f));return{pagesInStore:s,pagesMissingInStore:p,pagesToDeleteFromStore:[...c],pagesToWriteToStore:u}}function Dl(e,t){let{__cx:n}=z().paths(t),i=Ze.default.readdirSync(ve.default.join(n,"store")),a=e.map(({id:o})=>`${o}`),r=i.filter(o=>!a.includes(o));for(let o of r)Ze.default.rmSync(ve.default.join(n,"store",o),{recursive:!0,force:!0}),N(`Removed orphan site id: ${o}`)}Ye();ot();var Nr=class{headers;async login(){try{let t=await fetch(Z.LOGIN,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close"},body:JSON.stringify({username:O.GRIDDO_BOT_USER,password:O.GRIDDO_BOT_PASSWORD})});if(!t.ok)throw new Error("Error while login in the API");let{token:n}=await t.json();return this.headers={Authorization:`bearer ${n}`,"Cache-Control":"no-store"},this.headers}catch(t){Y(qp,t)}}},st=new Nr;function Mn(e,t){return function(){return e.apply(t,arguments)}}var{toString:mb}=Object.prototype,{getPrototypeOf:Br}=Object,Xi=(e=>t=>{let n=mb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Be=e=>(e=e.toLowerCase(),t=>Xi(t)===e),Hi=e=>t=>typeof t===e,{isArray:nn}=Array,$n=Hi("undefined");function fb(e){return e!==null&&!$n(e)&&e.constructor!==null&&!$n(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Cl=Be("ArrayBuffer");function hb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Cl(e.buffer),t}var xb=Hi("string"),Ie=Hi("function"),Tl=Hi("number"),Wi=e=>e!==null&&typeof e=="object",vb=e=>e===!0||e===!1,zi=e=>{if(Xi(e)!=="object")return!1;let t=Br(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gb=Be("Date"),bb=Be("File"),yb=Be("Blob"),wb=Be("FileList"),_b=e=>Wi(e)&&Ie(e.pipe),Sb=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Xi(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Eb=Be("URLSearchParams"),[Db,Rb,Ob,Cb]=["ReadableStream","Request","Response","Headers"].map(Be),Tb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Gn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,a;if(typeof e!="object"&&(e=[e]),nn(e))for(i=0,a=e.length;i<a;i++)t.call(null,e[i],i,e);else{let r=n?Object.getOwnPropertyNames(e):Object.keys(e),o=r.length,s;for(i=0;i<o;i++)s=r[i],t.call(null,e[s],s,e)}}function Il(e,t){t=t.toLowerCase();let n=Object.keys(e),i=n.length,a;for(;i-- >0;)if(a=n[i],t===a.toLowerCase())return a;return null}var Ft=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pl=e=>!$n(e)&&e!==Ft;function Ur(){let{caseless:e}=Pl(this)&&this||{},t={},n=(i,a)=>{let r=e&&Il(t,a)||a;zi(t[r])&&zi(i)?t[r]=Ur(t[r],i):zi(i)?t[r]=Ur({},i):nn(i)?t[r]=i.slice():t[r]=i};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Gn(arguments[i],n);return t}var Ib=(e,t,n,{allOwnKeys:i}={})=>(Gn(t,(a,r)=>{n&&Ie(a)?e[r]=Mn(a,n):e[r]=a},{allOwnKeys:i}),e),Pb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ab=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fb=(e,t,n,i)=>{let a,r,o,s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),r=a.length;r-- >0;)o=a[r],(!i||i(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Br(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kb=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let i=e.indexOf(t,n);return i!==-1&&i===n},jb=e=>{if(!e)return null;if(nn(e))return e;let t=e.length;if(!Tl(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Lb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Br(Uint8Array)),Nb=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),a;for(;(a=i.next())&&!a.done;){let r=a.value;t.call(e,r[0],r[1])}},qb=(e,t)=>{let n,i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Ub=Be("HTMLFormElement"),Bb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,a){return i.toUpperCase()+a}),Rl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mb=Be("RegExp"),Al=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),i={};Gn(n,(a,r)=>{let o;(o=t(a,r,e))!==!1&&(i[r]=o||a)}),Object.defineProperties(e,i)},$b=e=>{Al(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=e[n];if(Ie(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gb=(e,t)=>{let n={},i=a=>{a.forEach(r=>{n[r]=!0})};return nn(e)?i(e):i(String(e).split(t)),n},zb=()=>{},Xb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,qr="abcdefghijklmnopqrstuvwxyz",Ol="0123456789",Fl={DIGIT:Ol,ALPHA:qr,ALPHA_DIGIT:qr+qr.toUpperCase()+Ol},Hb=(e=16,t=Fl.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function Wb(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Vb=e=>{let t=new Array(10),n=(i,a)=>{if(Wi(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[a]=i;let r=nn(i)?[]:{};return Gn(i,(o,s)=>{let p=n(o,a+1);!$n(p)&&(r[s]=p)}),t[a]=void 0,r}}return i};return n(e,0)},Jb=Be("AsyncFunction"),Yb=e=>e&&(Wi(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),kl=((e,t)=>e?setImmediate:t?((n,i)=>(Ft.addEventListener("message",({source:a,data:r})=>{a===Ft&&r===n&&i.length&&i.shift()()},!1),a=>{i.push(a),Ft.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(Ft.postMessage)),Kb=typeof queueMicrotask<"u"?queueMicrotask.bind(Ft):typeof process<"u"&&process.nextTick||kl,d={isArray:nn,isArrayBuffer:Cl,isBuffer:fb,isFormData:Sb,isArrayBufferView:hb,isString:xb,isNumber:Tl,isBoolean:vb,isObject:Wi,isPlainObject:zi,isReadableStream:Db,isRequest:Rb,isResponse:Ob,isHeaders:Cb,isUndefined:$n,isDate:gb,isFile:bb,isBlob:yb,isRegExp:Mb,isFunction:Ie,isStream:_b,isURLSearchParams:Eb,isTypedArray:Lb,isFileList:wb,forEach:Gn,merge:Ur,extend:Ib,trim:Tb,stripBOM:Pb,inherits:Ab,toFlatObject:Fb,kindOf:Xi,kindOfTest:Be,endsWith:kb,toArray:jb,forEachEntry:Nb,matchAll:qb,isHTMLForm:Ub,hasOwnProperty:Rl,hasOwnProp:Rl,reduceDescriptors:Al,freezeMethods:$b,toObjectSet:Gb,toCamelCase:Bb,noop:zb,toFiniteNumber:Xb,findKey:Il,global:Ft,isContextDefined:Pl,ALPHABET:Fl,generateString:Hb,isSpecCompliantForm:Wb,toJSONObject:Vb,isAsyncFn:Jb,isThenable:Yb,setImmediate:kl,asap:Kb};function an(e,t,n,i,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),a&&(this.response=a,this.status=a.status?a.status:null)}d.inherits(an,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:d.toJSONObject(this.config),code:this.code,status:this.status}}});var jl=an.prototype,Ll={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ll[e]={value:e}});Object.defineProperties(an,Ll);Object.defineProperty(jl,"isAxiosError",{value:!0});an.from=(e,t,n,i,a,r)=>{let o=Object.create(jl);return d.toFlatObject(e,o,function(p){return p!==Error.prototype},s=>s!=="isAxiosError"),an.call(o,e.message,t,n,i,a),o.cause=e,o.name=e.name,r&&Object.assign(o,r),o};var y=an;var gu=R(vu(),1),Yi=gu.default;function Kr(e){return d.isPlainObject(e)||d.isArray(e)}function yu(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function bu(e,t,n){return e?e.concat(t).map(function(a,r){return a=yu(a),!n&&r?"["+a+"]":a}).join(n?".":""):t}function ky(e){return d.isArray(e)&&!e.some(Kr)}var jy=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function Ly(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new(Yi||FormData),n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,v){return!d.isUndefined(v[x])});let i=n.metaTokens,a=n.visitor||c,r=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(a))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(d.isDate(m))return m.toISOString();if(!p&&d.isBlob(m))throw new y("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(m)||d.isTypedArray(m)?p&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,x,v){let b=m;if(m&&!v&&typeof m=="object"){if(d.endsWith(x,"{}"))x=i?x:x.slice(0,-2),m=JSON.stringify(m);else if(d.isArray(m)&&ky(m)||(d.isFileList(m)||d.endsWith(x,"[]"))&&(b=d.toArray(m)))return x=yu(x),b.forEach(function(_,T){!(d.isUndefined(_)||_===null)&&t.append(o===!0?bu([x],T,r):o===null?x:x+"[]",l(_))}),!1}return Kr(m)?!0:(t.append(bu(v,x,r),l(m)),!1)}let u=[],f=Object.assign(jy,{defaultVisitor:c,convertValue:l,isVisitable:Kr});function h(m,x){if(!d.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(m),d.forEach(m,function(b,E){(!(d.isUndefined(b)||b===null)&&a.call(t,b,d.isString(E)?E.trim():E,x,f))===!0&&h(b,x?x.concat(E):[E])}),u.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}var gt=Ly;function wu(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function _u(e,t){this._pairs=[],e&&gt(e,this,t)}var Su=_u.prototype;Su.append=function(t,n){this._pairs.push([t,n])};Su.toString=function(t){let n=t?function(i){return t.call(this,i,wu)}:wu;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var Eu=_u;function Ny(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function kt(e,t,n){if(!t)return e;let i=n&&n.encode||Ny;d.isFunction(n)&&(n={serialize:n});let a=n&&n.serialize,r;if(a?r=a(t,n):r=d.isURLSearchParams(t)?t.toString():new Eu(t,n).toString(i),r){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}var Qr=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(i){i!==null&&t(i)})}},Zr=Qr;var rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Du=R(require("url"),1),Ru=Du.default.URLSearchParams;var Ou={isNode:!0,classes:{URLSearchParams:Ru,FormData:Yi,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var no={};ya(no,{hasBrowserEnv:()=>to,hasStandardBrowserEnv:()=>qy,hasStandardBrowserWebWorkerEnv:()=>Uy,navigator:()=>eo,origin:()=>By});var to=typeof window<"u"&&typeof document<"u",eo=typeof navigator=="object"&&navigator||void 0,qy=to&&(!eo||["ReactNative","NativeScript","NS"].indexOf(eo.product)<0),Uy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",By=to&&window.location.href||"http://localhost";var B={...no,...Ou};function io(e,t){return gt(e,new B.classes.URLSearchParams,Object.assign({visitor:function(n,i,a,r){return B.isNode&&d.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function My(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $y(e){let t={},n=Object.keys(e),i,a=n.length,r;for(i=0;i<a;i++)r=n[i],t[r]=e[r];return t}function Gy(e){function t(n,i,a,r){let o=n[r++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),p=r>=n.length;return o=!o&&d.isArray(a)?a.length:o,p?(d.hasOwnProp(a,o)?a[o]=[a[o],i]:a[o]=i,!s):((!a[o]||!d.isObject(a[o]))&&(a[o]=[]),t(n,i,a[o],r)&&d.isArray(a[o])&&(a[o]=$y(a[o])),!s)}if(d.isFormData(e)&&d.isFunction(e.entries)){let n={};return d.forEachEntry(e,(i,a)=>{t(My(i),a,n,0)}),n}return null}var Ki=Gy;function zy(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}var ao={transitional:rn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",a=i.indexOf("application/json")>-1,r=d.isObject(t);if(r&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return a?JSON.stringify(Ki(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return io(t,this.formSerializer).toString();if((s=d.isFileList(t))||i.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return gt(s?{"files[]":t}:t,p&&new p,this.formSerializer)}}return r||a?(n.setContentType("application/json",!1),zy(t)):t}],transformResponse:[function(t){let n=this.transitional||ao.transitional,i=n&&n.forcedJSONParsing,a=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(i&&!this.responseType||a)){let o=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?y.from(s,y.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{ao.headers[e]={}});var on=ao;var Xy=d.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"]),Cu=e=>{let t={},n,i,a;return e&&e.split(`
39
+ `)}ot();var yv=z(),Ya=e=>{if(!_e.default.statSync(e).isDirectory())return;let n=_e.default.readdirSync(e);if(n.length>0){let a=n.length,r=n.filter(o=>Ke.default.extname(o).toLowerCase()===".xml").length;if(a===r){for(let o of n){let s=Ke.default.join(e,o);_e.default.rmSync(s)}n=_e.default.readdirSync(e)}for(let o of n){let s=Ke.default.join(e,o);Ya(s)}n=_e.default.readdirSync(e)}if(n.length===0){_e.default.rmdirSync(e);return}};function Gp(e,t){for(let n of e)try{me.default.existsSync(n)||(me.default.mkdirSync(n,{recursive:!0,...t}),N(`create directory: ${n}`))}catch(i){Y(Tt,i)}}function zp(e,t){try{me.default.existsSync(e)&&(me.default.renameSync(e,t),N(`rename ${e} to ${t}`))}catch(n){Y(Tt,n)}}function Ka(e,t,n,i={withBackup:!1}){let{withBackup:a}=i;for(let r of n){let o=Ke.default.join(e,r),s=Ke.default.join(t,r);if(!_e.default.existsSync(o)){console.log(`(Maybe first render) Source directory does not exist: ${o}`);continue}a&&(Wp(s),N(`create backup: ${s}`));try{_e.default.existsSync(s)&&(me.default.rmSync(s,{recursive:!0,force:!0}),N(`clean destination: ${s}`)),me.default.cpSync(o,s,{recursive:!0,preserveTimestamps:!0}),N(`copy: ${o} to ${s}`),a&&(Hp(s),N(`delete backup: ${s}`))}catch(p){a&&(Xp(s),console.log("Backup has been restored.")),Y(Tt,p)}}}function Qt(e,t,n,i){let{override:a,withBackup:r}=i||{};for(let o of n){let s=Ke.default.join(e,o),p=Ke.default.join(t,o);if(_e.default.existsSync(s)){r&&Wp(p);try{a&&_e.default.existsSync(p)&&me.default.rmSync(p,{recursive:!0,force:!0}),me.default.renameSync(s,p),N(`moved: ${s} to ${p}`),r&&Hp(p)}catch(l){r&&(Xp(p),console.log("Backup has been restored.")),Y(Tt,l)}}}}function Qa(e){for(let t of e)if(t)try{_e.default.existsSync(t)&&(me.default.rmSync(t,{recursive:!0,force:!0}),N(`removed directory: ${t}`))}catch(n){Y(Tt,n)}}function Xp(e,t="-BACKUP"){let n=e+t;try{me.default.renameSync(n,e),console.log(`Backup ${n} has been restored`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Hp(e,t="-BACKUP"){let n=e+t;if(_e.default.existsSync(n))try{me.default.rmSync(n,{recursive:!0,force:!0}),console.log(`Backup ${n} has been deleted`)}catch(i){throw console.log(i),new Error(`Error while delete ${n} backup`)}}function Wp(e,t="-BACKUP"){let n=e+t;if(_e.default.existsSync(e)){if(_e.default.existsSync(n)){console.log(`Destination ${n} already exists`);return}try{me.default.renameSync(e,n),console.log(`Backup of ${e} has been created in ${n}`)}catch(i){console.log(`Error while coping ${e} to ${n} backup`),Y(Tt,i)}}}async function Vp(){let{__cx:e}=yv.paths(),t=Ke.default.join(e,"store");try{let n=Za(t);for(let i of n)Ke.default.basename(i).startsWith("-")&&me.default.unlinkSync(i)}catch(n){console.info("`store` folder does not exist. Skipping multipage or static list template cleaning.",n)}}function Jp(e,t){let n="";me.default.existsSync(e)&&(n=me.default.readFileSync(e,"utf8")),me.default.writeFileSync(e,t+n,"utf8")}var wt=R(require("node:path")),bn=R(Ot()),Ho=R(yl());var Ze=R(require("node:fs")),ve=R(require("node:path")),Fr=R(Ot());Ye();ot();var tn=z();async function kr(){let{__cx:e}=tn.paths(),{sitesToPublish:t,createdPages:n,buildProcessData:i}=Fr.default.readJSONSync(ve.default.join(e,"render-metadata.json"));return{buildProcessData:i,createdPages:n,sitesToPublish:t}}function wl(){let{__cx:e}=tn.paths(),t=ve.default.join(e,"store");Ze.default.existsSync(t)||(Ze.default.mkdirSync(t),Ze.default.mkdirSync(ve.default.join(t,"metadata"))),console.info("Store initialized")}function jr(e){let{__cx:t}=tn.paths();Ze.default.writeFileSync(ve.default.join(t,"render-metadata.json"),JSON.stringify(e))}function db(e){return Ze.default.readdirSync(e).filter(n=>{let i=`${e}/${n}`;if(Ze.default.statSync(i)?.isDirectory()||ve.default.extname(n)!==".json")return!1;let r=ve.default.basename(n,ve.default.extname(n));return!Number.isNaN(Number.parseInt(r))}).map(n=>{let i=ve.default.basename(n,ve.default.extname(n));return Number.parseInt(i)})}function _l(e,t){let{__cx:n}=tn.paths();try{for(let i of t){Lr(i,["editorID","parentEditorID"]);let a=`${i.context.page.id}.json`,r=ve.default.join(n,"store",e,a);Fr.default.writeJSONSync(r,i)}}catch(i){Y($p,i)}}function Sl(e,t){let{__cx:n}=tn.paths();if(t.length!==0)for(let i of t){let a=ve.default.join(n,"store",e,`${i}.json`);try{Ze.default.unlinkSync(a)}catch(r){throw console.log(r),new Error(`Error removing file ${i}`)}}}async function El(e){let{__cx:t}=tn.paths(),n=ve.default.join(t,"store"),{changedPages:i,validPagesIds:a,siteDirName:r}=e,o=ve.default.join(n,r),s=db(o),p=a.filter(f=>!s.includes(f)),l=p.concat(i),c=s.filter(f=>!a.includes(f)),u=Array.from(new Set(l)).filter(f=>!c.includes(f));return{pagesInStore:s,pagesMissingInStore:p,pagesToDeleteFromStore:[...c],pagesToWriteToStore:u}}function Dl(e,t){let{__cx:n}=z().paths(t),i=Ze.default.readdirSync(ve.default.join(n,"store")),a=e.map(({id:o})=>`${o}`),r=i.filter(o=>!a.includes(o));for(let o of r)Ze.default.rmSync(ve.default.join(n,"store",o),{recursive:!0,force:!0}),N(`Removed orphan site id: ${o}`)}Ye();ot();var Nr=class{headers;async login(){try{let t=await fetch(Z.LOGIN,{method:"POST",headers:{"Content-Type":"application/json",Connection:"close"},body:JSON.stringify({username:O.GRIDDO_BOT_USER,password:O.GRIDDO_BOT_PASSWORD})});if(!t.ok)throw new Error("Error while login in the API");let{token:n}=await t.json();return this.headers={Authorization:`bearer ${n}`,"Cache-Control":"no-store"},this.headers}catch(t){Y(qp,t)}}},st=new Nr;function Mn(e,t){return function(){return e.apply(t,arguments)}}var{toString:mb}=Object.prototype,{getPrototypeOf:Br}=Object,Xi=(e=>t=>{let n=mb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Be=e=>(e=e.toLowerCase(),t=>Xi(t)===e),Hi=e=>t=>typeof t===e,{isArray:nn}=Array,$n=Hi("undefined");function fb(e){return e!==null&&!$n(e)&&e.constructor!==null&&!$n(e.constructor)&&Ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Cl=Be("ArrayBuffer");function hb(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Cl(e.buffer),t}var xb=Hi("string"),Ie=Hi("function"),Tl=Hi("number"),Wi=e=>e!==null&&typeof e=="object",vb=e=>e===!0||e===!1,zi=e=>{if(Xi(e)!=="object")return!1;let t=Br(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},gb=Be("Date"),bb=Be("File"),yb=Be("Blob"),wb=Be("FileList"),_b=e=>Wi(e)&&Ie(e.pipe),Sb=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ie(e.append)&&((t=Xi(e))==="formdata"||t==="object"&&Ie(e.toString)&&e.toString()==="[object FormData]"))},Eb=Be("URLSearchParams"),[Db,Rb,Ob,Cb]=["ReadableStream","Request","Response","Headers"].map(Be),Tb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Gn(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,a;if(typeof e!="object"&&(e=[e]),nn(e))for(i=0,a=e.length;i<a;i++)t.call(null,e[i],i,e);else{let r=n?Object.getOwnPropertyNames(e):Object.keys(e),o=r.length,s;for(i=0;i<o;i++)s=r[i],t.call(null,e[s],s,e)}}function Il(e,t){t=t.toLowerCase();let n=Object.keys(e),i=n.length,a;for(;i-- >0;)if(a=n[i],t===a.toLowerCase())return a;return null}var Ft=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pl=e=>!$n(e)&&e!==Ft;function Ur(){let{caseless:e}=Pl(this)&&this||{},t={},n=(i,a)=>{let r=e&&Il(t,a)||a;zi(t[r])&&zi(i)?t[r]=Ur(t[r],i):zi(i)?t[r]=Ur({},i):nn(i)?t[r]=i.slice():t[r]=i};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Gn(arguments[i],n);return t}var Ib=(e,t,n,{allOwnKeys:i}={})=>(Gn(t,(a,r)=>{n&&Ie(a)?e[r]=Mn(a,n):e[r]=a},{allOwnKeys:i}),e),Pb=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ab=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fb=(e,t,n,i)=>{let a,r,o,s={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),r=a.length;r-- >0;)o=a[r],(!i||i(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Br(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kb=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let i=e.indexOf(t,n);return i!==-1&&i===n},jb=e=>{if(!e)return null;if(nn(e))return e;let t=e.length;if(!Tl(t))return null;let n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Lb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Br(Uint8Array)),Nb=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),a;for(;(a=i.next())&&!a.done;){let r=a.value;t.call(e,r[0],r[1])}},qb=(e,t)=>{let n,i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Ub=Be("HTMLFormElement"),Bb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,a){return i.toUpperCase()+a}),Rl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mb=Be("RegExp"),Al=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),i={};Gn(n,(a,r)=>{let o;(o=t(a,r,e))!==!1&&(i[r]=o||a)}),Object.defineProperties(e,i)},$b=e=>{Al(e,(t,n)=>{if(Ie(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=e[n];if(Ie(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gb=(e,t)=>{let n={},i=a=>{a.forEach(r=>{n[r]=!0})};return nn(e)?i(e):i(String(e).split(t)),n},zb=()=>{},Xb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,qr="abcdefghijklmnopqrstuvwxyz",Ol="0123456789",Fl={DIGIT:Ol,ALPHA:qr,ALPHA_DIGIT:qr+qr.toUpperCase()+Ol},Hb=(e=16,t=Fl.ALPHA_DIGIT)=>{let n="",{length:i}=t;for(;e--;)n+=t[Math.random()*i|0];return n};function Wb(e){return!!(e&&Ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Vb=e=>{let t=new Array(10),n=(i,a)=>{if(Wi(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[a]=i;let r=nn(i)?[]:{};return Gn(i,(o,s)=>{let p=n(o,a+1);!$n(p)&&(r[s]=p)}),t[a]=void 0,r}}return i};return n(e,0)},Jb=Be("AsyncFunction"),Yb=e=>e&&(Wi(e)||Ie(e))&&Ie(e.then)&&Ie(e.catch),kl=((e,t)=>e?setImmediate:t?((n,i)=>(Ft.addEventListener("message",({source:a,data:r})=>{a===Ft&&r===n&&i.length&&i.shift()()},!1),a=>{i.push(a),Ft.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ie(Ft.postMessage)),Kb=typeof queueMicrotask<"u"?queueMicrotask.bind(Ft):typeof process<"u"&&process.nextTick||kl,d={isArray:nn,isArrayBuffer:Cl,isBuffer:fb,isFormData:Sb,isArrayBufferView:hb,isString:xb,isNumber:Tl,isBoolean:vb,isObject:Wi,isPlainObject:zi,isReadableStream:Db,isRequest:Rb,isResponse:Ob,isHeaders:Cb,isUndefined:$n,isDate:gb,isFile:bb,isBlob:yb,isRegExp:Mb,isFunction:Ie,isStream:_b,isURLSearchParams:Eb,isTypedArray:Lb,isFileList:wb,forEach:Gn,merge:Ur,extend:Ib,trim:Tb,stripBOM:Pb,inherits:Ab,toFlatObject:Fb,kindOf:Xi,kindOfTest:Be,endsWith:kb,toArray:jb,forEachEntry:Nb,matchAll:qb,isHTMLForm:Ub,hasOwnProperty:Rl,hasOwnProp:Rl,reduceDescriptors:Al,freezeMethods:$b,toObjectSet:Gb,toCamelCase:Bb,noop:zb,toFiniteNumber:Xb,findKey:Il,global:Ft,isContextDefined:Pl,ALPHABET:Fl,generateString:Hb,isSpecCompliantForm:Wb,toJSONObject:Vb,isAsyncFn:Jb,isThenable:Yb,setImmediate:kl,asap:Kb};function an(e,t,n,i,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),a&&(this.response=a,this.status=a.status?a.status:null)}d.inherits(an,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:d.toJSONObject(this.config),code:this.code,status:this.status}}});var jl=an.prototype,Ll={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ll[e]={value:e}});Object.defineProperties(an,Ll);Object.defineProperty(jl,"isAxiosError",{value:!0});an.from=(e,t,n,i,a,r)=>{let o=Object.create(jl);return d.toFlatObject(e,o,function(p){return p!==Error.prototype},s=>s!=="isAxiosError"),an.call(o,e.message,t,n,i,a),o.cause=e,o.name=e.name,r&&Object.assign(o,r),o};var y=an;var gu=R(vu(),1),Yi=gu.default;function Kr(e){return d.isPlainObject(e)||d.isArray(e)}function yu(e){return d.endsWith(e,"[]")?e.slice(0,-2):e}function bu(e,t,n){return e?e.concat(t).map(function(a,r){return a=yu(a),!n&&r?"["+a+"]":a}).join(n?".":""):t}function ky(e){return d.isArray(e)&&!e.some(Kr)}var jy=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function Ly(e,t,n){if(!d.isObject(e))throw new TypeError("target must be an object");t=t||new(Yi||FormData),n=d.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,v){return!d.isUndefined(v[x])});let i=n.metaTokens,a=n.visitor||c,r=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(a))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(d.isDate(m))return m.toISOString();if(!p&&d.isBlob(m))throw new y("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(m)||d.isTypedArray(m)?p&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,x,v){let b=m;if(m&&!v&&typeof m=="object"){if(d.endsWith(x,"{}"))x=i?x:x.slice(0,-2),m=JSON.stringify(m);else if(d.isArray(m)&&ky(m)||(d.isFileList(m)||d.endsWith(x,"[]"))&&(b=d.toArray(m)))return x=yu(x),b.forEach(function(_,T){!(d.isUndefined(_)||_===null)&&t.append(o===!0?bu([x],T,r):o===null?x:x+"[]",l(_))}),!1}return Kr(m)?!0:(t.append(bu(v,x,r),l(m)),!1)}let u=[],f=Object.assign(jy,{defaultVisitor:c,convertValue:l,isVisitable:Kr});function h(m,x){if(!d.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(m),d.forEach(m,function(b,E){(!(d.isUndefined(b)||b===null)&&a.call(t,b,d.isString(E)?E.trim():E,x,f))===!0&&h(b,x?x.concat(E):[E])}),u.pop()}}if(!d.isObject(e))throw new TypeError("data must be an object");return h(e),t}var gt=Ly;function wu(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function _u(e,t){this._pairs=[],e&&gt(e,this,t)}var Su=_u.prototype;Su.append=function(t,n){this._pairs.push([t,n])};Su.toString=function(t){let n=t?function(i){return t.call(this,i,wu)}:wu;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var Eu=_u;function Ny(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function kt(e,t,n){if(!t)return e;let i=n&&n.encode||Ny;d.isFunction(n)&&(n={serialize:n});let a=n&&n.serialize,r;if(a?r=a(t,n):r=d.isURLSearchParams(t)?t.toString():new Eu(t,n).toString(i),r){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}var Qr=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(i){i!==null&&t(i)})}},Zr=Qr;var rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Du=R(require("url"),1),Ru=Du.default.URLSearchParams;var Ou={isNode:!0,classes:{URLSearchParams:Ru,FormData:Yi,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var no={};ya(no,{hasBrowserEnv:()=>to,hasStandardBrowserEnv:()=>qy,hasStandardBrowserWebWorkerEnv:()=>Uy,navigator:()=>eo,origin:()=>By});var to=typeof window<"u"&&typeof document<"u",eo=typeof navigator=="object"&&navigator||void 0,qy=to&&(!eo||["ReactNative","NativeScript","NS"].indexOf(eo.product)<0),Uy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",By=to&&window.location.href||"http://localhost";var B={...no,...Ou};function io(e,t){return gt(e,new B.classes.URLSearchParams,Object.assign({visitor:function(n,i,a,r){return B.isNode&&d.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function My(e){return d.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $y(e){let t={},n=Object.keys(e),i,a=n.length,r;for(i=0;i<a;i++)r=n[i],t[r]=e[r];return t}function Gy(e){function t(n,i,a,r){let o=n[r++];if(o==="__proto__")return!0;let s=Number.isFinite(+o),p=r>=n.length;return o=!o&&d.isArray(a)?a.length:o,p?(d.hasOwnProp(a,o)?a[o]=[a[o],i]:a[o]=i,!s):((!a[o]||!d.isObject(a[o]))&&(a[o]=[]),t(n,i,a[o],r)&&d.isArray(a[o])&&(a[o]=$y(a[o])),!s)}if(d.isFormData(e)&&d.isFunction(e.entries)){let n={};return d.forEachEntry(e,(i,a)=>{t(My(i),a,n,0)}),n}return null}var Ki=Gy;function zy(e,t,n){if(d.isString(e))try{return(t||JSON.parse)(e),d.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}var ao={transitional:rn,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i=n.getContentType()||"",a=i.indexOf("application/json")>-1,r=d.isObject(t);if(r&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return a?JSON.stringify(Ki(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return io(t,this.formSerializer).toString();if((s=d.isFileList(t))||i.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return gt(s?{"files[]":t}:t,p&&new p,this.formSerializer)}}return r||a?(n.setContentType("application/json",!1),zy(t)):t}],transformResponse:[function(t){let n=this.transitional||ao.transitional,i=n&&n.forcedJSONParsing,a=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(i&&!this.responseType||a)){let o=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?y.from(s,y.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],e=>{ao.headers[e]={}});var on=ao;var Xy=d.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"]),Cu=e=>{let t={},n,i,a;return e&&e.split(`
40
40
  `).forEach(function(o){a=o.indexOf(":"),n=o.substring(0,a).trim().toLowerCase(),i=o.substring(a+1).trim(),!(!n||t[n]&&Xy[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t};var Tu=Symbol("internals");function zn(e){return e&&String(e).trim().toLowerCase()}function Qi(e){return e===!1||e==null?e:d.isArray(e)?e.map(Qi):String(e)}function Hy(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}var Wy=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ro(e,t,n,i,a){if(d.isFunction(i))return i.call(this,t,n);if(a&&(t=n),!!d.isString(t)){if(d.isString(i))return t.indexOf(i)!==-1;if(d.isRegExp(i))return i.test(t)}}function Vy(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function Jy(e,t){let n=d.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(a,r,o){return this[i].call(this,t,a,r,o)},configurable:!0})})}var sn=class{constructor(t){t&&this.set(t)}set(t,n,i){let a=this;function r(s,p,l){let c=zn(p);if(!c)throw new Error("header name must be a non-empty string");let u=d.findKey(a,c);(!u||a[u]===void 0||l===!0||l===void 0&&a[u]!==!1)&&(a[u||p]=Qi(s))}let o=(s,p)=>d.forEach(s,(l,c)=>r(l,c,p));if(d.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(d.isString(t)&&(t=t.trim())&&!Wy(t))o(Cu(t),n);else if(d.isHeaders(t))for(let[s,p]of t.entries())r(p,s,i);else t!=null&&r(n,t,i);return this}get(t,n){if(t=zn(t),t){let i=d.findKey(this,t);if(i){let a=this[i];if(!n)return a;if(n===!0)return Hy(a);if(d.isFunction(n))return n.call(this,a,i);if(d.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=zn(t),t){let i=d.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||ro(this,this[i],i,n)))}return!1}delete(t,n){let i=this,a=!1;function r(o){if(o=zn(o),o){let s=d.findKey(i,o);s&&(!n||ro(i,i[s],s,n))&&(delete i[s],a=!0)}}return d.isArray(t)?t.forEach(r):r(t),a}clear(t){let n=Object.keys(this),i=n.length,a=!1;for(;i--;){let r=n[i];(!t||ro(this,this[r],r,t,!0))&&(delete this[r],a=!0)}return a}normalize(t){let n=this,i={};return d.forEach(this,(a,r)=>{let o=d.findKey(i,r);if(o){n[o]=Qi(a),delete n[r];return}let s=t?Vy(r):String(r).trim();s!==r&&delete n[r],n[s]=Qi(a),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return d.forEach(this,(i,a)=>{i!=null&&i!==!1&&(n[a]=t&&d.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
41
41
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(a=>i.set(a)),i}static accessor(t){let i=(this[Tu]=this[Tu]={accessors:{}}).accessors,a=this.prototype;function r(o){let s=zn(o);i[s]||(Jy(a,o),i[s]=!0)}return d.isArray(t)?t.forEach(r):r(t),this}};sn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(sn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});d.freezeMethods(sn);var V=sn;function Xn(e,t){let n=this||on,i=t||n,a=V.from(i.headers),r=i.data;return d.forEach(e,function(s){r=s.call(n,r,a.normalize(),t?t.status:void 0)}),a.normalize(),r}function Hn(e){return!!(e&&e.__CANCEL__)}function Iu(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}d.inherits(Iu,y,{__CANCEL__:!0});var Pe=Iu;function et(e,t,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oo(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function so(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jt(e,t){return e&&!oo(t)?so(e,t):t}var md=R(Au(),1),fd=R(require("http"),1),hd=R(require("https"),1),xd=R(require("util"),1),vd=R(Ku(),1),pt=R(require("zlib"),1);var Ut="1.7.9";function Kn(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var kw=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Do(e,t,n){let i=n&&n.Blob||B.classes.Blob,a=Kn(e);if(t===void 0&&i&&(t=!0),a==="data"){e=a.length?e.slice(a.length+1):e;let r=kw.exec(e);if(!r)throw new y("Invalid URL",y.ERR_INVALID_URL);let o=r[1],s=r[2],p=r[3],l=Buffer.from(decodeURIComponent(p),s?"base64":"utf8");if(t){if(!i)throw new y("Blob is not supported",y.ERR_NOT_SUPPORT);return new i([l],{type:o})}return l}throw new y("Unsupported protocol "+a,y.ERR_NOT_SUPPORT)}var Bt=R(require("stream"),1);var Qu=R(require("stream"),1);var Ro=Symbol("internals"),Oo=class extends Qu.default.Transform{constructor(t){t=d.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,a)=>!d.isUndefined(a[i])),super({readableHighWaterMark:t.chunkSize});let n=this[Ro]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(n.isCaptured||(n.isCaptured=!0))})}_read(t){let n=this[Ro];return n.onReadCallback&&n.onReadCallback(),super._read(t)}_transform(t,n,i){let a=this[Ro],r=a.maxRate,o=this.readableHighWaterMark,s=a.timeWindow,p=1e3/s,l=r/p,c=a.minChunkSize!==!1?Math.max(a.minChunkSize,l*.01):0,u=(h,m)=>{let x=Buffer.byteLength(h);a.bytesSeen+=x,a.bytes+=x,a.isCaptured&&this.emit("progress",a.bytesSeen),this.push(h)?process.nextTick(m):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(m)}},f=(h,m)=>{let x=Buffer.byteLength(h),v=null,b=o,E,_=0;if(r){let T=Date.now();(!a.ts||(_=T-a.ts)>=s)&&(a.ts=T,E=l-a.bytes,a.bytes=E<0?-E:0,_=0),E=l-a.bytes}if(r){if(E<=0)return setTimeout(()=>{m(null,h)},s-_);E<b&&(b=E)}b&&x>b&&x-b>c&&(v=h.subarray(b),h=h.subarray(0,b)),u(h,v?()=>{process.nextTick(m,null,v)}:m)};f(t,function h(m,x){if(m)return i(m);x?f(x,h):i(null)})}},Co=Oo;var gd=require("events");var ed=R(require("util"),1),td=require("stream");var{asyncIterator:Zu}=Symbol,jw=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Zu]?yield*e[Zu]():yield e},ia=jw;var Lw=d.ALPHABET.ALPHA_DIGIT+"-_",Qn=typeof TextEncoder=="function"?new TextEncoder:new ed.default.TextEncoder,yt=`\r
42
42
  `,Nw=Qn.encode(yt),qw=2,To=class{constructor(t,n){let{escapeName:i}=this.constructor,a=d.isString(n),r=`Content-Disposition: form-data; name="${i(t)}"${!a&&n.name?`; filename="${i(n.name)}"`:""}${yt}`;a?n=Qn.encode(String(n).replace(/\r?\n|\r\n?/g,yt)):r+=`Content-Type: ${n.type||"application/octet-stream"}${yt}`,this.headers=Qn.encode(r+yt),this.contentLength=a?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+qw,this.name=t,this.value=n}async*encode(){yield this.headers;let{value:t}=this;d.isTypedArray(t)?yield t:yield*ia(t),yield Nw}static escapeName(t){return String(t).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},Uw=(e,t,n)=>{let{tag:i="form-data-boundary",size:a=25,boundary:r=i+"-"+d.generateString(a,Lw)}=n||{};if(!d.isFormData(e))throw TypeError("FormData instance required");if(r.length<1||r.length>70)throw Error("boundary must be 10-70 characters long");let o=Qn.encode("--"+r+yt),s=Qn.encode("--"+r+"--"+yt+yt),p=s.byteLength,l=Array.from(e.entries()).map(([u,f])=>{let h=new To(u,f);return p+=h.size,h});p+=o.byteLength*l.length,p=d.toFiniteNumber(p);let c={"Content-Type":`multipart/form-data; boundary=${r}`};return Number.isFinite(p)&&(c["Content-Length"]=p),t&&t(c),td.Readable.from(async function*(){for(let u of l)yield o,yield*u.encode();yield s}())},nd=Uw;var id=R(require("stream"),1),Io=class extends id.default.Transform{__transform(t,n,i){this.push(t),i()}_transform(t,n,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let a=Buffer.alloc(2);a[0]=120,a[1]=156,this.push(a,n)}this.__transform(t,n,i)}},ad=Io;var Bw=(e,t)=>d.isAsyncFn(e)?function(...n){let i=n.pop();e.apply(this,n).then(a=>{try{t?i(null,...t(a)):i(null,a)}catch(r){i(r)}},i)}:e,rd=Bw;function Mw(e,t){e=e||10;let n=new Array(e),i=new Array(e),a=0,r=0,o;return t=t!==void 0?t:1e3,function(p){let l=Date.now(),c=i[r];o||(o=l),n[a]=p,i[a]=l;let u=r,f=0;for(;u!==a;)f+=n[u++],u=u%e;if(a=(a+1)%e,a===r&&(r=(r+1)%e),l-o<t)return;let h=c&&l-c;return h?Math.round(f*1e3/h):void 0}}var od=Mw;function $w(e,t){let n=0,i=1e3/t,a,r,o=(l,c=Date.now())=>{n=c,a=null,r&&(clearTimeout(r),r=null),e.apply(null,l)};return[(...l)=>{let c=Date.now(),u=c-n;u>=i?o(l,c):(a=l,r||(r=setTimeout(()=>{r=null,o(a)},i-u)))},()=>a&&o(a)]}var sd=$w;var ct=(e,t,n=3)=>{let i=0,a=od(50,250);return sd(r=>{let o=r.loaded,s=r.lengthComputable?r.total:void 0,p=o-i,l=a(p),c=o<=s;i=o;let u={loaded:o,total:s,progress:s?o/s:void 0,bytes:p,rate:l||void 0,estimated:l&&s&&c?(s-o)/l:void 0,event:r,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(u)},n)},dn=(e,t)=>{let n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},mn=e=>(...t)=>d.asap(()=>e(...t));var cd={flush:pt.default.constants.Z_SYNC_FLUSH,finishFlush:pt.default.constants.Z_SYNC_FLUSH},Gw={flush:pt.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:pt.default.constants.BROTLI_OPERATION_FLUSH},pd=d.isFunction(pt.default.createBrotliDecompress),{http:zw,https:Xw}=vd.default,Hw=/https:?/,ld=B.protocols.map(e=>e+":"),ud=(e,[t,n])=>(e.on("end",n).on("error",n),t);function Ww(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function bd(e,t,n){let i=t;if(!i&&i!==!1){let a=md.default.getProxyForUrl(n);a&&(i=new URL(a))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let r=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+r}e.headers.host=e.hostname+(e.port?":"+e.port:"");let a=i.hostname||i.host;e.hostname=a,e.host=a,e.port=i.port,e.path=n,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(r){bd(r,t,r.href)}}var Vw=typeof process<"u"&&d.kindOf(process)==="process",Jw=e=>new Promise((t,n)=>{let i,a,r=(p,l)=>{a||(a=!0,i&&i(p,l))},o=p=>{r(p),t(p)},s=p=>{r(p,!0),n(p)};e(o,s,p=>i=p).catch(s)}),Yw=({address:e,family:t})=>{if(!d.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},dd=(e,t)=>Yw(d.isObject(e)?e:{address:e,family:t}),yd=Vw&&function(t){return Jw(async function(i,a,r){let{data:o,lookup:s,family:p}=t,{responseType:l,responseEncoding:c}=t,u=t.method.toUpperCase(),f,h=!1,m;if(s){let w=rd(s,S=>d.isArray(S)?S:[S]);s=(S,C,He)=>{w(S,C,(ne,We,Gt)=>{if(ne)return He(ne);let Te=d.isArray(We)?We.map(Se=>dd(Se)):[dd(We,Gt)];C.all?He(ne,Te):He(ne,Te[0].address,Te[0].family)})}}let x=new gd.EventEmitter,v=()=>{t.cancelToken&&t.cancelToken.unsubscribe(b),t.signal&&t.signal.removeEventListener("abort",b),x.removeAllListeners()};r((w,S)=>{f=!0,S&&(h=!0,v())});function b(w){x.emit("abort",!w||w.type?new Pe(null,t,m):w)}x.once("abort",a),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(b),t.signal&&(t.signal.aborted?b():t.signal.addEventListener("abort",b)));let E=jt(t.baseURL,t.url),_=new URL(E,B.hasBrowserEnv?B.origin:void 0),T=_.protocol||ld[0];if(T==="data:"){let w;if(u!=="GET")return et(i,a,{status:405,statusText:"method not allowed",headers:{},config:t});try{w=Do(t.url,l==="blob",{Blob:t.env&&t.env.Blob})}catch(S){throw y.from(S,y.ERR_BAD_REQUEST,t)}return l==="text"?(w=w.toString(c),(!c||c==="utf8")&&(w=d.stripBOM(w))):l==="stream"&&(w=Bt.default.Readable.from(w)),et(i,a,{data:w,status:200,statusText:"OK",headers:new V,config:t})}if(ld.indexOf(T)===-1)return a(new y("Unsupported protocol "+T,y.ERR_BAD_REQUEST,t));let P=V.from(t.headers).normalize();P.set("User-Agent","axios/"+Ut,!1);let{onUploadProgress:X,onDownloadProgress:te}=t,K=t.maxRate,D,A;if(d.isSpecCompliantForm(o)){let w=P.getContentType(/boundary=([-_\w\d]{10,70})/i);o=nd(o,S=>{P.set(S)},{tag:`axios-${Ut}-boundary`,boundary:w&&w[1]||void 0})}else if(d.isFormData(o)&&d.isFunction(o.getHeaders)){if(P.set(o.getHeaders()),!P.hasContentLength())try{let w=await xd.default.promisify(o.getLength).call(o);Number.isFinite(w)&&w>=0&&P.setContentLength(w)}catch{}}else if(d.isBlob(o)||d.isFile(o))o.size&&P.setContentType(o.type||"application/octet-stream"),P.setContentLength(o.size||0),o=Bt.default.Readable.from(ia(o));else if(o&&!d.isStream(o)){if(!Buffer.isBuffer(o))if(d.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(d.isString(o))o=Buffer.from(o,"utf-8");else return a(new y("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",y.ERR_BAD_REQUEST,t));if(P.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return a(new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,t))}let F=d.toFiniteNumber(P.getContentLength());d.isArray(K)?(D=K[0],A=K[1]):D=A=K,o&&(X||D)&&(d.isStream(o)||(o=Bt.default.Readable.from(o,{objectMode:!1})),o=Bt.default.pipeline([o,new Co({maxRate:d.toFiniteNumber(D)})],d.noop),X&&o.on("progress",ud(o,dn(F,ct(mn(X),!1,3)))));let M;if(t.auth){let w=t.auth.username||"",S=t.auth.password||"";M=w+":"+S}if(!M&&_.username){let w=_.username,S=_.password;M=w+":"+S}M&&P.delete("authorization");let H;try{H=kt(_.pathname+_.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(w){let S=new Error(w.message);return S.config=t,S.url=t.url,S.exists=!0,a(S)}P.set("Accept-Encoding","gzip, compress, deflate"+(pd?", br":""),!1);let k={path:H,method:u,headers:P.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:M,protocol:T,family:p,beforeRedirect:Ww,beforeRedirects:{}};!d.isUndefined(s)&&(k.lookup=s),t.socketPath?k.socketPath=t.socketPath:(k.hostname=_.hostname.startsWith("[")?_.hostname.slice(1,-1):_.hostname,k.port=_.port,bd(k,t.proxy,T+"//"+_.hostname+(_.port?":"+_.port:"")+k.path));let L,q=Hw.test(k.protocol);if(k.agent=q?t.httpsAgent:t.httpAgent,t.transport?L=t.transport:t.maxRedirects===0?L=q?hd.default:fd.default:(t.maxRedirects&&(k.maxRedirects=t.maxRedirects),t.beforeRedirect&&(k.beforeRedirects.config=t.beforeRedirect),L=q?Xw:zw),t.maxBodyLength>-1?k.maxBodyLength=t.maxBodyLength:k.maxBodyLength=1/0,t.insecureHTTPParser&&(k.insecureHTTPParser=t.insecureHTTPParser),m=L.request(k,function(S){if(m.destroyed)return;let C=[S],He=+S.headers["content-length"];if(te||A){let Se=new Co({maxRate:d.toFiniteNumber(A)});te&&Se.on("progress",ud(Se,dn(He,ct(mn(te),!0,3)))),C.push(Se)}let ne=S,We=S.req||m;if(t.decompress!==!1&&S.headers["content-encoding"])switch((u==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":C.push(pt.default.createUnzip(cd)),delete S.headers["content-encoding"];break;case"deflate":C.push(new ad),C.push(pt.default.createUnzip(cd)),delete S.headers["content-encoding"];break;case"br":pd&&(C.push(pt.default.createBrotliDecompress(Gw)),delete S.headers["content-encoding"])}ne=C.length>1?Bt.default.pipeline(C,d.noop):C[0];let Gt=Bt.default.finished(ne,()=>{Gt(),v()}),Te={status:S.statusCode,statusText:S.statusMessage,headers:new V(S.headers),config:t,request:We};if(l==="stream")Te.data=ne,et(i,a,Te);else{let Se=[],ii=0;ne.on("data",function(re){Se.push(re),ii+=re.length,t.maxContentLength>-1&&ii>t.maxContentLength&&(h=!0,ne.destroy(),a(new y("maxContentLength size of "+t.maxContentLength+" exceeded",y.ERR_BAD_RESPONSE,t,We)))}),ne.on("aborted",function(){if(h)return;let re=new y("stream has been aborted",y.ERR_BAD_RESPONSE,t,We);ne.destroy(re),a(re)}),ne.on("error",function(re){m.destroyed||a(y.from(re,null,t,We))}),ne.on("end",function(){try{let re=Se.length===1?Se[0]:Buffer.concat(Se);l!=="arraybuffer"&&(re=re.toString(c),(!c||c==="utf8")&&(re=d.stripBOM(re))),Te.data=re}catch(re){return a(y.from(re,null,t,Te.request,Te))}et(i,a,Te)})}x.once("abort",Se=>{ne.destroyed||(ne.emit("error",Se),ne.destroy())})}),x.once("abort",w=>{a(w),m.destroy(w)}),m.on("error",function(S){a(y.from(S,null,t,m))}),m.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),t.timeout){let w=parseInt(t.timeout,10);if(Number.isNaN(w)){a(new y("error trying to parse `config.timeout` to int",y.ERR_BAD_OPTION_VALUE,t,m));return}m.setTimeout(w,function(){if(f)return;let C=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",He=t.transitional||rn;t.timeoutErrorMessage&&(C=t.timeoutErrorMessage),a(new y(C,He.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),b()})}if(d.isStream(o)){let w=!1,S=!1;o.on("end",()=>{w=!0}),o.once("error",C=>{S=!0,m.destroy(C)}),o.on("close",()=>{!w&&!S&&b(new Pe("Request stream has been aborted",t,m))}),o.pipe(m)}else m.end(o)})};var wd=B.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,B.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0;var _d=B.hasStandardBrowserEnv?{write(e,t,n,i,a,r){let o=[e+"="+encodeURIComponent(t)];d.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),d.isString(i)&&o.push("path="+i),d.isString(a)&&o.push("domain="+a),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Sd=e=>e instanceof V?{...e}:e;function $e(e,t){t=t||{};let n={};function i(l,c,u,f){return d.isPlainObject(l)&&d.isPlainObject(c)?d.merge.call({caseless:f},l,c):d.isPlainObject(c)?d.merge({},c):d.isArray(c)?c.slice():c}function a(l,c,u,f){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l,u,f)}else return i(l,c,u,f)}function r(l,c){if(!d.isUndefined(c))return i(void 0,c)}function o(l,c){if(d.isUndefined(c)){if(!d.isUndefined(l))return i(void 0,l)}else return i(void 0,c)}function s(l,c,u){if(u in t)return i(l,c);if(u in e)return i(void 0,l)}let p={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,c,u)=>a(Sd(l),Sd(c),u,!0)};return d.forEach(Object.keys(Object.assign({},e,t)),function(c){let u=p[c]||a,f=u(e[c],t[c],c);d.isUndefined(f)&&u!==s||(n[c]=f)}),n}var aa=e=>{let t=$e({},e),{data:n,withXSRFToken:i,xsrfHeaderName:a,xsrfCookieName:r,headers:o,auth:s}=t;t.headers=o=V.from(o),t.url=kt(jt(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let p;if(d.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((p=o.getContentType())!==!1){let[l,...c]=p?p.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...c].join("; "))}}if(B.hasStandardBrowserEnv&&(i&&d.isFunction(i)&&(i=i(t)),i||i!==!1&&wd(t.url))){let l=a&&r&&_d.read(r);l&&o.set(a,l)}return t};var Kw=typeof XMLHttpRequest<"u",Ed=Kw&&function(e){return new Promise(function(n,i){let a=aa(e),r=a.data,o=V.from(a.headers).normalize(),{responseType:s,onUploadProgress:p,onDownloadProgress:l}=a,c,u,f,h,m;function x(){h&&h(),m&&m(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(a.method.toUpperCase(),a.url,!0),v.timeout=a.timeout;function b(){if(!v)return;let _=V.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),P={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:_,config:e,request:v};et(function(te){n(te),x()},function(te){i(te),x()},P),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(i(new y("Request aborted",y.ECONNABORTED,e,v)),v=null)},v.onerror=function(){i(new y("Network Error",y.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",P=a.transitional||rn;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),i(new y(T,P.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,v)),v=null},r===void 0&&o.setContentType(null),"setRequestHeader"in v&&d.forEach(o.toJSON(),function(T,P){v.setRequestHeader(P,T)}),d.isUndefined(a.withCredentials)||(v.withCredentials=!!a.withCredentials),s&&s!=="json"&&(v.responseType=a.responseType),l&&([f,m]=ct(l,!0),v.addEventListener("progress",f)),p&&v.upload&&([u,h]=ct(p),v.upload.addEventListener("progress",u),v.upload.addEventListener("loadend",h)),(a.cancelToken||a.signal)&&(c=_=>{v&&(i(!_||_.type?new Pe(null,e,v):_),v.abort(),v=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));let E=Kn(a.url);if(E&&B.protocols.indexOf(E)===-1){i(new y("Unsupported protocol "+E+":",y.ERR_BAD_REQUEST,e));return}v.send(r||null)})};var Qw=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,a,r=function(l){if(!a){a=!0,s();let c=l instanceof Error?l:this.reason;i.abort(c instanceof y?c:new Pe(c instanceof Error?c.message:c))}},o=t&&setTimeout(()=>{o=null,r(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t),s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(r):l.removeEventListener("abort",r)}),e=null)};e.forEach(l=>l.addEventListener("abort",r));let{signal:p}=i;return p.unsubscribe=()=>d.asap(s),p}},Dd=Qw;var Zw=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let i=0,a;for(;i<n;)a=i+t,yield e.slice(i,a),i=a},e_=async function*(e,t){for await(let n of t_(e))yield*Zw(n,t)},t_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},Po=(e,t,n,i)=>{let a=e_(e,t),r=0,o,s=p=>{o||(o=!0,i&&i(p))};return new ReadableStream({async pull(p){try{let{done:l,value:c}=await a.next();if(l){s(),p.close();return}let u=c.byteLength;if(n){let f=r+=u;n(f)}p.enqueue(new Uint8Array(c))}catch(l){throw s(l),l}},cancel(p){return s(p),a.return()}},{highWaterMark:2})};var oa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Od=oa&&typeof ReadableStream=="function",n_=oa&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Cd=(e,...t)=>{try{return!!e(...t)}catch{return!1}},i_=Od&&Cd(()=>{let e=!1,t=new Request(B.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Rd=64*1024,Ao=Od&&Cd(()=>d.isReadableStream(new Response("").body)),ra={stream:Ao&&(e=>e.body)};oa&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ra[t]&&(ra[t]=d.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,i)})})})(new Response);var a_=async e=>{if(e==null)return 0;if(d.isBlob(e))return e.size;if(d.isSpecCompliantForm(e))return(await new Request(B.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(d.isArrayBufferView(e)||d.isArrayBuffer(e))return e.byteLength;if(d.isURLSearchParams(e)&&(e=e+""),d.isString(e))return(await n_(e)).byteLength},r_=async(e,t)=>{let n=d.toFiniteNumber(e.getContentLength());return n??a_(t)},Td=oa&&(async e=>{let{url:t,method:n,data:i,signal:a,cancelToken:r,timeout:o,onDownloadProgress:s,onUploadProgress:p,responseType:l,headers:c,withCredentials:u="same-origin",fetchOptions:f}=aa(e);l=l?(l+"").toLowerCase():"text";let h=Dd([a,r&&r.toAbortSignal()],o),m,x=h&&h.unsubscribe&&(()=>{h.unsubscribe()}),v;try{if(p&&i_&&n!=="get"&&n!=="head"&&(v=await r_(c,i))!==0){let P=new Request(t,{method:"POST",body:i,duplex:"half"}),X;if(d.isFormData(i)&&(X=P.headers.get("content-type"))&&c.setContentType(X),P.body){let[te,K]=dn(v,ct(mn(p)));i=Po(P.body,Rd,te,K)}}d.isString(u)||(u=u?"include":"omit");let b="credentials"in Request.prototype;m=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:i,duplex:"half",credentials:b?u:void 0});let E=await fetch(m),_=Ao&&(l==="stream"||l==="response");if(Ao&&(s||_&&x)){let P={};["status","statusText","headers"].forEach(D=>{P[D]=E[D]});let X=d.toFiniteNumber(E.headers.get("content-length")),[te,K]=s&&dn(X,ct(mn(s),!0))||[];E=new Response(Po(E.body,Rd,te,()=>{K&&K(),x&&x()}),P)}l=l||"text";let T=await ra[d.findKey(ra,l)||"text"](E,e);return!_&&x&&x(),await new Promise((P,X)=>{et(P,X,{data:T,headers:V.from(E.headers),status:E.status,statusText:E.statusText,config:e,request:m})})}catch(b){throw x&&x(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,m),{cause:b.cause||b}):y.from(b,b&&b.code,e,m)}});var Fo={http:yd,xhr:Ed,fetch:Td};d.forEach(Fo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Id=e=>`- ${e}`,o_=e=>d.isFunction(e)||e===null||e===!1,sa={getAdapter:e=>{e=d.isArray(e)?e:[e];let{length:t}=e,n,i,a={};for(let r=0;r<t;r++){n=e[r];let o;if(i=n,!o_(n)&&(i=Fo[(o=String(n)).toLowerCase()],i===void 0))throw new y(`Unknown adapter '${o}'`);if(i)break;a[o||"#"+r]=i}if(!i){let r=Object.entries(a).map(([s,p])=>`adapter ${s} `+(p===!1?"is not supported by the environment":"is not available in the build")),o=t?r.length>1?`since :