@opencloud-eu/web-client 5.1.0 → 6.0.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/{functions-JSgappH3.js → functions-BBKWOL6l.js} +1 -1
- package/dist/{functions-K2XX5sqY.cjs → functions-VxhUeT1u.cjs} +1 -1
- package/dist/{index-Dn0XwAD_.cjs → index-BYnmk_Nt.cjs} +10 -10
- package/dist/{index-YuBBVVCr.js → index-Bf956okn.js} +172 -158
- package/dist/{index-CRMq09Yn.js → index-Bjx4f50a.js} +630 -564
- package/dist/index-C32gBO3b.cjs +6 -0
- package/dist/index-Di51ZQKD.cjs +4 -0
- package/dist/index-Dn8UfKx7.js +1520 -0
- package/dist/{index-Brk6gzFd.js → index-Sp7XASDj.js} +1 -1
- package/dist/{index-CDNcS2Ra.cjs → index-_S-l3FmE.cjs} +1 -1
- package/dist/web-client/graph/generated.cjs +1 -1
- package/dist/web-client/graph/generated.js +1 -1
- package/dist/web-client/graph.cjs +1 -1
- package/dist/web-client/graph.js +1 -1
- package/dist/web-client/ocs.cjs +1 -1
- package/dist/web-client/ocs.js +1 -1
- package/dist/web-client/webdav.cjs +1 -1
- package/dist/web-client/webdav.js +3 -3
- package/dist/web-client.cjs +1 -1
- package/dist/web-client.js +5 -5
- package/package.json +1 -1
- package/dist/index-Bjk4YP4o.js +0 -1447
- package/dist/index-_QOU-c0Z.cjs +0 -4
- package/dist/index-mNoGEl9R.cjs +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const le=require("./index-D0bnLDAA.cjs");function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var st={exports:{}},E=st.exports={},L,D;function Oe(){throw new Error("setTimeout has not been defined")}function Te(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?L=setTimeout:L=Oe}catch{L=Oe}try{typeof clearTimeout=="function"?D=clearTimeout:D=Te}catch{D=Te}})();function ot(e){if(L===setTimeout)return setTimeout(e,0);if((L===Oe||!L)&&setTimeout)return L=setTimeout,setTimeout(e,0);try{return L(e,0)}catch{try{return L.call(null,e,0)}catch{return L.call(this,e,0)}}}function Ut(e){if(D===clearTimeout)return clearTimeout(e);if((D===Te||!D)&&clearTimeout)return D=clearTimeout,clearTimeout(e);try{return D(e)}catch{try{return D.call(null,e)}catch{return D.call(this,e)}}}var B=[],V=!1,M,ie=-1;function Lt(){!V||!M||(V=!1,M.length?B=M.concat(B):ie=-1,B.length&&it())}function it(){if(!V){var e=ot(Lt);V=!0;for(var t=B.length;t;){for(M=B,B=[];++ie<t;)M&&M[ie].run();ie=-1,t=B.length}M=null,V=!1,Ut(e)}}E.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];B.push(new at(e,t)),B.length===1&&!V&&ot(it)};function at(e,t){this.fun=e,this.array=t}at.prototype.run=function(){this.fun.apply(null,this.array)};E.title="browser";E.browser=!0;E.env={};E.argv=[];E.version="";E.versions={};function k(){}E.on=k;E.addListener=k;E.once=k;E.off=k;E.removeListener=k;E.removeAllListeners=k;E.emit=k;E.prependListener=k;E.prependOnceListener=k;E.listeners=function(e){return[]};E.binding=function(e){throw new Error("process.binding is not supported")};E.cwd=function(){return"/"};E.chdir=function(e){throw new Error("process.chdir is not supported")};E.umask=function(){return 0};var Dt=st.exports;const Ae=Ft(Dt);function ct(e,t){return function(){return e.apply(t,arguments)}}const{toString:Bt}=Object.prototype,{getPrototypeOf:Pe}=Object,{iterator:de,toStringTag:ut}=Symbol,pe=(e=>t=>{const n=Bt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>pe(t)===e),he=e=>t=>typeof t===e,{isArray:K}=Array,W=he("undefined");function Q(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const lt=U("ArrayBuffer");function kt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&<(e.buffer),t}const jt=he("string"),C=he("function"),ft=he("number"),Z=e=>e!==null&&typeof e=="object",qt=e=>e===!0||e===!1,ae=e=>{if(pe(e)!=="object")return!1;const t=Pe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ut in e)&&!(de in e)},It=e=>{if(!Z(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ht=U("Date"),Mt=U("File"),$t=e=>!!(e&&typeof e.uri<"u"),vt=e=>e&&typeof e.getParts<"u",zt=U("Blob"),Jt=U("FileList"),Vt=e=>Z(e)&&C(e.pipe);function Wt(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof le.global<"u"?le.global:{}}const Me=Wt(),$e=typeof Me.FormData<"u"?Me.FormData:void 0,Kt=e=>{let t;return e&&($e&&e instanceof $e||C(e.append)&&((t=pe(e))==="formdata"||t==="object"&&C(e.toString)&&e.toString()==="[object FormData]"))},Xt=U("URLSearchParams"),[Gt,Qt,Zt,Yt]=["ReadableStream","Request","Response","Headers"].map(U),en=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),K(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function dt(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:le.global,pt=e=>!W(e)&&e!==$;function Ce(){const{caseless:e,skipUndefined:t}=pt(this)&&this||{},n={},r=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=e&&dt(n,o)||o;ae(n[i])&&ae(s)?n[i]=Ce(n[i],s):ae(s)?n[i]=Ce({},s):K(s)?n[i]=s.slice():(!t||!W(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Y(arguments[s],r);return n}const tn=(e,t,n,{allOwnKeys:r}={})=>(Y(t,(s,o)=>{n&&C(s)?Object.defineProperty(e,o,{value:ct(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),nn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},sn=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Pe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},on=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},an=e=>{if(!e)return null;if(K(e))return e;let t=e.length;if(!ft(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},cn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pe(Uint8Array)),un=(e,t)=>{const r=(e&&e[de]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},ln=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=U("HTMLFormElement"),dn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pn=U("RegExp"),ht=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Y(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},hn=e=>{ht(e,(t,n)=>{if(C(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(C(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return K(e)?r(e):r(String(e).split(t)),n},yn=()=>{},bn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wn(e){return!!(e&&C(e.append)&&e[ut]==="FormData"&&e[de])}const En=e=>{const t=new Array(10),n=(r,s)=>{if(Z(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=K(r)?[]:{};return Y(r,(i,c)=>{const p=n(i,s+1);!W(p)&&(o[c]=p)}),t[s]=void 0,o}}return r};return n(e,0)},Rn=U("AsyncFunction"),gn=e=>e&&(Z(e)||C(e))&&C(e.then)&&C(e.catch),mt=((e,t)=>e?setImmediate:t?((n,r)=>($.addEventListener("message",({source:s,data:o})=>{s===$&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),$.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C($.postMessage)),Sn=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof Ae<"u"&&Ae.nextTick||mt,On=e=>e!=null&&C(e[de]),a={isArray:K,isArrayBuffer:lt,isBuffer:Q,isFormData:Kt,isArrayBufferView:kt,isString:jt,isNumber:ft,isBoolean:qt,isObject:Z,isPlainObject:ae,isEmptyObject:It,isReadableStream:Gt,isRequest:Qt,isResponse:Zt,isHeaders:Yt,isUndefined:W,isDate:Ht,isFile:Mt,isReactNativeBlob:$t,isReactNative:vt,isBlob:zt,isRegExp:pn,isFunction:C,isStream:Vt,isURLSearchParams:Xt,isTypedArray:cn,isFileList:Jt,forEach:Y,merge:Ce,extend:tn,trim:en,stripBOM:nn,inherits:rn,toFlatObject:sn,kindOf:pe,kindOfTest:U,endsWith:on,toArray:an,forEachEntry:un,matchAll:ln,isHTMLForm:fn,hasOwnProperty:ve,hasOwnProp:ve,reduceDescriptors:ht,freezeMethods:hn,toObjectSet:mn,toCamelCase:dn,noop:yn,toFiniteNumber:bn,findKey:dt,global:$,isContextDefined:pt,isSpecCompliantForm:wn,toJSONObject:En,isAsyncFn:Rn,isThenable:gn,setImmediate:mt,asap:Sn,isIterable:On};let y=class yt extends Error{static from(t,n,r,s,o,i){const c=new yt(t.message,n||t.code,r,s,o);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),i&&Object.assign(c,i),c}constructor(t,n,r,s,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.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:a.toJSONObject(this.config),code:this.code,status:this.status}}};y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";y.ERR_BAD_OPTION="ERR_BAD_OPTION";y.ECONNABORTED="ECONNABORTED";y.ETIMEDOUT="ETIMEDOUT";y.ERR_NETWORK="ERR_NETWORK";y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";y.ERR_DEPRECATED="ERR_DEPRECATED";y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";y.ERR_BAD_REQUEST="ERR_BAD_REQUEST";y.ERR_CANCELED="ERR_CANCELED";y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";y.ERR_INVALID_URL="ERR_INVALID_URL";const Tn=null;function xe(e){return a.isPlainObject(e)||a.isArray(e)}function bt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ee(e,t,n){return e?e.concat(t).map(function(s,o){return s=bt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function An(e){return a.isArray(e)&&!e.some(xe)}const Cn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function me(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!a.isUndefined(d[m])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function f(l){if(l===null)return"";if(a.isDate(l))return l.toISOString();if(a.isBoolean(l))return l.toString();if(!p&&a.isBlob(l))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(l)||a.isTypedArray(l)?p&&typeof Blob=="function"?new Blob([l]):le.Buffer.from(l):l}function u(l,m,d){let R=l;if(a.isReactNative(t)&&a.isReactNativeBlob(l))return t.append(Ee(d,m,o),f(l)),!1;if(l&&!d&&typeof l=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),l=JSON.stringify(l);else if(a.isArray(l)&&An(l)||(a.isFileList(l)||a.endsWith(m,"[]"))&&(R=a.toArray(l)))return m=bt(m),R.forEach(function(g,T){!(a.isUndefined(g)||g===null)&&t.append(i===!0?Ee([m],T,o):i===null?m:m+"[]",f(g))}),!1}return xe(l)?!0:(t.append(Ee(d,m,o),f(l)),!1)}const h=[],b=Object.assign(Cn,{defaultVisitor:u,convertValue:f,isVisitable:xe});function S(l,m){if(!a.isUndefined(l)){if(h.indexOf(l)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(l),a.forEach(l,function(R,_){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(_)?_.trim():_,m,b))===!0&&S(R,m?m.concat(_):[_])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}function ze(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fe(e,t){this._pairs=[],e&&me(e,this,t)}const wt=Fe.prototype;wt.append=function(t,n){this._pairs.push([t,n])};wt.toString=function(t){const n=t?function(r){return t.call(this,r,ze)}:ze;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function xn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Et(e,t,n){if(!t)return e;const r=n&&n.encode||xn,s=a.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=a.isURLSearchParams(t)?t.toString():new Fe(t,s).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Je{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},_n=typeof URLSearchParams<"u"?URLSearchParams:Fe,Nn=typeof FormData<"u"?FormData:null,Pn=typeof Blob<"u"?Blob:null,Fn={isBrowser:!0,classes:{URLSearchParams:_n,FormData:Nn,Blob:Pn},protocols:["http","https","file","blob","url","data"]},Le=typeof window<"u"&&typeof document<"u",_e=typeof navigator=="object"&&navigator||void 0,Un=Le&&(!_e||["ReactNative","NativeScript","NS"].indexOf(_e.product)<0),Ln=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dn=Le&&window.location.href||"http://localhost",Bn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Le,hasStandardBrowserEnv:Un,hasStandardBrowserWebWorkerEnv:Ln,navigator:_e,origin:Dn},Symbol.toStringTag,{value:"Module"})),O={...Bn,...Fn};function kn(e,t){return me(e,new O.classes.URLSearchParams,{visitor:function(n,r,s,o){return O.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function jn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Rt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),p=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,p?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=qn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(jn(r),s,n,0)}),n}return null}function In(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ee={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Rt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return me(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),In(t)):t}],transformResponse:[function(t){const n=this.transitional||ee.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const Hn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Mn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Hn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:a.isArray(e)?e.map(ce):String(e)}function $n(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const vn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Re(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function zn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Jn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let x=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,p,f){const u=G(p);if(!u)throw new Error("header name must be a non-empty string");const h=a.findKey(s,u);(!h||s[h]===void 0||f===!0||f===void 0&&s[h]!==!1)&&(s[h||p]=ce(c))}const i=(c,p)=>a.forEach(c,(f,u)=>o(f,u,p));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!vn(t))i(Mn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,f;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[f=u[0]]=(p=c[f])?a.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=G(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return $n(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=G(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Re(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=G(i),i){const c=a.findKey(r,i);c&&(!n||Re(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Re(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=ce(s),delete n[o];return}const c=t?zn(o):String(o).trim();c!==o&&delete n[o],n[c]=ce(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=G(i);r[c]||(Jn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(x.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(x);function ge(e,t){const n=this||ee,r=t||n,s=x.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function gt(e){return!!(e&&e.__CANCEL__)}let te=class extends y{constructor(t,n,r){super(t??"canceled",y.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function St(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Vn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const f=Date.now(),u=r[o];i||(i=f),n[s]=p,r[s]=f;let h=o,b=0;for(;h!==s;)b+=n[h++],h=h%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-i<t)return;const S=u&&f-u;return S?Math.round(b*1e3/S):void 0}}function Kn(e,t){let n=0,r=1e3/t,s,o;const i=(f,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),h=u-n;h>=r?i(f,u):(s=f,o||(o=setTimeout(()=>{o=null,i(s)},r-h)))},()=>s&&i(s)]}const fe=(e,t,n=3)=>{let r=0;const s=Wn(50,250);return Kn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,p=i-r,f=s(p),u=i<=c;r=i;const h={loaded:i,total:c,progress:c?i/c:void 0,bytes:p,rate:f||void 0,estimated:f&&c&&u?(c-i)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},We=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ke=e=>(...t)=>a.asap(()=>e(...t)),Xn=O.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,O.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,Gn=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Qn(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ot(e,t,n){let r=!Qn(t);return e&&(r||n==!1)?Zn(e,t):t}const Xe=e=>e instanceof x?{...e}:e;function z(e,t){t=t||{};const n={};function r(f,u,h,b){return a.isPlainObject(f)&&a.isPlainObject(u)?a.merge.call({caseless:b},f,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(f,u,h,b){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f,h,b)}else return r(f,u,h,b)}function o(f,u){if(!a.isUndefined(u))return r(void 0,u)}function i(f,u){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function c(f,u,h){if(h in t)return r(f,u);if(h in e)return r(void 0,f)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(f,u,h)=>s(Xe(f),Xe(u),h,!0)};return a.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=a.hasOwnProp(p,u)?p[u]:s,b=h(e[u],t[u],u);a.isUndefined(b)&&h!==c||(n[u]=b)}),n}const Tt=e=>{const t=z({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=x.from(i),t.url=Et(Ot(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),f=["content-type","content-length"];Object.entries(p).forEach(([u,h])=>{f.includes(u.toLowerCase())&&i.set(u,h)})}}if(O.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Xn(t.url))){const p=s&&o&&Gn.read(o);p&&i.set(s,p)}return t},Yn=typeof XMLHttpRequest<"u",er=Yn&&function(e){return new Promise(function(n,r){const s=Tt(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:f}=s,u,h,b,S,l;function m(){S&&S(),l&&l(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(s.method.toUpperCase(),s.url,!0),d.timeout=s.timeout;function R(){if(!d)return;const g=x.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),F={data:!c||c==="text"||c==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:e,request:d};St(function(N){n(N),m()},function(N){r(N),m()},F),d=null}"onloadend"in d?d.onloadend=R:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(R)},d.onabort=function(){d&&(r(new y("Request aborted",y.ECONNABORTED,e,d)),d=null)},d.onerror=function(T){const F=T&&T.message?T.message:"Network Error",I=new y(F,y.ERR_NETWORK,e,d);I.event=T||null,r(I),d=null},d.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const F=s.transitional||Ue;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new y(T,F.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,d)),d=null},o===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(T,F){d.setRequestHeader(F,T)}),a.isUndefined(s.withCredentials)||(d.withCredentials=!!s.withCredentials),c&&c!=="json"&&(d.responseType=s.responseType),f&&([b,l]=fe(f,!0),d.addEventListener("progress",b)),p&&d.upload&&([h,S]=fe(p),d.upload.addEventListener("progress",h),d.upload.addEventListener("loadend",S)),(s.cancelToken||s.signal)&&(u=g=>{d&&(r(!g||g.type?new te(null,e,d):g),d.abort(),d=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const _=Vn(s.url);if(_&&O.protocols.indexOf(_)===-1){r(new y("Unsupported protocol "+_+":",y.ERR_BAD_REQUEST,e));return}d.send(o||null)})},tr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(f){if(!s){s=!0,c();const u=f instanceof Error?f:this.reason;r.abort(u instanceof y?u:new te(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout of ${t}ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},nr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},rr=async function*(e,t){for await(const n of sr(e))yield*nr(n,t)},sr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ge=(e,t,n,r)=>{const s=rr(e,t);let o=0,i,c=p=>{i||(i=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:f,value:u}=await s.next();if(f){c(),p.close();return}let h=u.byteLength;if(n){let b=o+=h;n(b)}p.enqueue(new Uint8Array(u))}catch(f){throw c(f),f}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},Qe=64*1024,{isFunction:oe}=a,or=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ze,TextEncoder:Ye}=a.global,et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ir=e=>{e=a.merge.call({skipUndefined:!0},or,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",o=oe(n),i=oe(r);if(!s)return!1;const c=s&&oe(Ze),p=s&&(typeof Ye=="function"?(l=>m=>l.encode(m))(new Ye):async l=>new Uint8Array(await new n(l).arrayBuffer())),f=o&&c&&et(()=>{let l=!1;const m=new n(O.origin,{body:new Ze,method:"POST",get duplex(){return l=!0,"half"}}).headers.has("Content-Type");return l&&!m}),u=i&&c&&et(()=>a.isReadableStream(new r("").body)),h={stream:u&&(l=>l.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(l=>{!h[l]&&(h[l]=(m,d)=>{let R=m&&m[l];if(R)return R.call(m);throw new y(`Response type '${l}' is not supported`,y.ERR_NOT_SUPPORT,d)})});const b=async l=>{if(l==null)return 0;if(a.isBlob(l))return l.size;if(a.isSpecCompliantForm(l))return(await new n(O.origin,{method:"POST",body:l}).arrayBuffer()).byteLength;if(a.isArrayBufferView(l)||a.isArrayBuffer(l))return l.byteLength;if(a.isURLSearchParams(l)&&(l=l+""),a.isString(l))return(await p(l)).byteLength},S=async(l,m)=>{const d=a.toFiniteNumber(l.getContentLength());return d??b(m)};return async l=>{let{url:m,method:d,data:R,signal:_,cancelToken:g,timeout:T,onDownloadProgress:F,onUploadProgress:I,responseType:N,headers:be,withCredentials:ne="same-origin",fetchOptions:Be}=Tt(l),ke=t||fetch;N=N?(N+"").toLowerCase():"text";let re=tr([_,g&&g.toAbortSignal()],T),X=null;const H=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let je;try{if(I&&f&&d!=="get"&&d!=="head"&&(je=await S(be,R))!==0){let q=new n(m,{method:"POST",body:R,duplex:"half"}),J;if(a.isFormData(R)&&(J=q.headers.get("content-type"))&&be.setContentType(J),q.body){const[we,se]=We(je,fe(Ke(I)));R=Ge(q.body,Qe,we,se)}}a.isString(ne)||(ne=ne?"include":"omit");const A=o&&"credentials"in n.prototype,qe={...Be,signal:re,method:d.toUpperCase(),headers:be.normalize().toJSON(),body:R,duplex:"half",credentials:A?ne:void 0};X=o&&new n(m,qe);let j=await(o?ke(X,Be):ke(m,qe));const Ie=u&&(N==="stream"||N==="response");if(u&&(F||Ie&&H)){const q={};["status","statusText","headers"].forEach(He=>{q[He]=j[He]});const J=a.toFiniteNumber(j.headers.get("content-length")),[we,se]=F&&We(J,fe(Ke(F),!0))||[];j=new r(Ge(j.body,Qe,we,()=>{se&&se(),H&&H()}),q)}N=N||"text";let Pt=await h[a.findKey(h,N)||"text"](j,l);return!Ie&&H&&H(),await new Promise((q,J)=>{St(q,J,{data:Pt,headers:x.from(j.headers),status:j.status,statusText:j.statusText,config:l,request:X})})}catch(A){throw H&&H(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,l,X,A&&A.response),{cause:A.cause||A}):y.from(A,A&&A.code,l,X,A&&A.response)}}},ar=new Map,At=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,p,f,u=ar;for(;c--;)p=o[c],f=u.get(p),f===void 0&&u.set(p,f=c?new Map:ir(t)),u=f;return f};At();const De={http:Tn,xhr:er,fetch:{get:At}};a.forEach(De,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const tt=e=>`- ${e}`,cr=e=>a.isFunction(e)||e===null||e===!1;function ur(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!cr(r)&&(s=De[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,f])=>`adapter ${p} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
4
|
+
`+i.map(tt).join(`
|
|
5
|
+
`):" "+tt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Ct={getAdapter:ur,adapters:De};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te(null,e)}function nt(e){return Se(e),e.headers=x.from(e.headers),e.data=ge.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ct.getAdapter(e.adapter||ee.adapter,e)(e).then(function(r){return Se(e),r.data=ge.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return gt(r)||(Se(e),r&&r.response&&(r.response.data=ge.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const xt="1.13.6",ye={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ye[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rt={};ye.transitional=function(t,n,r){function s(o,i){return"[Axios v"+xt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!rt[i]&&(rt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ye.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function lr(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],p=c===void 0||i(c,o,e);if(p!==!0)throw new y("option "+o+" must be "+p,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ue={assertOptions:lr,validators:ye},P=ue.validators;let v=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Je,response:new Je}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=z(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean),legacyInterceptorReqResOrdering:P.transitional(P.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ue.assertOptions(s,{encode:P.function,serialize:P.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ue.assertOptions(n,{baseUrl:P.spelling("baseURL"),withXsrfToken:P.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],l=>{delete o[l]}),n.headers=x.concat(i,o);const c=[];let p=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(n)===!1)return;p=p&&m.synchronous;const d=n.transitional||Ue;d&&d.legacyInterceptorReqResOrdering?c.unshift(m.fulfilled,m.rejected):c.push(m.fulfilled,m.rejected)});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let u,h=0,b;if(!p){const l=[nt.bind(this),void 0];for(l.unshift(...c),l.push(...f),b=l.length,u=Promise.resolve(n);h<b;)u=u.then(l[h++],l[h++]);return u}b=c.length;let S=n;for(;h<b;){const l=c[h++],m=c[h++];try{S=l(S)}catch(d){m.call(this,d);break}}try{u=nt.call(this,S)}catch(l){return Promise.reject(l)}for(h=0,b=f.length;h<b;)u=u.then(f[h++],f[h++]);return u}getUri(t){t=z(this.defaults,t);const n=Ot(t.baseURL,t.url,t.allowAbsoluteUrls);return Et(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){v.prototype[t]=function(n,r){return this.request(z(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(z(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}v.prototype[t]=n(),v.prototype[t+"Form"]=n(!0)});let fr=class _t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new te(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _t(function(s){t=s}),cancel:t}}};function dr(e){return function(n){return e.apply(null,n)}}function pr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ne={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(Ne).forEach(([e,t])=>{Ne[t]=e});function Nt(e){const t=new v(e),n=ct(v.prototype.request,t);return a.extend(n,v.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Nt(z(e,s))},n}const w=Nt(ee);w.Axios=v;w.CanceledError=te;w.CancelToken=fr;w.isCancel=gt;w.VERSION=xt;w.toFormData=me;w.AxiosError=y;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=dr;w.isAxiosError=pr;w.mergeConfig=z;w.AxiosHeaders=x;w.formToJSON=e=>Rt(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=Ct.getAdapter;w.HttpStatusCode=Ne;w.default=w;const{Axios:br,AxiosError:wr,CanceledError:Er,isCancel:Rr,CancelToken:gr,VERSION:Sr,all:Or,Cancel:Tr,isAxiosError:Ar,spread:Cr,toFormData:xr,AxiosHeaders:_r,HttpStatusCode:Nr,formToJSON:Pr,getAdapter:Fr,mergeConfig:Ur}=w;exports.axios=w;exports.process$1=Ae;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";const _=require("./toString-DsGM1XcL.cjs"),Oe=require("./index-D0bnLDAA.cjs");var me=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Se=/^\w*$/;function Le(t,e){if(_.isArray(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||_.isSymbol(t)?!0:Se.test(t)||!me.test(t)||e!=null&&t in Object(e)}var Pe="Expected a function";function re(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Pe);var n=function(){var s=arguments,r=e?e.apply(this,s):s[0],i=n.cache;if(i.has(r))return i.get(r);var o=t.apply(this,s);return n.cache=i.set(r,o)||i,o};return n.cache=new(re.Cache||_.MapCache),n}re.Cache=_.MapCache;var He=500;function _e(t){var e=re(t,function(s){return n.size===He&&n.clear(),s}),n=e.cache;return e}var Fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/\\(\\)?/g,Ue=_e(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Fe,function(n,s,r,i){e.push(r?i.replace(ke,"$1"):s||n)}),e});function Me(t,e){return _.isArray(t)?t:Le(t,e)?[t]:Ue(_.toString(t))}function Ve(t){if(typeof t=="string"||_.isSymbol(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ve(t,e){e=Me(e,t);for(var n=0,s=e.length;t!=null&&n<s;)t=t[Ve(e[n++])];return n&&n==s?t:void 0}function $e(t,e,n){var s=t==null?void 0:ve(t,e);return s===void 0?n:s}const pe=(t,e)=>{const n=new URL(t);n.pathname=[...n.pathname.split("/"),"cloud","capabilities"].filter(Boolean).join("/"),n.searchParams.append("format","json");const s=n.href;return{async getCapabilities(){const r=await e.get(s);return $e(r,"data.ocs.data",{capabilities:null,version:null})}}};function Be(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function $(t,e=""){if(!Number.isSafeInteger(t)||t<0){const n=e&&`"${e}" `;throw new Error(`${n}expected integer >= 0, got ${t}`)}}function B(t,e,n=""){const s=Be(t),r=t?.length,i=e!==void 0;if(!s||i&&r!==e){const o=n&&`"${n}" `,a=i?` of length ${e}`:"",f=s?`length=${r}`:`type=${typeof t}`;throw new Error(o+"expected Uint8Array"+a+", got "+f)}return t}function be(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash must wrapped by utils.createHasher");$(t.outputLen),$(t.blockLen)}function W(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Re(t,e){B(t,void 0,"digestInto() output");const n=e.outputLen;if(t.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function R(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Y(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function je(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function oe(t,e=""){return typeof t=="string"?je(t):B(t,void 0,e)}function Ke(t,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options must be object or undefined");return Object.assign(t,e)}function Ge(t,e={}){const n=(r,i)=>t(i).update(r).digest(),s=t(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=r=>t(r),Object.assign(n,e),Object.freeze(n)}const Xe=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});class Ee{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,n){if(be(e),B(n,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,r=new Uint8Array(s);r.set(n.length>s?e.create().update(n).digest():n);for(let i=0;i<r.length;i++)r[i]^=54;this.iHash.update(r),this.oHash=e.create();for(let i=0;i<r.length;i++)r[i]^=106;this.oHash.update(r),R(r)}update(e){return W(this),this.iHash.update(e),this}digestInto(e){W(this),B(e,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:n,iHash:s,finished:r,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=s._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ye=(t,e,n)=>new Ee(t,e).update(n).digest();ye.create=(t,e)=>new Ee(t,e);function ze(t,e,n,s){be(t);const r=Ke({dkLen:32,asyncTick:10},s),{c:i,dkLen:o,asyncTick:a}=r;if($(i,"c"),$(o,"dkLen"),$(a,"asyncTick"),i<1)throw new Error("iterations (c) must be >= 1");const f=oe(e,"password"),c=oe(n,"salt"),l=new Uint8Array(o),u=ye.create(t,f),d=u._cloneInto().update(c);return{c:i,dkLen:o,asyncTick:a,DK:l,PRF:u,PRFSalt:d}}function Ye(t,e,n,s,r){return t.destroy(),e.destroy(),s&&s.destroy(),R(r),n}function We(t,e,n,s){const{c:r,dkLen:i,DK:o,PRF:a,PRFSalt:f}=ze(t,e,n,s);let c;const l=new Uint8Array(4),u=Y(l),d=new Uint8Array(a.outputLen);for(let w=1,E=0;E<i;w++,E+=a.outputLen){const b=o.subarray(E,E+a.outputLen);u.setInt32(0,w,!1),(c=f._cloneInto(c)).update(l).digestInto(d),b.set(d.subarray(0,b.length));for(let h=1;h<r;h++){a._cloneInto(c).update(d).digestInto(d);for(let y=0;y<b.length;y++)b[y]^=d[y]}}return Ye(a,f,o,c,d)}class Ze{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,n,s,r){this.blockLen=e,this.outputLen=n,this.padOffset=s,this.isLE=r,this.buffer=new Uint8Array(e),this.view=Y(this.buffer)}update(e){W(this),B(e);const{view:n,buffer:s,blockLen:r}=this,i=e.length;for(let o=0;o<i;){const a=Math.min(r-this.pos,i-o);if(a===r){const f=Y(e);for(;r<=i-o;o+=r)this.process(f,o);continue}s.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){W(this),Re(e,this),this.finished=!0;const{buffer:n,view:s,blockLen:r,isLE:i}=this;let{pos:o}=this;n[o++]=128,R(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(s,0),o=0);for(let u=o;u<r;u++)n[u]=0;s.setBigUint64(r-8,BigInt(this.length*8),i),this.process(s,0);const a=Y(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=f/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)a.setUint32(4*u,l[u],i)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const s=e.slice(0,n);return this.destroy(),s}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:n,buffer:s,length:r,finished:i,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=i,e.length=r,e.pos=a,r%n&&e.buffer.set(s),e}clone(){return this._cloneInto()}}const x=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),G=BigInt(2**32-1),ce=BigInt(32);function qe(t,e=!1){return e?{h:Number(t&G),l:Number(t>>ce&G)}:{h:Number(t>>ce&G)|0,l:Number(t&G)|0}}function Je(t,e=!1){const n=t.length;let s=new Uint32Array(n),r=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:a}=qe(t[i],e);[s[i],r[i]]=[o,a]}return[s,r]}const fe=(t,e,n)=>t>>>n,ae=(t,e,n)=>t<<32-n|e>>>n,U=(t,e,n)=>t>>>n|e<<32-n,M=(t,e,n)=>t<<32-n|e>>>n,X=(t,e,n)=>t<<64-n|e>>>n-32,z=(t,e,n)=>t>>>n-32|e<<64-n;function O(t,e,n,s){const r=(e>>>0)+(s>>>0);return{h:t+n+(r/2**32|0)|0,l:r|0}}const Qe=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),De=(t,e,n,s)=>e+n+s+(t/2**32|0)|0,et=(t,e,n,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(s>>>0),tt=(t,e,n,s,r)=>e+n+s+r+(t/2**32|0)|0,nt=(t,e,n,s,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(s>>>0)+(r>>>0),st=(t,e,n,s,r,i)=>e+n+s+r+i+(t/2**32|0)|0,we=Je(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),rt=we[0],it=we[1],L=new Uint32Array(80),P=new Uint32Array(80);class ot extends Ze{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:n,Bh:s,Bl:r,Ch:i,Cl:o,Dh:a,Dl:f,Eh:c,El:l,Fh:u,Fl:d,Gh:w,Gl:E,Hh:b,Hl:h}=this;return[e,n,s,r,i,o,a,f,c,l,u,d,w,E,b,h]}set(e,n,s,r,i,o,a,f,c,l,u,d,w,E,b,h){this.Ah=e|0,this.Al=n|0,this.Bh=s|0,this.Bl=r|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=f|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=w|0,this.Gl=E|0,this.Hh=b|0,this.Hl=h|0}process(e,n){for(let g=0;g<16;g++,n+=4)L[g]=e.getUint32(n),P[g]=e.getUint32(n+=4);for(let g=16;g<80;g++){const m=L[g-15]|0,S=P[g-15]|0,J=U(m,S,1)^U(m,S,8)^fe(m,S,7),Q=M(m,S,1)^M(m,S,8)^ae(m,S,7),A=L[g-2]|0,C=P[g-2]|0,j=U(A,C,19)^X(A,C,61)^fe(A,C,6),D=M(A,C,19)^z(A,C,61)^ae(A,C,6),K=et(Q,D,P[g-7],P[g-16]),ee=tt(K,J,j,L[g-7],L[g-16]);L[g]=ee|0,P[g]=K|0}let{Ah:s,Al:r,Bh:i,Bl:o,Ch:a,Cl:f,Dh:c,Dl:l,Eh:u,El:d,Fh:w,Fl:E,Gh:b,Gl:h,Hh:y,Hl:I}=this;for(let g=0;g<80;g++){const m=U(u,d,14)^U(u,d,18)^X(u,d,41),S=M(u,d,14)^M(u,d,18)^z(u,d,41),J=u&w^~u&b,Q=d&E^~d&h,A=nt(I,S,Q,it[g],P[g]),C=st(A,y,m,J,rt[g],L[g]),j=A|0,D=U(s,r,28)^X(s,r,34)^X(s,r,39),K=M(s,r,28)^z(s,r,34)^z(s,r,39),ee=s&i^s&a^i&a,Ce=r&o^r&f^o&f;y=b|0,I=h|0,b=w|0,h=E|0,w=u|0,E=d|0,{h:u,l:d}=O(c|0,l|0,C|0,j|0),c=a|0,l=f|0,a=i|0,f=o|0,i=s|0,o=r|0;const ie=Qe(j,K,Ce);s=De(ie,C,D,ee),r=ie|0}({h:s,l:r}=O(this.Ah|0,this.Al|0,s|0,r|0)),{h:i,l:o}=O(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:f}=O(this.Ch|0,this.Cl|0,a|0,f|0),{h:c,l}=O(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=O(this.Eh|0,this.El|0,u|0,d|0),{h:w,l:E}=O(this.Fh|0,this.Fl|0,w|0,E|0),{h:b,l:h}=O(this.Gh|0,this.Gl|0,b|0,h|0),{h:y,l:I}=O(this.Hh|0,this.Hl|0,y|0,I|0),this.set(s,r,i,o,a,f,c,l,u,d,w,E,b,h,y,I)}roundClean(){R(L,P)}destroy(){R(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ct extends ot{Ah=x[0]|0;Al=x[1]|0;Bh=x[2]|0;Bl=x[3]|0;Ch=x[4]|0;Cl=x[5]|0;Dh=x[6]|0;Dl=x[7]|0;Eh=x[8]|0;El=x[9]|0;Fh=x[10]|0;Fl=x[11]|0;Gh=x[12]|0;Gl=x[13]|0;Hh=x[14]|0;Hl=x[15]|0;constructor(){super(64)}}const ft=Ge(()=>new ct,Xe(3)),at=(t,e,n,s)=>Oe.Buffer.from(We(ft,t,e,{c:n,dkLen:s})),xe=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ut=xe+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",lt="["+xe+"]["+ut+"]*",dt=new RegExp("^"+lt+"$");function Ne(t,e){const n=[];let s=e.exec(t);for(;s;){const r=[];r.startIndex=e.lastIndex-s[0].length;const i=s.length;for(let o=0;o<i;o++)r.push(s[o]);n.push(r),s=e.exec(t)}return n}const q=function(t){const e=dt.exec(t);return!(e===null||typeof e>"u")};function ht(t){return typeof t<"u"}const gt={allowBooleanAttributes:!1,unpairedTags:[]};function pt(t,e){e=Object.assign({},gt,e);const n=[];let s=!1,r=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let i=0;i<t.length;i++)if(t[i]==="<"&&t[i+1]==="?"){if(i+=2,i=le(t,i),i.err)return i}else if(t[i]==="<"){let o=i;if(i++,t[i]==="!"){i=de(t,i);continue}else{let a=!1;t[i]==="/"&&(a=!0,i++);let f="";for(;i<t.length&&t[i]!==">"&&t[i]!==" "&&t[i]!==" "&&t[i]!==`
|
|
2
|
+
`&&t[i]!=="\r";i++)f+=t[i];if(f=f.trim(),f[f.length-1]==="/"&&(f=f.substring(0,f.length-1),i--),!It(f)){let u;return f.trim().length===0?u="Invalid space after '<'.":u="Tag '"+f+"' is an invalid name.",p("InvalidTag",u,N(t,i))}const c=yt(t,i);if(c===!1)return p("InvalidAttr","Attributes for '"+f+"' have open quote.",N(t,i));let l=c.value;if(i=c.index,l[l.length-1]==="/"){const u=i-l.length;l=l.substring(0,l.length-1);const d=he(l,e);if(d===!0)s=!0;else return p(d.err.code,d.err.msg,N(t,u+d.err.line))}else if(a)if(c.tagClosed){if(l.trim().length>0)return p("InvalidTag","Closing tag '"+f+"' can't have attributes or invalid starting.",N(t,o));if(n.length===0)return p("InvalidTag","Closing tag '"+f+"' has not been opened.",N(t,o));{const u=n.pop();if(f!==u.tagName){let d=N(t,u.tagStartPos);return p("InvalidTag","Expected closing tag '"+u.tagName+"' (opened in line "+d.line+", col "+d.col+") instead of closing tag '"+f+"'.",N(t,o))}n.length==0&&(r=!0)}}else return p("InvalidTag","Closing tag '"+f+"' doesn't have proper closing.",N(t,i));else{const u=he(l,e);if(u!==!0)return p(u.err.code,u.err.msg,N(t,i-l.length+u.err.line));if(r===!0)return p("InvalidXml","Multiple possible root nodes found.",N(t,i));e.unpairedTags.indexOf(f)!==-1||n.push({tagName:f,tagStartPos:o}),s=!0}for(i++;i<t.length;i++)if(t[i]==="<")if(t[i+1]==="!"){i++,i=de(t,i);continue}else if(t[i+1]==="?"){if(i=le(t,++i),i.err)return i}else break;else if(t[i]==="&"){const u=Nt(t,i);if(u==-1)return p("InvalidChar","char '&' is not expected.",N(t,i));i=u}else if(r===!0&&!ue(t[i]))return p("InvalidXml","Extra text at the end",N(t,i));t[i]==="<"&&i--}}else{if(ue(t[i]))continue;return p("InvalidChar","char '"+t[i]+"' is not expected.",N(t,i))}if(s){if(n.length==1)return p("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",N(t,n[0].tagStartPos));if(n.length>0)return p("InvalidXml","Invalid '"+JSON.stringify(n.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return p("InvalidXml","Start tag expected.",1);return!0}function ue(t){return t===" "||t===" "||t===`
|
|
3
|
+
`||t==="\r"}function le(t,e){const n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){const s=t.substr(n,e-n);if(e>5&&s==="xml")return p("InvalidXml","XML declaration allowed only at the start of the document.",N(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function de(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}const bt='"',Et="'";function yt(t,e){let n="",s="",r=!1;for(;e<t.length;e++){if(t[e]===bt||t[e]===Et)s===""?s=t[e]:s!==t[e]||(s="");else if(t[e]===">"&&s===""){r=!0;break}n+=t[e]}return s!==""?!1:{value:n,index:e,tagClosed:r}}const wt=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function he(t,e){const n=Ne(t,wt),s={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return p("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",V(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return p("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",V(n[r]));if(n[r][3]===void 0&&!e.allowBooleanAttributes)return p("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",V(n[r]));const i=n[r][2];if(!Tt(i))return p("InvalidAttr","Attribute '"+i+"' is an invalid name.",V(n[r]));if(!Object.prototype.hasOwnProperty.call(s,i))s[i]=1;else return p("InvalidAttr","Attribute '"+i+"' is repeated.",V(n[r]))}return!0}function xt(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return-1}function Nt(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,xt(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}function p(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function Tt(t){return q(t)}function It(t){return q(t)}function N(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function V(t){return t.startIndex+t[1].length}const At={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0};function Te(t){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof t=="object"&&t!==null?{enabled:t.enabled!==!1,maxEntitySize:t.maxEntitySize??1e4,maxExpansionDepth:t.maxExpansionDepth??10,maxTotalExpansions:t.maxTotalExpansions??1e3,maxExpandedLength:t.maxExpandedLength??1e5,maxEntityCount:t.maxEntityCount??100,allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:Te(!0)}const Ct=function(t){const e=Object.assign({},At,t);return e.processEntities=Te(e.processEntities),e};let Z;typeof Symbol!="function"?Z="@@xmlMetadata":Z=Symbol("XML Node Metadata");class H{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),n!==void 0&&(this.child[this.child.length-1][Z]={startIndex:n})}static getMetaDataSymbol(){return Z}}class Ot{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,n){const s=Object.create(null);let r=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let i=1,o=!1,a=!1,f="";for(;n<e.length;n++)if(e[n]==="<"&&!a){if(o&&F(e,"!ENTITY",n)){n+=7;let c,l;if([c,l,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),l.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const u=c.replace(/[.\-+*:]/g,"\\.");s[c]={regx:RegExp(`&${u};`,"g"),val:l},r++}}else if(o&&F(e,"!ELEMENT",n)){n+=8;const{index:c}=this.readElementExp(e,n+1);n=c}else if(o&&F(e,"!ATTLIST",n))n+=8;else if(o&&F(e,"!NOTATION",n)){n+=9;const{index:c}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=c}else if(F(e,"!--",n))a=!0;else throw new Error("Invalid DOCTYPE");i++,f=""}else if(e[n]===">"){if(a?e[n-1]==="-"&&e[n-2]==="-"&&(a=!1,i--):i--,i===0)break}else e[n]==="["?o=!0:f+=e[n];if(i!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:n}}readEntityExp(e,n){n=T(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)s+=e[n],n++;if(v(s),n=T(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let r="";if([n,r]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize&&r.length>this.options.maxEntitySize)throw new Error(`Entity "${s}" size (${r.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[s,r,n]}readNotationExp(e,n){n=T(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;!this.suppressValidationErr&&v(s),n=T(e,n);const r=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&r!=="SYSTEM"&&r!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);n+=r.length,n=T(e,n);let i=null,o=null;if(r==="PUBLIC")[n,i]=this.readIdentifierVal(e,n,"publicIdentifier"),n=T(e,n),(e[n]==='"'||e[n]==="'")&&([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(r==="SYSTEM"&&([n,o]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:i,systemIdentifier:o,index:--n}}readIdentifierVal(e,n,s){let r="";const i=e[n];if(i!=='"'&&i!=="'")throw new Error(`Expected quoted string, found "${i}"`);for(n++;n<e.length&&e[n]!==i;)r+=e[n],n++;if(e[n]!==i)throw new Error(`Unterminated ${s} value`);return n++,[n,r]}readElementExp(e,n){n=T(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;if(!this.suppressValidationErr&&!q(s))throw new Error(`Invalid element name: "${s}"`);n=T(e,n);let r="";if(e[n]==="E"&&F(e,"MPTY",n))n+=4;else if(e[n]==="A"&&F(e,"NY",n))n+=2;else if(e[n]==="("){for(n++;n<e.length&&e[n]!==")";)r+=e[n],n++;if(e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return{elementName:s,contentModel:r.trim(),index:n}}readAttlistExp(e,n){n=T(e,n);let s="";for(;n<e.length&&!/\s/.test(e[n]);)s+=e[n],n++;v(s),n=T(e,n);let r="";for(;n<e.length&&!/\s/.test(e[n]);)r+=e[n],n++;if(!v(r))throw new Error(`Invalid attribute name: "${r}"`);n=T(e,n);let i="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(i="NOTATION",n+=8,n=T(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let a=[];for(;n<e.length&&e[n]!==")";){let f="";for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)f+=e[n],n++;if(f=f.trim(),!v(f))throw new Error(`Invalid notation name: "${f}"`);a.push(f),e[n]==="|"&&(n++,n=T(e,n))}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,i+=" ("+a.join("|")+")"}else{for(;n<e.length&&!/\s/.test(e[n]);)i+=e[n],n++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(i.toUpperCase()))throw new Error(`Invalid attribute type: "${i}"`)}n=T(e,n);let o="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(o="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(o="#IMPLIED",n+=7):[n,o]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:s,attributeName:r,attributeType:i,defaultValue:o,index:n}}}const T=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function F(t,e,n){for(let s=0;s<e.length;s++)if(e[s]!==t[n+s+1])return!1;return!0}function v(t){if(q(t))return t;throw new Error(`Invalid entity name ${t}`)}const mt=/^[-+]?0x[a-fA-F0-9]+$/,St=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Lt={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function Pt(t,e={}){if(e=Object.assign({},Lt,e),!t||typeof t!="string")return t;let n=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(t==="0")return 0;if(e.hex&&mt.test(n))return kt(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return _t(t,n,e);{const s=St.exec(n);if(s){const r=s[1]||"",i=s[2];let o=Ft(s[3]);const a=r?t[i.length+1]===".":t[i.length]===".";if(!e.leadingZeros&&(i.length>1||i.length===1&&!a))return t;{const f=Number(n),c=String(f);if(f===0)return f;if(c.search(/[eE]/)!==-1)return e.eNotation?f:t;if(n.indexOf(".")!==-1)return c==="0"||c===o||c===`${r}${o}`?f:t;let l=i?o:n;return i?l===c||r+l===c?f:t:l===c||l===r+c?f:t}}else return t}}else return Ut(t,Number(n),e)}const Ht=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function _t(t,e,n){if(!n.eNotation)return t;const s=e.match(Ht);if(s){let r=s[1]||"";const i=s[3].indexOf("e")===-1?"E":"e",o=s[2],a=r?t[o.length+1]===i:t[o.length]===i;return o.length>1&&a?t:o.length===1&&(s[3].startsWith(`.${i}`)||s[3][0]===i)?Number(e):n.leadingZeros&&!a?(e=(s[1]||"")+s[3],Number(e)):t}else return t}function Ft(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substring(0,t.length-1))),t}function kt(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Ut(t,e,n){const s=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return s?"Infinity":"-Infinity";default:return t}}function Mt(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}class Vt{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,s)=>ge(s,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,s)=>ge(s,16,"&#x")}},this.addExternalEntities=vt,this.parseXml=Kt,this.parseTextData=$t,this.resolveNameSpace=Bt,this.buildAttributesMap=jt,this.isItStopNode=Yt,this.replaceEntitiesValue=Xt,this.readStopNodeData=Zt,this.saveTextToParentTag=zt,this.addChild=Gt,this.ignoreAttributesFn=Mt(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const s=this.options.stopNodes[n];typeof s=="string"&&(s.startsWith("*.")?this.stopNodesWildcard.add(s.substring(2)):this.stopNodesExact.add(s))}}}}function vt(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const s=e[n],r=s.replace(/[.\-+*:]/g,"\\.");this.lastEntities[s]={regex:new RegExp("&"+r+";","g"),val:t[s]}}}function $t(t,e,n,s,r,i,o){if(t!==void 0&&(this.options.trimValues&&!s&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const a=this.options.tagValueProcessor(e,t,n,r,i);return a==null?t:typeof a!=typeof t||a!==t?a:this.options.trimValues?se(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?se(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Bt(t){if(this.options.removeNSPrefix){const e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}const Rt=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function jt(t,e,n){if(this.options.ignoreAttributes!==!0&&typeof t=="string"){const s=Ne(t,Rt),r=s.length,i={};for(let o=0;o<r;o++){const a=this.resolveNameSpace(s[o][1]);if(this.ignoreAttributesFn(a,e))continue;let f=s[o][4],c=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),f!==void 0){this.options.trimValues&&(f=f.trim()),f=this.replaceEntitiesValue(f,n,e);const l=this.options.attributeValueProcessor(a,f,e);l==null?i[c]=f:typeof l!=typeof f||l!==f?i[c]=l:i[c]=se(f,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[c]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const o={};return o[this.options.attributesGroupName]=i,o}return i}}const Kt=function(t){t=t.replace(/\r\n?/g,`
|
|
4
|
+
`);const e=new H("!xml");let n=e,s="",r="";this.entityExpansionCount=0,this.currentExpandedLength=0;const i=new Ot(this.options.processEntities);for(let o=0;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="/"){const f=k(t,">",o,"Closing Tag is not closed.");let c=t.substring(o+2,f).trim();if(this.options.removeNSPrefix){const d=c.indexOf(":");d!==-1&&(c=c.substr(d+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&(s=this.saveTextToParentTag(s,n,r));const l=r.substring(r.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let u=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(u=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=r.lastIndexOf("."),r=r.substring(0,u),n=this.tagsNodeStack.pop(),s="",o=f}else if(t[o+1]==="?"){let f=ne(t,o,!1,"?>");if(!f)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,n,r),!(this.options.ignoreDeclaration&&f.tagName==="?xml"||this.options.ignorePiTags)){const c=new H(f.tagName);c.add(this.options.textNodeName,""),f.tagName!==f.tagExp&&f.attrExpPresent&&(c[":@"]=this.buildAttributesMap(f.tagExp,r,f.tagName)),this.addChild(n,c,r,o)}o=f.closeIndex+1}else if(t.substr(o+1,3)==="!--"){const f=k(t,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=t.substring(o+4,f-2);s=this.saveTextToParentTag(s,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=f}else if(t.substr(o+1,2)==="!D"){const f=i.readDocType(t,o);this.docTypeEntities=f.entities,o=f.i}else if(t.substr(o+1,2)==="!["){const f=k(t,"]]>",o,"CDATA is not closed.")-2,c=t.substring(o+9,f);s=this.saveTextToParentTag(s,n,r);let l=this.parseTextData(c,n.tagname,r,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):n.add(this.options.textNodeName,l),o=f+2}else{let f=ne(t,o,this.options.removeNSPrefix),c=f.tagName;const l=f.rawTagName;let u=f.tagExp,d=f.attrExpPresent,w=f.closeIndex;if(this.options.transformTagName){const h=this.options.transformTagName(c);u===c&&(u=h),c=h}if(this.options.strictReservedNames&&(c===this.options.commentPropName||c===this.options.cdataPropName))throw new Error(`Invalid tag name: ${c}`);n&&s&&n.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,n,r,!1));const E=n;E&&this.options.unpairedTags.indexOf(E.tagname)!==-1&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),c!==e.tagname&&(r+=r?"."+c:c);const b=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,r,c)){let h="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),u=c):u=u.substr(0,u.length-1),o=f.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=f.closeIndex;else{const I=this.readStopNodeData(t,l,w+1);if(!I)throw new Error(`Unexpected end of ${l}`);o=I.i,h=I.tagContent}const y=new H(c);c!==u&&d&&(y[":@"]=this.buildAttributesMap(u,r,c)),h&&(h=this.parseTextData(h,c,r,!0,d,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),y.add(this.options.textNodeName,h),this.addChild(n,y,r,b)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if(c[c.length-1]==="/"?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName){const y=this.options.transformTagName(c);u===c&&(u=y),c=y}const h=new H(c);c!==u&&d&&(h[":@"]=this.buildAttributesMap(u,r,c)),this.addChild(n,h,r,b),r=r.substr(0,r.lastIndexOf("."))}else if(this.options.unpairedTags.indexOf(c)!==-1){const h=new H(c);c!==u&&d&&(h[":@"]=this.buildAttributesMap(u,r)),this.addChild(n,h,r,b),r=r.substr(0,r.lastIndexOf(".")),o=f.closeIndex;continue}else{const h=new H(c);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),c!==u&&d&&(h[":@"]=this.buildAttributesMap(u,r,c)),this.addChild(n,h,r,b),n=h}s="",o=w}}else s+=t[o];return e.child};function Gt(t,e,n,s){this.options.captureMetaData||(s=void 0);const r=this.options.updateTag(e.tagname,n,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),t.addChild(e,s))}const Xt=function(t,e,n){if(t.indexOf("&")===-1)return t;const s=this.options.processEntities;if(!s.enabled||s.allowedTags&&!s.allowedTags.includes(e)||s.tagFilter&&!s.tagFilter(e,n))return t;for(let r in this.docTypeEntities){const i=this.docTypeEntities[r],o=t.match(i.regx);if(o){if(this.entityExpansionCount+=o.length,s.maxTotalExpansions&&this.entityExpansionCount>s.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${s.maxTotalExpansions}`);const a=t.length;if(t=t.replace(i.regx,i.val),s.maxExpandedLength&&(this.currentExpandedLength+=t.length-a,this.currentExpandedLength>s.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${s.maxExpandedLength}`)}}if(t.indexOf("&")===-1)return t;for(let r in this.lastEntities){const i=this.lastEntities[r];t=t.replace(i.regex,i.val)}if(t.indexOf("&")===-1)return t;if(this.options.htmlEntities)for(let r in this.htmlEntities){const i=this.htmlEntities[r];t=t.replace(i.regex,i.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val),t};function zt(t,e,n,s){return t&&(s===void 0&&(s=e.child.length===0),t=this.parseTextData(t,e.tagname,n,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function Yt(t,e,n,s){return!!(e&&e.has(s)||t&&t.has(n))}function Wt(t,e,n=">"){let s,r="";for(let i=e;i<t.length;i++){let o=t[i];if(s)o===s&&(s="");else if(o==='"'||o==="'")s=o;else if(o===n[0])if(n[1]){if(t[i+1]===n[1])return{data:r,index:i}}else return{data:r,index:i};else o===" "&&(o=" ");r+=o}}function k(t,e,n,s){const r=t.indexOf(e,n);if(r===-1)throw new Error(s);return r+e.length-1}function ne(t,e,n,s=">"){const r=Wt(t,e+1,s);if(!r)return;let i=r.data;const o=r.index,a=i.search(/\s/);let f=i,c=!0;a!==-1&&(f=i.substring(0,a),i=i.substring(a+1).trimStart());const l=f;if(n){const u=f.indexOf(":");u!==-1&&(f=f.substr(u+1),c=f!==r.data.substr(u+1))}return{tagName:f,tagExp:i,closeIndex:o,attrExpPresent:c,rawTagName:l}}function Zt(t,e,n){const s=n;let r=1;for(;n<t.length;n++)if(t[n]==="<")if(t[n+1]==="/"){const i=k(t,">",n,`${e} is not closed`);if(t.substring(n+2,i).trim()===e&&(r--,r===0))return{tagContent:t.substring(s,n),i};n=i}else if(t[n+1]==="?")n=k(t,"?>",n+1,"StopNode is not closed.");else if(t.substr(n+1,3)==="!--")n=k(t,"-->",n+3,"StopNode is not closed.");else if(t.substr(n+1,2)==="![")n=k(t,"]]>",n,"StopNode is not closed.")-2;else{const i=ne(t,n,">");i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&r++,n=i.closeIndex)}}function se(t,e,n){if(e&&typeof t=="string"){const s=t.trim();return s==="true"?!0:s==="false"?!1:Pt(t,n)}else return ht(t)?t:""}function ge(t,e,n){const s=Number.parseInt(t,e);return s>=0&&s<=1114111?String.fromCodePoint(s):n+t+";"}const te=H.getMetaDataSymbol();function qt(t,e){return Ie(t,e)}function Ie(t,e,n){let s;const r={};for(let i=0;i<t.length;i++){const o=t[i],a=Jt(o);let f="";if(n===void 0?f=a:f=n+"."+a,a===e.textNodeName)s===void 0?s=o[a]:s+=""+o[a];else{if(a===void 0)continue;if(o[a]){let c=Ie(o[a],e,f);const l=Dt(c,e);o[":@"]?Qt(c,o[":@"],f,e):Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?c=c[e.textNodeName]:Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""),o[te]!==void 0&&typeof c=="object"&&c!==null&&(c[te]=o[te]),r[a]!==void 0&&Object.prototype.hasOwnProperty.call(r,a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(c)):e.isArray(a,f,l)?r[a]=[c]:r[a]=c}}}return typeof s=="string"?s.length>0&&(r[e.textNodeName]=s):s!==void 0&&(r[e.textNodeName]=s),r}function Jt(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const s=e[n];if(s!==":@")return s}}function Qt(t,e,n,s){if(e){const r=Object.keys(e),i=r.length;for(let o=0;o<i;o++){const a=r[o];s.isArray(a,n+"."+a,!0,!0)?t[a]=[e[a]]:t[a]=e[a]}}}function Dt(t,e){const{textNodeName:n}=e,s=Object.keys(t).length;return!!(s===0||s===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}class Ae{constructor(e){this.externalEntities={},this.options=Ct(e)}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const i=pt(e,n);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const s=new Vt(this.options);s.addExternalEntities(this.externalEntities);const r=s.parseXml(e);return this.options.preserveOrder||r===void 0?r:qt(r,this.options)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}static getMetaDataSymbol(){return H.getMetaDataSymbol()}}class en{axiosClient;baseURI;xmlParser;signingKey;ALGORITHM="sha512";TTL=1200;HASH_LENGTH=32;ITERATION_COUNT=1e4;constructor({axiosClient:e,baseURI:n}){this.axiosClient=e,this.baseURI=n,this.xmlParser=new Ae}async signUrl(e,n){const s=new URL(e);s.searchParams.set("OC-Credential",n),s.searchParams.set("OC-Date",new Date().toISOString()),s.searchParams.set("OC-Expires",this.TTL.toString()),s.searchParams.set("OC-Verb","GET");const r=await this.createHashedKey(s.toString());return s.searchParams.set("OC-Algo",`PBKDF2/${this.ITERATION_COUNT}-SHA512`),s.searchParams.set("OC-Signature",r),s.toString()}async getSignKey(){if(this.signingKey)return this.signingKey;const e=await this.axiosClient.get(_.urlJoin(this.baseURI,"ocs/v1.php/cloud/user/signing-key"),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}),n=this.xmlParser.parse(e.data);return this.signingKey=n.ocs.data["signing-key"],this.signingKey}async createHashedKey(e){const n=await this.getSignKey();return at(e,n,this.ITERATION_COUNT,this.HASH_LENGTH,this.ALGORITHM).toString("hex")}}const tn=(t,e)=>{const n=new URL(t);n.pathname=[...n.pathname.split("/"),"ocs","v1.php"].filter(Boolean).join("/");const s=n.href,r=pe(s,e),i=new en({baseURI:t,axiosClient:e});return{getCapabilities:()=>r.getCapabilities(),signUrl:(o,a)=>i.signUrl(o,a)}};exports.GetCapabilitiesFactory=pe;exports.XMLParser=Ae;exports.ocs=tn;
|