@libretexts/cxone-expert-node 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2130 -1821
- package/dist/modules/archive.d.ts.map +1 -1
- package/dist/modules/contextMaps.d.ts.map +1 -1
- package/dist/modules/events.d.ts.map +1 -1
- package/dist/modules/files.d.ts.map +1 -1
- package/dist/modules/groups.d.ts.map +1 -1
- package/dist/modules/pages.d.ts.map +1 -1
- package/dist/modules/requests.d.ts +1 -1
- package/dist/modules/requests.d.ts.map +1 -1
- package/dist/modules/site.d.ts.map +1 -1
- package/dist/modules/users.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
"use strict";const Ct=require("crypto");class et{token=null;BrowserToken({key:e}){return this.token=e,this}ServerToken({key:e,secret:t,user:s}){if(!e||!t||!s)throw new Error("Missing required parameters: key, secret, user");const r=Math.floor(Date.now()/1e3),n=Ct.createHmac("sha256",t);n.update(`${e}${r}=${s}`);const o=n.digest("hex");return this.token=`${e}_${r}_=${s}_${o}`,this}getToken(){return this.token}getHeader(){return{"X-Deki-Token":this.token}}}function Ft(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var re={exports:{}},fe,Ue;function Et(){if(Ue)return fe;Ue=1;var a=1e3,e=a*60,t=e*60,s=t*24,r=s*7,n=s*365.25;fe=function(u,h){h=h||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isFinite(u))return h.long?l(u):i(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(h){var m=parseFloat(h[1]),q=(h[2]||"ms").toLowerCase();switch(q){case"years":case"year":case"yrs":case"yr":case"y":return m*n;case"weeks":case"week":case"w":return m*r;case"days":case"day":case"d":return m*s;case"hours":case"hour":case"hrs":case"hr":case"h":return m*t;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function i(u){var h=Math.abs(u);return h>=s?Math.round(u/s)+"d":h>=t?Math.round(u/t)+"h":h>=e?Math.round(u/e)+"m":h>=a?Math.round(u/a)+"s":u+"ms"}function l(u){var h=Math.abs(u);return h>=s?d(u,h,s,"day"):h>=t?d(u,h,t,"hour"):h>=e?d(u,h,e,"minute"):h>=a?d(u,h,a,"second"):u+" ms"}function d(u,h,m,q){var f=h>=m*1.5;return Math.round(u/m)+" "+q+(f?"s":"")}return fe}var be,De;function St(){if(De)return be;De=1;function a(e){s.debug=s,s.default=s,s.coerce=d,s.disable=i,s.enable=n,s.enabled=l,s.humanize=Et(),s.destroy=u,Object.keys(e).forEach(h=>{s[h]=e[h]}),s.names=[],s.skips=[],s.formatters={};function t(h){let m=0;for(let q=0;q<h.length;q++)m=(m<<5)-m+h.charCodeAt(q),m|=0;return s.colors[Math.abs(m)%s.colors.length]}s.selectColor=t;function s(h){let m,q=null,f,y;function b(...R){if(!b.enabled)return;const F=b,I=Number(new Date),E=I-(m||I);F.diff=E,F.prev=m,F.curr=I,m=I,R[0]=s.coerce(R[0]),typeof R[0]!="string"&&R.unshift("%O");let S=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(T,J)=>{if(T==="%%")return"%";S++;const L=s.formatters[J];if(typeof L=="function"){const ee=R[S];T=L.call(F,ee),R.splice(S,1),S--}return T}),s.formatArgs.call(F,R),(F.log||s.log).apply(F,R)}return b.namespace=h,b.useColors=s.useColors(),b.color=s.selectColor(h),b.extend=r,b.destroy=s.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>q!==null?q:(f!==s.namespaces&&(f=s.namespaces,y=s.enabled(h)),y),set:R=>{q=R}}),typeof s.init=="function"&&s.init(b),b}function r(h,m){const q=s(this.namespace+(typeof m>"u"?":":m)+h);return q.log=this.log,q}function n(h){s.save(h),s.namespaces=h,s.names=[],s.skips=[];const m=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const q of m)q[0]==="-"?s.skips.push(q.slice(1)):s.names.push(q)}function o(h,m){let q=0,f=0,y=-1,b=0;for(;q<h.length;)if(f<m.length&&(m[f]===h[q]||m[f]==="*"))m[f]==="*"?(y=f,b=q,f++):(q++,f++);else if(y!==-1)f=y+1,b++,q=b;else return!1;for(;f<m.length&&m[f]==="*";)f++;return f===m.length}function i(){const h=[...s.names,...s.skips.map(m=>"-"+m)].join(",");return s.enable(""),h}function l(h){for(const m of s.skips)if(o(h,m))return!1;for(const m of s.names)if(o(h,m))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return be=a,be}var ke;function Tt(){return ke||(ke=1,(function(a,e){e.formatArgs=s,e.save=r,e.load=n,e.useColors=t,e.storage=o(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;l.splice(1,0,d,"color: inherit");let u=0,h=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(u++,m==="%c"&&(h=u))}),l.splice(h,0,d)}e.log=console.debug||console.log||(()=>{});function r(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function n(){let l;try{l=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}a.exports=St()(e);const{formatters:i}=a.exports;i.j=function(l){try{return JSON.stringify(l)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(re,re.exports)),re.exports}var xt=Tt();const Ot=Ft(xt);function Ce(a,e){const t=Ot(a);return e!==void 0&&(t.enabled=e),t}function p(a,e){if(!e&&!a.tld)throw new Error("TLD is required");return e??a.tld}function g(a,e){if(e)return e;if(a.auth){const t=new et;if(a.auth.type==="server")return t.ServerToken(a.auth.params).getHeader();if(a.auth.type==="browser")return t.BrowserToken(a.auth.params).getHeader()}throw new Error("Authentication is required. Configure auth in Expert constructor or pass auth to method call.")}function tt(a,e){return function(){return a.apply(e,arguments)}}const{toString:$t}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:ue,toStringTag:st}=Symbol,ce=(a=>e=>{const t=$t.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),v=a=>(a=a.toLowerCase(),e=>ce(e)===a),de=a=>e=>typeof e===a,{isArray:z}=Array,K=de("undefined");function G(a){return a!==null&&!K(a)&&a.constructor!==null&&!K(a.constructor)&&$(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const rt=v("ArrayBuffer");function _t(a){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(a):e=a&&a.buffer&&rt(a.buffer),e}const Nt=de("string"),$=de("function"),at=de("number"),X=a=>a!==null&&typeof a=="object",vt=a=>a===!0||a===!1,ne=a=>{if(ce(a)!=="object")return!1;const e=Fe(a);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(st in a)&&!(ue in a)},Ut=a=>{if(!X(a)||G(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},Dt=v("Date"),kt=v("File"),Lt=v("Blob"),Bt=v("FileList"),At=a=>X(a)&&$(a.pipe),jt=a=>{let e;return a&&(typeof FormData=="function"&&a instanceof FormData||$(a.append)&&((e=ce(a))==="formdata"||e==="object"&&$(a.toString)&&a.toString()==="[object FormData]"))},Mt=v("URLSearchParams"),[Ht,Kt,zt,Jt]=["ReadableStream","Request","Response","Headers"].map(v),Wt=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(a,e,{allOwnKeys:t=!1}={}){if(a===null||typeof a>"u")return;let s,r;if(typeof a!="object"&&(a=[a]),z(a))for(s=0,r=a.length;s<r;s++)e.call(null,a[s],s,a);else{if(G(a))return;const n=t?Object.getOwnPropertyNames(a):Object.keys(a),o=n.length;let i;for(s=0;s<o;s++)i=n[s],e.call(null,a[i],i,a)}}function nt(a,e){if(G(a))return null;e=e.toLowerCase();const t=Object.keys(a);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const A=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ot=a=>!K(a)&&a!==A;function Pe(){const{caseless:a,skipUndefined:e}=ot(this)&&this||{},t={},s=(r,n)=>{if(n==="__proto__"||n==="constructor"||n==="prototype")return;const o=a&&nt(t,n)||n;ne(t[o])&&ne(r)?t[o]=Pe(t[o],r):ne(r)?t[o]=Pe({},r):z(r)?t[o]=r.slice():(!e||!K(r))&&(t[o]=r)};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Q(arguments[r],s);return t}const Vt=(a,e,t,{allOwnKeys:s}={})=>(Q(e,(r,n)=>{t&&$(r)?Object.defineProperty(a,n,{value:tt(r,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,n,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),a),Gt=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),Xt=(a,e,t,s)=>{a.prototype=Object.create(e.prototype,s),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:e.prototype}),t&&Object.assign(a.prototype,t)},Qt=(a,e,t,s)=>{let r,n,o;const i={};if(e=e||{},a==null)return e;do{for(r=Object.getOwnPropertyNames(a),n=r.length;n-- >0;)o=r[n],(!s||s(o,a,e))&&!i[o]&&(e[o]=a[o],i[o]=!0);a=t!==!1&&Fe(a)}while(a&&(!t||t(a,e))&&a!==Object.prototype);return e},Zt=(a,e,t)=>{a=String(a),(t===void 0||t>a.length)&&(t=a.length),t-=e.length;const s=a.indexOf(e,t);return s!==-1&&s===t},Yt=a=>{if(!a)return null;if(z(a))return a;let e=a.length;if(!at(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=a[e];return t},es=(a=>e=>a&&e instanceof a)(typeof Uint8Array<"u"&&Fe(Uint8Array)),ts=(a,e)=>{const s=(a&&a[ue]).call(a);let r;for(;(r=s.next())&&!r.done;){const n=r.value;e.call(a,n[0],n[1])}},ss=(a,e)=>{let t;const s=[];for(;(t=a.exec(e))!==null;)s.push(t);return s},rs=v("HTMLFormElement"),as=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),Le=(({hasOwnProperty:a})=>(e,t)=>a.call(e,t))(Object.prototype),ns=v("RegExp"),it=(a,e)=>{const t=Object.getOwnPropertyDescriptors(a),s={};Q(t,(r,n)=>{let o;(o=e(r,n,a))!==!1&&(s[n]=o||r)}),Object.defineProperties(a,s)},os=a=>{it(a,(e,t)=>{if($(a)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=a[t];if($(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},is=(a,e)=>{const t={},s=r=>{r.forEach(n=>{t[n]=!0})};return z(a)?s(a):s(String(a).split(e)),t},ls=()=>{},us=(a,e)=>a!=null&&Number.isFinite(a=+a)?a:e;function cs(a){return!!(a&&$(a.append)&&a[st]==="FormData"&&a[ue])}const ds=a=>{const e=new Array(10),t=(s,r)=>{if(X(s)){if(e.indexOf(s)>=0)return;if(G(s))return s;if(!("toJSON"in s)){e[r]=s;const n=z(s)?[]:{};return Q(s,(o,i)=>{const l=t(o,r+1);!K(l)&&(n[i]=l)}),e[r]=void 0,n}}return s};return t(a,0)},hs=v("AsyncFunction"),ps=a=>a&&(X(a)||$(a))&&$(a.then)&&$(a.catch),lt=((a,e)=>a?setImmediate:e?((t,s)=>(A.addEventListener("message",({source:r,data:n})=>{r===A&&n===t&&s.length&&s.shift()()},!1),r=>{s.push(r),A.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",$(A.postMessage)),gs=typeof queueMicrotask<"u"?queueMicrotask.bind(A):typeof process<"u"&&process.nextTick||lt,fs=a=>a!=null&&$(a[ue]),c={isArray:z,isArrayBuffer:rt,isBuffer:G,isFormData:jt,isArrayBufferView:_t,isString:Nt,isNumber:at,isBoolean:vt,isObject:X,isPlainObject:ne,isEmptyObject:Ut,isReadableStream:Ht,isRequest:Kt,isResponse:zt,isHeaders:Jt,isUndefined:K,isDate:Dt,isFile:kt,isBlob:Lt,isRegExp:ns,isFunction:$,isStream:At,isURLSearchParams:Mt,isTypedArray:es,isFileList:Bt,forEach:Q,merge:Pe,extend:Vt,trim:Wt,stripBOM:Gt,inherits:Xt,toFlatObject:Qt,kindOf:ce,kindOfTest:v,endsWith:Zt,toArray:Yt,forEachEntry:ts,matchAll:ss,isHTMLForm:rs,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:it,freezeMethods:os,toObjectSet:is,toCamelCase:as,noop:ls,toFiniteNumber:us,findKey:nt,global:A,isContextDefined:ot,isSpecCompliantForm:cs,toJSONObject:ds,isAsyncFn:hs,isThenable:ps,setImmediate:lt,asap:gs,isIterable:fs};let P=class ut extends Error{static from(e,t,s,r,n,o){const i=new ut(e.message,t||e.code,s,r,n);return i.cause=e,i.name=e.name,o&&Object.assign(i,o),i}constructor(e,t,s,r,n){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),s&&(this.config=s),r&&(this.request=r),n&&(this.response=n,this.status=n.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};P.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";P.ERR_BAD_OPTION="ERR_BAD_OPTION";P.ECONNABORTED="ECONNABORTED";P.ETIMEDOUT="ETIMEDOUT";P.ERR_NETWORK="ERR_NETWORK";P.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";P.ERR_DEPRECATED="ERR_DEPRECATED";P.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";P.ERR_BAD_REQUEST="ERR_BAD_REQUEST";P.ERR_CANCELED="ERR_CANCELED";P.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";P.ERR_INVALID_URL="ERR_INVALID_URL";const bs=null;function qe(a){return c.isPlainObject(a)||c.isArray(a)}function ct(a){return c.endsWith(a,"[]")?a.slice(0,-2):a}function Be(a,e,t){return a?a.concat(e).map(function(r,n){return r=ct(r),!t&&n?"["+r+"]":r}).join(t?".":""):e}function ms(a){return c.isArray(a)&&!a.some(qe)}const ys=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function he(a,e,t){if(!c.isObject(a))throw new TypeError("target must be an object");e=e||new FormData,t=c.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!c.isUndefined(b[y])});const s=t.metaTokens,r=t.visitor||u,n=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new P("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,y,b){let R=f;if(f&&!b&&typeof f=="object"){if(c.endsWith(y,"{}"))y=s?y:y.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&ms(f)||(c.isFileList(f)||c.endsWith(y,"[]"))&&(R=c.toArray(f)))return y=ct(y),R.forEach(function(I,E){!(c.isUndefined(I)||I===null)&&e.append(o===!0?Be([y],E,n):o===null?y:y+"[]",d(I))}),!1}return qe(f)?!0:(e.append(Be(b,y,n),d(f)),!1)}const h=[],m=Object.assign(ys,{defaultVisitor:u,convertValue:d,isVisitable:qe});function q(f,y){if(!c.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(f),c.forEach(f,function(R,F){(!(c.isUndefined(R)||R===null)&&r.call(e,R,c.isString(F)?F.trim():F,y,m))===!0&&q(R,y?y.concat(F):[F])}),h.pop()}}if(!c.isObject(a))throw new TypeError("data must be an object");return q(a),e}function Ae(a){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ee(a,e){this._pairs=[],a&&he(a,this,e)}const dt=Ee.prototype;dt.append=function(e,t){this._pairs.push([e,t])};dt.toString=function(e){const t=e?function(s){return e.call(this,s,Ae)}:Ae;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function ws(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(a,e,t){if(!e)return a;const s=t&&t.encode||ws,r=c.isFunction(t)?{serialize:t}:t,n=r&&r.serialize;let o;if(n?o=n(e,r):o=c.isURLSearchParams(e)?e.toString():new Ee(e,r).toString(s),o){const i=a.indexOf("#");i!==-1&&(a=a.slice(0,i)),a+=(a.indexOf("?")===-1?"?":"&")+o}return a}class je{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ps=typeof URLSearchParams<"u"?URLSearchParams:Ee,qs=typeof FormData<"u"?FormData:null,Rs=typeof Blob<"u"?Blob:null,Is={isBrowser:!0,classes:{URLSearchParams:Ps,FormData:qs,Blob:Rs},protocols:["http","https","file","blob","url","data"]},Te=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,Cs=Te&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Fs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Es=Te&&window.location.href||"http://localhost",Ss=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Te,hasStandardBrowserEnv:Cs,hasStandardBrowserWebWorkerEnv:Fs,navigator:Re,origin:Es},Symbol.toStringTag,{value:"Module"})),x={...Ss,...Is};function Ts(a,e){return he(a,new x.classes.URLSearchParams,{visitor:function(t,s,r,n){return x.isNode&&c.isBuffer(t)?(this.append(s,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function xs(a){return c.matchAll(/\w+|\[(\w*)]/g,a).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Os(a){const e={},t=Object.keys(a);let s;const r=t.length;let n;for(s=0;s<r;s++)n=t[s],e[n]=a[n];return e}function pt(a){function e(t,s,r,n){let o=t[n++];if(o==="__proto__")return!0;const i=Number.isFinite(+o),l=n>=t.length;return o=!o&&c.isArray(r)?r.length:o,l?(c.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!i):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],n)&&c.isArray(r[o])&&(r[o]=Os(r[o])),!i)}if(c.isFormData(a)&&c.isFunction(a.entries)){const t={};return c.forEachEntry(a,(s,r)=>{e(xs(s),r,t,0)}),t}return null}function $s(a,e,t){if(c.isString(a))try{return(e||JSON.parse)(a),c.trim(a)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(a)}const Z={transitional:Se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,n=c.isObject(e);if(n&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return r?JSON.stringify(pt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ts(e,this.formSerializer).toString();if((i=c.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return he(i?{"files[]":e}:e,l&&new l,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),$s(e)):e}],transformResponse:[function(e){const t=this.transitional||Z.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?P.from(i,P.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],a=>{Z.headers[a]={}});const _s=c.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"]),Ns=a=>{const e={};let t,s,r;return a&&a.split(`
|
|
2
|
-
`).forEach(function(o){
|
|
3
|
-
`)}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,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function n(o){const i=V(o);s[i]||(ks(r,o),s[i]=!0)}return c.isArray(e)?e.forEach(n):n(e),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(_.prototype,({value:a},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>a,set(s){this[t]=s}}});c.freezeMethods(_);function ye(a,e){const t=this||Z,s=e||t,r=_.from(s.headers);let n=s.data;return c.forEach(a,function(i){n=i.call(t,n,r.normalize(),e?e.status:void 0)}),r.normalize(),n}function gt(a){return!!(a&&a.__CANCEL__)}let Y=class extends P{constructor(e,t,s){super(e??"canceled",P.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=!0}};function ft(a,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?a(t):e(new P("Request failed with status code "+t.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Ls(a){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return e&&e[1]||""}function Bs(a,e){a=a||10;const t=new Array(a),s=new Array(a);let r=0,n=0,o;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),u=s[n];o||(o=d),t[r]=l,s[r]=d;let h=n,m=0;for(;h!==r;)m+=t[h++],h=h%a;if(r=(r+1)%a,r===n&&(n=(n+1)%a),d-o<e)return;const q=u&&d-u;return q?Math.round(m*1e3/q):void 0}}function As(a,e){let t=0,s=1e3/e,r,n;const o=(d,u=Date.now())=>{t=u,r=null,n&&(clearTimeout(n),n=null),a(...d)};return[(...d)=>{const u=Date.now(),h=u-t;h>=s?o(d,u):(r=d,n||(n=setTimeout(()=>{n=null,o(r)},s-h)))},()=>r&&o(r)]}const le=(a,e,t=3)=>{let s=0;const r=Bs(50,250);return As(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,l=o-s,d=r(l),u=o<=i;s=o;const h={loaded:o,total:i,progress:i?o/i:void 0,bytes:l,rate:d||void 0,estimated:d&&i&&u?(i-o)/d:void 0,event:n,lengthComputable:i!=null,[e?"download":"upload"]:!0};a(h)},t)},He=(a,e)=>{const t=a!=null;return[s=>e[0]({lengthComputable:t,total:a,loaded:s}),e[1]]},Ke=a=>(...e)=>c.asap(()=>a(...e)),js=x.hasStandardBrowserEnv?((a,e)=>t=>(t=new URL(t,x.origin),a.protocol===t.protocol&&a.host===t.host&&(e||a.port===t.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0,Ms=x.hasStandardBrowserEnv?{write(a,e,t,s,r,n,o){if(typeof document>"u")return;const i=[`${a}=${encodeURIComponent(e)}`];c.isNumber(t)&&i.push(`expires=${new Date(t).toUTCString()}`),c.isString(s)&&i.push(`path=${s}`),c.isString(r)&&i.push(`domain=${r}`),n===!0&&i.push("secure"),c.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(a){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hs(a){return typeof a!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function Ks(a,e){return e?a.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):a}function bt(a,e,t){let s=!Hs(e);return a&&(s||t==!1)?Ks(a,e):e}const ze=a=>a instanceof _?{...a}:a;function M(a,e){e=e||{};const t={};function s(d,u,h,m){return c.isPlainObject(d)&&c.isPlainObject(u)?c.merge.call({caseless:m},d,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function r(d,u,h,m){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d,h,m)}else return s(d,u,h,m)}function n(d,u){if(!c.isUndefined(u))return s(void 0,u)}function o(d,u){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,u)}function i(d,u,h){if(h in e)return s(d,u);if(h in a)return s(void 0,d)}const l={url:n,method:n,data:n,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:i,headers:(d,u,h)=>r(ze(d),ze(u),h,!0)};return c.forEach(Object.keys({...a,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=c.hasOwnProp(l,u)?l[u]:r,m=h(a[u],e[u],u);c.isUndefined(m)&&h!==i||(t[u]=m)}),t}const mt=a=>{const e=M({},a);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:n,headers:o,auth:i}=e;if(e.headers=o=_.from(o),e.url=ht(bt(e.baseURL,e.url,e.allowAbsoluteUrls),a.params,a.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),c.isFormData(t)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(t.getHeaders)){const l=t.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([u,h])=>{d.includes(u.toLowerCase())&&o.set(u,h)})}}if(x.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(e)),s||s!==!1&&js(e.url))){const l=r&&n&&Ms.read(n);l&&o.set(r,l)}return e},zs=typeof XMLHttpRequest<"u",Js=zs&&function(a){return new Promise(function(t,s){const r=mt(a);let n=r.data;const o=_.from(r.headers).normalize();let{responseType:i,onUploadProgress:l,onDownloadProgress:d}=r,u,h,m,q,f;function y(){q&&q(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(r.method.toUpperCase(),r.url,!0),b.timeout=r.timeout;function R(){if(!b)return;const I=_.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),S={data:!i||i==="text"||i==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:I,config:a,request:b};ft(function(T){t(T),y()},function(T){s(T),y()},S),b=null}"onloadend"in b?b.onloadend=R:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(R)},b.onabort=function(){b&&(s(new P("Request aborted",P.ECONNABORTED,a,b)),b=null)},b.onerror=function(E){const S=E&&E.message?E.message:"Network Error",U=new P(S,P.ERR_NETWORK,a,b);U.event=E||null,s(U),b=null},b.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||Se;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),s(new P(E,S.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,a,b)),b=null},n===void 0&&o.setContentType(null),"setRequestHeader"in b&&c.forEach(o.toJSON(),function(E,S){b.setRequestHeader(S,E)}),c.isUndefined(r.withCredentials)||(b.withCredentials=!!r.withCredentials),i&&i!=="json"&&(b.responseType=r.responseType),d&&([m,f]=le(d,!0),b.addEventListener("progress",m)),l&&b.upload&&([h,q]=le(l),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",q)),(r.cancelToken||r.signal)&&(u=I=>{b&&(s(!I||I.type?new Y(null,a,b):I),b.abort(),b=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const F=Ls(r.url);if(F&&x.protocols.indexOf(F)===-1){s(new P("Unsupported protocol "+F+":",P.ERR_BAD_REQUEST,a));return}b.send(n||null)})},Ws=(a,e)=>{const{length:t}=a=a?a.filter(Boolean):[];if(e||t){let s=new AbortController,r;const n=function(d){if(!r){r=!0,i();const u=d instanceof Error?d:this.reason;s.abort(u instanceof P?u:new Y(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,n(new P(`timeout of ${e}ms exceeded`,P.ETIMEDOUT))},e);const i=()=>{a&&(o&&clearTimeout(o),o=null,a.forEach(d=>{d.unsubscribe?d.unsubscribe(n):d.removeEventListener("abort",n)}),a=null)};a.forEach(d=>d.addEventListener("abort",n));const{signal:l}=s;return l.unsubscribe=()=>c.asap(i),l}},Vs=function*(a,e){let t=a.byteLength;if(t<e){yield a;return}let s=0,r;for(;s<t;)r=s+e,yield a.slice(s,r),s=r},Gs=async function*(a,e){for await(const t of Xs(a))yield*Vs(t,e)},Xs=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const e=a.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Je=(a,e,t,s)=>{const r=Gs(a,e);let n=0,o,i=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await r.next();if(d){i(),l.close();return}let h=u.byteLength;if(t){let m=n+=h;t(m)}l.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(l){return i(l),r.return()}},{highWaterMark:2})},We=64*1024,{isFunction:ae}=c,Qs=(({Request:a,Response:e})=>({Request:a,Response:e}))(c.global),{ReadableStream:Ve,TextEncoder:Ge}=c.global,Xe=(a,...e)=>{try{return!!a(...e)}catch{return!1}},Zs=a=>{a=c.merge.call({skipUndefined:!0},Qs,a);const{fetch:e,Request:t,Response:s}=a,r=e?ae(e):typeof fetch=="function",n=ae(t),o=ae(s);if(!r)return!1;const i=r&&ae(Ve),l=r&&(typeof Ge=="function"?(f=>y=>f.encode(y))(new Ge):async f=>new Uint8Array(await new t(f).arrayBuffer())),d=n&&i&&Xe(()=>{let f=!1;const y=new t(x.origin,{body:new Ve,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),u=o&&i&&Xe(()=>c.isReadableStream(new s("").body)),h={stream:u&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!h[f]&&(h[f]=(y,b)=>{let R=y&&y[f];if(R)return R.call(y);throw new P(`Response type '${f}' is not supported`,P.ERR_NOT_SUPPORT,b)})});const m=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new t(x.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},q=async(f,y)=>{const b=c.toFiniteNumber(f.getContentLength());return b??m(y)};return async f=>{let{url:y,method:b,data:R,signal:F,cancelToken:I,timeout:E,onDownloadProgress:S,onUploadProgress:U,responseType:T,headers:J,withCredentials:L="same-origin",fetchOptions:ee}=mt(f),Oe=e||fetch;T=T?(T+"").toLowerCase():"text";let te=Ws([F,I&&I.toAbortSignal()],E),W=null;const B=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let $e;try{if(U&&d&&b!=="get"&&b!=="head"&&($e=await q(J,R))!==0){let k=new t(y,{method:"POST",body:R,duplex:"half"}),H;if(c.isFormData(R)&&(H=k.headers.get("content-type"))&&J.setContentType(H),k.body){const[ge,se]=He($e,le(Ke(U)));R=Je(k.body,We,ge,se)}}c.isString(L)||(L=L?"include":"omit");const O=n&&"credentials"in t.prototype,_e={...ee,signal:te,method:b.toUpperCase(),headers:J.normalize().toJSON(),body:R,duplex:"half",credentials:O?L:void 0};W=n&&new t(y,_e);let D=await(n?Oe(W,ee):Oe(y,_e));const Ne=u&&(T==="stream"||T==="response");if(u&&(S||Ne&&B)){const k={};["status","statusText","headers"].forEach(ve=>{k[ve]=D[ve]});const H=c.toFiniteNumber(D.headers.get("content-length")),[ge,se]=S&&He(H,le(Ke(S),!0))||[];D=new s(Je(D.body,We,ge,()=>{se&&se(),B&&B()}),k)}T=T||"text";let It=await h[c.findKey(h,T)||"text"](D,f);return!Ne&&B&&B(),await new Promise((k,H)=>{ft(k,H,{data:It,headers:_.from(D.headers),status:D.status,statusText:D.statusText,config:f,request:W})})}catch(O){throw B&&B(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new P("Network Error",P.ERR_NETWORK,f,W,O&&O.response),{cause:O.cause||O}):P.from(O,O&&O.code,f,W,O&&O.response)}}},Ys=new Map,yt=a=>{let e=a&&a.env||{};const{fetch:t,Request:s,Response:r}=e,n=[s,r,t];let o=n.length,i=o,l,d,u=Ys;for(;i--;)l=n[i],d=u.get(l),d===void 0&&u.set(l,d=i?new Map:Zs(e)),u=d;return d};yt();const xe={http:bs,xhr:Js,fetch:{get:yt}};c.forEach(xe,(a,e)=>{if(a){try{Object.defineProperty(a,"name",{value:e})}catch{}Object.defineProperty(a,"adapterName",{value:e})}});const Qe=a=>`- ${a}`,er=a=>c.isFunction(a)||a===null||a===!1;function tr(a,e){a=c.isArray(a)?a:[a];const{length:t}=a;let s,r;const n={};for(let o=0;o<t;o++){s=a[o];let i;if(r=s,!er(s)&&(r=xe[(i=String(s)).toLowerCase()],r===void 0))throw new P(`Unknown adapter '${i}'`);if(r&&(c.isFunction(r)||(r=r.get(e))))break;n[i||"#"+o]=r}if(!r){const o=Object.entries(n).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
|
-
`+o.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+n):s.stack=n}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=M(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:n}=t;s!==void 0&&ie.assertOptions(s,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean),legacyInterceptorReqResOrdering:N.transitional(N.boolean)},!1),r!=null&&(c.isFunction(r)?t.paramsSerializer={serialize:r}:ie.assertOptions(r,{encode:N.function,serialize:N.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ie.assertOptions(t,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=n&&c.merge(n.common,n[t.method]);n&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),t.headers=_.concat(o,n);const i=[];let l=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(t)===!1)return;l=l&&y.synchronous;const b=t.transitional||Se;b&&b.legacyInterceptorReqResOrdering?i.unshift(y.fulfilled,y.rejected):i.push(y.fulfilled,y.rejected)});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,h=0,m;if(!l){const f=[Ze.bind(this),void 0];for(f.unshift(...i),f.push(...d),m=f.length,u=Promise.resolve(t);h<m;)u=u.then(f[h++],f[h++]);return u}m=i.length;let q=t;for(;h<m;){const f=i[h++],y=i[h++];try{q=f(q)}catch(b){y.call(this,b);break}}try{u=Ze.call(this,q)}catch(f){return Promise.reject(f)}for(h=0,m=d.length;h<m;)u=u.then(d[h++],d[h++]);return u}getUri(e){e=M(this.defaults,e);const t=bt(e.baseURL,e.url,e.allowAbsoluteUrls);return ht(t,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){j.prototype[e]=function(t,s){return this.request(M(s||{},{method:e,url:t,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(e){function t(s){return function(n,o,i){return this.request(M(i||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}j.prototype[e]=t(),j.prototype[e+"Form"]=t(!0)});let rr=class qt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});const s=this;this.promise.then(r=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](r);s._listeners=null}),this.promise.then=r=>{let n;const o=new Promise(i=>{s.subscribe(i),n=i}).then(r);return o.cancel=function(){s.unsubscribe(n)},o},e(function(n,o,i){s.reason||(s.reason=new Y(n,o,i),t(s.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 t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new qt(function(r){e=r}),cancel:e}}};function ar(a){return function(t){return a.apply(null,t)}}function nr(a){return c.isObject(a)&&a.isAxiosError===!0}const Ie={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ie).forEach(([a,e])=>{Ie[e]=a});function Rt(a){const e=new j(a),t=tt(j.prototype.request,e);return c.extend(t,j.prototype,e,{allOwnKeys:!0}),c.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Rt(M(a,r))},t}const C=Rt(Z);C.Axios=j;C.CanceledError=Y;C.CancelToken=rr;C.isCancel=gt;C.VERSION=Pt;C.toFormData=he;C.AxiosError=P;C.Cancel=C.CanceledError;C.all=function(e){return Promise.all(e)};C.spread=ar;C.isAxiosError=nr;C.mergeConfig=M;C.AxiosHeaders=_;C.formToJSON=a=>pt(c.isHTMLForm(a)?new FormData(a):a);C.getAdapter=wt.getAdapter;C.HttpStatusCode=Ie;C.default=C;const{Axios:wr,AxiosError:Pr,CanceledError:qr,isCancel:Rr,CancelToken:Ir,VERSION:Cr,all:Fr,Cancel:Er,isAxiosError:Sr,spread:Tr,toFormData:xr,AxiosHeaders:Or,HttpStatusCode:$r,formToJSON:_r,getAdapter:Nr,mergeConfig:vr}=C,or="/@api/deki";class w{axiosInstance=C.create();format="json";debug;constructor(e,t,s="json",r){if(this.debug=Ce("cxone-expert:requests",r),!e)throw this.debug("TLD is required to initialize Requests module"),new Error("TLD is required");if(!t)throw this.debug("Auth object is required to initialize Requests module"),new Error("Auth object is required");let n=e;!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`https://${n}`),n.endsWith("/")&&(n=n.slice(0,n.length-1)),this.format=s,this.axiosInstance=C.create({baseURL:`${n}${or}`,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...t}}),this.setupInterceptors()}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{if(this.debug(`→ ${e.method?.toUpperCase()} ${e.baseURL}${e.url}`),e.params&&Object.keys(e.params).length>0&&this.debug(" Query params:",JSON.stringify(e.params)),e.data&&e.headers?.["Content-Type"]!=="application/octet-stream"){const t=typeof e.data=="string"?e.data:JSON.stringify(e.data);t.length>200?this.debug(" Body:",t.substring(0,200)+"... (truncated)"):t.length>0&&this.debug(" Body:",t)}return e},e=>(this.debug("✗ Request error:",e.message),Promise.reject(e))),this.axiosInstance.interceptors.response.use(e=>{if(this.debug(`← ${e.status} ${e.config.method?.toUpperCase()} ${e.config.url}`),e.data&&e.headers["content-type"]?.includes("application/json")){const t=JSON.stringify(e.data);t.length>200?this.debug(" Response:",t.substring(0,200)+"... (truncated)"):this.debug(" Response:",t)}else e.headers["content-type"]?.includes("text/")?this.debug(" Response: [text content]"):e.data&&this.debug(" Response: [binary content]");return e},e=>{if(e.response){if(this.debug(`✗ ${e.response.status} ${e.config?.method?.toUpperCase()} ${e.config?.url}`),this.debug(" Error:",e.response.statusText),e.response.data){const t=typeof e.response.data=="string"?e.response.data:JSON.stringify(e.response.data);t.length>200?this.debug(" Error details:",t.substring(0,200)+"... (truncated)"):this.debug(" Error details:",t)}}else e.request?this.debug("✗ No response received:",e.message):this.debug("✗ Request setup error:",e.message);return Promise.reject(e)})}getFormatParam(){return{"dream.out.format":this.format}}async get(e,t){return await this.axiosInstance.get(e,{...t,params:{...t?.params,...this.getFormatParam()}})}async post(e,t,s){return await this.axiosInstance.post(e,t,{...s})}async put(e,t,s){return await this.axiosInstance.put(e,t,{...s})}async patch(e,t,s){return await this.axiosInstance.patch(e,t,{...s})}async del(e,t){return await this.axiosInstance.delete(e,{...t})}async head(e,t){return await this.axiosInstance.head(e,{...t})}}class ir{globals;_auth;debug;constructor(e,t){this.globals=e,this._auth=t,this.debug=Ce("cxone-expert-node:pages",e.debug),this.debug("Pages module initialized")}parsePageId(e){return typeof e=="number"?e.toString():e==="home"?e:`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return`${encodeURIComponent(encodeURIComponent(e))}`}createRequests(e,t){return new w(e,t,"json",this.globals.debug)}async getPages(e,t){this.debug("getPages called");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages",{params:{...e}});return this.debug("getPages completed successfully"),o.data}async getPage(e,t,s){this.debug("getPage called for:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}`,{params:{...t}});return this.debug("getPage completed successfully"),l.data}async getPageContents(e,t,s){this.debug("getPageContents called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/contents`,{params:{...t}});return this.debug("getPageContents retrieved contents for page:",e),l.data}async getPageContentsExplain(e,t,s){this.debug("getPageContentsExplain called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/contents/explain`,{params:{...t}});return this.debug("getPageContentsExplain retrieved contents for page:",e),l.data}async getPageDiff(e,t,s){this.debug("getPageDiff called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/diff`,{params:{...t}});return this.debug("getPageDiff retrieved diff for page:",e),l.data}async getPageExplain(e,t,s){this.debug("getPageExplain called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageExplain retrieved explanation for page:",e),l.data}async getPageExportToken(e,t,s,r){this.debug("getPageExportToken called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).get(`/pages/${n}/export/${t}`,{params:{...s},responseType:"stream"});return this.debug("getPageExportToken successfully retrieved export for page:",e),d.data}async getPageExportTokenFilename(e,t,s,r,n){this.debug("getPageExportTokenFilename called for page:",e);const o=this.parsePageId(e),i=this.parseFileName(s),l=p(this.globals,n?.tld),d=g(this.globals,n?.auth),h=await this.createRequests(l,d).get(`/pages/${o}/export/${t}/${i}`,{params:{...r},responseType:"stream"});return this.debug("getPageExportTokenFilename successfully retrieved export for page:",e),h.data}async getPageFilesSubpages(e,t,s){this.debug("getPageFilesSubpages called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageFilesSubpages retrieved file and subpage info for page:",e),l.data}async getPageFiles(e,t,s){this.debug("getPageFiles called");const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageFiles retrieved file info for page:",e),l.data}async getPageFile(e,t,s,r){this.debug("getPageFile called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}`,{params:{...s},responseType:"stream"});return this.debug("getPageFile successfully retrieved file for page:",e),u.data}async getPageFileDescription(e,t,s,r){this.debug("getPageFileDescription called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/description`,{params:{...s},responseType:"stream"});return this.debug("getPageFileDescription successfully retrieved description for page:",e),u.data}async getPageFileInfo(e,t,s,r){this.debug("getPageFileInfo called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/info`,{params:{...s}});return this.debug("getPageFileInfo successfully retrieved info for file on page:",e),u.data}async getPageFileRevisions(e,t,s,r){this.debug("getPageFileRevisions called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/revisions`,{params:{...s}});return this.debug("getPageFileRevisions successfully retrieved revisions for file on page:",e),u.data}async getPageFind(e,t,s){this.debug("getPageFind called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/find`,{params:{...t}});return this.debug("getPageFind successfully retrieved find results for page:",e),l.data}async getPageInfo(e,t,s){this.debug("getPageInfo called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/info`,{params:{...t}});return this.debug("getPageInfo successfully retrieved info for page:",e),l.data}async getPageLinks(e,t,s){this.debug("getPageLinks called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/links`,{params:{...t}});return this.debug("getPageLinks successfully retrieved links for page:",e),l.data}async getPagePDF(e,t,s){this.debug("getPagePDF called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/pdf`,{params:{...t},responseType:"stream"});return this.debug("getPagePDF successfully retrieved PDF for page:",e),l.data}async getPagePDFFilename(e,t,s,r){this.debug("getPagePDFFilename called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/pdf/${o}`,{params:{...s},responseType:"stream"});return this.debug("getPagePDFFilename successfully retrieved PDF for page:",e),u.data}async getPageProperties(e,t,s){this.debug("getPageProperties called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/properties`,{params:{...t}});return this.debug("getPageProperties successfully retrieved properties for page:",e),l.data}async getPagePropertiesKey(e,t,s,r){this.debug("getPagePropertiesKey called for page:",e);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/properties/${o}`,{params:{...s}});return this.debug("getPagePropertiesKey successfully retrieved property key for page:",e),u.data}async getPagePropertiesKeyInfo(e,t,s,r){this.debug("getPagePropertiesKeyInfo called for page:",e);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/properties/${o}/info`,{params:{...s}});return this.debug("getPagePropertiesKeyInfo successfully retrieved property key info for page:",e),u.data}async getPageRatings(e,t,s){this.debug("getPageRatings called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/ratings`,{params:{...t}});return this.debug("getPageRatings successfully retrieved ratings for page:",e),l.data}async getPageRevisions(e,t,s){this.debug("getPageRevisions called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/revisions`,{params:{...t}});return this.debug("getPageRevisions successfully retrieved revisions for page:",e),l.data}async getPageSubpages(e,t,s){this.debug("getPageSubpages called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/subpages`,{params:{...t}});return this.debug("getPageSubpages successfully retrieved subpages for page:",e),l.data}async getPageTags(e,t,s){this.debug("getPageTags called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/tags`,{params:{...t}});return this.debug("getPageTags successfully retrieved tags for page:",e),l.data}async getPageTree(e,t,s){this.debug("getPageTree called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/tree`,{params:{...t}});return this.debug("getPageTree successfully retrieved tree for page:",e),l.data}async getPageBook(e,t){this.debug("getPageBook called");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/book",{params:{...e},responseType:"stream"});return this.debug("getPageBook successfully retrieved book"),o.data}async getPageBookFilename(e,t,s,r){this.debug("getPageBookFilename called for page:",e),this.parsePageId(e),this.parseFileName(t);const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth),l=await this.createRequests(n,o).get(`/pages/book/${t}`,{params:{...s},responseType:"stream"});return this.debug("getPageBookFilename successfully retrieved book for page:",e),l.data}async getPagesCsv(e,t){this.debug("getPagesCsv called with params");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/csv",{params:{...e},responseType:"stream"});return this.debug("getPagesCsv successfully retrieved CSV data"),o.data}async getPagesPopular(e,t){this.debug("getPagesPopular called for page.");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/popular",{params:{...e}});return this.debug("getPagesPopular successfully retrieved popular pages."),o.data}async postPageContents(e,t,s,r){this.debug("postPageContents called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).post(`/pages/${n}/contents`,t??"",{headers:{"Content-Type":"text/plain"},params:{...s}});return this.debug("postPageContents successfully updated page:",e),d.data}async putPageUnorder(e,t){this.debug("putPageUnorder called for page:",e);const s=this.parsePageId(e),r=p(this.globals,t?.tld),n=g(this.globals,t?.auth);return(await this.createRequests(r,n).put(`/pages/${s}/unorder`,"")).data}async delPageDelete(e,t,s){this.debug("delPageDelete called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}`,{params:{...t}});return this.debug("delPageDelete successfully deleted page:",e),l.data}async delPageAllowed(e,t,s){this.debug("delPageAllowed called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}/allowed`,{params:{...t}});return this.debug("delPageAllowed successfully changed permissions for page:",e),l.data}async postPageCopied(e,t,s){this.debug("postPageCopied called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/copy`,"",{params:{...t}});return this.debug("postPageCopied successfully copied page:",e),l.data}async postPageExport(e,t){this.debug("postPageExport called for page:",e);const s=this.parsePageId(e),r=p(this.globals,t?.tld),n=g(this.globals,t?.auth),i=await this.createRequests(r,n).post(`/pages/${s}/export`,"");return this.debug("postPageExport successfully exported page:",e),i.data}async delPageFileName(e,t,s,r){this.debug("delPageFileName called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/files/${o}`,{params:{...s}});return this.debug("delPageFileName successfully deleted file:",t,"from page:",e),u.data}async headPageFileName(e,t,s,r){this.debug("headPageFileName called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).head(`/pages/${n}/files/${o}`,{params:{...s}});return this.debug("headPageFileName successfully checked existence of file:",t,"on page:",e),u.data}async putPageFileName(e,t,s,r,n){this.debug("putPageFileName called for page:",e,"filename:",t);const o=this.parsePageId(e),i=this.parseFileName(t),l=p(this.globals,n?.tld),d=g(this.globals,n?.auth),h=await this.createRequests(l,d).put(`/pages/${o}/files/${i}`,s,{headers:{"Content-Type":"application/octet-stream"},params:{...r}});return this.debug("putPageFileName successfully uploaded file:",t,"to page:",e),h.data}async delPageFileNameDescription(e,t,s,r){this.debug("delPageFileNameDescription called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/files/${o}/description`,{params:{...s}});return this.debug("delPageFileNameDescription successfully deleted description for file:",t,"on page:",e),u.data}async putPageFileNameDescription(e,t,s,r){this.debug("putPageFileNameDescription called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).put(`/pages/${n}/files/${o}/description`,{params:{...s}});return this.debug("putPageFileNameDescription successfully updated description for file:",t,"on page:",e),u.data}async putPageFileNamePropertiesKey(e,t,s,r,n){this.debug("putPageFileNamePropertiesKey called for page:",e,"filename:",t,"key:",s);const o=this.parsePageId(e),i=this.parseFileName(t),l=this.parseKey(s),d=p(this.globals,n?.tld),u=g(this.globals,n?.auth),m=await this.createRequests(d,u).put(`/pages/${o}/files/${i}/properties/${l}`,"",{params:{...r}});return this.debug("putPageFileNamePropertiesKey successfully updated property key:",s,"for file:",t,"on page:",e),m.data}async putPageImport(e,t,s){this.debug("putPageImport called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/import`,"",{params:{...t}});return this.debug("putPageImport successfully imported content to page:",e),l.data}async putPageMove(e,t,s){this.debug("putPageMove called for page:",e,"to:",t?.to);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/move`,"",{params:{...t}});return this.debug("putPageMove successfully moved page:",e),l.data}async putPageOrder(e,t,s){this.debug("putPageOrder called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/order`,"",{params:{...t}});return this.debug("putPageOrder successfully updated order for page:",e),l.data}async postPageProperties(e,t,s,r,n){this.debug("postPageProperties called for page:",e,"property:",t);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),u=await this.createRequests(i,l).post(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...r}});return this.debug("postPageProperties successfully created property:",t,"for page:",e),u.data}async putPageProperties(e,t,s,r,n){this.debug("putPageProperties called for page:",e,"property:",t);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),u=await this.createRequests(i,l).put(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...r}});return this.debug("putPageProperties successfully updated property:",t,"for page:",e),u.data}async deletePagePropertiesKey(e,t,s,r){this.debug("deletePagePropertiesKey called for page:",e,"key:",t);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/properties/${o}`,{params:{...s}});return this.debug("deletePagePropertiesKey successfully deleted property key:",t,"for page:",e),u.data}async putPagePropertiesKey(e,t,s,r){this.debug("putPagePropertiesKey called for page:",e,"key:",t);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).put(`/pages/${n}/properties/${o}`,"",{params:{...s}});return this.debug("putPagePropertiesKey successfully updated property key:",t,"for page:",e),u.data}async postPageRatings(e,t,s){this.debug("postPageRatings called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/ratings`,"",{params:{...t}});return this.debug("postPageRatings successfully submitted rating for page:",e),l.data}async postPageRevert(e,t,s){this.debug("postPageRevert called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/revert`,"",{params:{...t}});return this.debug("postPageRevert successfully reverted page:",e),l.data}async deletePageSecurity(e,t,s){this.debug("deletePageSecurity called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}/security`,{params:{...t}});return this.debug("deletePageSecurity successfully deleted security settings for page:",e),l.data}async postPageSecurity(e,t,s,r){this.debug("postPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).post(`/pages/${n}/security`,t,{params:{...s}});return this.debug("postPageSecurity successfully created security settings for page:",e),d.data}async putPageSecurity(e,t,s,r){this.debug("putPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).put(`/pages/${n}/security`,t,{params:{...s}});return this.debug("putPageSecurity successfully updated security settings for page:",e),d.data}async putPageTags(e,t,s,r){this.debug("putPageTags called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).put(`/pages/${n}/tags`,t,{params:{...s}});return this.debug("putPageTags successfully updated tags for page:",e),d.data}}class lr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseGroupId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(e)}`}async getGroups(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/groups",{params:{...e}})).data}async getGroup(e,t,s){const r=this.parseGroupId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/groups/${r}`,{params:{...t}})).data}async getGroupUser(e,t,s){const r=this.parseGroupId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/groups/${r}/users`,{params:{...t}})).data}}class ur{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}async getPageHierarchyById(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`events/page-hierarchy/${r}`,{params:{...t}})).data}async getPageHierarchyDetailById(e,t,s,r){const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth);return(await new w(o,i).get(`events/page-hierarchy/${n}/${t}`,{params:{...s}})).data}async getEventPage(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`events/page/${r}`,{params:{...t}})).data}async getEventPageDetail(e,t,s,r){const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth);return(await new w(o,i).get(`/events/page/${n}/${t}`,{params:{...s}})).data}async getEventUserPage(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/events/user-page/${this.parseUserId(e)}`,{params:{...t}})).data}async getEventUserDetailPage(e,t,s,r){const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth);return(await new w(n,o).get(`/events/user-page/${this.parseUserId(e)}/${t}`,{params:{...s}})).data}}class cr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getArchive(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive",{params:{...e}})).data}async getArchiveFiles(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive/files",{params:{...e}})).data}async getArchiveFile(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/files/${e}`,{params:{...t},responseType:"stream"})).data}async getArchiveFileByName(e,t,s,r){const n=p(this.globals,r?.tld),o=this.parseFileName(t),i=g(this.globals,r?.auth);return(await new w(n,i).get(`/archive/files/${e}/${o}`,{params:{...s},responseType:"stream"})).data}async getArchiveFileInfo(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/files/${e}/info`,{params:{...t}})).data}async getArchivePages(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive/pages",{params:{...e}})).data}async getArchivePage(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}`,{params:{...t}})).data}async getArchivePageContents(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/contents`,{params:{...t}})).data}async getArchivePageInfo(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/info`,{params:{...t}})).data}async getArchivePageSubPages(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/subpages`,{params:{...t}})).data}}class dr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getSiteActivity(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/activity",{params:{...e}})).data}async getSiteExportGroups(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/export/groups")).data}async getSiteExportUsers(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/export/users")).data}async getSiteSubPagesTags(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/nav/${r}/children`,{params:{...t}})).data}async getSiteFullNavTreeTags(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/nav/${r}/full`,{params:{...t}})).data}async getSiteOperations(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/operations",{params:{...e}})).data}async getSiteProperties(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/properties",{params:{...e}})).data}async GetSiteKeyProperties(e,t,s){const r=this.parseKey(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/properties/${r}`,{params:{...t}})).data}async GetSiteKeyPropertiesInfo(e,t,s){const r=this.parseKey(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/properties/${r}/info`,{params:{...t}})).data}async GetSiteQuery(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/query",{params:{...e}})).data}async GetSiteStatus(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/status")).data}async GetSiteTags(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/tags",{params:{...e}})).data}async GetSiteTag(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/tag",{params:{...e}})).data}}class hr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getContextMaps(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/contextmaps",{params:{...e}})).data}async getContextMapsById(e,t,s,r){const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth);return(await new w(n,o).get(`/contextmaps/${e}/${t}`,{params:{...s}})).data}}class pr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getUsers(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/users",{params:{...e}})).data}async getUser(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}`,{params:{...t}})).data}async getUserMetrics(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}/metrics`,{params:{...t}})).data}async getUserProperties(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}/properties`,{params:{...t}})).data}async getUserPropertiesKey(e,t,s,r){const n=this.parseUserId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`/users/${n}/properties/${o}`,{params:{...s}})).data}async getUserPropertiesKeyInfo(e,t,s,r){const n=this.parseUserId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`/users/${n}/properties/${o}/info`,{params:{...s}})).data}async getUsersSearch(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/users/search",{params:{...e}})).data}}class gr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}`,{params:{...t},responseType:"stream"})).data}async getFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`files/${n}/${o}`,{params:{...s},responseType:"stream"})).data}async getFileDescription(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/description`,{params:{...t},responseType:"stream"})).data}async getFileInfo(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/info`,{params:{...t}})).data}async getFileRevisions(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/revisions`,{params:{...t}})).data}async deleteFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).del(`files/${r}`,{params:{...t}})).data}async headFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).head(`files/${r}`,{params:{...t}})).data}async putFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).put(`files/${r}`,"",{params:{...t}})).data}async deleteFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).del(`files/${n}/${o}`,{params:{...s}})).data}async headFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).head(`files/${n}/${o}`,{params:{...s}})).data}async putFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).put(`files/${n}/${o}`,"",{params:{...s}})).data}async postFileCopy(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).post(`files/${r}/copy`,"",{params:{...t}})).data}async delDescriptionFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).del(`files/${r}/description`,{params:{...t}})).data}}class fr{globals={};debug;_pages;_groups;_site;_auth;_archive;_events;_contextMaps;_users;_files;constructor(e){e&&(e.tld&&(this.globals.tld=e.tld),e.auth&&(this.globals.auth=e.auth),e.debug!==void 0&&(this.globals.debug=e.debug)),this.debug=Ce("cxone-expert-node",this.globals.debug),this.debug("Debug logging enabled for cxone-expert-node. This is not recommended for production use as credentials may be exposed in log files!"),this.debug("Expert instance created with options:",e)}setAuth(e){return this.globals.auth=e,this.debug("Authentication configured:",e),this}configureServerAuth(e){return this.globals.auth={type:"server",params:e},this.debug("Server authentication configured:",e),this}configureBrowserAuth(e){return this.globals.auth={type:"browser",params:e},this.debug("Browser authentication configured:",e),this}get pages(){return this._pages||(this.debug("Initializing Pages module"),this._pages=new ir(this.globals)),this._pages}get auth(){return this._auth||(this.debug("Initializing Auth module"),this._auth=new et),this._auth}get site(){return this._site||(this.debug("Initializing Site module"),this._site=new dr(this.globals)),this._site}get archive(){return this._archive||(this.debug("Initializing Archive module"),this._archive=new cr(this.globals)),this._archive}get groups(){return this._groups||(this.debug("Initializing Groups module"),this._groups=new lr(this.globals)),this._groups}get events(){return this._events||(this.debug("Initializing Events module"),this._events=new ur(this.globals)),this._events}get contextMaps(){return this._contextMaps||(this.debug("Initializing Context Maps module"),this._contextMaps=new hr(this.globals)),this._contextMaps}get users(){return this._users||(this.debug("Initializing Users module"),this._users=new pr(this.globals)),this._users}get files(){return this._files||(this.debug("Initializing Files module"),this._files=new gr(this.globals)),this._files}}module.exports=fr;
|
|
1
|
+
"use strict";const kt=require("crypto");class ht{token=null;BrowserToken({key:e}){return this.token=e,this}ServerToken({key:e,secret:s,user:t}){if(!e||!s||!t)throw new Error("Missing required parameters: key, secret, user");const a=Math.floor(Date.now()/1e3),n=kt.createHmac("sha256",s);n.update(`${e}${a}=${t}`);const o=n.digest("hex");return this.token=`${e}_${a}_=${t}_${o}`,this}getToken(){return this.token}getHeader(){return{"X-Deki-Token":this.token}}}function Lt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var pe={exports:{}},Se,Ge;function Bt(){if(Ge)return Se;Ge=1;var r=1e3,e=r*60,s=e*60,t=s*24,a=t*7,n=t*365.25;Se=function(u,h){h=h||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isFinite(u))return h.long?l(u):i(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(h){var m=parseFloat(h[1]),P=(h[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return m*n;case"weeks":case"week":case"w":return m*a;case"days":case"day":case"d":return m*t;case"hours":case"hour":case"hrs":case"hr":case"h":return m*s;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function i(u){var h=Math.abs(u);return h>=t?Math.round(u/t)+"d":h>=s?Math.round(u/s)+"h":h>=e?Math.round(u/e)+"m":h>=r?Math.round(u/r)+"s":u+"ms"}function l(u){var h=Math.abs(u);return h>=t?c(u,h,t,"day"):h>=s?c(u,h,s,"hour"):h>=e?c(u,h,e,"minute"):h>=r?c(u,h,r,"second"):u+" ms"}function c(u,h,m,P){var C=h>=m*1.5;return Math.round(u/m)+" "+P+(C?"s":"")}return Se}var _e,Xe;function jt(){if(Xe)return _e;Xe=1;function r(e){t.debug=t,t.default=t,t.coerce=c,t.disable=i,t.enable=n,t.enabled=l,t.humanize=Bt(),t.destroy=u,Object.keys(e).forEach(h=>{t[h]=e[h]}),t.names=[],t.skips=[],t.formatters={};function s(h){let m=0;for(let P=0;P<h.length;P++)m=(m<<5)-m+h.charCodeAt(P),m|=0;return t.colors[Math.abs(m)%t.colors.length]}t.selectColor=s;function t(h){let m,P=null,C,w;function b(...y){if(!b.enabled)return;const I=b,E=Number(new Date),F=E-(m||E);I.diff=F,I.prev=m,I.curr=E,m=E,y[0]=t.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let v=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(j,ee)=>{if(j==="%%")return"%";v++;const te=t.formatters[ee];if(typeof te=="function"){const k=y[v];j=te.call(I,k),y.splice(v,1),v--}return j}),t.formatArgs.call(I,y),(I.log||t.log).apply(I,y)}return b.namespace=h,b.useColors=t.useColors(),b.color=t.selectColor(h),b.extend=a,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>P!==null?P:(C!==t.namespaces&&(C=t.namespaces,w=t.enabled(h)),w),set:y=>{P=y}}),typeof t.init=="function"&&t.init(b),b}function a(h,m){const P=t(this.namespace+(typeof m>"u"?":":m)+h);return P.log=this.log,P}function n(h){t.save(h),t.namespaces=h,t.names=[],t.skips=[];const m=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const P of m)P[0]==="-"?t.skips.push(P.slice(1)):t.names.push(P)}function o(h,m){let P=0,C=0,w=-1,b=0;for(;P<h.length;)if(C<m.length&&(m[C]===h[P]||m[C]==="*"))m[C]==="*"?(w=C,b=P,C++):(P++,C++);else if(w!==-1)C=w+1,b++,P=b;else return!1;for(;C<m.length&&m[C]==="*";)C++;return C===m.length}function i(){const h=[...t.names,...t.skips.map(m=>"-"+m)].join(",");return t.enable(""),h}function l(h){for(const m of t.skips)if(o(h,m))return!1;for(const m of t.names)if(o(h,m))return!0;return!1}function c(h){return h instanceof Error?h.stack||h.message:h}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}return _e=r,_e}var Qe;function Mt(){return Qe||(Qe=1,(function(r,e){e.formatArgs=t,e.save=a,e.load=n,e.useColors=s,e.storage=o(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function t(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,h=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(u++,m==="%c"&&(h=u))}),l.splice(h,0,c)}e.log=console.debug||console.log||(()=>{});function a(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function n(){let l;try{l=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}r.exports=jt()(e);const{formatters:i}=r.exports;i.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(pe,pe.exports)),pe.exports}var Ht=Mt();const zt=Lt(Ht);function Le(r,e){const s=zt(r);return e!==void 0&&(s.enabled=e),s}function p(r,e){if(!e&&!r.tld)throw new Error("TLD is required");return e??r.tld}function g(r,e){if(e)return e;if(r.auth){const s=new ht;if(r.auth.type==="server")return s.ServerToken(r.auth.params).getHeader();if(r.auth.type==="browser")return s.BrowserToken(r.auth.params).getHeader()}throw new Error("Authentication is required. Configure auth in Expert constructor or pass auth to method call.")}function f(r,e){if(!(!r.headers&&!e))return{...r.headers,...e}}function pt(r,e){return function(){return r.apply(e,arguments)}}const{toString:Kt}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:Pe,toStringTag:gt}=Symbol,Re=(r=>e=>{const s=Kt.call(e);return r[s]||(r[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),D=r=>(r=r.toLowerCase(),e=>Re(e)===r),qe=r=>e=>typeof e===r,{isArray:Y}=Array,Z=qe("undefined");function ne(r){return r!==null&&!Z(r)&&r.constructor!==null&&!Z(r.constructor)&&N(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const ft=D("ArrayBuffer");function Jt(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&ft(r.buffer),e}const Vt=qe("string"),N=qe("function"),bt=qe("number"),oe=r=>r!==null&&typeof r=="object",At=r=>r===!0||r===!1,fe=r=>{if(Re(r)!=="object")return!1;const e=we(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(gt in r)&&!(Pe in r)},Wt=r=>{if(!oe(r)||ne(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Gt=D("Date"),Xt=D("File"),Qt=r=>!!(r&&typeof r.uri<"u"),Zt=r=>r&&typeof r.getParts<"u",Yt=D("Blob"),es=D("FileList"),ts=r=>oe(r)&&N(r.pipe);function ss(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ze=ss(),Ye=typeof Ze.FormData<"u"?Ze.FormData:void 0,as=r=>{if(!r)return!1;if(Ye&&r instanceof Ye)return!0;const e=we(r);if(!e||e===Object.prototype||!N(r.append))return!1;const s=Re(r);return s==="formdata"||s==="object"&&N(r.toString)&&r.toString()==="[object FormData]"},rs=D("URLSearchParams"),[ns,os,is,ls]=["ReadableStream","Request","Response","Headers"].map(D),cs=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ie(r,e,{allOwnKeys:s=!1}={}){if(r===null||typeof r>"u")return;let t,a;if(typeof r!="object"&&(r=[r]),Y(r))for(t=0,a=r.length;t<a;t++)e.call(null,r[t],t,r);else{if(ne(r))return;const n=s?Object.getOwnPropertyNames(r):Object.keys(r),o=n.length;let i;for(t=0;t<o;t++)i=n[t],e.call(null,r[i],i,r)}}function mt(r,e){if(ne(r))return null;e=e.toLowerCase();const s=Object.keys(r);let t=s.length,a;for(;t-- >0;)if(a=s[t],e===a.toLowerCase())return a;return null}const A=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,yt=r=>!Z(r)&&r!==A;function Ne(...r){const{caseless:e,skipUndefined:s}=yt(this)&&this||{},t={},a=(n,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=e&&mt(t,o)||o,l=$e(t,i)?t[i]:void 0;fe(l)&&fe(n)?t[i]=Ne(l,n):fe(n)?t[i]=Ne({},n):Y(n)?t[i]=n.slice():(!s||!Z(n))&&(t[i]=n)};for(let n=0,o=r.length;n<o;n++)r[n]&&ie(r[n],a);return t}const us=(r,e,s,{allOwnKeys:t}={})=>(ie(e,(a,n)=>{s&&N(a)?Object.defineProperty(r,n,{__proto__:null,value:pt(a,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,n,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:t}),r),ds=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),hs=(r,e,s,t)=>{r.prototype=Object.create(e.prototype,t),Object.defineProperty(r.prototype,"constructor",{__proto__:null,value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{__proto__:null,value:e.prototype}),s&&Object.assign(r.prototype,s)},ps=(r,e,s,t)=>{let a,n,o;const i={};if(e=e||{},r==null)return e;do{for(a=Object.getOwnPropertyNames(r),n=a.length;n-- >0;)o=a[n],(!t||t(o,r,e))&&!i[o]&&(e[o]=r[o],i[o]=!0);r=s!==!1&&we(r)}while(r&&(!s||s(r,e))&&r!==Object.prototype);return e},gs=(r,e,s)=>{r=String(r),(s===void 0||s>r.length)&&(s=r.length),s-=e.length;const t=r.indexOf(e,s);return t!==-1&&t===s},fs=r=>{if(!r)return null;if(Y(r))return r;let e=r.length;if(!bt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=r[e];return s},bs=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&we(Uint8Array)),ms=(r,e)=>{const t=(r&&r[Pe]).call(r);let a;for(;(a=t.next())&&!a.done;){const n=a.value;e.call(r,n[0],n[1])}},ys=(r,e)=>{let s;const t=[];for(;(s=r.exec(e))!==null;)t.push(s);return t},ws=D("HTMLFormElement"),Ps=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,t,a){return t.toUpperCase()+a}),$e=(({hasOwnProperty:r})=>(e,s)=>r.call(e,s))(Object.prototype),Rs=D("RegExp"),wt=(r,e)=>{const s=Object.getOwnPropertyDescriptors(r),t={};ie(s,(a,n)=>{let o;(o=e(a,n,r))!==!1&&(t[n]=o||a)}),Object.defineProperties(r,t)},qs=r=>{wt(r,(e,s)=>{if(N(r)&&["arguments","caller","callee"].includes(s))return!1;const t=r[s];if(N(t)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},Cs=(r,e)=>{const s={},t=a=>{a.forEach(n=>{s[n]=!0})};return Y(r)?t(r):t(String(r).split(e)),s},Is=()=>{},Es=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Fs(r){return!!(r&&N(r.append)&&r[gt]==="FormData"&&r[Pe])}const Ss=r=>{const e=new WeakSet,s=t=>{if(oe(t)){if(e.has(t))return;if(ne(t))return t;if(!("toJSON"in t)){e.add(t);const a=Y(t)?[]:{};return ie(t,(n,o)=>{const i=s(n);!Z(i)&&(a[o]=i)}),e.delete(t),a}}return t};return s(r)},_s=D("AsyncFunction"),vs=r=>r&&(oe(r)||N(r))&&N(r.then)&&N(r.catch),Pt=((r,e)=>r?setImmediate:e?((s,t)=>(A.addEventListener("message",({source:a,data:n})=>{a===A&&n===s&&t.length&&t.shift()()},!1),a=>{t.push(a),A.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",N(A.postMessage)),Os=typeof queueMicrotask<"u"?queueMicrotask.bind(A):typeof process<"u"&&process.nextTick||Pt,xs=r=>r!=null&&N(r[Pe]),d={isArray:Y,isArrayBuffer:ft,isBuffer:ne,isFormData:as,isArrayBufferView:Jt,isString:Vt,isNumber:bt,isBoolean:At,isObject:oe,isPlainObject:fe,isEmptyObject:Wt,isReadableStream:ns,isRequest:os,isResponse:is,isHeaders:ls,isUndefined:Z,isDate:Gt,isFile:Xt,isReactNativeBlob:Qt,isReactNative:Zt,isBlob:Yt,isRegExp:Rs,isFunction:N,isStream:ts,isURLSearchParams:rs,isTypedArray:bs,isFileList:es,forEach:ie,merge:Ne,extend:us,trim:cs,stripBOM:ds,inherits:hs,toFlatObject:ps,kindOf:Re,kindOfTest:D,endsWith:gs,toArray:fs,forEachEntry:ms,matchAll:ys,isHTMLForm:ws,hasOwnProperty:$e,hasOwnProp:$e,reduceDescriptors:wt,freezeMethods:qs,toObjectSet:Cs,toCamelCase:Ps,noop:Is,toFiniteNumber:Es,findKey:mt,global:A,isContextDefined:yt,isSpecCompliantForm:Fs,toJSONObject:Ss,isAsyncFn:_s,isThenable:vs,setImmediate:Pt,asap:Os,isIterable:xs},Ts=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"]),Ns=r=>{const e={};let s,t,a;return r&&r.split(`
|
|
2
|
+
`).forEach(function(o){a=o.indexOf(":"),s=o.substring(0,a).trim().toLowerCase(),t=o.substring(a+1).trim(),!(!s||e[s]&&Ts[s])&&(s==="set-cookie"?e[s]?e[s].push(t):e[s]=[t]:e[s]=e[s]?e[s]+", "+t:t)}),e};function $s(r){let e=0,s=r.length;for(;e<s;){const t=r.charCodeAt(e);if(t!==9&&t!==32)break;e+=1}for(;s>e;){const t=r.charCodeAt(s-1);if(t!==9&&t!==32)break;s-=1}return e===0&&s===r.length?r:r.slice(e,s)}const Us=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ds=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Be(r,e){return d.isArray(r)?r.map(s=>Be(s,e)):$s(String(r).replace(e,""))}const ks=r=>Be(r,Us),Ls=r=>Be(r,Ds);function Rt(r){const e=Object.create(null);return d.forEach(r.toJSON(),(s,t)=>{e[t]=Ls(s)}),e}const et=Symbol("internals");function re(r){return r&&String(r).trim().toLowerCase()}function be(r){return r===!1||r==null?r:d.isArray(r)?r.map(be):ks(String(r))}function Bs(r){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=s.exec(r);)e[t[1]]=t[2];return e}const js=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ve(r,e,s,t,a){if(d.isFunction(t))return t.call(this,e,s);if(a&&(e=s),!!d.isString(e)){if(d.isString(t))return e.indexOf(t)!==-1;if(d.isRegExp(t))return t.test(e)}}function Ms(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,t)=>s.toUpperCase()+t)}function Hs(r,e){const s=d.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(r,t+s,{__proto__:null,value:function(a,n,o){return this[t].call(this,e,a,n,o)},configurable:!0})})}let T=class{constructor(e){e&&this.set(e)}set(e,s,t){const a=this;function n(i,l,c){const u=re(l);if(!u)throw new Error("header name must be a non-empty string");const h=d.findKey(a,u);(!h||a[h]===void 0||c===!0||c===void 0&&a[h]!==!1)&&(a[h||l]=be(i))}const o=(i,l)=>d.forEach(i,(c,u)=>n(c,u,l));if(d.isPlainObject(e)||e instanceof this.constructor)o(e,s);else if(d.isString(e)&&(e=e.trim())&&!js(e))o(Ns(e),s);else if(d.isObject(e)&&d.isIterable(e)){let i={},l,c;for(const u of e){if(!d.isArray(u))throw TypeError("Object iterator must return a key-value pair");i[c=u[0]]=(l=i[c])?d.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(i,s)}else e!=null&&n(s,e,t);return this}get(e,s){if(e=re(e),e){const t=d.findKey(this,e);if(t){const a=this[t];if(!s)return a;if(s===!0)return Bs(a);if(d.isFunction(s))return s.call(this,a,t);if(d.isRegExp(s))return s.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,s){if(e=re(e),e){const t=d.findKey(this,e);return!!(t&&this[t]!==void 0&&(!s||ve(this,this[t],t,s)))}return!1}delete(e,s){const t=this;let a=!1;function n(o){if(o=re(o),o){const i=d.findKey(t,o);i&&(!s||ve(t,t[i],i,s))&&(delete t[i],a=!0)}}return d.isArray(e)?e.forEach(n):n(e),a}clear(e){const s=Object.keys(this);let t=s.length,a=!1;for(;t--;){const n=s[t];(!e||ve(this,this[n],n,e,!0))&&(delete this[n],a=!0)}return a}normalize(e){const s=this,t={};return d.forEach(this,(a,n)=>{const o=d.findKey(t,n);if(o){s[o]=be(a),delete s[n];return}const i=e?Ms(n):String(n).trim();i!==n&&delete s[n],s[i]=be(a),t[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const s=Object.create(null);return d.forEach(this,(t,a)=>{t!=null&&t!==!1&&(s[a]=e&&d.isArray(t)?t.join(", "):t)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,s])=>e+": "+s).join(`
|
|
3
|
+
`)}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,...s){const t=new this(e);return s.forEach(a=>t.set(a)),t}static accessor(e){const t=(this[et]=this[et]={accessors:{}}).accessors,a=this.prototype;function n(o){const i=re(o);t[i]||(Hs(a,o),t[i]=!0)}return d.isArray(e)?e.forEach(n):n(e),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(T.prototype,({value:r},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(t){this[s]=t}}});d.freezeMethods(T);const zs="[REDACTED ****]";function Ks(r){if(d.hasOwnProp(r,"toJSON"))return!0;let e=Object.getPrototypeOf(r);for(;e&&e!==Object.prototype;){if(d.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function Js(r,e){const s=new Set(e.map(n=>String(n).toLowerCase())),t=[],a=n=>{if(n===null||typeof n!="object"||d.isBuffer(n))return n;if(t.indexOf(n)!==-1)return;n instanceof T&&(n=n.toJSON()),t.push(n);let o;if(d.isArray(n))o=[],n.forEach((i,l)=>{const c=a(i);d.isUndefined(c)||(o[l]=c)});else{if(!d.isPlainObject(n)&&Ks(n))return t.pop(),n;o=Object.create(null);for(const[i,l]of Object.entries(n)){const c=s.has(i.toLowerCase())?zs:a(l);d.isUndefined(c)||(o[i]=c)}}return t.pop(),o};return a(r)}let R=class qt extends Error{static from(e,s,t,a,n,o){const i=new qt(e.message,s||e.code,t,a,n);return i.cause=e,i.name=e.name,e.status!=null&&i.status==null&&(i.status=e.status),o&&Object.assign(i,o),i}constructor(e,s,t,a,n){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),t&&(this.config=t),a&&(this.request=a),n&&(this.response=n,this.status=n.status)}toJSON(){const e=this.config,s=e&&d.hasOwnProp(e,"redact")?e.redact:void 0,t=d.isArray(s)&&s.length>0?Js(e,s):d.toJSONObject(e);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:t,code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";R.ERR_BAD_OPTION="ERR_BAD_OPTION";R.ECONNABORTED="ECONNABORTED";R.ETIMEDOUT="ETIMEDOUT";R.ECONNREFUSED="ECONNREFUSED";R.ERR_NETWORK="ERR_NETWORK";R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";R.ERR_DEPRECATED="ERR_DEPRECATED";R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";R.ERR_BAD_REQUEST="ERR_BAD_REQUEST";R.ERR_CANCELED="ERR_CANCELED";R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";R.ERR_INVALID_URL="ERR_INVALID_URL";R.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Vs=null;function Ue(r){return d.isPlainObject(r)||d.isArray(r)}function Ct(r){return d.endsWith(r,"[]")?r.slice(0,-2):r}function Oe(r,e,s){return r?r.concat(e).map(function(a,n){return a=Ct(a),!s&&n?"["+a+"]":a}).join(s?".":""):e}function As(r){return d.isArray(r)&&!r.some(Ue)}const Ws=d.toFlatObject(d,{},null,function(e){return/^is[A-Z]/.test(e)});function Ce(r,e,s){if(!d.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,s=d.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,y){return!d.isUndefined(y[b])});const t=s.metaTokens,a=s.visitor||h,n=s.dots,o=s.indexes,i=s.Blob||typeof Blob<"u"&&Blob,l=s.maxDepth===void 0?100:s.maxDepth,c=i&&d.isSpecCompliantForm(e);if(!d.isFunction(a))throw new TypeError("visitor must be a function");function u(w){if(w===null)return"";if(d.isDate(w))return w.toISOString();if(d.isBoolean(w))return w.toString();if(!c&&d.isBlob(w))throw new R("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(w)||d.isTypedArray(w)?c&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function h(w,b,y){let I=w;if(d.isReactNative(e)&&d.isReactNativeBlob(w))return e.append(Oe(y,b,n),u(w)),!1;if(w&&!y&&typeof w=="object"){if(d.endsWith(b,"{}"))b=t?b:b.slice(0,-2),w=JSON.stringify(w);else if(d.isArray(w)&&As(w)||(d.isFileList(w)||d.endsWith(b,"[]"))&&(I=d.toArray(w)))return b=Ct(b),I.forEach(function(F,v){!(d.isUndefined(F)||F===null)&&e.append(o===!0?Oe([b],v,n):o===null?b:b+"[]",u(F))}),!1}return Ue(w)?!0:(e.append(Oe(y,b,n),u(w)),!1)}const m=[],P=Object.assign(Ws,{defaultVisitor:h,convertValue:u,isVisitable:Ue});function C(w,b,y=0){if(!d.isUndefined(w)){if(y>l)throw new R("Object is too deeply nested ("+y+" levels). Max depth: "+l,R.ERR_FORM_DATA_DEPTH_EXCEEDED);if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+b.join("."));m.push(w),d.forEach(w,function(E,F){(!(d.isUndefined(E)||E===null)&&a.call(e,E,d.isString(F)?F.trim():F,b,P))===!0&&C(E,b?b.concat(F):[F],y+1)}),m.pop()}}if(!d.isObject(r))throw new TypeError("data must be an object");return C(r),e}function tt(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(r).replace(/[!'()~]|%20/g,function(t){return e[t]})}function je(r,e){this._pairs=[],r&&Ce(r,this,e)}const It=je.prototype;It.append=function(e,s){this._pairs.push([e,s])};It.toString=function(e){const s=e?function(t){return e.call(this,t,tt)}:tt;return this._pairs.map(function(a){return s(a[0])+"="+s(a[1])},"").join("&")};function Gs(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Et(r,e,s){if(!e)return r;const t=s&&s.encode||Gs,a=d.isFunction(s)?{serialize:s}:s,n=a&&a.serialize;let o;if(n?o=n(e,a):o=d.isURLSearchParams(e)?e.toString():new je(e,a).toString(t),o){const i=r.indexOf("#");i!==-1&&(r=r.slice(0,i)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class st{constructor(){this.handlers=[]}use(e,s,t){return this.handlers.push({fulfilled:e,rejected:s,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){d.forEach(this.handlers,function(t){t!==null&&e(t)})}}const Me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Xs=typeof URLSearchParams<"u"?URLSearchParams:je,Qs=typeof FormData<"u"?FormData:null,Zs=typeof Blob<"u"?Blob:null,Ys={isBrowser:!0,classes:{URLSearchParams:Xs,FormData:Qs,Blob:Zs},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",De=typeof navigator=="object"&&navigator||void 0,ea=He&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0),ta=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",sa=He&&window.location.href||"http://localhost",aa=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:ea,hasStandardBrowserWebWorkerEnv:ta,navigator:De,origin:sa},Symbol.toStringTag,{value:"Module"})),x={...aa,...Ys};function ra(r,e){return Ce(r,new x.classes.URLSearchParams,{visitor:function(s,t,a,n){return x.isNode&&d.isBuffer(s)?(this.append(t,s.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function na(r){return d.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function oa(r){const e={},s=Object.keys(r);let t;const a=s.length;let n;for(t=0;t<a;t++)n=s[t],e[n]=r[n];return e}function Ft(r){function e(s,t,a,n){let o=s[n++];if(o==="__proto__")return!0;const i=Number.isFinite(+o),l=n>=s.length;return o=!o&&d.isArray(a)?a.length:o,l?(d.hasOwnProp(a,o)?a[o]=d.isArray(a[o])?a[o].concat(t):[a[o],t]:a[o]=t,!i):((!d.hasOwnProp(a,o)||!d.isObject(a[o]))&&(a[o]=[]),e(s,t,a[o],n)&&d.isArray(a[o])&&(a[o]=oa(a[o])),!i)}if(d.isFormData(r)&&d.isFunction(r.entries)){const s={};return d.forEachEntry(r,(t,a)=>{e(na(t),a,s,0)}),s}return null}const Q=(r,e)=>r!=null&&d.hasOwnProp(r,e)?r[e]:void 0;function ia(r,e,s){if(d.isString(r))try{return(e||JSON.parse)(r),d.trim(r)}catch(t){if(t.name!=="SyntaxError")throw t}return(s||JSON.stringify)(r)}const le={transitional:Me,adapter:["xhr","http","fetch"],transformRequest:[function(e,s){const t=s.getContentType()||"",a=t.indexOf("application/json")>-1,n=d.isObject(e);if(n&&d.isHTMLForm(e)&&(e=new FormData(e)),d.isFormData(e))return a?JSON.stringify(Ft(e)):e;if(d.isArrayBuffer(e)||d.isBuffer(e)||d.isStream(e)||d.isFile(e)||d.isBlob(e)||d.isReadableStream(e))return e;if(d.isArrayBufferView(e))return e.buffer;if(d.isURLSearchParams(e))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(n){const l=Q(this,"formSerializer");if(t.indexOf("application/x-www-form-urlencoded")>-1)return ra(e,l).toString();if((i=d.isFileList(e))||t.indexOf("multipart/form-data")>-1){const c=Q(this,"env"),u=c&&c.FormData;return Ce(i?{"files[]":e}:e,u&&new u,l)}}return n||a?(s.setContentType("application/json",!1),ia(e)):e}],transformResponse:[function(e){const s=Q(this,"transitional")||le.transitional,t=s&&s.forcedJSONParsing,a=Q(this,"responseType"),n=a==="json";if(d.isResponse(e)||d.isReadableStream(e))return e;if(e&&d.isString(e)&&(t&&!a||n)){const i=!(s&&s.silentJSONParsing)&&n;try{return JSON.parse(e,Q(this,"parseReviver"))}catch(l){if(i)throw l.name==="SyntaxError"?R.from(l,R.ERR_BAD_RESPONSE,this,null,Q(this,"response")):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch","query"],r=>{le.headers[r]={}});function xe(r,e){const s=this||le,t=e||s,a=T.from(t.headers);let n=t.data;return d.forEach(r,function(i){n=i.call(s,n,a.normalize(),e?e.status:void 0)}),a.normalize(),n}function St(r){return!!(r&&r.__CANCEL__)}let ce=class extends R{constructor(e,s,t){super(e??"canceled",R.ERR_CANCELED,s,t),this.name="CanceledError",this.__CANCEL__=!0}};function _t(r,e,s){const t=s.config.validateStatus;!s.status||!t||t(s.status)?r(s):e(new R("Request failed with status code "+s.status,s.status>=400&&s.status<500?R.ERR_BAD_REQUEST:R.ERR_BAD_RESPONSE,s.config,s.request,s))}function la(r){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r);return e&&e[1]||""}function ca(r,e){r=r||10;const s=new Array(r),t=new Array(r);let a=0,n=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=t[n];o||(o=c),s[a]=l,t[a]=c;let h=n,m=0;for(;h!==a;)m+=s[h++],h=h%r;if(a=(a+1)%r,a===n&&(n=(n+1)%r),c-o<e)return;const P=u&&c-u;return P?Math.round(m*1e3/P):void 0}}function ua(r,e){let s=0,t=1e3/e,a,n;const o=(c,u=Date.now())=>{s=u,a=null,n&&(clearTimeout(n),n=null),r(...c)};return[(...c)=>{const u=Date.now(),h=u-s;h>=t?o(c,u):(a=c,n||(n=setTimeout(()=>{n=null,o(a)},t-h)))},()=>a&&o(a)]}const ye=(r,e,s=3)=>{let t=0;const a=ca(50,250);return ua(n=>{if(!n||typeof n.loaded!="number")return;const o=n.loaded,i=n.lengthComputable?n.total:void 0,l=i!=null?Math.min(o,i):o,c=Math.max(0,l-t),u=a(c);t=Math.max(t,l);const h={loaded:l,total:i,progress:i?l/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i?(i-l)/u:void 0,event:n,lengthComputable:i!=null,[e?"download":"upload"]:!0};r(h)},s)},at=(r,e)=>{const s=r!=null;return[t=>e[0]({lengthComputable:s,total:r,loaded:t}),e[1]]},rt=r=>(...e)=>d.asap(()=>r(...e)),da=x.hasStandardBrowserEnv?((r,e)=>s=>(s=new URL(s,x.origin),r.protocol===s.protocol&&r.host===s.host&&(e||r.port===s.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0,ha=x.hasStandardBrowserEnv?{write(r,e,s,t,a,n,o){if(typeof document>"u")return;const i=[`${r}=${encodeURIComponent(e)}`];d.isNumber(s)&&i.push(`expires=${new Date(s).toUTCString()}`),d.isString(t)&&i.push(`path=${t}`),d.isString(a)&&i.push(`domain=${a}`),n===!0&&i.push("secure"),d.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(r){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let s=0;s<e.length;s++){const t=e[s].replace(/^\s+/,""),a=t.indexOf("=");if(a!==-1&&t.slice(0,a)===r)return decodeURIComponent(t.slice(a+1))}return null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function pa(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function ga(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function vt(r,e,s){let t=!pa(e);return r&&(t||s===!1)?ga(r,e):e}const nt=r=>r instanceof T?{...r}:r;function G(r,e){e=e||{};const s=Object.create(null);Object.defineProperty(s,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function t(c,u,h,m){return d.isPlainObject(c)&&d.isPlainObject(u)?d.merge.call({caseless:m},c,u):d.isPlainObject(u)?d.merge({},u):d.isArray(u)?u.slice():u}function a(c,u,h,m){if(d.isUndefined(u)){if(!d.isUndefined(c))return t(void 0,c,h,m)}else return t(c,u,h,m)}function n(c,u){if(!d.isUndefined(u))return t(void 0,u)}function o(c,u){if(d.isUndefined(u)){if(!d.isUndefined(c))return t(void 0,c)}else return t(void 0,u)}function i(c,u,h){if(d.hasOwnProp(e,h))return t(c,u);if(d.hasOwnProp(r,h))return t(void 0,c)}const l={url:n,method:n,data:n,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,allowedSocketPaths:o,responseEncoding:o,validateStatus:i,headers:(c,u,h)=>a(nt(c),nt(u),h,!0)};return d.forEach(Object.keys({...r,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=d.hasOwnProp(l,u)?l[u]:a,m=d.hasOwnProp(r,u)?r[u]:void 0,P=d.hasOwnProp(e,u)?e[u]:void 0,C=h(m,P,u);d.isUndefined(C)&&h!==i||(s[u]=C)}),s}const fa=["content-type","content-length"];function ba(r,e,s){if(s!=="content-only"){r.set(e);return}Object.entries(e).forEach(([t,a])=>{fa.includes(t.toLowerCase())&&r.set(t,a)})}const ma=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(e,s)=>String.fromCharCode(parseInt(s,16))),Ot=r=>{const e=G({},r),s=m=>d.hasOwnProp(e,m)?e[m]:void 0,t=s("data");let a=s("withXSRFToken");const n=s("xsrfHeaderName"),o=s("xsrfCookieName");let i=s("headers");const l=s("auth"),c=s("baseURL"),u=s("allowAbsoluteUrls"),h=s("url");if(e.headers=i=T.from(i),e.url=Et(vt(c,h,u),r.params,r.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?ma(l.password):""))),d.isFormData(t)&&(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):d.isFunction(t.getHeaders)&&ba(i,t.getHeaders(),s("formDataHeaderPolicy"))),x.hasStandardBrowserEnv&&(d.isFunction(a)&&(a=a(e)),a===!0||a==null&&da(e.url))){const P=n&&o&&ha.read(o);P&&i.set(n,P)}return e},ya=typeof XMLHttpRequest<"u",wa=ya&&function(r){return new Promise(function(s,t){const a=Ot(r);let n=a.data;const o=T.from(a.headers).normalize();let{responseType:i,onUploadProgress:l,onDownloadProgress:c}=a,u,h,m,P,C;function w(){P&&P(),C&&C(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function y(){if(!b)return;const E=T.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),v={data:!i||i==="text"||i==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:E,config:r,request:b};_t(function(j){s(j),w()},function(j){t(j),w()},v),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(y)},b.onabort=function(){b&&(t(new R("Request aborted",R.ECONNABORTED,r,b)),w(),b=null)},b.onerror=function(F){const v=F&&F.message?F.message:"Network Error",H=new R(v,R.ERR_NETWORK,r,b);H.event=F||null,t(H),w(),b=null},b.ontimeout=function(){let F=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const v=a.transitional||Me;a.timeoutErrorMessage&&(F=a.timeoutErrorMessage),t(new R(F,v.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,r,b)),w(),b=null},n===void 0&&o.setContentType(null),"setRequestHeader"in b&&d.forEach(Rt(o),function(F,v){b.setRequestHeader(v,F)}),d.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),i&&i!=="json"&&(b.responseType=a.responseType),c&&([m,C]=ye(c,!0),b.addEventListener("progress",m)),l&&b.upload&&([h,P]=ye(l),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",P)),(a.cancelToken||a.signal)&&(u=E=>{b&&(t(!E||E.type?new ce(null,r,b):E),b.abort(),w(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const I=la(a.url);if(I&&!x.protocols.includes(I)){t(new R("Unsupported protocol "+I+":",R.ERR_BAD_REQUEST,r));return}b.send(n||null)})},Pa=(r,e)=>{if(r=r?r.filter(Boolean):[],!e&&!r.length)return;const s=new AbortController;let t=!1;const a=function(l){if(!t){t=!0,o();const c=l instanceof Error?l:this.reason;s.abort(c instanceof R?c:new ce(c instanceof Error?c.message:c))}};let n=e&&setTimeout(()=>{n=null,a(new R(`timeout of ${e}ms exceeded`,R.ETIMEDOUT))},e);const o=()=>{r&&(n&&clearTimeout(n),n=null,r.forEach(l=>{l.unsubscribe?l.unsubscribe(a):l.removeEventListener("abort",a)}),r=null)};r.forEach(l=>l.addEventListener("abort",a));const{signal:i}=s;return i.unsubscribe=()=>d.asap(o),i},Ra=function*(r,e){let s=r.byteLength;if(s<e){yield r;return}let t=0,a;for(;t<s;)a=t+e,yield r.slice(t,a),t=a},qa=async function*(r,e){for await(const s of Ca(r))yield*Ra(s,e)},Ca=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:s,value:t}=await e.read();if(s)break;yield t}}finally{await e.cancel()}},ot=(r,e,s,t)=>{const a=qa(r,e);let n=0,o,i=l=>{o||(o=!0,t&&t(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await a.next();if(c){i(),l.close();return}let h=u.byteLength;if(s){let m=n+=h;s(m)}l.enqueue(new Uint8Array(u))}catch(c){throw i(c),c}},cancel(l){return i(l),a.return()}},{highWaterMark:2})};function Ia(r){if(!r||typeof r!="string"||!r.startsWith("data:"))return 0;const e=r.indexOf(",");if(e<0)return 0;const s=r.slice(5,e),t=r.slice(e+1);if(/;base64/i.test(s)){let o=t.length;const i=t.length;for(let P=0;P<i;P++)if(t.charCodeAt(P)===37&&P+2<i){const C=t.charCodeAt(P+1),w=t.charCodeAt(P+2);(C>=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102)&&(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102)&&(o-=2,P+=2)}let l=0,c=i-1;const u=P=>P>=2&&t.charCodeAt(P-2)===37&&t.charCodeAt(P-1)===51&&(t.charCodeAt(P)===68||t.charCodeAt(P)===100);c>=0&&(t.charCodeAt(c)===61?(l++,c--):u(c)&&(l++,c-=3)),l===1&&c>=0&&(t.charCodeAt(c)===61||u(c))&&l++;const m=Math.floor(o/4)*3-(l||0);return m>0?m:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(t,"utf8");let n=0;for(let o=0,i=t.length;o<i;o++){const l=t.charCodeAt(o);if(l<128)n+=1;else if(l<2048)n+=2;else if(l>=55296&&l<=56319&&o+1<i){const c=t.charCodeAt(o+1);c>=56320&&c<=57343?(n+=4,o++):n+=3}else n+=3}return n}const ze="1.16.1",it=64*1024,{isFunction:ge}=d,lt=(r,...e)=>{try{return!!r(...e)}catch{return!1}},Ea=r=>{const e=d.global!==void 0&&d.global!==null?d.global:globalThis,{ReadableStream:s,TextEncoder:t}=e;r=d.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},r);const{fetch:a,Request:n,Response:o}=r,i=a?ge(a):typeof fetch=="function",l=ge(n),c=ge(o);if(!i)return!1;const u=i&&ge(s),h=i&&(typeof t=="function"?(y=>I=>y.encode(I))(new t):async y=>new Uint8Array(await new n(y).arrayBuffer())),m=l&&u&<(()=>{let y=!1;const I=new n(x.origin,{body:new s,method:"POST",get duplex(){return y=!0,"half"}}),E=I.headers.has("Content-Type");return I.body!=null&&I.body.cancel(),y&&!E}),P=c&&u&<(()=>d.isReadableStream(new o("").body)),C={stream:P&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!C[y]&&(C[y]=(I,E)=>{let F=I&&I[y];if(F)return F.call(I);throw new R(`Response type '${y}' is not supported`,R.ERR_NOT_SUPPORT,E)})});const w=async y=>{if(y==null)return 0;if(d.isBlob(y))return y.size;if(d.isSpecCompliantForm(y))return(await new n(x.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(d.isArrayBufferView(y)||d.isArrayBuffer(y))return y.byteLength;if(d.isURLSearchParams(y)&&(y=y+""),d.isString(y))return(await h(y)).byteLength},b=async(y,I)=>{const E=d.toFiniteNumber(y.getContentLength());return E??w(I)};return async y=>{let{url:I,method:E,data:F,signal:v,cancelToken:H,timeout:j,onDownloadProgress:ee,onUploadProgress:te,responseType:k,headers:J,withCredentials:ue="same-origin",fetchOptions:Je,maxContentLength:L,maxBodyLength:Ee}=Ot(y);const se=d.isNumber(L)&&L>-1,Ut=d.isNumber(Ee)&&Ee>-1;let Ve=a||fetch;k=k?(k+"").toLowerCase():"text";let z=Pa([v,H&&H.toAbortSignal()],j),$=null;const V=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let Ae;try{if(se&&typeof I=="string"&&I.startsWith("data:")&&Ia(I)>L)throw new R("maxContentLength size of "+L+" exceeded",R.ERR_BAD_RESPONSE,y,$);if(Ut&&E!=="get"&&E!=="head"){const S=await b(J,F);if(typeof S=="number"&&isFinite(S)&&S>Ee)throw new R("Request body larger than maxBodyLength limit",R.ERR_BAD_REQUEST,y,$)}if(te&&m&&E!=="get"&&E!=="head"&&(Ae=await b(J,F))!==0){let S=new n(I,{method:"POST",body:F,duplex:"half"}),X;if(d.isFormData(F)&&(X=S.headers.get("content-type"))&&J.setContentType(X),S.body){const[de,he]=at(Ae,ye(rt(te)));F=ot(S.body,it,de,he)}}d.isString(ue)||(ue=ue?"include":"omit");const O=l&&"credentials"in n.prototype;if(d.isFormData(F)){const S=J.getContentType();S&&/^multipart\/form-data/i.test(S)&&!/boundary=/i.test(S)&&J.delete("content-type")}J.set("User-Agent","axios/"+ze,!1);const K={...Je,signal:z,method:E.toUpperCase(),headers:Rt(J.normalize()),body:F,duplex:"half",credentials:O?ue:void 0};$=l&&new n(I,K);let B=await(l?Ve($,Je):Ve(I,K));if(se){const S=d.toFiniteNumber(B.headers.get("content-length"));if(S!=null&&S>L)throw new R("maxContentLength size of "+L+" exceeded",R.ERR_BAD_RESPONSE,y,$)}const Fe=P&&(k==="stream"||k==="response");if(P&&B.body&&(ee||se||Fe&&V)){const S={};["status","statusText","headers"].forEach(ae=>{S[ae]=B[ae]});const X=d.toFiniteNumber(B.headers.get("content-length")),[de,he]=ee&&at(X,ye(rt(ee),!0))||[];let We=0;const Dt=ae=>{if(se&&(We=ae,We>L))throw new R("maxContentLength size of "+L+" exceeded",R.ERR_BAD_RESPONSE,y,$);de&&de(ae)};B=new o(ot(B.body,it,Dt,()=>{he&&he(),V&&V()}),S)}k=k||"text";let M=await C[d.findKey(C,k)||"text"](B,y);if(se&&!P&&!Fe){let S;if(M!=null&&(typeof M.byteLength=="number"?S=M.byteLength:typeof M.size=="number"?S=M.size:typeof M=="string"&&(S=typeof t=="function"?new t().encode(M).byteLength:M.length)),typeof S=="number"&&S>L)throw new R("maxContentLength size of "+L+" exceeded",R.ERR_BAD_RESPONSE,y,$)}return!Fe&&V&&V(),await new Promise((S,X)=>{_t(S,X,{data:M,headers:T.from(B.headers),status:B.status,statusText:B.statusText,config:y,request:$})})}catch(O){if(V&&V(),z&&z.aborted&&z.reason instanceof R){const K=z.reason;throw K.config=y,$&&(K.request=$),O!==K&&(K.cause=O),K}throw O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,y,$,O&&O.response),{cause:O.cause||O}):R.from(O,O&&O.code,y,$,O&&O.response)}}},Fa=new Map,xt=r=>{let e=r&&r.env||{};const{fetch:s,Request:t,Response:a}=e,n=[t,a,s];let o=n.length,i=o,l,c,u=Fa;for(;i--;)l=n[i],c=u.get(l),c===void 0&&u.set(l,c=i?new Map:Ea(e)),u=c;return c};xt();const Ke={http:Vs,xhr:wa,fetch:{get:xt}};d.forEach(Ke,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(r,"adapterName",{__proto__:null,value:e})}});const ct=r=>`- ${r}`,Sa=r=>d.isFunction(r)||r===null||r===!1;function _a(r,e){r=d.isArray(r)?r:[r];const{length:s}=r;let t,a;const n={};for(let o=0;o<s;o++){t=r[o];let i;if(a=t,!Sa(t)&&(a=Ke[(i=String(t)).toLowerCase()],a===void 0))throw new R(`Unknown adapter '${i}'`);if(a&&(d.isFunction(a)||(a=a.get(e))))break;n[i||"#"+o]=a}if(!a){const o=Object.entries(n).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=s?o.length>1?`since :
|
|
4
|
+
`+o.map(ct).join(`
|
|
5
|
+
`):" "+ct(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return a}const Tt={getAdapter:_a,adapters:Ke};function Te(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new ce(null,r)}function ut(r){return Te(r),r.headers=T.from(r.headers),r.data=xe.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(r.adapter||le.adapter,r)(r).then(function(t){Te(r),r.response=t;try{t.data=xe.call(r,r.transformResponse,t)}finally{delete r.response}return t.headers=T.from(t.headers),t},function(t){if(!St(t)&&(Te(r),t&&t.response)){r.response=t.response;try{t.response.data=xe.call(r,r.transformResponse,t.response)}finally{delete r.response}t.response.headers=T.from(t.response.headers)}return Promise.reject(t)})}const Ie={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Ie[r]=function(t){return typeof t===r||"a"+(e<1?"n ":" ")+r}});const dt={};Ie.transitional=function(e,s,t){function a(n,o){return"[Axios v"+ze+"] Transitional option '"+n+"'"+o+(t?". "+t:"")}return(n,o,i)=>{if(e===!1)throw new R(a(o," has been removed"+(s?" in "+s:"")),R.ERR_DEPRECATED);return s&&!dt[o]&&(dt[o]=!0,console.warn(a(o," has been deprecated since v"+s+" and will be removed in the near future"))),e?e(n,o,i):!0}};Ie.spelling=function(e){return(s,t)=>(console.warn(`${t} is likely a misspelling of ${e}`),!0)};function va(r,e,s){if(typeof r!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const t=Object.keys(r);let a=t.length;for(;a-- >0;){const n=t[a],o=Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;if(o){const i=r[n],l=i===void 0||o(i,n,r);if(l!==!0)throw new R("option "+n+" must be "+l,R.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new R("Unknown option "+n,R.ERR_BAD_OPTION)}}const me={assertOptions:va,validators:Ie},U=me.validators;let W=class{constructor(e){this.defaults=e||{},this.interceptors={request:new st,response:new st}}async request(e,s){try{return await this._request(e,s)}catch(t){if(t instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const n=(()=>{if(!a.stack)return"";const o=a.stack.indexOf(`
|
|
6
|
+
`);return o===-1?"":a.stack.slice(o+1)})();try{if(!t.stack)t.stack=n;else if(n){const o=n.indexOf(`
|
|
7
|
+
`),i=o===-1?-1:n.indexOf(`
|
|
8
|
+
`,o+1),l=i===-1?"":n.slice(i+1);String(t.stack).endsWith(l)||(t.stack+=`
|
|
9
|
+
`+n)}}catch{}}throw t}}_request(e,s){typeof e=="string"?(s=s||{},s.url=e):s=e||{},s=G(this.defaults,s);const{transitional:t,paramsSerializer:a,headers:n}=s;t!==void 0&&me.assertOptions(t,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean),legacyInterceptorReqResOrdering:U.transitional(U.boolean)},!1),a!=null&&(d.isFunction(a)?s.paramsSerializer={serialize:a}:me.assertOptions(a,{encode:U.function,serialize:U.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),me.assertOptions(s,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let o=n&&d.merge(n.common,n[s.method]);n&&d.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete n[C]}),s.headers=T.concat(o,n);const i=[];let l=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(s)===!1)return;l=l&&w.synchronous;const b=s.transitional||Me;b&&b.legacyInterceptorReqResOrdering?i.unshift(w.fulfilled,w.rejected):i.push(w.fulfilled,w.rejected)});const c=[];this.interceptors.response.forEach(function(w){c.push(w.fulfilled,w.rejected)});let u,h=0,m;if(!l){const C=[ut.bind(this),void 0];for(C.unshift(...i),C.push(...c),m=C.length,u=Promise.resolve(s);h<m;)u=u.then(C[h++],C[h++]);return u}m=i.length;let P=s;for(;h<m;){const C=i[h++],w=i[h++];try{P=C(P)}catch(b){w.call(this,b);break}}try{u=ut.call(this,P)}catch(C){return Promise.reject(C)}for(h=0,m=c.length;h<m;)u=u.then(c[h++],c[h++]);return u}getUri(e){e=G(this.defaults,e);const s=vt(e.baseURL,e.url,e.allowAbsoluteUrls);return Et(s,e.params,e.paramsSerializer)}};d.forEach(["delete","get","head","options"],function(e){W.prototype[e]=function(s,t){return this.request(G(t||{},{method:e,url:s,data:(t||{}).data}))}});d.forEach(["post","put","patch","query"],function(e){function s(t){return function(n,o,i){return this.request(G(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}W.prototype[e]=s(),e!=="query"&&(W.prototype[e+"Form"]=s(!0))});let Oa=class Nt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(n){s=n});const t=this;this.promise.then(a=>{if(!t._listeners)return;let n=t._listeners.length;for(;n-- >0;)t._listeners[n](a);t._listeners=null}),this.promise.then=a=>{let n;const o=new Promise(i=>{t.subscribe(i),n=i}).then(a);return o.cancel=function(){t.unsubscribe(n)},o},e(function(n,o,i){t.reason||(t.reason=new ce(n,o,i),s(t.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 s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=t=>{e.abort(t)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new Nt(function(a){e=a}),cancel:e}}};function xa(r){return function(s){return r.apply(null,s)}}function Ta(r){return d.isObject(r)&&r.isAxiosError===!0}const ke={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ke).forEach(([r,e])=>{ke[e]=r});function $t(r){const e=new W(r),s=pt(W.prototype.request,e);return d.extend(s,W.prototype,e,{allOwnKeys:!0}),d.extend(s,e,null,{allOwnKeys:!0}),s.create=function(a){return $t(G(r,a))},s}const _=$t(le);_.Axios=W;_.CanceledError=ce;_.CancelToken=Oa;_.isCancel=St;_.VERSION=ze;_.toFormData=Ce;_.AxiosError=R;_.Cancel=_.CanceledError;_.all=function(e){return Promise.all(e)};_.spread=xa;_.isAxiosError=Ta;_.mergeConfig=G;_.AxiosHeaders=T;_.formToJSON=r=>Ft(d.isHTMLForm(r)?new FormData(r):r);_.getAdapter=Tt.getAdapter;_.HttpStatusCode=ke;_.default=_;const{Axios:Va,AxiosError:Aa,CanceledError:Wa,isCancel:Ga,CancelToken:Xa,VERSION:Qa,all:Za,Cancel:Ya,isAxiosError:er,spread:tr,toFormData:sr,AxiosHeaders:ar,HttpStatusCode:rr,formToJSON:nr,getAdapter:or,mergeConfig:ir,create:lr}=_,Na="/@api/deki";class q{axiosInstance=_.create();format="json";debug;constructor(e,s,t="json",a,n){if(this.debug=Le("cxone-expert:requests",a),!e)throw this.debug("TLD is required to initialize Requests module"),new Error("TLD is required");if(!s)throw this.debug("Auth object is required to initialize Requests module"),new Error("Auth object is required");let o=e;!o.startsWith("http://")&&!o.startsWith("https://")&&(o=`https://${o}`),o.endsWith("/")&&(o=o.slice(0,o.length-1)),this.format=t,this.axiosInstance=_.create({baseURL:`${o}${Na}`,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...n,...s}}),this.setupInterceptors()}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{if(this.debug(`→ ${e.method?.toUpperCase()} ${e.baseURL}${e.url}`),e.params&&Object.keys(e.params).length>0&&this.debug(" Query params:",JSON.stringify(e.params)),e.data&&e.headers?.["Content-Type"]!=="application/octet-stream"){const s=typeof e.data=="string"?e.data:JSON.stringify(e.data);s.length>200?this.debug(" Body:",s.substring(0,200)+"... (truncated)"):s.length>0&&this.debug(" Body:",s)}return e},e=>(this.debug("✗ Request error:",e.message),Promise.reject(e))),this.axiosInstance.interceptors.response.use(e=>{if(this.debug(`← ${e.status} ${e.config.method?.toUpperCase()} ${e.config.url}`),e.data&&e.headers["content-type"]?.includes("application/json")){const s=JSON.stringify(e.data);s.length>200?this.debug(" Response:",s.substring(0,200)+"... (truncated)"):this.debug(" Response:",s)}else e.headers["content-type"]?.includes("text/")?this.debug(" Response: [text content]"):e.data&&this.debug(" Response: [binary content]");return e},e=>{if(e.response){if(this.debug(`✗ ${e.response.status} ${e.config?.method?.toUpperCase()} ${e.config?.url}`),this.debug(" Error:",e.response.statusText),e.response.data){const s=typeof e.response.data=="string"?e.response.data:JSON.stringify(e.response.data);s.length>200?this.debug(" Error details:",s.substring(0,200)+"... (truncated)"):this.debug(" Error details:",s)}}else e.request?this.debug("✗ No response received:",e.message):this.debug("✗ Request setup error:",e.message);return Promise.reject(e)})}getFormatParam(){return{"dream.out.format":this.format}}async get(e,s){return await this.axiosInstance.get(e,{...s,params:{...s?.params,...this.getFormatParam()}})}async post(e,s,t){return await this.axiosInstance.post(e,s,{...t})}async put(e,s,t){return await this.axiosInstance.put(e,s,{...t})}async patch(e,s,t){return await this.axiosInstance.patch(e,s,{...t})}async del(e,s){return await this.axiosInstance.delete(e,{...s})}async head(e,s){return await this.axiosInstance.head(e,{...s})}}class $a{globals;_auth;debug;constructor(e,s){this.globals=e,this._auth=s,this.debug=Le("cxone-expert-node:pages",e.debug),this.debug("Pages module initialized")}parsePageId(e){return typeof e=="number"?e.toString():e==="home"?e:`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return`${encodeURIComponent(encodeURIComponent(e))}`}createRequests(e,s,t){return new q(e,s,"json",this.globals.debug,t)}async getPages(e,s){this.debug("getPages called");const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers),i=await this.createRequests(t,a,n).get("/pages",{params:{...e}});return this.debug("getPages completed successfully"),i.data}async getPage(e,s,t){this.debug("getPage called for:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}`,{params:{...s}});return this.debug("getPage completed successfully"),c.data}async getPageContents(e,s,t){this.debug("getPageContents called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/contents`,{params:{...s}});return this.debug("getPageContents retrieved contents for page:",e),c.data}async getPageContentsExplain(e,s,t){this.debug("getPageContentsExplain called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/contents/explain`,{params:{...s}});return this.debug("getPageContentsExplain retrieved contents for page:",e),c.data}async getPageDiff(e,s,t){this.debug("getPageDiff called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/diff`,{params:{...s}});return this.debug("getPageDiff retrieved diff for page:",e),c.data}async getPageExplain(e,s,t){this.debug("getPageExplain called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/explain`,{params:{...s}});return this.debug("getPageExplain retrieved explanation for page:",e),c.data}async getPageExportToken(e,s,t,a){this.debug("getPageExportToken called for page:",e);const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers),u=await this.createRequests(o,i,l).get(`/pages/${n}/export/${s}`,{params:{...t},responseType:"stream"});return this.debug("getPageExportToken successfully retrieved export for page:",e),u.data}async getPageExportTokenFilename(e,s,t,a,n){this.debug("getPageExportTokenFilename called for page:",e);const o=this.parsePageId(e),i=this.parseFileName(t),l=p(this.globals,n?.tld),c=g(this.globals,n?.auth),u=f(this.globals,n?.headers),m=await this.createRequests(l,c,u).get(`/pages/${o}/export/${s}/${i}`,{params:{...a},responseType:"stream"});return this.debug("getPageExportTokenFilename successfully retrieved export for page:",e),m.data}async getPageFilesSubpages(e,s,t){this.debug("getPageFilesSubpages called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/explain`,{params:{...s}});return this.debug("getPageFilesSubpages retrieved file and subpage info for page:",e),c.data}async getPageFiles(e,s,t){this.debug("getPageFiles called");const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/explain`,{params:{...s}});return this.debug("getPageFiles retrieved file info for page:",e),c.data}async getPageFile(e,s,t,a){this.debug("getPageFile called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/files/${o}`,{params:{...t},responseType:"stream"});return this.debug("getPageFile successfully retrieved file for page:",e),h.data}async getPageFileDescription(e,s,t,a){this.debug("getPageFileDescription called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/files/${o}/description`,{params:{...t},responseType:"stream"});return this.debug("getPageFileDescription successfully retrieved description for page:",e),h.data}async getPageFileInfo(e,s,t,a){this.debug("getPageFileInfo called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/files/${o}/info`,{params:{...t}});return this.debug("getPageFileInfo successfully retrieved info for file on page:",e),h.data}async getPageFileRevisions(e,s,t,a){this.debug("getPageFileRevisions called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/files/${o}/revisions`,{params:{...t}});return this.debug("getPageFileRevisions successfully retrieved revisions for file on page:",e),h.data}async getPageFind(e,s,t){this.debug("getPageFind called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/find`,{params:{...s}});return this.debug("getPageFind successfully retrieved find results for page:",e),c.data}async getPageInfo(e,s,t){this.debug("getPageInfo called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/info`,{params:{...s}});return this.debug("getPageInfo successfully retrieved info for page:",e),c.data}async getPageLinks(e,s,t){this.debug("getPageLinks called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/links`,{params:{...s}});return this.debug("getPageLinks successfully retrieved links for page:",e),c.data}async getPagePDF(e,s,t){this.debug("getPagePDF called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/pdf`,{params:{...s},responseType:"stream"});return this.debug("getPagePDF successfully retrieved PDF for page:",e),c.data}async getPagePDFFilename(e,s,t,a){this.debug("getPagePDFFilename called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/pdf/${o}`,{params:{...t},responseType:"stream"});return this.debug("getPagePDFFilename successfully retrieved PDF for page:",e),h.data}async getPageProperties(e,s,t){this.debug("getPageProperties called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/properties`,{params:{...s}});return this.debug("getPageProperties successfully retrieved properties for page:",e),c.data}async getPagePropertiesKey(e,s,t,a){this.debug("getPagePropertiesKey called for page:",e);const n=this.parsePageId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/properties/${o}`,{params:{...t}});return this.debug("getPagePropertiesKey successfully retrieved property key for page:",e),h.data}async getPagePropertiesKeyInfo(e,s,t,a){this.debug("getPagePropertiesKeyInfo called for page:",e);const n=this.parsePageId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).get(`/pages/${n}/properties/${o}/info`,{params:{...t}});return this.debug("getPagePropertiesKeyInfo successfully retrieved property key info for page:",e),h.data}async getPageRatings(e,s,t){this.debug("getPageRatings called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/ratings`,{params:{...s}});return this.debug("getPageRatings successfully retrieved ratings for page:",e),c.data}async getPageRevisions(e,s,t){this.debug("getPageRevisions called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/revisions`,{params:{...s}});return this.debug("getPageRevisions successfully retrieved revisions for page:",e),c.data}async getPageSubpages(e,s,t){this.debug("getPageSubpages called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/subpages`,{params:{...s}});return this.debug("getPageSubpages successfully retrieved subpages for page:",e),c.data}async getPageTags(e,s,t){this.debug("getPageTags called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/tags`,{params:{...s}});return this.debug("getPageTags successfully retrieved tags for page:",e),c.data}async getPageTree(e,s,t){this.debug("getPageTree called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).get(`/pages/${a}/tree`,{params:{...s}});return this.debug("getPageTree successfully retrieved tree for page:",e),c.data}async getPageBook(e,s){this.debug("getPageBook called");const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers),i=await this.createRequests(t,a,n).get("/pages/book",{params:{...e},responseType:"stream"});return this.debug("getPageBook successfully retrieved book"),i.data}async getPageBookFilename(e,s,t,a){this.debug("getPageBookFilename called for page:",e),this.parsePageId(e),this.parseFileName(s);const n=p(this.globals,a?.tld),o=g(this.globals,a?.auth),i=f(this.globals,a?.headers),c=await this.createRequests(n,o,i).get(`/pages/book/${s}`,{params:{...t},responseType:"stream"});return this.debug("getPageBookFilename successfully retrieved book for page:",e),c.data}async getPagesCsv(e,s){this.debug("getPagesCsv called with params");const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers),i=await this.createRequests(t,a,n).get("/pages/csv",{params:{...e},responseType:"stream"});return this.debug("getPagesCsv successfully retrieved CSV data"),i.data}async getPagesPopular(e,s){this.debug("getPagesPopular called for page.");const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers),i=await this.createRequests(t,a,n).get("/pages/popular",{params:{...e}});return this.debug("getPagesPopular successfully retrieved popular pages."),i.data}async postPageContents(e,s,t,a){this.debug("postPageContents called for page:",e);const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers),u=await this.createRequests(o,i,l).post(`/pages/${n}/contents`,s??"",{headers:{"Content-Type":"text/plain"},params:{...t}});return this.debug("postPageContents successfully updated page:",e),u.data}async putPageUnorder(e,s){this.debug("putPageUnorder called for page:",e);const t=this.parsePageId(e),a=p(this.globals,s?.tld),n=g(this.globals,s?.auth),o=f(this.globals,s?.headers);return(await this.createRequests(a,n,o).put(`/pages/${t}/unorder`,"")).data}async delPageDelete(e,s,t){this.debug("delPageDelete called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).del(`/pages/${a}`,{params:{...s}});return this.debug("delPageDelete successfully deleted page:",e),c.data}async delPageAllowed(e,s,t){this.debug("delPageAllowed called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).del(`/pages/${a}/allowed`,{params:{...s}});return this.debug("delPageAllowed successfully changed permissions for page:",e),c.data}async postPageCopied(e,s,t){this.debug("postPageCopied called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).post(`/pages/${a}/copy`,"",{params:{...s}});return this.debug("postPageCopied successfully copied page:",e),c.data}async postPageExport(e,s){this.debug("postPageExport called for page:",e);const t=this.parsePageId(e),a=p(this.globals,s?.tld),n=g(this.globals,s?.auth),o=f(this.globals,s?.headers),l=await this.createRequests(a,n,o).post(`/pages/${t}/export`,"");return this.debug("postPageExport successfully exported page:",e),l.data}async delPageFileName(e,s,t,a){this.debug("delPageFileName called for page:",e,"filename:",s);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).del(`/pages/${n}/files/${o}`,{params:{...t}});return this.debug("delPageFileName successfully deleted file:",s,"from page:",e),h.data}async headPageFileName(e,s,t,a){this.debug("headPageFileName called for page:",e,"filename:",s);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).head(`/pages/${n}/files/${o}`,{params:{...t}});return this.debug("headPageFileName successfully checked existence of file:",s,"on page:",e),h.data}async putPageFileName(e,s,t,a,n){this.debug("putPageFileName called for page:",e,"filename:",s);const o=this.parsePageId(e),i=this.parseFileName(s),l=p(this.globals,n?.tld),c=g(this.globals,n?.auth),u=f(this.globals,n?.headers),m=await this.createRequests(l,c,u).put(`/pages/${o}/files/${i}`,t,{headers:{"Content-Type":"application/octet-stream"},params:{...a}});return this.debug("putPageFileName successfully uploaded file:",s,"to page:",e),m.data}async delPageFileNameDescription(e,s,t,a){this.debug("delPageFileNameDescription called for page:",e,"filename:",s);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).del(`/pages/${n}/files/${o}/description`,{params:{...t}});return this.debug("delPageFileNameDescription successfully deleted description for file:",s,"on page:",e),h.data}async putPageFileNameDescription(e,s,t,a){this.debug("putPageFileNameDescription called for page:",e,"filename:",s);const n=this.parsePageId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).put(`/pages/${n}/files/${o}/description`,{params:{...t}});return this.debug("putPageFileNameDescription successfully updated description for file:",s,"on page:",e),h.data}async putPageFileNamePropertiesKey(e,s,t,a,n){this.debug("putPageFileNamePropertiesKey called for page:",e,"filename:",s,"key:",t);const o=this.parsePageId(e),i=this.parseFileName(s),l=this.parseKey(t),c=p(this.globals,n?.tld),u=g(this.globals,n?.auth),h=f(this.globals,n?.headers),P=await this.createRequests(c,u,h).put(`/pages/${o}/files/${i}/properties/${l}`,"",{params:{...a}});return this.debug("putPageFileNamePropertiesKey successfully updated property key:",t,"for file:",s,"on page:",e),P.data}async putPageImport(e,s,t){this.debug("putPageImport called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).put(`/pages/${a}/import`,"",{params:{...s}});return this.debug("putPageImport successfully imported content to page:",e),c.data}async putPageMove(e,s,t){this.debug("putPageMove called for page:",e,"to:",s?.to);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).put(`/pages/${a}/move`,"",{params:{...s}});return this.debug("putPageMove successfully moved page:",e),c.data}async putPageOrder(e,s,t){this.debug("putPageOrder called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).put(`/pages/${a}/order`,"",{params:{...s}});return this.debug("putPageOrder successfully updated order for page:",e),c.data}async postPageProperties(e,s,t,a,n){this.debug("postPageProperties called for page:",e,"property:",s);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),c=f(this.globals,n?.headers),h=await this.createRequests(i,l,c).post(`/pages/${o}/properties`,t,{headers:{Slug:s},params:{...a}});return this.debug("postPageProperties successfully created property:",s,"for page:",e),h.data}async putPageProperties(e,s,t,a,n){this.debug("putPageProperties called for page:",e,"property:",s);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),c=f(this.globals,n?.headers),h=await this.createRequests(i,l,c).put(`/pages/${o}/properties`,t,{headers:{Slug:s},params:{...a}});return this.debug("putPageProperties successfully updated property:",s,"for page:",e),h.data}async deletePagePropertiesKey(e,s,t,a){this.debug("deletePagePropertiesKey called for page:",e,"key:",s);const n=this.parsePageId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).del(`/pages/${n}/properties/${o}`,{params:{...t}});return this.debug("deletePagePropertiesKey successfully deleted property key:",s,"for page:",e),h.data}async putPagePropertiesKey(e,s,t,a){this.debug("putPagePropertiesKey called for page:",e,"key:",s);const n=this.parsePageId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers),h=await this.createRequests(i,l,c).put(`/pages/${n}/properties/${o}`,"",{params:{...t}});return this.debug("putPagePropertiesKey successfully updated property key:",s,"for page:",e),h.data}async postPageRatings(e,s,t){this.debug("postPageRatings called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).post(`/pages/${a}/ratings`,"",{params:{...s}});return this.debug("postPageRatings successfully submitted rating for page:",e),c.data}async postPageRevert(e,s,t){this.debug("postPageRevert called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).post(`/pages/${a}/revert`,"",{params:{...s}});return this.debug("postPageRevert successfully reverted page:",e),c.data}async deletePageSecurity(e,s,t){this.debug("deletePageSecurity called for page:",e);const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers),c=await this.createRequests(n,o,i).del(`/pages/${a}/security`,{params:{...s}});return this.debug("deletePageSecurity successfully deleted security settings for page:",e),c.data}async postPageSecurity(e,s,t,a){this.debug("postPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers),u=await this.createRequests(o,i,l).post(`/pages/${n}/security`,s,{params:{...t}});return this.debug("postPageSecurity successfully created security settings for page:",e),u.data}async putPageSecurity(e,s,t,a){this.debug("putPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers),u=await this.createRequests(o,i,l).put(`/pages/${n}/security`,s,{params:{...t}});return this.debug("putPageSecurity successfully updated security settings for page:",e),u.data}async putPageTags(e,s,t,a){this.debug("putPageTags called for page:",e);const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers),u=await this.createRequests(o,i,l).put(`/pages/${n}/tags`,s,{params:{...t}});return this.debug("putPageTags successfully updated tags for page:",e),u.data}}class Ua{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parseGroupId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(e)}`}async getGroups(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/groups",{params:{...e}})).data}async getGroup(e,s,t){const a=this.parseGroupId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/groups/${a}`,{params:{...s}})).data}async getGroupUser(e,s,t){const a=this.parseGroupId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).get(`/groups/${a}/users`,{params:{...s}})).data}}class Da{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}async getPageHierarchyById(e,s,t){const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`events/page-hierarchy/${a}`,{params:{...s}})).data}async getPageHierarchyDetailById(e,s,t,a){const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers);return(await new q(o,i,void 0,void 0,l).get(`events/page-hierarchy/${n}/${s}`,{params:{...t}})).data}async getEventPage(e,s,t){const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`events/page/${a}`,{params:{...s}})).data}async getEventPageDetail(e,s,t,a){const n=this.parsePageId(e),o=p(this.globals,a?.tld),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers);return(await new q(o,i,void 0,void 0,l).get(`/events/page/${n}/${s}`,{params:{...t}})).data}async getEventUserPage(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/events/user-page/${this.parseUserId(e)}`,{params:{...s}})).data}async getEventUserDetailPage(e,s,t,a){const n=p(this.globals,a?.tld),o=g(this.globals,a?.auth),i=f(this.globals,a?.headers);return(await new q(n,o,void 0,void 0,i).get(`/events/user-page/${this.parseUserId(e)}/${s}`,{params:{...t}})).data}}class ka{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getArchive(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/archive",{params:{...e}})).data}async getArchiveFiles(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/archive/files",{params:{...e}})).data}async getArchiveFile(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/files/${e}`,{params:{...s},responseType:"stream"})).data}async getArchiveFileByName(e,s,t,a){const n=p(this.globals,a?.tld),o=this.parseFileName(s),i=g(this.globals,a?.auth),l=f(this.globals,a?.headers);return(await new q(n,i,void 0,void 0,l).get(`/archive/files/${e}/${o}`,{params:{...t},responseType:"stream"})).data}async getArchiveFileInfo(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/files/${e}/info`,{params:{...s}})).data}async getArchivePages(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/archive/pages",{params:{...e}})).data}async getArchivePage(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/page/${e}`,{params:{...s}})).data}async getArchivePageContents(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/page/${e}/contents`,{params:{...s}})).data}async getArchivePageInfo(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/page/${e}/info`,{params:{...s}})).data}async getArchivePageSubPages(e,s,t){const a=p(this.globals,t?.tld),n=g(this.globals,t?.auth),o=f(this.globals,t?.headers);return(await new q(a,n,void 0,void 0,o).get(`/archive/page/${e}/subpages`,{params:{...s}})).data}}class La{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getSiteActivity(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/activity",{params:{...e}})).data}async getSiteExportGroups(e){const s=p(this.globals,e?.tld),t=g(this.globals,e?.auth),a=f(this.globals,e?.headers);return(await new q(s,t,void 0,void 0,a).get("/site/export/groups")).data}async getSiteExportUsers(e){const s=p(this.globals,e?.tld),t=g(this.globals,e?.auth),a=f(this.globals,e?.headers);return(await new q(s,t,void 0,void 0,a).get("/site/export/users")).data}async getSiteSubPagesTags(e,s,t){const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/site/nav/${a}/children`,{params:{...s}})).data}async getSiteFullNavTreeTags(e,s,t){const a=this.parsePageId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/site/nav/${a}/full`,{params:{...s}})).data}async getSiteOperations(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/operations",{params:{...e}})).data}async getSiteProperties(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/properties",{params:{...e}})).data}async GetSiteKeyProperties(e,s,t){const a=this.parseKey(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/site/properties/${a}`,{params:{...s}})).data}async GetSiteKeyPropertiesInfo(e,s,t){const a=this.parseKey(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/site/properties/${a}/info`,{params:{...s}})).data}async GetSiteQuery(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/query",{params:{...e}})).data}async GetSiteStatus(e){const s=p(this.globals,e?.tld),t=g(this.globals,e?.auth),a=f(this.globals,e?.headers);return(await new q(s,t,void 0,void 0,a).get("/site/status")).data}async GetSiteTags(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/tags",{params:{...e}})).data}async GetSiteTag(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/site/tag",{params:{...e}})).data}}class Ba{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getContextMaps(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/contextmaps",{params:{...e}})).data}async getContextMapsById(e,s,t,a){const n=p(this.globals,a?.tld),o=g(this.globals,a?.auth),i=f(this.globals,a?.headers);return(await new q(n,o,void 0,void 0,i).get(`/contextmaps/${e}/${s}`,{params:{...t}})).data}}class ja{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getUsers(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/users",{params:{...e}})).data}async getUser(e,s,t){const a=this.parseUserId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/users/${a}`,{params:{...s}})).data}async getUserMetrics(e,s,t){const a=this.parseUserId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/users/${a}/metrics`,{params:{...s}})).data}async getUserProperties(e,s,t){const a=this.parseUserId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`/users/${a}/properties`,{params:{...s}})).data}async getUserPropertiesKey(e,s,t,a){const n=this.parseUserId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers);return(await new q(i,l,void 0,void 0,c).get(`/users/${n}/properties/${o}`,{params:{...t}})).data}async getUserPropertiesKeyInfo(e,s,t,a){const n=this.parseUserId(e),o=this.parseKey(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth),c=f(this.globals,a?.headers);return(await new q(i,l,void 0,void 0,c).get(`/users/${n}/properties/${o}/info`,{params:{...t}})).data}async getUsersSearch(e,s){const t=p(this.globals,s?.tld),a=g(this.globals,s?.auth),n=f(this.globals,s?.headers);return(await new q(t,a,void 0,void 0,n).get("/users/search",{params:{...e}})).data}}class Ma{globals;_auth;constructor(e,s){this.globals=e,this._auth=s}parseFileId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getFile(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth),i=f(this.globals,t?.headers);return(await new q(n,o,void 0,void 0,i).get(`files/${a}`,{params:{...s},responseType:"stream"})).data}async getFileName(e,s,t,a){const n=this.parseFileId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth);return(await new q(i,l).get(`files/${n}/${o}`,{params:{...t},responseType:"stream"})).data}async getFileDescription(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).get(`files/${a}/description`,{params:{...s},responseType:"stream"})).data}async getFileInfo(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).get(`files/${a}/info`,{params:{...s}})).data}async getFileRevisions(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).get(`files/${a}/revisions`,{params:{...s}})).data}async deleteFile(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).del(`files/${a}`,{params:{...s}})).data}async headFile(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).head(`files/${a}`,{params:{...s}})).data}async putFile(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).put(`files/${a}`,"",{params:{...s}})).data}async deleteFileName(e,s,t,a){const n=this.parseFileId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth);return(await new q(i,l).del(`files/${n}/${o}`,{params:{...t}})).data}async headFileName(e,s,t,a){const n=this.parseFileId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth);return(await new q(i,l).head(`files/${n}/${o}`,{params:{...t}})).data}async putFileName(e,s,t,a){const n=this.parseFileId(e),o=this.parseFileName(s),i=p(this.globals,a?.tld),l=g(this.globals,a?.auth);return(await new q(i,l).put(`files/${n}/${o}`,"",{params:{...t}})).data}async postFileCopy(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).post(`files/${a}/copy`,"",{params:{...s}})).data}async delDescriptionFile(e,s,t){const a=this.parseFileId(e),n=p(this.globals,t?.tld),o=g(this.globals,t?.auth);return(await new q(n,o).del(`files/${a}/description`,{params:{...s}})).data}}class Ha{globals={};debug;_pages;_groups;_site;_auth;_archive;_events;_contextMaps;_users;_files;constructor(e){e&&(e.tld&&(this.globals.tld=e.tld),e.auth&&(this.globals.auth=e.auth),e.debug!==void 0&&(this.globals.debug=e.debug),e.headers&&(this.globals.headers=e.headers)),this.debug=Le("cxone-expert-node",this.globals.debug),this.debug("Debug logging enabled for cxone-expert-node. This is not recommended for production use as credentials may be exposed in log files!"),this.debug("Expert instance created with options:",e)}setAuth(e){return this.globals.auth=e,this.debug("Authentication configured:",e),this}configureServerAuth(e){return this.globals.auth={type:"server",params:e},this.debug("Server authentication configured:",e),this}configureBrowserAuth(e){return this.globals.auth={type:"browser",params:e},this.debug("Browser authentication configured:",e),this}get pages(){return this._pages||(this.debug("Initializing Pages module"),this._pages=new $a(this.globals)),this._pages}get auth(){return this._auth||(this.debug("Initializing Auth module"),this._auth=new ht),this._auth}get site(){return this._site||(this.debug("Initializing Site module"),this._site=new La(this.globals)),this._site}get archive(){return this._archive||(this.debug("Initializing Archive module"),this._archive=new ka(this.globals)),this._archive}get groups(){return this._groups||(this.debug("Initializing Groups module"),this._groups=new Ua(this.globals)),this._groups}get events(){return this._events||(this.debug("Initializing Events module"),this._events=new Da(this.globals)),this._events}get contextMaps(){return this._contextMaps||(this.debug("Initializing Context Maps module"),this._contextMaps=new Ba(this.globals)),this._contextMaps}get users(){return this._users||(this.debug("Initializing Users module"),this._users=new ja(this.globals)),this._users}get files(){return this._files||(this.debug("Initializing Files module"),this._files=new Ma(this.globals)),this._files}}module.exports=Ha;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAIpC,cAAc,eAAe,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAC,CAAQ;gBAEX,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAIpC,cAAc,eAAe,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAC,CAAQ;gBAEX,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE;IAarG,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAMrC,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAMpD,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAM7D,IAAW,KAAK,IAAI,KAAK,CAOxB;IAED,IAAW,IAAI,IAAI,IAAI,CAOtB;IAED,IAAW,IAAI,IAAI,IAAI,CAOtB;IAED,IAAW,OAAO,IAAI,OAAO,CAO5B;IAED,IAAW,MAAM,IAAI,MAAM,CAO1B;IAED,IAAW,MAAM,IAAI,MAAM,CAO1B;IAED,IAAW,WAAW,IAAI,WAAW,CAMpC;IAED,IAAW,KAAK,IAAI,KAAK,CAOxB;IAED,IAAW,KAAK,IAAI,KAAK,CAOxB;CACJ"}
|