@openremote/or-scheduler 1.31.0 → 1.32.0-snapshot.20260928140716
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.
|
@@ -2116,7 +2116,7 @@ var ORScheduler;(()=>{var e={3260(e){"use strict";let t=(async function(){}).con
|
|
|
2116
2116
|
<slot name="footer" slot="footer"></slot>
|
|
2117
2117
|
<slot></slot>
|
|
2118
2118
|
</vaadin-dialog-overlay>
|
|
2119
|
-
`}updated(e){super.updated(e),e.has("headerTitle")&&(this.ariaLabel=this.headerTitle)}}nJ(sG),o(4532);var sK=o(4867),sJ=o.n(sK);o(3472);class sX{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function sQ(e,t,o=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(o){if(Array.isArray(e))return e.every((e,o)=>sQ(e,t[o]));let o=Object.keys(e);return Object.keys(t).every(e=>-1!==o.indexOf(e))&&o.every(o=>sQ(e[o],t[o]))}return!1}class sZ{constructor(e){e&&Object.assign(this,e)}matches(e){var t,o,n,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(o=this.types)?void 0:o.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.name)&&e.realm!==this.realm.name||(null==(i=this.parents)?void 0:i.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(r=this.paths)?void 0:r.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var o;return(null!=(o=e.path)?o:[]).every((e,o)=>t[o]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>sZ._evalValuePredicate(e.name,t)))&&(!this.attributes||sZ._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!sZ._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?sZ._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var o;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(o=t.value)?void 0:o.toLowerCase();switch(t.match){case"BEGIN":n=i.startsWith(r);break;case"END":n=i.endsWith(r);break;case"CONTAINS":n=i.includes(r);break;default:n=i===r}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let o;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":o=e>t.value;break;case"GREATER_EQUALS":o=e>=t.value;break;case"LESS_THAN":o=e<t.value;break;case"LESS_EQUALS":o=e<=t.value;break;case"BETWEEN":o=e>=t.value&&e<=t.rangeValue;break;default:o=e===t.value}return t.negate?!o:o}}return!1}static _evalPredicate(e,t){var o,n;let i=null==(o=t.name)?void 0:o.value;if(!i)return!0;let r=null==(n=e.attributes)?void 0:n[i];if(!r)return!!t.negated;let a=!t.value||sZ._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var o,n,i;let r=null!=(o=t.operator)?o:"AND",a=[...(null!=(n=t.items)?n:[]).map(t=>sZ._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>sZ._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,o;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(o=e.groups)?o:[]).flatMap(e=>sZ._collectNames(e))]}}sZ._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var s0=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let s1=o(4461);class s2{constructor(e,t,o){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=o,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),i=n.get("consoleName"),r=n.get("consoleVersion"),a=n.get("consolePlatform"),s=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=s2._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let f=d.providers;for(let e of(d.providers={},c)){let t=f&&f.hasOwnProperty(e)?f[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let h=ud.getAppName();h.length>0&&0>d.apps.indexOf(h)&&d.apps.push(h),this._registration=d,i&&(d.name=i),r&&(d.version=r),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return s0(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let o={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(o,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(e){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return s0(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let o=e.provider+e.action;if(this._pendingProviderPromises[o])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new sX,i=()=>{delete this._pendingProviderPromises[o],n.reject("No response from provider")};return this._pendingProviderPromises[o]=[n,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>s0(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return s0(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield ud.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(o){if(e&&t&&s2._isStaleRegistrationResponse(o)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw o}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return s0(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let o={type:e,data:t};this.isMobile?this._postNativeShellMessage(o):console.warn("Failed to send generic message to console.",o)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let o=window.localStorage.getItem(t);if(null!==o)try{o=JSON.parse(o)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:o}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),o=t.provider,n=t.action,i=this._pendingProviderPromises[o+n];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[o+n],i[0].resolve(t));let r=this._providerMessageListeners[o+n];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:s1.name,version:s1.version,platform:s1.os.toString(),apps:[],model:((s1.manufacturer?s1.manufacturer+" ":"")+(s1.product?s1.product:"")).trim()}}_initialiseProvider(e){return s0(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function s3(e,t){return function(){return e.apply(t,arguments)}}let{toString:s5}=Object.prototype,{getPrototypeOf:s4}=Object,{iterator:s6,toStringTag:s8}=Symbol,s9=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),s7=(e,t)=>{let o=e,n=[];for(;null!=o&&o!==Object.prototype&&-1===n.indexOf(o);){if(n.push(o),s9(o,t))return!0;o=s4(o)}return!1},le=(r=Object.create(null),e=>{let t=s5.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),lt=e=>(e=e.toLowerCase(),t=>le(t)===e),lo=e=>t=>typeof t===e,{isArray:ln}=Array,li=lo("undefined");function lr(e){return null!==e&&!li(e)&&null!==e.constructor&&!li(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let la=lt("ArrayBuffer"),ls=lo("string"),ll=lo("function"),lc=lo("number"),ld=e=>null!==e&&"object"==typeof e,lu=e=>{if(!ld(e))return!1;let t=s4(e);return(null===t||t===Object.prototype||null===s4(t))&&!s7(e,s8)&&!s7(e,s6)},lf=lt("Date"),lh=lt("File"),lm=lt("Blob"),lb=lt("FileList"),lp="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lF=void 0!==lp.FormData?lp.FormData:void 0,lg=lt("URLSearchParams"),[lv,l_,ly,lw]=["ReadableStream","Request","Response","Headers"].map(lt);function lE(e,t,{allOwnKeys:o=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),ln(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(lr(e))return;let r=o?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(n=0;n<a;n++)i=r[n],t.call(null,e[i],i,e)}}function lC(e,t){let o;if(lr(e))return null;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(o=n[i]).toLowerCase())return o;return null}let lk="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lA=e=>!li(e)&&e!==lk,lx=(a="u">typeof Uint8Array&&s4(Uint8Array),e=>a&&e instanceof a),lD=lt("HTMLFormElement"),{propertyIsEnumerable:lS}=Object.prototype,lT=lt("RegExp"),lO=(e,t)=>{let o=Object.getOwnPropertyDescriptors(e),n={};lE(o,(o,i)=>{let r;!1!==(r=t(o,i,e))&&(n[i]=r||o)}),Object.defineProperties(e,n)},lI=lt("AsyncFunction"),lB=(c="function"==typeof setImmediate,d=ll(lk.postMessage),c?setImmediate:d?(u=`axios@${Math.random()}`,f=[],lk.addEventListener("message",({source:e,data:t})=>{e===lk&&t===u&&f.length&&f.shift()()},!1),e=>{f.push(e),lk.postMessage(u,"*")}):e=>setTimeout(e)),lR="u">typeof queueMicrotask?queueMicrotask.bind(lk):"u">typeof process&&process.nextTick||lB,lP=e=>null!=e&&ll(e[s6]),lN={isArray:ln,isArrayBuffer:la,isBuffer:lr,isFormData:e=>{if(!e)return!1;if(lF&&e instanceof lF)return!0;let t=s4(e);if(!t||t===Object.prototype||!ll(e.append))return!1;let o=le(e);return"formdata"===o||"object"===o&&ll(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&la(e.buffer)},isString:ls,isNumber:lc,isBoolean:e=>!0===e||!1===e,isObject:ld,isPlainObject:lu,isEmptyObject:e=>{if(!ld(e)||lr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lv,isRequest:l_,isResponse:ly,isHeaders:lw,isUndefined:li,isDate:lf,isFile:lh,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lm,isRegExp:lT,isFunction:ll,isStream:e=>ld(e)&&ll(e.pipe),isURLSearchParams:lg,isTypedArray:lx,isFileList:lb,forEach:lE,merge:function e(...t){let{caseless:o,skipUndefined:n}=lA(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=o&&"string"==typeof r&&lC(i,r)||r,s=s9(i,a)?i[a]:void 0;lu(s)&&lu(t)?i[a]=e(s,t):lu(t)?i[a]=e({},t):ln(t)?i[a]=t.slice():n&&li(t)||(i[a]=t)};for(let e=0,o=t.length;e<o;e++){let o=t[e];if(!o||lr(o)||(lE(o,r),"object"!=typeof o||ln(o)))continue;let n=Object.getOwnPropertySymbols(o);for(let e=0;e<n.length;e++){let t=n[e];lS.call(o,t)&&r(o[t],t)}}return i},extend:(e,t,o,{allOwnKeys:n}={})=>(lE(t,(t,n)=>{o&&ll(t)?Object.defineProperty(e,n,{__proto__:null,value:s3(t,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,o,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,n)=>{let i,r,a,s={};if(t=t||{},null==e)return t;do{for(r=(i=Object.getOwnPropertyNames(e)).length;r-- >0;)a=i[r],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==o&&s4(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:le,kindOfTest:lt,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;let n=e.indexOf(t,o);return -1!==n&&n===o},toArray:e=>{if(!e)return null;if(ln(e))return e;let t=e.length;if(!lc(t))return null;let o=Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{let o,n=(e&&e[s6]).call(e);for(;(o=n.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let o,n=[];for(;null!==(o=e.exec(t));)n.push(o);return n},isHTMLForm:lD,hasOwnProperty:s9,hasOwnProp:s9,hasOwnInPrototypeChain:s7,getSafeProp:(e,t)=>null!=e&&s7(e,t)?e[t]:void 0,reduceDescriptors:lO,freezeMethods:e=>{lO(e,(t,o)=>{if(ll(e)&&["arguments","caller","callee"].includes(o))return!1;if(ll(e[o])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},toObjectSet:(e,t)=>{let o={};return(ln(e)?e:String(e).split(t)).forEach(e=>{o[e]=!0}),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,o){return t.toUpperCase()+o}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lC,global:lk,isContextDefined:lA,isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[s8]&&e[s6])},toJSONObject:e=>{let t=new WeakSet,o=e=>{if(ld(e)){if(t.has(e))return;if(lr(e))return e;if(!("toJSON"in e)){t.add(e);let n=ln(e)?[]:{};return lE(e,(e,t)=>{let i=o(e);li(i)||(n[t]=i)}),t.delete(e),n}}return e};return o(e)},isAsyncFn:lI,isThenable:e=>e&&(ld(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:lB,asap:lR,isIterable:lP,isSafeIterable:e=>null!=e&&s7(e,s6)&&lP(e)},lL=lN.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"]),lM=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lU=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lj(e,t){return lN.isArray(e)?e.map(e=>lj(e,t)):function(e){let t=0,o=e.length;for(;t<o;){let o=e.charCodeAt(t);if(9!==o&&32!==o)break;t+=1}for(;o>t;){let t=e.charCodeAt(o-1);if(9!==t&&32!==t)break;o-=1}return 0===t&&o===e.length?e:e.slice(t,o)}(String(e).replace(t,""))}function l$(e){let t=Object.create(null);return lN.forEach(e.toJSON(),(e,o)=>{t[o]=lj(e,lU)}),t}let lV=Symbol("internals");function lz(e){return e&&String(e).trim().toLowerCase()}function lq(e){return!1===e||null==e?e:lN.isArray(e)?e.map(lq):lj(String(e),lM)}function lH(e,t,o,n,i){if(lN.isFunction(n))return n.call(this,t,o);if(i&&(t=o),lN.isString(t)){if(lN.isString(n))return -1!==t.indexOf(n);if(lN.isRegExp(n))return n.test(t)}}class lY{constructor(e){e&&this.set(e)}set(e,t,o){let n=this;function i(e,t,o){let i=lz(t);if(!i)return;let r=lN.findKey(n,i);r&&void 0!==n[r]&&!0!==o&&(void 0!==o||!1===n[r])||(n[r||t]=lq(e))}let r=(e,t)=>lN.forEach(e,(e,o)=>i(e,o,t));if(lN.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let n;if(lN.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let o,n,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),o=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!o||s[o]&&lL[o]||("set-cookie"===o?s[o]?s[o].push(n):s[o]=[n]:s[o]=s[o]?s[o]+", "+n:n)}),s),t)}else if(lN.isObject(e)&&lN.isSafeIterable(e)){let o=Object.create(null),n,i;for(let t of e){if(!lN.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],lN.hasOwnProp(o,i)?(n=o[i],o[i]=lN.isArray(n)?[...n,t[1]]:[n,t[1]]):o[i]=t[1]}r(o,t)}else null!=e&&i(t,e,o)}return this}get(e,t){if(e=lz(e)){let o=lN.findKey(this,e);if(o){let e=this[o];if(!t)return e;if(!0===t){let t,o=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)o[t[1]]=t[2];return o}if(lN.isFunction(t))return t.call(this,e,o);if(lN.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lz(e)){let o=lN.findKey(this,e);return!!(o&&void 0!==this[o]&&(!t||lH(this,this[o],o,t)))}return!1}delete(e,t){let o=this,n=!1;function i(e){if(e=lz(e)){let i=lN.findKey(o,e);i&&(!t||lH(o,o[i],i,t))&&(delete o[i],n=!0)}}return lN.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),o=t.length,n=!1;for(;o--;){let i=t[o];(!e||lH(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,o={};return lN.forEach(this,(n,i)=>{let r=lN.findKey(o,i);if(r){t[r]=lq(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,o)=>t.toUpperCase()+o):String(i).trim();a!==i&&delete t[i],t[a]=lq(n),o[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lN.forEach(this,(o,n)=>{null!=o&&!1!==o&&(t[n]=e&&lN.isArray(o)?o.join(", "):o)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}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){let o=new this(e);return t.forEach(e=>o.set(e)),o}static accessor(e){let t=(this[lV]=this[lV]={accessors:{}}).accessors,o=this.prototype;function n(e){let n=lz(e);if(!t[n]){let i;i=lN.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(o,t+i,{__proto__:null,value:function(o,n,i){return this[t].call(this,e,o,n,i)},configurable:!0})}),t[n]=!0}}return lN.isArray(e)?e.forEach(n):n(e),this}}lY.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lN.reduceDescriptors(lY.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}}),lN.freezeMethods(lY);class lW extends Error{static from(e,t,o,n,i,r){let a=new lW(e.message,t||e.code,o,n,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,o,n,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,o,n=this.config,i=n&&lN.hasOwnProp(n,"redact")?n.redact:void 0,r=lN.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(o=n=>{let i;if(null===n||"object"!=typeof n||lN.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof lY&&(n=n.toJSON()),t.push(n),lN.isArray(n))i=[],n.forEach((e,t)=>{let n=o(e);lN.isUndefined(n)||(i[t]=n)});else{if(!lN.isPlainObject(n)&&function(e){if(lN.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lN.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(n))return t.pop(),n;for(let[t,r]of(i=Object.create(null),Object.entries(n))){let n=e.has(t.toLowerCase())?"[REDACTED ****]":o(r);lN.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):lN.toJSONObject(n);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:r,code:this.code,status:this.status}}}lW.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lW.ERR_BAD_OPTION="ERR_BAD_OPTION",lW.ECONNABORTED="ECONNABORTED",lW.ETIMEDOUT="ETIMEDOUT",lW.ECONNREFUSED="ECONNREFUSED",lW.ERR_NETWORK="ERR_NETWORK",lW.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lW.ERR_DEPRECATED="ERR_DEPRECATED",lW.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lW.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lW.ERR_CANCELED="ERR_CANCELED",lW.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lW.ERR_INVALID_URL="ERR_INVALID_URL",lW.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lG=lW;function lK(e){return lN.isPlainObject(e)||lN.isArray(e)}function lJ(e){return lN.endsWith(e,"[]")?e.slice(0,-2):e}function lX(e,t,o){return e?e.concat(t).map(function(e,t){return e=lJ(e),!o&&t?"["+e+"]":e}).join(o?".":""):t}let lQ=lN.toFlatObject(lN,{},null,function(e){return/^is[A-Z]/.test(e)}),lZ=function(e,t,o){if(!lN.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(o=lN.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lN.isUndefined(t[e])})).metaTokens,i=o.visitor||h,r=o.dots,a=o.indexes,s=o.Blob||"u">typeof Blob&&Blob,l=void 0===o.maxDepth?100:o.maxDepth,c=s&&lN.isSpecCompliantForm(t),d=[];if(!lN.isFunction(i))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lN.isDate(e))return e.toISOString();if(lN.isBoolean(e))return e.toString();if(!c&&lN.isBlob(e))throw new lG("Blob is not supported. Use a Buffer instead.");if(lN.isArrayBuffer(e)||lN.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lG("Blob is not supported. Use a Buffer instead.",lG.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new lG("Object is too deeply nested ("+e+" levels). Max depth: "+l,lG.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,o,i){let s=e;if(lN.isReactNative(t)&&lN.isReactNativeBlob(e))return t.append(lX(i,o,r),u(e)),!1;if(e&&!i&&"object"==typeof e)if(lN.endsWith(o,"{}"))o=n?o:o.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,o){if(!lN.isObject(o))return o;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(o),f(1+t.length-1),o})}(e);else{var c;if(lN.isArray(e)&&(c=e,lN.isArray(c)&&!c.some(lK))||(lN.isFileList(e)||lN.endsWith(o,"[]"))&&(s=lN.toArray(e)))return o=lJ(o),s.forEach(function(e,n){lN.isUndefined(e)||null===e||t.append(!0===a?lX([o],n,r):null===a?o:o+"[]",u(e))}),!1}return!!lK(e)||(t.append(lX(i,o,r),u(e)),!1)}let m=Object.assign(lQ,{defaultVisitor:h,convertValue:u,isVisitable:lK});if(!lN.isObject(e))throw TypeError("data must be an object");return!function e(o,n,r=0){if(!lN.isUndefined(o)){if(f(r),-1!==d.indexOf(o))throw Error("Circular reference detected in "+n.join("."));d.push(o),lN.forEach(o,function(o,a){!0===(!(lN.isUndefined(o)||null===o)&&i.call(t,o,lN.isString(a)?a.trim():a,n,m))&&e(o,n?n.concat(a):[a],r+1)}),d.pop()}}(e),t};function l0(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l1(e,t){this._pairs=[],e&&lZ(e,this,t)}let l2=l1.prototype;function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l5(e,t,o){let n;if(!t)return e;e=e||"";let i=lN.isFunction(o)?{serialize:o}:o,r=lN.getSafeProp(i,"encode")||l3,a=lN.getSafeProp(i,"serialize");if(n=a?a(t,i):lN.isURLSearchParams(t)?t.toString():new l1(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}l2.append=function(e,t){this._pairs.push([e,t])},l2.toString=function(e){let t=e?t=>e.call(this,t,l0):l0;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l4=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lN.forEach(this.handlers,function(t){null!==t&&e(t)})}},l6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l8="u">typeof URLSearchParams?URLSearchParams:l1,l9="u">typeof FormData?FormData:null,l7="u">typeof Blob?Blob:null,ce="u">typeof window&&"u">typeof document,ct="object"==typeof navigator&&navigator||void 0,co=ce&&(!ct||0>["ReactNative","NativeScript","NS"].indexOf(ct.product)),cn="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ci=ce&&window.location.href||"http://localhost",cr={...tI,isBrowser:!0,classes:{URLSearchParams:l8,FormData:l9,Blob:l7},protocols:["http","https","file","blob","url","data"]};function ca(e){if(e>100)throw new lG("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lG.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cs=function(e){if(lN.isFormData(e)&&lN.isFunction(e.entries)){let t={};return lN.forEachEntry(e,(e,o)=>{!function e(t,o,n,i){ca(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&lN.isArray(n)?n.length:r,s)?lN.hasOwnProp(n,r)?n[r]=lN.isArray(n[r])?n[r].concat(o):[n[r],o]:n[r]=o:(lN.hasOwnProp(n,r)&&lN.isObject(n[r])||(n[r]=[]),e(t,o,n[r],i)&&lN.isArray(n[r])&&(n[r]=function(e){let t,o,n={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)n[o=i[t]]=e[o];return n}(n[r]))),!a}(function(e){let t,o=[],n=/\w+|\[(\w*)]/g;for(;null!==(t=n.exec(e));)ca(o.length),o.push("[]"===t[0]?"":t[1]||t[0]);return o}(e),o,t,0)}),t}return null},cl=(e,t)=>null!=e&&lN.hasOwnProp(e,t)?e[t]:void 0,cc={transitional:l6,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let o,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=lN.isObject(e);if(r&&lN.isHTMLForm(e)&&(e=new FormData(e)),lN.isFormData(e))return i?JSON.stringify(cs(e)):e;if(lN.isArrayBuffer(e)||lN.isBuffer(e)||lN.isStream(e)||lN.isFile(e)||lN.isBlob(e)||lN.isReadableStream(e))return e;if(lN.isArrayBufferView(e))return e.buffer;if(lN.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=cl(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return lZ(e,new cr.classes.URLSearchParams,{visitor:function(e,t,o,n){return cr.isNode&&lN.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((o=lN.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=cl(this,"env"),i=n&&n.FormData;return lZ(o?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(lN.isString(a))try{return(0,JSON.parse)(a),lN.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cl(this,"transitional")||cc.transitional,o=t&&t.forcedJSONParsing,n=cl(this,"responseType"),i="json"===n;if(lN.isResponse(e)||lN.isReadableStream(e))return e;if(e&&lN.isString(e)&&(o&&!n||i)){let o=t&&t.silentJSONParsing;try{return JSON.parse(e,cl(this,"parseReviver"))}catch(e){if(!o&&i){if("SyntaxError"===e.name)throw lG.from(e,lG.ERR_BAD_RESPONSE,this,null,cl(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cr.classes.FormData,Blob:cr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cd(e,t){let o=this||cc,n=t||o,i=lY.from(n.headers),r=n.data;return lN.forEach(e,function(e){r=e.call(o,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function cu(e){return!!(e&&e.__CANCEL__)}lN.forEach(["delete","get","head","post","put","patch","query"],e=>{cc.headers[e]={}});let cf=class extends lG{constructor(e,t,o){super(null==e?"canceled":e,lG.ERR_CANCELED,t,o),this.name="CanceledError",this.__CANCEL__=!0}};function ch(e,t,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(new lG("Request failed with status code "+o.status,o.status>=400&&o.status<500?lG.ERR_BAD_REQUEST:lG.ERR_BAD_RESPONSE,o.config,o.request,o))}let cm=function(e,t){let o,n=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=i[a];o||(o=l),n[r]=s,i[r]=l;let d=a,u=0;for(;d!==r;)u+=n[d++],d%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),l-o<t)return;let f=c&&l-c;return f?Math.round(1e3*u/f):void 0}},cb=function(e,t){let o,n,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,o=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(o=e,n||(n=setTimeout(()=>{n=null,a(o)},r-s)))},()=>o&&a(o)]},cp=(e,t,o=3)=>{let n=0,i=cm(50,250);return cb(o=>{if(!o||"number"!=typeof o.loaded)return;let r=o.loaded,a=o.lengthComputable?o.total:void 0,s=null!=a?Math.min(r,a):r,l=Math.max(0,s-n),c=i(l);n=Math.max(n,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:o,lengthComputable:null!=a,[t?"download":"upload"]:!0})},o)},cF=(e,t)=>{let o=null!=e;return[n=>t[0]({lengthComputable:o,total:e,loaded:n}),t[1]]},cg=e=>(...t)=>lN.asap(()=>e(...t)),cv=cr.hasStandardBrowserEnv?(s=new URL(cr.origin),l=cr.navigator&&/(msie|trident)/i.test(cr.navigator.userAgent),e=>(e=new URL(e,cr.origin),s.protocol===e.protocol&&s.host===e.host&&(l||s.port===e.port))):()=>!0,c_=cr.hasStandardBrowserEnv?{write(e,t,o,n,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lN.isNumber(o)&&s.push(`expires=${new Date(o).toUTCString()}`),lN.isString(n)&&s.push(`path=${n}`),lN.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),lN.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].replace(/^\s+/,""),i=n.indexOf("=");if(-1!==i&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch(e){return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cy=/^https?:(?!\/\/)/i,cw=/[\t\n\r]/g;function cE(e,t){if("string"==typeof e&&cy.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(cw,"")))throw new lG('Invalid URL: missing "//" after protocol',lG.ERR_INVALID_URL,t)}function cC(e,t,o,n){cE(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(i||!1===o)?(cE(e,n),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let ck=e=>e instanceof lY?{...e}:e;function cA(e,t){e=e||{},t=t||{};let o=Object.create(null);function n(e,t,o,n){return lN.isPlainObject(e)&&lN.isPlainObject(t)?lN.merge.call({caseless:n},e,t):lN.isPlainObject(t)?lN.merge({},t):lN.isArray(t)?t.slice():t}function i(e,t,o,i){return lN.isUndefined(t)?lN.isUndefined(e)?void 0:n(void 0,e,o,i):n(e,t,o,i)}function r(e,t){if(!lN.isUndefined(t))return n(void 0,t)}function a(e,t){return lN.isUndefined(t)?lN.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(o,i,r){return lN.hasOwnProp(t,r)?n(o,i):lN.hasOwnProp(e,r)?n(void 0,o):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,o)=>i(ck(e),ck(t),o,!0)};return lN.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let r=lN.hasOwnProp(l,n)?l[n]:i,a=r(lN.hasOwnProp(e,n)?e[n]:void 0,lN.hasOwnProp(t,n)?t[n]:void 0,n);lN.isUndefined(a)&&r!==s||(o[n]=a)}),lN.hasOwnProp(t,"validateStatus")&&lN.isUndefined(t.validateStatus)&&!1===function(o){let n=lN.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lN.isUndefined(n)){if(!lN.isPlainObject(n))return;else if(lN.hasOwnProp(n,o))return n[o]}let i=lN.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lN.isPlainObject(i)&&lN.hasOwnProp(i,o))return i[o]}("validateStatusUndefinedResolves")&&(lN.hasOwnProp(e,"validateStatus")?o.validateStatus=n(void 0,e.validateStatus):delete o.validateStatus),o}let cx=["content-type","content-length"],cD=function(e){let t=cA({},e),o=e=>lN.hasOwnProp(t,e)?t[e]:void 0,n=o("data"),i=o("withXSRFToken"),r=o("xsrfHeaderName"),a=o("xsrfCookieName"),s=o("headers"),l=o("auth"),c=o("baseURL"),d=o("allowAbsoluteUrls"),u=o("url");if(t.headers=s=lY.from(s),t.url=l5(cC(c,u,d,t),o("params"),o("paramsSerializer")),l){let t=lN.getSafeProp(l,"username")||"",o=lN.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(o?encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lG.from(t,lG.ERR_BAD_OPTION_VALUE,e)}}if(lN.isFormData(n))if(cr.hasStandardBrowserEnv||cr.hasStandardBrowserWebWorkerEnv||lN.isReactNative(n))s.setContentType(void 0);else{var f,h;lN.isFunction(n.getHeaders)&&(f=s,h=n.getHeaders(),"content-only"!==o("formDataHeaderPolicy")?f.set(h):Object.entries(h||{}).forEach(([e,t])=>{cx.includes(e.toLowerCase())&&f.set(e,t)}))}if(cr.hasStandardBrowserEnv&&(lN.isFunction(i)&&(i=i(t)),!0===i||null==i&&cv(t.url))){let e=r&&a&&c_.read(a);e&&s.set(r,e)}return t},cS="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,o){var n;let i,r,a,s,l,c,d=cD(e),u=d.data,f=lY.from(d.headers).normalize(),{responseType:h,onUploadProgress:m,onDownloadProgress:b}=d;function p(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(i),d.signal&&d.signal.removeEventListener("abort",i)}let F=new XMLHttpRequest;function g(){if(!F)return;let n=lY.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders());ch(function(e){t(e),p()},function(e){o(e),p()},{data:h&&"text"!==h&&"json"!==h?F.response:F.responseText,status:F.status,statusText:F.statusText,headers:n,config:e,request:F}),F=null}F.open(d.method.toUpperCase(),d.url,!0),F.timeout=d.timeout,"onloadend"in F?F.onloadend=g:F.onreadystatechange=function(){!F||4!==F.readyState||(0!==F.status||F.responseURL&&F.responseURL.startsWith("file:"))&&setTimeout(g)},F.onabort=function(){F&&(o(new lG("Request aborted",lG.ECONNABORTED,e,F)),p(),F=null)},F.onerror=function(t){let n=new lG(t&&t.message?t.message:"Network Error",lG.ERR_NETWORK,e,F);n.event=t||null,o(n),p(),F=null},F.ontimeout=function(){let t=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||l6;d.timeoutErrorMessage&&(t=d.timeoutErrorMessage),o(new lG(t,n.clarifyTimeoutError?lG.ETIMEDOUT:lG.ECONNABORTED,e,F)),p(),F=null},void 0===u&&f.setContentType(null),"setRequestHeader"in F&&lN.forEach(l$(f),function(e,t){F.setRequestHeader(t,e)}),lN.isUndefined(d.withCredentials)||(F.withCredentials=!!d.withCredentials),h&&"json"!==h&&(F.responseType=d.responseType),b&&([a,l]=cp(b,!0),F.addEventListener("progress",a)),m&&F.upload&&([r,s]=cp(m),F.upload.addEventListener("progress",r),F.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(i=t=>{F&&(o(!t||t.type?new cf(null,e,F):t),F.abort(),p(),F=null)},d.cancelToken&&d.cancelToken.subscribe(i),d.signal&&(d.signal.aborted?i():d.signal.addEventListener("abort",i)));let v=(n=d.url,(c=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n))&&c[1]||"");if(v&&!cr.protocols.includes(v)){o(new lG("Unsupported protocol "+v+":",lG.ERR_BAD_REQUEST,e)),p();return}F.send(u||null)})},cT=function*(e,t){let o,n=e.byteLength;if(!t||n<t)return void(yield e);let i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},cO=async function*(e,t){for await(let o of cI(e))yield*cT(o,t)},cI=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},cB=(e,t,o,n)=>{let i,r=cO(e,t),a=0,s=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await r.next();if(t){s(),e.close();return}let i=n.byteLength;if(o){let e=a+=i;o(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},cR=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cP=(e,t,o)=>t+2<o&&cR(e.charCodeAt(t+1))&&cR(e.charCodeAt(t+2)),{isFunction:cN}=lN,cL=e=>{if(!lN.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cM=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cU=e=>{let t,o=void 0!==lN.global&&null!==lN.global?lN.global:globalThis,{ReadableStream:n,TextEncoder:i}=o,{fetch:r,Request:a,Response:s}=e=lN.merge.call({skipUndefined:!0},{Request:o.Request,Response:o.Response},e),l=r?cN(r):"function"==typeof fetch,c=cN(a),d=cN(s);if(!l)return!1;let u=l&&cN(n),f=l&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=c&&u&&cM(()=>{let e=!1,t=new a(cr.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),m=d&&u&&cM(()=>lN.isReadableStream(new s("").body)),b={stream:m&&(e=>e.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,o)=>{let n=t&&t[e];if(n)return n.call(t);throw new lG(`Response type '${e}' is not supported`,lG.ERR_NOT_SUPPORT,o)})});let p=async e=>{if(null==e)return 0;if(lN.isBlob(e))return e.size;if(lN.isSpecCompliantForm(e)){let t=new a(cr.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lN.isArrayBufferView(e)||lN.isArrayBuffer(e)?e.byteLength:(lN.isURLSearchParams(e)&&(e+=""),lN.isString(e))?(await f(e)).byteLength:void 0},F=async(e,t)=>{let o=lN.toFiniteNumber(e.getContentLength());return null==o?p(t):o};return async e=>{let t,{url:o,method:n,data:l,signal:d,cancelToken:f,timeout:g,onDownloadProgress:v,onUploadProgress:_,responseType:y,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:k,maxBodyLength:A}=cD(e),x=lN.isNumber(k)&&k>-1,D=lN.isNumber(A)&&A>-1,S=r||fetch;y=y?(y+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let o=new AbortController,n=!1,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof lG?t:new cf(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new lG(`timeout of ${t}ms exceeded`,lG.ETIMEDOUT))},t),a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i,{once:!0}));let{signal:s}=o;return s.unsubscribe=()=>lN.asap(a),s})([d,f&&f.toAbortSignal()],g),O=null,I=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),B=null,R=()=>new lG("Request body larger than maxBodyLength limit",lG.ERR_BAD_REQUEST,e,O);try{var P;let r,d,f,g,N=(d="auth",lN.hasOwnProp(e,d)?e[d]:void 0);if(N){let e=lN.getSafeProp(N,"username")||"",t=lN.getSafeProp(N,"password")||"";r={username:e,password:t}}if(f=(P=o).indexOf("://"),g=P,-1!==f&&(g=g.slice(f+3)),g.includes("@")||g.includes(":")){let e=new URL(o,cr.origin);if(!r&&(e.username||e.password)){let t=cL(e.username),o=cL(e.password);r={username:t,password:o}}(e.username||e.password)&&(e.username="",e.password="",o=e.href)}if(r){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(r.username||"")+":"+(r.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(x&&"string"==typeof o&&o.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let o=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(o)){let e=n.length,t=n.length;for(let o=0;o<t;o++)if(37===n.charCodeAt(o)&&o+2<t){let t=n.charCodeAt(o+1),i=n.charCodeAt(o+2);cR(t)&&cR(i)&&(e-=2,o+=2)}let o=0,i=t-1,r=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));i>=0&&(61===n.charCodeAt(i)?(o++,i--):r(i)&&(o++,i-=3)),1===o&&i>=0&&(61===n.charCodeAt(i)?o++:r(i)&&o++);let a=3*Math.floor(e/4)-(o||0);return a>0?a:0}let i=0;for(let e=0,t=n.length;e<t;e++){let o=n.charCodeAt(e);if(37===o&&cP(n,e,t))i+=1,e+=2;else if(o<128)i+=1;else if(o<2048)i+=2;else if(o>=55296&&o<=56319&&e+1<t){let t=n.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(o)>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O);if(D&&"get"!==n&&"head"!==n){let e=await p(l);if("number"==typeof e&&isFinite(e)&&(t=e,e>A))throw R()}let L=D&&(lN.isReadableStream(l)||lN.isStream(l)),M=(e,t,o)=>cB(e,65536,e=>{if(D&&e>A)throw B=R();t&&t(e)},o);if(h&&"get"!==n&&"head"!==n&&(_||L)){if(t=null==t?await F(w,l):t,0!==t||L){let e,n=new a(o,{method:"POST",body:l,duplex:"half"});if(lN.isFormData(l)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){let[e,o]=_&&cF(t,cp(cg(_)))||[];l=M(n.body,e,o)}}}else if(L&&!c&&u&&"get"!==n&&"head"!==n)l=M(l);else if(L&&c&&!h&&"get"!==n&&"head"!==n)throw new lG("Stream request bodies are not supported by the current fetch implementation",lG.ERR_NOT_SUPPORT,e,O);lN.isString(E)||(E=E?"include":"omit");let U=c&&"credentials"in a.prototype;if(lN.isFormData(l)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...C,signal:T,method:n.toUpperCase(),headers:l$(w.normalize()),body:l,duplex:"half",credentials:U?E:void 0};O=c&&new a(o,j);let $=await (c?S(O,C):S(o,j)),V=lY.from($.headers);if(x){let t=lN.toFiniteNumber(V.getContentLength());if(null!=t&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O)}let z=m&&("stream"===y||"response"===y);if(m&&$.body&&(v||x||z&&I)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let o=lN.toFiniteNumber(V.getContentLength()),[n,i]=v&&cF(o,cp(cg(v),!0))||[];$=new s(cB($.body,65536,t=>{if(x&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O);n&&n(t)},()=>{i&&i(),I&&I()}),t)}y=y||"text";let q=await b[lN.findKey(b,y)||"text"]($,e);if(x&&!m&&!z){let t;if(null!=q&&("number"==typeof q.byteLength?t=q.byteLength:"number"==typeof q.size?t=q.size:"string"==typeof q&&(t="function"==typeof i?new i().encode(q).byteLength:q.length)),"number"==typeof t&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O)}return!z&&I&&I(),await new Promise((t,o)=>{ch(t,o,{data:q,headers:lY.from($.headers),status:$.status,statusText:$.statusText,config:e,request:O})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof lG){let o=T.reason;throw o.config=e,O&&(o.request=O),t!==o&&Object.defineProperty(o,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),o}if(B)throw O&&!B.request&&(B.request=O),B;if(t instanceof lG)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let o=new lG("Network Error",lG.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(o,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),o}throw lG.from(t,t&&t.code,e,O,t&&t.response)}}},cj=new Map,c$=e=>{let t=e&&e.env||{},{fetch:o,Request:n,Response:i}=t,r=[n,i,o],a=r.length,s,l,c=cj;for(;a--;)s=r[a],void 0===(l=c.get(s))&&c.set(s,l=a?new Map:cU(t)),c=l;return l};c$();let cV={http:null,xhr:cS,fetch:{get:c$}};lN.forEach(cV,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cz=e=>`- ${e}`,cq=e=>lN.isFunction(e)||null===e||!1===e,cH=function(e,t){let o,n,{length:i}=e=lN.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(n=o=e[a],!cq(o)&&void 0===(n=cV[(i=String(o)).toLowerCase()]))throw new lG(`Unknown adapter '${i}'`);if(n&&(lN.isFunction(n)||(n=n.get(t))))break;r[i||"#"+a]=n}if(!n){let e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new lG("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(cz).join("\n"):" "+cz(e[0]):"as no adapter specified"),lG.ERR_NOT_SUPPORT)}return n};function cY(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cf(null,e)}function cW(e){return cY(e),e.headers=lY.from(e.headers),e.data=cd.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cH(e.adapter||cc.adapter,e)(e).then(function(t){cY(e),e.response=t;try{t.data=cd.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lY.from(t.headers),t},function(t){if(!cu(t)&&(cY(e),t&&t.response)){e.response=t.response;try{t.response.data=cd.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lY.from(t.response.headers)}return Promise.reject(t)})}let cG={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cG[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});let cK={};cG.transitional=function(e,t,o){function n(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,i,r)=>{if(!1===e)throw new lG(n(i," has been removed"+(t?" in "+t:"")),lG.ERR_DEPRECATED);return t&&!cK[i]&&(cK[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,i,r)}},cG.spelling=function(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};let cJ=function(e,t,o){if("object"!=typeof e||null===e)throw new lG("options must be an object",lG.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let r=n[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],o=void 0===t||a(t,r,e);if(!0!==o)throw new lG("option "+r+" must be "+o,lG.ERR_BAD_OPTION_VALUE);continue}if(!0!==o)throw new lG("Unknown option "+r,lG.ERR_BAD_OPTION)}};class cX{constructor(e){this.defaults=e||{},this.interceptors={request:new l4,response:new l4}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let o=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(o){let t=o.indexOf("\n"),n=-1===t?-1:o.indexOf("\n",t+1),i=-1===n?"":o.slice(n+1);String(e.stack).endsWith(i)||(e.stack+="\n"+o)}}else e.stack=o}catch(e){}}throw e}}_request(e,t){let o,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cA(this.defaults,t);void 0!==i&&cJ(i,{silentJSONParsing:cG.transitional(cG.boolean),forcedJSONParsing:cG.transitional(cG.boolean),clarifyTimeoutError:cG.transitional(cG.boolean),legacyInterceptorReqResOrdering:cG.transitional(cG.boolean),advertiseZstdAcceptEncoding:cG.transitional(cG.boolean),validateStatusUndefinedResolves:cG.transitional(cG.boolean)},!1),null!=r&&(lN.isFunction(r)?t.paramsSerializer={serialize:r}:cJ(r,{encode:cG.function,serialize:cG.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cJ(t,{baseUrl:cG.spelling("baseURL"),withXsrfToken:cG.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lN.merge(a.common,a[t.method]);a&&lN.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lY.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;let o=t.transitional||l6;o&&o.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let d=[];this.interceptors.response.forEach(function(e){d.push(e.fulfilled,e.rejected)});let u=0;if(!c){let e=[cW.bind(this),void 0];for(e.unshift(...l),e.push(...d),n=e.length,o=Promise.resolve(t);u<n;)o=o.then(e[u++],e[u++]);return o}n=l.length;let f=t;for(;u<n;){let e=l[u++],t=l[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{o=cW.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,n=d.length;u<n;)o=o.then(d[u++],d[u++]);return o}getUri(e){return l5(cC((e=cA(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lN.forEach(["delete","get","head","options"],function(e){cX.prototype[e]=function(t,o){return this.request(cA(o||{},{method:e,url:t,data:o&&lN.hasOwnProp(o,"data")?o.data:void 0}))}}),lN.forEach(["post","put","patch","query"],function(e){function t(t){return function(o,n,i){return this.request(cA(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}cX.prototype[e]=t(),"query"!==e&&(cX.prototype[e+"Form"]=t(!0))});let cQ=class e{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const o=this;this.promise.then(e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null}),this.promise.then=e=>{let t,n=new Promise(e=>{o.subscribe(e),t=e}).then(e);return n.cancel=function(){o.unsubscribe(t)},n},e(function(e,n,i){o.reason||(o.reason=new cf(e,n,i),t(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},cZ={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(cZ).forEach(([e,t])=>{cZ[t]=e});let c0=function e(t){let o=new cX(t),n=s3(cX.prototype.request,o);return lN.extend(n,cX.prototype,o,{allOwnKeys:!0}),lN.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return e(cA(t,o))},n}(cc);c0.Axios=cX,c0.CanceledError=cf,c0.CancelToken=cQ,c0.isCancel=cu,c0.VERSION="1.18.1",c0.toFormData=lZ,c0.AxiosError=lG,c0.Cancel=c0.CanceledError,c0.all=function(e){return Promise.all(e)},c0.spread=function(e){return function(t){return e.apply(null,t)}},c0.isAxiosError=function(e){return lN.isObject(e)&&!0===e.isAxiosError},c0.mergeConfig=cA,c0.AxiosHeaders=lY,c0.formToJSON=e=>cs(lN.isHTMLForm(e)?new FormData(e):e),c0.getAdapter=cH,c0.HttpStatusCode=cZ,c0.default=c0;class c1{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:dm`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:dm`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:dm`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:dm`realm/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`realm/${e}`,data:t,options:o})}}class c2{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:dm`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:dm`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:dm`dashboard/query`,data:e,options:t})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`dashboard/${e}/${t}`,options:o})}get(e,t,o){return this.httpClient.request({method:"GET",url:dm`dashboard/${e}/${t}`,options:o})}}class c3{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:dm`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:dm`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:dm`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:dm`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:dm`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:dm`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:dm`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:dm`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:dm`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:dm`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:dm`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:dm`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`asset/user/link/${e}/${t}`,options:o})}deleteUserAssetLink(e,t,o,n){return this.httpClient.request({method:"DELETE",url:dm`asset/user/link/${e}/${t}/${o}`,options:n})}get(e,t){return this.httpClient.request({method:"GET",url:dm`asset/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`asset/${e}`,data:t,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/attribute/${t}`,data:o,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/attribute/${t}/${o}`,data:n,options:i})}updateParent(e,t,o){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/child`,queryParams:t,options:o})}}class c5{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:dm`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:dm`configuration/manager`,data:e,options:t})}fileUpload(e,t,o){return this.httpClient.request({method:"POST",url:dm`configuration/manager/file`,queryParams:t,data:e,options:o})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:dm`configuration/manager/image/${e}`,options:t})}}class c4{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:dm`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:dm`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:dm`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:dm`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:dm`notification/${e}`,options:t})}notificationAcknowledged(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`notification/${e}/acknowledged`,queryParams:o,data:t,options:n})}notificationDelivered(e,t,o){return this.httpClient.request({method:"PUT",url:dm`notification/${e}/delivered`,queryParams:t,options:o})}}class c6{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:dm`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:dm`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:dm`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:dm`service/global`,data:e,options:t})}deregisterService(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`service/${e}/${t}`,options:o})}getService(e,t,o){return this.httpClient.request({method:"GET",url:dm`service/${e}/${t}`,options:o})}heartbeat(e,t,o){return this.httpClient.request({method:"PUT",url:dm`service/${e}/${t}`,options:o})}}class c8{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:dm`agent/assetDiscovery/${e}`,queryParams:t,options:o})}doProtocolAssetImport(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`agent/assetImport/${e}`,queryParams:o,data:t,options:n})}doProtocolInstanceDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:dm`agent/instanceDiscovery/${e}`,queryParams:t,options:o})}}class c9{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:dm`console/register`,data:e,options:t})}}class c7{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`asset/predicted/${e}/${t}`,data:o,options:n})}writePredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`asset/predicted/${e}/${t}`,data:o,options:n})}}class de{constructor(e){this.httpClient=e}createAlarm(e,t,o){return this.httpClient.request({method:"POST",url:dm`alarm`,queryParams:t,data:e,options:o})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:dm`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:dm`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:dm`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:dm`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:dm`alarm/${e}`,options:t})}updateAlarm(e,t,o){return this.httpClient.request({method:"PUT",url:dm`alarm/${e}`,data:t,options:o})}getAssetLinks(e,t,o){return this.httpClient.request({method:"GET",url:dm`alarm/${e}/assets`,queryParams:t,options:o})}}class dt{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:dm`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:dm`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:dm`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,o){return this.httpClient.request({method:"PUT",url:dm`provisioning/${e}`,data:t,options:o})}}class dn{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:dm`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:dm`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`asset/datapoint/${e}/${t}`,data:o,options:n})}}class di{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:dm`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:dm`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:dm`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:dm`syslog/event`,queryParams:e,options:t})}}class dr{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:dm`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,o){return this.httpClient.request({method:"GET",url:dm`rules/asset/for/${e}`,queryParams:t,options:o})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/asset/${e}`,data:t,options:o})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:dm`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:dm`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:dm`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:dm`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,o){return this.httpClient.request({method:"GET",url:dm`rules/realm/for/${e}`,queryParams:t,options:o})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/realm/${e}`,data:t,options:o})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/${e}`,options:t})}updateGlobalRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/${e}`,data:t,options:o})}}class da{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:dm`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:dm`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:dm`flow/${e}`,options:t})}}class ds{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:dm`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:dm`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:dm`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:dm`map/getCustomMapInfo`,options:e})}getTile(e,t,o,n){return this.httpClient.request({method:"GET",url:dm`map/tile/${e}/${t}/${o}`,options:n})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:dm`map/upload`,queryParams:e,options:t})}}class dl{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:dm`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:dm`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:dm`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:dm`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:dm`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:dm`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:dm`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:dm`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`user/${e}/disconnect/${t}`,options:o})}requestPasswordReset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/request-password-reset/${t}`,options:o})}updatePassword(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/reset-password/${t}`,data:o,options:n})}resetSecret(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/reset-secret/${t}`,options:o})}updateRoles(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/roles`,data:t,options:o})}getUserRealmRoles(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/userRealmRoles/${t}`,options:o})}updateUserRealmRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/userRealmRoles/${t}`,data:o,options:n})}getUserClientRoles(e,t,o,n){return this.httpClient.request({method:"GET",url:dm`user/${e}/userRoles/${t}/${o}`,options:n})}updateUserClientRoles(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:dm`user/${e}/userRoles/${t}/${o}`,data:n,options:i})}getUserSessions(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/userSessions/${t}`,options:o})}create(e,t,o){return this.httpClient.request({method:"POST",url:dm`user/${e}/users`,data:t,options:o})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/users`,data:t,options:o})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`user/${e}/users/${t}`,options:o})}getClientRoles(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/${t}/roles`,options:o})}updateClientRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/${t}/roles`,data:o,options:n})}get(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/${t}`,options:o})}}class dc{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,o){return this.httpClient.request({method:"GET",url:dm`model/assetInfo/${e}`,queryParams:t,options:o})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:dm`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:dm`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/valueDescriptors`,queryParams:e,options:t})}}class dd{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:dm`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:dm`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:dm`apps/info`,options:e})}}class du{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:dm`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/connection/${e}`,options:t})}setConnection(e,t,o){return this.httpClient.request({method:"PUT",url:dm`gateway/connection/${e}`,data:t,options:o})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/status/${e}`,options:t})}}class df{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:dm`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:dm`info`,options:e})}}class dh{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:dm`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,o){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}/${t}`,options:o})}getActiveTunnelInfo(e,t,o,n,i){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}/${t}/${o}/${n}`,options:i})}}function dm(e,...t){let o="";for(let n=0;n<t.length;n++)o+=e[n],o+=encodeURIComponent(t[n]);return o+e[e.length-1]}class db{constructor(e,t=c0.create()){this._realmResource=new dF(e,t),this._dashboardResource=new dg(e,t),this._assetResource=new dv(e,t),this._configurationResource=new d_(e,t),this._notificationResource=new dy(e,t),this._externalServiceResource=new dw(e,t),this._agentResource=new dE(e,t),this._consoleResource=new dC(e,t),this._assetPredictedDatapointResource=new dk(e,t),this._alarmResource=new dA(e,t),this._provisioningResource=new dx(e,t),this._assetDatapointResource=new dD(e,t),this._syslogResource=new dS(e,t),this._rulesResource=new dT(e,t),this._flowResource=new dO(e,t),this._mapResource=new dI(e,t),this._userResource=new dB(e,t),this._assetModelResource=new dR(e,t),this._appResource=new dP(e,t),this._gatewayClientResource=new dN(e,t),this._statusResource=new dL(e,t),this._gatewayServiceResource=new dM(e,t),this._assetResource=new dv(e,t)}get RealmResource(){return this._realmResource}get DashboardResource(){return this._dashboardResource}get AssetResource(){return this._assetResource}get ConfigurationResource(){return this._configurationResource}get NotificationResource(){return this._notificationResource}get ExternalServiceResource(){return this._externalServiceResource}get AgentResource(){return this._agentResource}get ConsoleResource(){return this._consoleResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AlarmResource(){return this._alarmResource}get ProvisioningResource(){return this._provisioningResource}get AssetDatapointResource(){return this._assetDatapointResource}get SyslogResource(){return this._syslogResource}get RulesResource(){return this._rulesResource}get FlowResource(){return this._flowResource}get MapResource(){return this._mapResource}get UserResource(){return this._userResource}get AssetModelResource(){return this._assetModelResource}get AppResource(){return this._appResource}get GatewayClientResource(){return this._gatewayClientResource}get StatusResource(){return this._statusResource}get GatewayServiceResource(){return this._gatewayServiceResource}}class dp{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}(t,e.options);let o=e.copyFn;return this.axios.request(t).then(e=>(o&&e.data&&(e.originalData=e.data,e.data=o(e.data)),e))}}class dF extends c1{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dg extends c2{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dv extends c3{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class d_ extends c5{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dy extends c4{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dw extends c6{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dE extends c8{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dC extends c9{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dk extends c7{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dA extends de{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dx extends dt{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dD extends dn{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dS extends di{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dT extends dr{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dO extends da{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dI extends ds{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dB extends dl{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dR extends dc{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dP extends dd{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dN extends du{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dL extends df{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dM extends dh{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}var dU=o(8183),dj=o.n(dU);c0.isAxiosError;let d$=new class{get api(){return this._client}constructor(){this._axiosInstance=c0.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dj().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new db(e,this._axiosInstance)}};var dV=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};(ey=tA||(tA={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let dz="SUBSCRIBED:",dq="UNAUTHORIZED:",dH="TRIGGERED:",dY="EVENT:";class dW{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=dG.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tA.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let o=e.indexOf(t);o>=0&&e.splice(o,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tA.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tA.CONNECTING),this._connectingDeferred=new sX,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=dG.MIN_RECONNECT_DELAY,this._onStatusChanged(tA.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tA.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let o={eventSubscription:e,callback:t,deferred:new sX};return null!=this._pendingSubscription||this._status!==tA.CONNECTED?(this._queuedSubscriptions.push(o),o.deferred.promise):(this._pendingSubscription=o,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return dV(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===tA.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tA.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,o){return dV(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+dW._subscriptionCounter++;if(!this._assetEventPromise){let e;ud.authenticated||(e={filterType:"asset",realm:ud.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(i,e=>{let t=e.asset.id;n?n.find(e=>t===e)&&o(e):e.asset.realm===ud.displayRealm&&o(e)}),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{o({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),i&&this.unsubscribe(i),t}return i})})}subscribeAttributeEvents(e,t,o){return dV(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],i=n?e.map(e=>e.id):e,r=n?e:void 0,a="AttributeEvent"+dW._subscriptionCounter++;if(!this._attributeEventPromise){let e;ud.authenticated||(e={filterType:"asset",realm:ud.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let r=t.ref;n?e.forEach(e=>{r.id===e.id&&r.name===e.name&&o(t)}):i?i.find(e=>r.id===e)&&o(t):t.realm===ud.displayRealm&&o(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&i){let e={messageID:"read-assets:"+i.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,o])=>{(!r||r.find(o=>o.id===e.id&&o.name===t))&&s({eventType:"attribute",timestamp:o.timestamp,value:o.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tA.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let o=e.deferred;e.deferred=null,o&&o.resolve(t)},t=>{let o=e.deferred;e.deferred=null,o&&o.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let o=this._subscriptionMap.get(e);o&&o.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tA.CONNECTED&&this._onStatusChanged(tA.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tA.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<dG.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(dG.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}dW.MIN_RECONNECT_DELAY=0,dW.MAX_RECONNECT_DELAY=3e4,dW._subscriptionCounter=0;class dG extends dW{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+ud.config.realm;return this._connectDeferred=new sX,(ud.authenticated?ud.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(dz)){let e=JSON.parse(t.substring(dz.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(e.subscriptionId)}else if(t.startsWith(dq)){let e=JSON.parse(t.substring(dq.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),o.reject("Unauthorized"))}else if(t.startsWith(dH)){let e=JSON.parse(t.substring(dH.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(dY)){let e=JSON.parse(t.substring(dY.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new sX,e.subscriptionId||(e.subscriptionId=dG._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=dY+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new sX;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(dY+JSON.stringify(e)),t.promise}}dG._subscriptionCounter=1;let dK=["__proto__","constructor","prototype"];function dJ(e){return!("string"!=typeof e||0===e.length||e.length>128||dK.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function dX(e){return!(!dJ(e)||e.indexOf("/")>-1)}let dQ={lng:dX,ns:function(e){return dJ(e)}};function dZ(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function d0(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let d1=/\{\{(.+?)\}\}/g;function d2(e,t){let o=!1,n=e.replace(d1,(e,n)=>{let i=n.trim();if(dK.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=dQ[i]||dX,s=String(r).split("+");for(let t of s)if(!a(t))return o=!0,e;return s.join("+")});return o?null:n}let d3="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:d3&&"function"==typeof d3.fetch&&(i=d3.fetch);let d5=d0()&&d3?d3.XMLHttpRequest:void 0,d4="function"==typeof ActiveXObject&&d3?d3.ActiveXObject:void 0,d6=["__proto__","constructor","prototype"],d8=(e,t)=>{if(t&&"object"==typeof t){let o="";for(let e of Object.keys(t))d6.indexOf(e)>-1||(o+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!o)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+o.slice(1)}return e},d9=(e,t,o,n)=>{let r=e=>{if(!e.ok)return o(e.statusText||"Error",{status:e.status});e.text().then(t=>{o(null,{status:e.status,data:t})}).catch(o)};if(n){let i=n(e,t);if(i instanceof Promise)return void i.then(r).catch(o)}"function"==typeof fetch?fetch(e,t).then(r).catch(o):i(e,t).then(r).catch(o)},d7=(e,t,o,n)=>{if("function"==typeof o&&(n=o,o=void 0),n=n||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=o,s=n;e.queryStringParams&&(r=d8(r,e.queryStringParams));let i={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(i["Content-Type"]="application/json");let l="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,c={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:l},d="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{d9(r,c,s,d)}catch(t){if(!l||0===Object.keys(l).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(l).forEach(e=>{delete c[e]}),d9(r,c,s,d),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(d0()||"function"==typeof ActiveXObject){var l=t,c=o,d=n;c&&"object"==typeof c&&(c=d8("",c).slice(1)),e.queryStringParams&&(l=d8(l,e.queryStringParams));try{let t=d5?new d5:new d4("MSXML2.XMLHTTP.3.0");t.open(c?"POST":"GET",l,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,c&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let o=e.customHeaders;if(o="function"==typeof o?o():o)for(let e of Object.keys(o))d6.indexOf(e)>-1||t.setRequestHeader(e,o[e]);t.onreadystatechange=()=>{t.readyState>3&&d(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(c)}catch(e){console&&console.log(e)}return}n(Error("No fetch and no xhr implementation found!"))};var ue=class{constructor(e,t={},o={}){this.services=e,this.options=t,this.allOptions=o,this.type="backend",this.init(e,t,o)}init(e,t={},o={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,o)=>({[t]:o||""}),parseLoadPayload:(e,t)=>void 0,request:d7,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=o,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,o){this._readAny(e,e,t,t,o)}read(e,t,o){this._readAny([e],e,[t],t,o)}_readAny(e,t,o,n,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,o)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=d2(r,{lng:e.join("+"),ns:o.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(dZ).join(", ")+"] namespaces=["+o.map(dZ).join(", ")+"]"),!1);this.loadUrl(a,i,t,n)})}loadUrl(e,t,o,n){let i=this.options.parseLoadPayload("string"==typeof o?[o]:o,"string"==typeof n?[n]:n),r=dZ(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,i)=>{let a,s;if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+r+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+r+"; status code: "+i.status,!1);if(!i&&e&&e.message){let o=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>o.indexOf(e)>-1))return t("failed loading "+r+": "+dZ(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,o,n):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,o,n,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,o,n),a=0,s=[],l=[];e.forEach(o=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(o,t));let c=d2(n,{lng:o,ns:t});if(null==c){a+=1,i&&a===e.length&&i(s,l);return}this.options.request(this.options,c,r,(t,o)=>{a+=1,s.push(t),l.push(o),a===e.length&&"function"==typeof i&&i(s,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:o}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(i,r)=>{i&&o.warn(`loading namespace ${n} for language ${t} failed`,i),!i&&r&&o.log(`loaded namespace ${n} for language ${t}`,r),e.loaded(`${t}|${n}`,i,r)})})})}};ue.type="backend";var ut=o(4954);class uo extends Error{}function un(e,t){let o;if("string"!=typeof e)throw new uo("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),i=e.split(".")[n];if("string"!=typeof i)throw new uo(`Invalid token specified: missing part #${n+1}`);try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var o;return o=t,decodeURIComponent(atob(o).replace(/(.)/g,(e,t)=>{let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}catch(e){return atob(t)}}(i)}catch(e){throw new uo(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new uo(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(uo.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function ui(e){if(!(this instanceof ui))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,o,n=this,i=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(n.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=x(console.info),d=x(console.warn);function u(e,t){for(var o=function(e){var t=null,o=window.crypto||window.msCrypto;if(o&&o.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),o.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),i=0;i<e;i++)n[i]=t.charCodeAt(o[i]%t.length);return String.fromCharCode.apply(null,n)}function f(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var o=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};n.onAuthError&&n.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&o){var d="code="+o+"&grant_type=authorization_code",u=n.endpoints.token(),f=new XMLHttpRequest;f.open("POST",u,!0),f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),f.withCredentials=!0,f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status){var e=JSON.parse(f.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),y()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},f.send(d)}function h(o,i,r,s){b(o,i,r,a=(a+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):s&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function m(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,o,i){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=un(t)):(delete n.refreshToken,delete n.refreshTokenParsed),o?(n.idToken=o,n.idTokenParsed=un(o)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=un(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,i&&(n.timeSkew=Math.floor(i/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var r=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,r)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function F(e){var t=function(e){switch(n.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,o,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===n.responseMode&&-1!==r?(o=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(o+="?"+i.paramsString),-1!==a&&(o+=e.substring(a))):"fragment"===n.responseMode&&-1!==a&&(o=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(o+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}else if("implicit"===n.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}}(e);if(t){var i=o.get(t.state);return i&&(t.valid=!0,t.redirectUri=i.redirectUri,t.storedNonce=i.nonce,t.prompt=i.prompt,t.pkceCodeVerifier=i.pkceCodeVerifier,t.loginOptions=i.loginOptions),t}}function g(e,t){for(var o=e.split("&"),n={paramsString:"",oauthParams:{}},i=0;i<o.length;i++){var r=o[i].indexOf("="),a=o[i].slice(0,r);-1!==t.indexOf(a)?n.oauthParams[a]=o[i].slice(r+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=o[i])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,o){e.resolve=t,e.reject=o}),e}function _(){var e=v();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var o=n.endpoints.checkSessionIframe();return t.setAttribute("src",o),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),o=t.length-1;o>=0;--o){var i=t[o];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&y()})},1e3*r.interval)}function w(){var e=v();if(r.iframe&&r.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");r.callbackList.push(e);var o=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,o)}else e.setSuccess();return e.promise}function E(){var e,t,o,i=v();if(r.enable||n.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(d("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),r.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),i.setSuccess())};window.addEventListener("message",s,!1)}else i.setSuccess();return e=i.promise,t=n.messageReceiveTimeout,o=null,Promise.race([e,new Promise(function(e,n){o=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(o)})}function C(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let o=n.createLogoutUrl(e),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(i.redirected){window.location.href=i.url;return}if(i.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var o=function(e,t,o){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,o):window.open(e,t,o)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,o){return t[o]=e.cordovaOptions[o],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,o){return e.push(o+"="+t[o]),e},[]).join(",")},a=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),r=i(e),s=o(n.createLoginUrl(e),"_blank",r),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(F(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(h(F(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=v(),r=o(n.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?i.setError():(n.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=v(),r=o(n.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(F(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=o(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=v(),o=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},logout:function(e){var t=v(),o=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(o),t.promise},register:function(e){var t=v(),o=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(i){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,o=function(){try{return new k}catch(e){}return new A}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?C(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?C("cordova"):C(),i){if(void 0!==i.useNonce&&(l=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(n.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)n.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=i.flow}if(null!=i.timeSkew&&(n.timeSkew=i.timeSkew),i.redirectUri&&(n.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?n.silentCheckSsoFallback=i.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,void 0!==i.pkceMethod){if("S256"!==i.pkceMethod&&!1!==i.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${i.pkceMethod}.`);n.pkceMethod=i.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof i.enableLogging?n.enableLogging=i.enableLogging:n.enableLogging=!1,"POST"===i.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof i.scope&&(n.scope=i.scope),"string"==typeof i.acrValues&&(n.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?n.messageReceiveTimeout=i.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var a=v(),s=v();s.promise.then(function(){n.onReady&&n.onReady(n.authenticated),a.setSuccess(n.authenticated)}).catch(function(e){a.setError(e)});var c=function(){var t=v();function o(e){e?n.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:n.endpoints={authorize:function(){return f()+"/protocol/openid-connect/auth"},token:function(){return f()+"/protocol/openid-connect/token"},logout:function(){return f()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=f()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=f()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return f()+"/protocol/openid-connect/registrations"},userinfo:function(){return f()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var i=new XMLHttpRequest;i.open("GET",a,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status||m(i)){var e=JSON.parse(i.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,o(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var r=e.oidcProvider;if(r)if("string"==typeof r){var a,s="/"==r.charAt(r.length-1)?r+".well-known/openid-configuration":r+"/.well-known/openid-configuration",i=new XMLHttpRequest;i.open("GET",s,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||m(i)?(o(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else o(r),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,o(null),t.setSuccess()}}return t.promise}();function d(){var e=function(e){e||(o.prompt="none"),i&&i.locale&&(o.locale=i.locale),n.login(o).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var o=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",o))};window.addEventListener("message",o)},o={};switch(i.onLoad){case"check-sso":r.enable?_().then(function(){w().then(function(o){o?s.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().then(function(){h(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(b(i.token,i.refreshToken,i.idToken),r.enable?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),i.onLoad?d():s.setError(e)})):i.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(E).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),c={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),i=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var d=e&&e.scope||n.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var f=i+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(d);if(l&&(f=f+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(f+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(f+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(f+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(f+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(f+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(f+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(f+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,f+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(ut.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return o.add(c),f},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var o=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(o+="&id_token_hint="+encodeURIComponent(n.idToken)),o},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var o=f(),i=void 0;return void 0!==o&&(i=o+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var o=n.resourceAccess[t||n.clientId];return!!o&&o.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=f()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),o.setSuccess(n.profile)):o.setError())},t.send(),o.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),o.setSuccess(n.userInfo)):o.setError())},t.send(),o.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var o=function(){var o=!1;if(-1==e?(o=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(o=!0,c("[KEYCLOAK] Refreshing token: token expired")),o){var r="grant_type=refresh_token&refresh_token="+n.refreshToken,a=n.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(n.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?w().then(function(){o()}).catch(function(e){t.setError(e)}):o(),t.promise},n.clearToken=function(){n.token&&(b(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var k=function(){if(!(this instanceof k))return new k;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var o=localStorage.key(t);if(o&&0==o.indexOf("kc-callback-")){var n=localStorage.getItem(o);if(n)try{var i=JSON.parse(n).expires;(!i||i<e)&&localStorage.removeItem(o)}catch(e){localStorage.removeItem(o)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var o="kc-callback-"+t,n=localStorage.getItem(o);return n&&(localStorage.removeItem(o),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var o="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(o,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(n){if(n){var i=t("kc-callback-"+n);if(o("kc-callback-"+n,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){o("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){o(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},o=function(e,t,o){var n=e+"="+t+"; expires="+o.toUTCString()+"; ";document.cookie=n}};function x(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ur=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let ua="openremote";(ew=tx||(tx={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(eE=tD||(tD={})).ERROR="ERROR",eE.READY="READY",eE.ONLINE="ONLINE",eE.OFFLINE="OFFLINE",eE.CONNECTING="CONNECTING",eE.CONSOLE_INIT="CONSOLE_INIT",eE.CONSOLE_READY="CONSOLE_READY",eE.TRANSLATE_INIT="TRANSLATE_INIT",eE.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",eE.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",eE.LOGIN="LOGIN";let us={cn:"zh-cn"};class ul{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak&&this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,o])=>{let n=o.roles;e.set(t,n)}),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return d$}get language(){return nY.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(nY.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tD.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||ua}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return ur(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=ua),t);let o=yield this.loadManagerInfo(),n=new s2(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tD.CONSOLE_READY)});if(this._console=n,"KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")?(this._authServerUrl=t.protocol+this._authServerUrl,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((e=new URL(t)).pathname=this._authServerUrl,e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString())}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),o=yield this.doAuthInit()}return!!o&&(o&&(o=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(o=(yield this.doTranslateInit())&&o)&&(o=yield this.doDescriptorsInit(),o=yield this.getConsoleAppConfig()),this.doIconInit(),o?(o=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tD.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",o)})}loadManagerInfo(){return ur(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let o=new XMLHttpRequest;o.addEventListener("load",()=>{e(JSON.parse(o.responseText))}),o.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),o.open("GET",this._config.managerUrl+"/api/master/info"),o.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tx.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return ur(this,void 0,void 0,function*(){if(nY.isInitialized)return!0;nY.on("initialized",e=>{this._emitEvent(tD.TRANSLATE_INIT)}),nY.on("languageChanged",e=>{var t;sJ().locale(null!=(t=us[e])?t:e),this._emitEvent(tD.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,o)=>"uppercase"===t?e.toUpperCase():e instanceof Date?sJ()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield nY.use(ue).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return ur(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield d$.api.AssetModelResource.getAssetInfos(),t=yield d$.api.AssetModelResource.getMetaItemDescriptors(),o=yield d$.api.AssetModelResource.getValueDescriptors();oq._assetTypeInfos=e.data,oq._metaItemDescriptors=Object.values(t.data),oq._valueDescriptors=Object.values(o.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return ur(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(d$.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return d$.setTimeout(2e4),d$.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return ur(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new dG(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tx.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tA.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tA.DISCONNECTED:this._onDisconnect();break;case tA.CONNECTED:break;case tA.CONNECTING:this._emitEvent(tD.CONNECTING)}}doConsoleInit(){return ur(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tD.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(oG.addIconSet("mdi",(e=uc.managerUrl,{getIconTemplate:e=>of`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),oG.addIconSet("or",{getIconTemplate:e=>{let t=oH[e];return t?of`
|
|
2119
|
+
`}updated(e){super.updated(e),e.has("headerTitle")&&(this.ariaLabel=this.headerTitle)}}nJ(sG),o(4532);var sK=o(4867),sJ=o.n(sK);o(3472);class sX{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),Object.freeze(this)}}function sQ(e,t,o=!0){if(null==e||null==t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Function||e instanceof RegExp)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)&&e.length!==t.length||e instanceof Date||!(e instanceof Object)||!(t instanceof Object))return!1;if(o){if(Array.isArray(e))return e.every((e,o)=>sQ(e,t[o]));let o=Object.keys(e);return Object.keys(t).every(e=>-1!==o.indexOf(e))&&o.every(o=>sQ(e[o],t[o]))}return!1}class sZ{constructor(e){e&&Object.assign(this,e)}matches(e){var t,o,n,i,r,a,s;if((null==(t=this.ids)?void 0:t.length)&&(!e.id||!this.ids.includes(e.id))||(null==(o=this.types)?void 0:o.length)&&(!e.type||!this.types.includes(e.type))||(null==(n=this.realm)?void 0:n.name)&&e.realm!==this.realm.name||(null==(i=this.parents)?void 0:i.length)&&!this.parents.some(t=>!t.id||e.parentId===t.id))return!1;if(null==(r=this.paths)?void 0:r.length){let t=null!=(a=e.path)?a:[];if(!this.paths.some(e=>{var o;return(null!=(o=e.path)?o:[]).every((e,o)=>t[o]===e)}))return!1}return(null==(s=this.names)||!s.length||!!this.names.every(t=>sZ._evalValuePredicate(e.name,t)))&&(!this.attributes||sZ._evalGroup(e,this.attributes))}static getUnsupportedFields(e){return Object.keys(e).filter(e=>!sZ._SUPPORTED_FIELDS.has(e))}collectAttributeNames(){return this.attributes?sZ._collectNames(this.attributes):[]}static _evalValuePredicate(e,t){var o;switch(t.predicateType){case"string":{let n;if(null==e)return!1;let i=!1!==t.caseSensitive?String(e):String(e).toLowerCase(),r=!1!==t.caseSensitive?t.value:null==(o=t.value)?void 0:o.toLowerCase();switch(t.match){case"BEGIN":n=i.startsWith(r);break;case"END":n=i.endsWith(r);break;case"CONTAINS":n=i.includes(r);break;default:n=i===r}return t.negate?!n:n}case"boolean":return e===t.value;case"number":{let o;if("number"!=typeof e)return!1;switch(t.operator){case"GREATER_THAN":o=e>t.value;break;case"GREATER_EQUALS":o=e>=t.value;break;case"LESS_THAN":o=e<t.value;break;case"LESS_EQUALS":o=e<=t.value;break;case"BETWEEN":o=e>=t.value&&e<=t.rangeValue;break;default:o=e===t.value}return t.negate?!o:o}}return!1}static _evalPredicate(e,t){var o,n;let i=null==(o=t.name)?void 0:o.value;if(!i)return!0;let r=null==(n=e.attributes)?void 0:n[i];if(!r)return!!t.negated;let a=!t.value||sZ._evalValuePredicate(r.value,t.value);return t.negated?!a:a}static _evalGroup(e,t){var o,n,i;let r=null!=(o=t.operator)?o:"AND",a=[...(null!=(n=t.items)?n:[]).map(t=>sZ._evalPredicate(e,t)),...(null!=(i=t.groups)?i:[]).map(t=>sZ._evalGroup(e,t))];return!a.length||("OR"===r?a.some(Boolean):a.every(Boolean))}static _collectNames(e){var t,o;return[...(null!=(t=e.items)?t:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.value}).filter(e=>!!e),...(null!=(o=e.groups)?o:[]).flatMap(e=>sZ._collectNames(e))]}}sZ._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var s0=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let s1=o(4461);class s2{constructor(e,t,o){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=e,this._autoEnable=t,this._enableCompleteCallback=o,window.OpenRemoteConsole=this;let n=new URLSearchParams(window.location.search),i=n.get("consoleName"),r=n.get("consoleVersion"),a=n.get("consolePlatform"),s=n.get("consoleProviders"),l=n.get("consoleAutoEnable"),c=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=c;let d=s2._createConsoleRegistration(),u=window.localStorage.getItem(this._storageKey);if(u)try{let e=JSON.parse(u);e.id&&(d.id=e.id),e.name&&(d.name=e.name),e.providers&&(d.providers=e.providers),e.apps&&(d.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let f=d.providers;for(let e of(d.providers={},c)){let t=f&&f.hasOwnProperty(e)?f[e]:{enabled:!1,disabled:!1};d.providers[e]=t}let h=ud.getAppName();h.length>0&&0>d.apps.indexOf(h)&&d.apps.push(h),this._registration=d,i&&(d.name=i),r&&(d.version=r),a&&(d.platform=a),l&&(this._autoEnable="TRUE"===l||"true"===l)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let e=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return e&&("iP"===e.substring(0,2)||"Mac"===e.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return s0(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let e of Object.keys(this._registration.providers))yield this._initialiseProvider(e);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(e){console.error(e)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let e=this._pendingProviderEnables.length-1;e>-1;e--){let t=this._pendingProviderEnables[e];yield this.enableProvider(t)}})}enableProvider(e,t){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: enabling provider '"+e+"'");let o={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},n=yield this.sendProviderMessage(o,!0);this._registration.providers[e].hasPermission=n.hasPermission,this._registration.providers[e].success=n.success,this._registration.providers[e].enabled=n.success,this._registration.providers[e].data=n.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),n})}disableProvider(e){return s0(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(e))throw console.debug("Invalid console provider '"+e+"'"),Error("Invalid console provider '"+e+"'");console.debug("Console: disabling provider '"+e+"'");let t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[e].disabled=!0,this._registration.providers[e].enabled=!1,t})}getProvider(e){return this._registration&&this._registration.providers?this._registration.providers[e]:void 0}sendProviderMessage(e,t){return s0(this,void 0,void 0,function*(){if("storage"!==e.provider&&!this._registration.providers.hasOwnProperty(e.provider))throw console.debug("Invalid console provider '"+e.provider+"'"),Error("Invalid console provider '"+e.provider+"'");if(!t)return void this._doSendProviderMessage(e);let o=e.provider+e.action;if(this._pendingProviderPromises[o])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let n=new sX,i=()=>{delete this._pendingProviderPromises[o],n.reject("No response from provider")};return this._pendingProviderPromises[o]=[n,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),n.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>s0(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),e()}catch(e){console.error("Failed to register console",e),t(e)}}))})}_sendRegistration(e){return s0(this,void 0,void 0,function*(){this._normaliseRegistration();let t=!!this._registration.id;try{let e=yield ud.rest.api.ConsoleResource.register(this._registration);if(200!==e.status)throw Error("Failed to register console");this._registration=e.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(o){if(e&&t&&s2._isStaleRegistrationResponse(o)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw o}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(e){let t=e&&e.response?e.response.status:void 0;return 403===t||409===t}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return s0(this,void 0,void 0,function*(){let t=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:e},!0);try{let e=yield Promise.race([t,new Promise((e,t)=>setTimeout(t,2e3))]);if(e&&e.value){let t=e.value;return"null"===t?void 0:t}}catch(e){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(e,t){this._providerMessageListeners[e.provider+e.action]=t}removeProviderMessageListener(e){delete this._providerMessageListeners[e.provider+e.action]}_postNativeShellMessage(e){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(e));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(e)}catch(e){console.error("Failed to send shell message towards console",e)}}_doSendGenericMessage(e,t){let o={type:e,data:t};this.isMobile?this._postNativeShellMessage(o):console.warn("Failed to send generic message to console.",o)}_doSendProviderMessage(e){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:e});else{if(!e.provider||!e.action)return;switch(e.provider.trim().toUpperCase()){case"PUSH":switch(e.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;case"STORAGE":switch(e.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'store' action requires a `key`");null===e.value?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e.value))}break;case"RETRIEVE":{let t=e.key?e.key.trim():null;if(!t||0===t.length)throw Error("Storage provider 'retrieve' action requires a `key`");let o=window.localStorage.getItem(t);if(null!==o)try{o=JSON.parse(o)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:o}))}break;default:throw Error("Unsupported provider '"+e.provider+"' and action '"+e.action+"'")}break;default:console.error("Unsupported provider: "+e.provider)}}}_handleProviderResponse(e){if(!e)return;let t=JSON.parse(e),o=t.provider,n=t.action,i=this._pendingProviderPromises[o+n];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[o+n],i[0].resolve(t));let r=this._providerMessageListeners[o+n];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:s1.name,version:s1.version,platform:s1.os.toString(),apps:[],model:((s1.manufacturer?s1.manufacturer+" ":"")+(s1.product?s1.product:"")).trim()}}_initialiseProvider(e){return s0(this,void 0,void 0,function*(){let t;console.debug("Console: initialising provider '"+e+"'");try{t=yield this.sendProviderMessage({provider:e,action:"PROVIDER_INIT"},!0),this._registration.providers[e].version=t.version,this._registration.providers[e].requiresPermission=t.requiresPermission,this._registration.providers[e].hasPermission=t.hasPermission,this._registration.providers[e].success=t.success,this._registration.providers[e].enabled=t.enabled,this._registration.providers[e].disabled=t.disabled,this._registration.providers[e].data=t.data}catch(e){console.error(e),t={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(t.success||(console.debug("Provider initialisation failed: '"+e+"'"),t.disabled=!0,this._registration.providers[e].disabled=!0),t.disabled||t.enabled){let t=this._pendingProviderEnables.indexOf(e);t>=0&&this._pendingProviderEnables.splice(t,1)}})}}function s3(e,t){return function(){return e.apply(t,arguments)}}let{toString:s5}=Object.prototype,{getPrototypeOf:s4}=Object,{iterator:s6,toStringTag:s8}=Symbol,s9=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),s7=(e,t)=>{let o=e,n=[];for(;null!=o&&o!==Object.prototype&&-1===n.indexOf(o);){if(n.push(o),s9(o,t))return!0;o=s4(o)}return!1},le=(r=Object.create(null),e=>{let t=s5.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())}),lt=e=>(e=e.toLowerCase(),t=>le(t)===e),lo=e=>t=>typeof t===e,{isArray:ln}=Array,li=lo("undefined");function lr(e){return null!==e&&!li(e)&&null!==e.constructor&&!li(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let la=lt("ArrayBuffer"),ls=lo("string"),ll=lo("function"),lc=lo("number"),ld=e=>null!==e&&"object"==typeof e,lu=e=>{if(!ld(e))return!1;let t=s4(e);return(null===t||t===Object.prototype||null===s4(t))&&!s7(e,s8)&&!s7(e,s6)},lf=lt("Date"),lh=lt("File"),lm=lt("Blob"),lb=lt("FileList"),lp="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lF=void 0!==lp.FormData?lp.FormData:void 0,lg=lt("URLSearchParams"),[lv,l_,ly,lw]=["ReadableStream","Request","Response","Headers"].map(lt);function lE(e,t,{allOwnKeys:o=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),ln(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(lr(e))return;let r=o?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(n=0;n<a;n++)i=r[n],t.call(null,e[i],i,e)}}function lC(e,t){let o;if(lr(e))return null;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(o=n[i]).toLowerCase())return o;return null}let lk="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lA=e=>!li(e)&&e!==lk,lx=(a="u">typeof Uint8Array&&s4(Uint8Array),e=>a&&e instanceof a),lD=lt("HTMLFormElement"),{propertyIsEnumerable:lS}=Object.prototype,lT=lt("RegExp"),lO=(e,t)=>{let o=Object.getOwnPropertyDescriptors(e),n={};lE(o,(o,i)=>{let r;!1!==(r=t(o,i,e))&&(n[i]=r||o)}),Object.defineProperties(e,n)},lI=lt("AsyncFunction"),lB=(c="function"==typeof setImmediate,d=ll(lk.postMessage),c?setImmediate:d?(u=`axios@${Math.random()}`,f=[],lk.addEventListener("message",({source:e,data:t})=>{e===lk&&t===u&&f.length&&f.shift()()},!1),e=>{f.push(e),lk.postMessage(u,"*")}):e=>setTimeout(e)),lR="u">typeof queueMicrotask?queueMicrotask.bind(lk):"u">typeof process&&process.nextTick||lB,lP=e=>null!=e&&ll(e[s6]),lN={isArray:ln,isArrayBuffer:la,isBuffer:lr,isFormData:e=>{if(!e)return!1;if(lF&&e instanceof lF)return!0;let t=s4(e);if(!t||t===Object.prototype||!ll(e.append))return!1;let o=le(e);return"formdata"===o||"object"===o&&ll(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&la(e.buffer)},isString:ls,isNumber:lc,isBoolean:e=>!0===e||!1===e,isObject:ld,isPlainObject:lu,isEmptyObject:e=>{if(!ld(e)||lr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lv,isRequest:l_,isResponse:ly,isHeaders:lw,isUndefined:li,isDate:lf,isFile:lh,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lm,isRegExp:lT,isFunction:ll,isStream:e=>ld(e)&&ll(e.pipe),isURLSearchParams:lg,isTypedArray:lx,isFileList:lb,forEach:lE,merge:function e(...t){let{caseless:o,skipUndefined:n}=lA(this)&&this||{},i={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=o&&"string"==typeof r&&lC(i,r)||r,s=s9(i,a)?i[a]:void 0;lu(s)&&lu(t)?i[a]=e(s,t):lu(t)?i[a]=e({},t):ln(t)?i[a]=t.slice():n&&li(t)||(i[a]=t)};for(let e=0,o=t.length;e<o;e++){let o=t[e];if(!o||lr(o)||(lE(o,r),"object"!=typeof o||ln(o)))continue;let n=Object.getOwnPropertySymbols(o);for(let e=0;e<n.length;e++){let t=n[e];lS.call(o,t)&&r(o[t],t)}}return i},extend:(e,t,o,{allOwnKeys:n}={})=>(lE(t,(t,n)=>{o&&ll(t)?Object.defineProperty(e,n,{__proto__:null,value:s3(t,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,o,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,n)=>{let i,r,a,s={};if(t=t||{},null==e)return t;do{for(r=(i=Object.getOwnPropertyNames(e)).length;r-- >0;)a=i[r],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==o&&s4(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:le,kindOfTest:lt,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;let n=e.indexOf(t,o);return -1!==n&&n===o},toArray:e=>{if(!e)return null;if(ln(e))return e;let t=e.length;if(!lc(t))return null;let o=Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{let o,n=(e&&e[s6]).call(e);for(;(o=n.next())&&!o.done;){let n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let o,n=[];for(;null!==(o=e.exec(t));)n.push(o);return n},isHTMLForm:lD,hasOwnProperty:s9,hasOwnProp:s9,hasOwnInPrototypeChain:s7,getSafeProp:(e,t)=>null!=e&&s7(e,t)?e[t]:void 0,reduceDescriptors:lO,freezeMethods:e=>{lO(e,(t,o)=>{if(ll(e)&&["arguments","caller","callee"].includes(o))return!1;if(ll(e[o])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},toObjectSet:(e,t)=>{let o={};return(ln(e)?e:String(e).split(t)).forEach(e=>{o[e]=!0}),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,o){return t.toUpperCase()+o}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:lC,global:lk,isContextDefined:lA,isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[s8]&&e[s6])},toJSONObject:e=>{let t=new WeakSet,o=e=>{if(ld(e)){if(t.has(e))return;if(lr(e))return e;if(!("toJSON"in e)){t.add(e);let n=ln(e)?[]:{};return lE(e,(e,t)=>{let i=o(e);li(i)||(n[t]=i)}),t.delete(e),n}}return e};return o(e)},isAsyncFn:lI,isThenable:e=>e&&(ld(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:lB,asap:lR,isIterable:lP,isSafeIterable:e=>null!=e&&s7(e,s6)&&lP(e)},lL=lN.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"]),lM=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lU=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function lj(e,t){return lN.isArray(e)?e.map(e=>lj(e,t)):function(e){let t=0,o=e.length;for(;t<o;){let o=e.charCodeAt(t);if(9!==o&&32!==o)break;t+=1}for(;o>t;){let t=e.charCodeAt(o-1);if(9!==t&&32!==t)break;o-=1}return 0===t&&o===e.length?e:e.slice(t,o)}(String(e).replace(t,""))}function l$(e){let t=Object.create(null);return lN.forEach(e.toJSON(),(e,o)=>{t[o]=lj(e,lU)}),t}let lV=Symbol("internals");function lz(e){return e&&String(e).trim().toLowerCase()}function lq(e){return!1===e||null==e?e:lN.isArray(e)?e.map(lq):lj(String(e),lM)}function lH(e,t,o,n,i){if(lN.isFunction(n))return n.call(this,t,o);if(i&&(t=o),lN.isString(t)){if(lN.isString(n))return -1!==t.indexOf(n);if(lN.isRegExp(n))return n.test(t)}}class lY{constructor(e){e&&this.set(e)}set(e,t,o){let n=this;function i(e,t,o){let i=lz(t);if(!i)return;let r=lN.findKey(n,i);r&&void 0!==n[r]&&!0!==o&&(void 0!==o||!1===n[r])||(n[r||t]=lq(e))}let r=(e,t)=>lN.forEach(e,(e,o)=>i(e,o,t));if(lN.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let n;if(lN.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let o,n,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),o=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!o||s[o]&&lL[o]||("set-cookie"===o?s[o]?s[o].push(n):s[o]=[n]:s[o]=s[o]?s[o]+", "+n:n)}),s),t)}else if(lN.isObject(e)&&lN.isSafeIterable(e)){let o=Object.create(null),n,i;for(let t of e){if(!lN.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],lN.hasOwnProp(o,i)?(n=o[i],o[i]=lN.isArray(n)?[...n,t[1]]:[n,t[1]]):o[i]=t[1]}r(o,t)}else null!=e&&i(t,e,o)}return this}get(e,t){if(e=lz(e)){let o=lN.findKey(this,e);if(o){let e=this[o];if(!t)return e;if(!0===t){let t,o=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)o[t[1]]=t[2];return o}if(lN.isFunction(t))return t.call(this,e,o);if(lN.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=lz(e)){let o=lN.findKey(this,e);return!!(o&&void 0!==this[o]&&(!t||lH(this,this[o],o,t)))}return!1}delete(e,t){let o=this,n=!1;function i(e){if(e=lz(e)){let i=lN.findKey(o,e);i&&(!t||lH(o,o[i],i,t))&&(delete o[i],n=!0)}}return lN.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),o=t.length,n=!1;for(;o--;){let i=t[o];(!e||lH(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,o={};return lN.forEach(this,(n,i)=>{let r=lN.findKey(o,i);if(r){t[r]=lq(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,o)=>t.toUpperCase()+o):String(i).trim();a!==i&&delete t[i],t[a]=lq(n),o[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return lN.forEach(this,(o,n)=>{null!=o&&!1!==o&&(t[n]=e&&lN.isArray(o)?o.join(", "):o)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}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){let o=new this(e);return t.forEach(e=>o.set(e)),o}static accessor(e){let t=(this[lV]=this[lV]={accessors:{}}).accessors,o=this.prototype;function n(e){let n=lz(e);if(!t[n]){let i;i=lN.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(o,t+i,{__proto__:null,value:function(o,n,i){return this[t].call(this,e,o,n,i)},configurable:!0})}),t[n]=!0}}return lN.isArray(e)?e.forEach(n):n(e),this}}lY.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),lN.reduceDescriptors(lY.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}}),lN.freezeMethods(lY);class lW extends Error{static from(e,t,o,n,i,r){let a=new lW(e.message,t||e.code,o,n,i);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,o,n,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,o,n=this.config,i=n&&lN.hasOwnProp(n,"redact")?n.redact:void 0,r=lN.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(o=n=>{let i;if(null===n||"object"!=typeof n||lN.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof lY&&(n=n.toJSON()),t.push(n),lN.isArray(n))i=[],n.forEach((e,t)=>{let n=o(e);lN.isUndefined(n)||(i[t]=n)});else{if(!lN.isPlainObject(n)&&function(e){if(lN.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(lN.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(n))return t.pop(),n;for(let[t,r]of(i=Object.create(null),Object.entries(n))){let n=e.has(t.toLowerCase())?"[REDACTED ****]":o(r);lN.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):lN.toJSONObject(n);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:r,code:this.code,status:this.status}}}lW.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",lW.ERR_BAD_OPTION="ERR_BAD_OPTION",lW.ECONNABORTED="ECONNABORTED",lW.ETIMEDOUT="ETIMEDOUT",lW.ECONNREFUSED="ECONNREFUSED",lW.ERR_NETWORK="ERR_NETWORK",lW.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",lW.ERR_DEPRECATED="ERR_DEPRECATED",lW.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",lW.ERR_BAD_REQUEST="ERR_BAD_REQUEST",lW.ERR_CANCELED="ERR_CANCELED",lW.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",lW.ERR_INVALID_URL="ERR_INVALID_URL",lW.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let lG=lW;function lK(e){return lN.isPlainObject(e)||lN.isArray(e)}function lJ(e){return lN.endsWith(e,"[]")?e.slice(0,-2):e}function lX(e,t,o){return e?e.concat(t).map(function(e,t){return e=lJ(e),!o&&t?"["+e+"]":e}).join(o?".":""):t}let lQ=lN.toFlatObject(lN,{},null,function(e){return/^is[A-Z]/.test(e)}),lZ=function(e,t,o){if(!lN.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(o=lN.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!lN.isUndefined(t[e])})).metaTokens,i=o.visitor||h,r=o.dots,a=o.indexes,s=o.Blob||"u">typeof Blob&&Blob,l=void 0===o.maxDepth?100:o.maxDepth,c=s&&lN.isSpecCompliantForm(t),d=[];if(!lN.isFunction(i))throw TypeError("visitor must be a function");function u(e){if(null===e)return"";if(lN.isDate(e))return e.toISOString();if(lN.isBoolean(e))return e.toString();if(!c&&lN.isBlob(e))throw new lG("Blob is not supported. Use a Buffer instead.");if(lN.isArrayBuffer(e)||lN.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if("u">typeof Buffer)return Buffer.from(e);throw new lG("Blob is not supported. Use a Buffer instead.",lG.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new lG("Object is too deeply nested ("+e+" levels). Max depth: "+l,lG.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,o,i){let s=e;if(lN.isReactNative(t)&&lN.isReactNativeBlob(e))return t.append(lX(i,o,r),u(e)),!1;if(e&&!i&&"object"==typeof e)if(lN.endsWith(o,"{}"))o=n?o:o.slice(0,-2),e=function(e){if(1/0===l)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,o){if(!lN.isObject(o))return o;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(o),f(1+t.length-1),o})}(e);else{var c;if(lN.isArray(e)&&(c=e,lN.isArray(c)&&!c.some(lK))||(lN.isFileList(e)||lN.endsWith(o,"[]"))&&(s=lN.toArray(e)))return o=lJ(o),s.forEach(function(e,n){lN.isUndefined(e)||null===e||t.append(!0===a?lX([o],n,r):null===a?o:o+"[]",u(e))}),!1}return!!lK(e)||(t.append(lX(i,o,r),u(e)),!1)}let m=Object.assign(lQ,{defaultVisitor:h,convertValue:u,isVisitable:lK});if(!lN.isObject(e))throw TypeError("data must be an object");return!function e(o,n,r=0){if(!lN.isUndefined(o)){if(f(r),-1!==d.indexOf(o))throw Error("Circular reference detected in "+n.join("."));d.push(o),lN.forEach(o,function(o,a){!0===(!(lN.isUndefined(o)||null===o)&&i.call(t,o,lN.isString(a)?a.trim():a,n,m))&&e(o,n?n.concat(a):[a],r+1)}),d.pop()}}(e),t};function l0(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function l1(e,t){this._pairs=[],e&&lZ(e,this,t)}let l2=l1.prototype;function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function l5(e,t,o){let n;if(!t)return e;e=e||"";let i=lN.isFunction(o)?{serialize:o}:o,r=lN.getSafeProp(i,"encode")||l3,a=lN.getSafeProp(i,"serialize");if(n=a?a(t,i):lN.isURLSearchParams(t)?t.toString():new l1(t,i).toString(r)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}l2.append=function(e,t){this._pairs.push([e,t])},l2.toString=function(e){let t=e?t=>e.call(this,t,l0):l0;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let l4=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){lN.forEach(this.handlers,function(t){null!==t&&e(t)})}},l6={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},l8="u">typeof URLSearchParams?URLSearchParams:l1,l9="u">typeof FormData?FormData:null,l7="u">typeof Blob?Blob:null,ce="u">typeof window&&"u">typeof document,ct="object"==typeof navigator&&navigator||void 0,co=ce&&(!ct||0>["ReactNative","NativeScript","NS"].indexOf(ct.product)),cn="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ci=ce&&window.location.href||"http://localhost",cr={...tI,isBrowser:!0,classes:{URLSearchParams:l8,FormData:l9,Blob:l7},protocols:["http","https","file","blob","url","data"]};function ca(e){if(e>100)throw new lG("FormData field is too deeply nested ("+e+" levels). Max depth: 100",lG.ERR_FORM_DATA_DEPTH_EXCEEDED)}let cs=function(e){if(lN.isFormData(e)&&lN.isFunction(e.entries)){let t={};return lN.forEachEntry(e,(e,o)=>{!function e(t,o,n,i){ca(i);let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&lN.isArray(n)?n.length:r,s)?lN.hasOwnProp(n,r)?n[r]=lN.isArray(n[r])?n[r].concat(o):[n[r],o]:n[r]=o:(lN.hasOwnProp(n,r)&&lN.isObject(n[r])||(n[r]=[]),e(t,o,n[r],i)&&lN.isArray(n[r])&&(n[r]=function(e){let t,o,n={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)n[o=i[t]]=e[o];return n}(n[r]))),!a}(function(e){let t,o=[],n=/\w+|\[(\w*)]/g;for(;null!==(t=n.exec(e));)ca(o.length),o.push("[]"===t[0]?"":t[1]||t[0]);return o}(e),o,t,0)}),t}return null},cl=(e,t)=>null!=e&&lN.hasOwnProp(e,t)?e[t]:void 0,cc={transitional:l6,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let o,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=lN.isObject(e);if(r&&lN.isHTMLForm(e)&&(e=new FormData(e)),lN.isFormData(e))return i?JSON.stringify(cs(e)):e;if(lN.isArrayBuffer(e)||lN.isBuffer(e)||lN.isStream(e)||lN.isFile(e)||lN.isBlob(e)||lN.isReadableStream(e))return e;if(lN.isArrayBufferView(e))return e.buffer;if(lN.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){let t=cl(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return lZ(e,new cr.classes.URLSearchParams,{visitor:function(e,t,o,n){return cr.isNode&&lN.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((o=lN.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=cl(this,"env"),i=n&&n.FormData;return lZ(o?{"files[]":e}:e,i&&new i,t)}}if(r||i){t.setContentType("application/json",!1);var a=e;if(lN.isString(a))try{return(0,JSON.parse)(a),lN.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=cl(this,"transitional")||cc.transitional,o=t&&t.forcedJSONParsing,n=cl(this,"responseType"),i="json"===n;if(lN.isResponse(e)||lN.isReadableStream(e))return e;if(e&&lN.isString(e)&&(o&&!n||i)){let o=t&&t.silentJSONParsing;try{return JSON.parse(e,cl(this,"parseReviver"))}catch(e){if(!o&&i){if("SyntaxError"===e.name)throw lG.from(e,lG.ERR_BAD_RESPONSE,this,null,cl(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cr.classes.FormData,Blob:cr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function cd(e,t){let o=this||cc,n=t||o,i=lY.from(n.headers),r=n.data;return lN.forEach(e,function(e){r=e.call(o,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function cu(e){return!!(e&&e.__CANCEL__)}lN.forEach(["delete","get","head","post","put","patch","query"],e=>{cc.headers[e]={}});let cf=class extends lG{constructor(e,t,o){super(null==e?"canceled":e,lG.ERR_CANCELED,t,o),this.name="CanceledError",this.__CANCEL__=!0}};function ch(e,t,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(new lG("Request failed with status code "+o.status,o.status>=400&&o.status<500?lG.ERR_BAD_REQUEST:lG.ERR_BAD_RESPONSE,o.config,o.request,o))}let cm=function(e,t){let o,n=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),c=i[a];o||(o=l),n[r]=s,i[r]=l;let d=a,u=0;for(;d!==r;)u+=n[d++],d%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),l-o<t)return;let f=c&&l-c;return f?Math.round(1e3*u/f):void 0}},cb=function(e,t){let o,n,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,o=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(o=e,n||(n=setTimeout(()=>{n=null,a(o)},r-s)))},()=>o&&a(o)]},cp=(e,t,o=3)=>{let n=0,i=cm(50,250);return cb(o=>{if(!o||"number"!=typeof o.loaded)return;let r=o.loaded,a=o.lengthComputable?o.total:void 0,s=null!=a?Math.min(r,a):r,l=Math.max(0,s-n),c=i(l);n=Math.max(n,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:o,lengthComputable:null!=a,[t?"download":"upload"]:!0})},o)},cF=(e,t)=>{let o=null!=e;return[n=>t[0]({lengthComputable:o,total:e,loaded:n}),t[1]]},cg=e=>(...t)=>lN.asap(()=>e(...t)),cv=cr.hasStandardBrowserEnv?(s=new URL(cr.origin),l=cr.navigator&&/(msie|trident)/i.test(cr.navigator.userAgent),e=>(e=new URL(e,cr.origin),s.protocol===e.protocol&&s.host===e.host&&(l||s.port===e.port))):()=>!0,c_=cr.hasStandardBrowserEnv?{write(e,t,o,n,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];lN.isNumber(o)&&s.push(`expires=${new Date(o).toUTCString()}`),lN.isString(n)&&s.push(`path=${n}`),lN.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),lN.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let o=0;o<t.length;o++){let n=t[o].replace(/^\s+/,""),i=n.indexOf("=");if(-1!==i&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch(e){return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},cy=/^https?:(?!\/\/)/i,cw=/[\t\n\r]/g;function cE(e,t){if("string"==typeof e&&cy.test((function(e){let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t)})(e).replace(cw,"")))throw new lG('Invalid URL: missing "//" after protocol',lG.ERR_INVALID_URL,t)}function cC(e,t,o,n){cE(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(i||!1===o)?(cE(e,n),t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e):t}let ck=e=>e instanceof lY?{...e}:e;function cA(e,t){e=e||{},t=t||{};let o=Object.create(null);function n(e,t,o,n){return lN.isPlainObject(e)&&lN.isPlainObject(t)?lN.merge.call({caseless:n},e,t):lN.isPlainObject(t)?lN.merge({},t):lN.isArray(t)?t.slice():t}function i(e,t,o,i){return lN.isUndefined(t)?lN.isUndefined(e)?void 0:n(void 0,e,o,i):n(e,t,o,i)}function r(e,t){if(!lN.isUndefined(t))return n(void 0,t)}function a(e,t){return lN.isUndefined(t)?lN.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(o,i,r){return lN.hasOwnProp(t,r)?n(o,i):lN.hasOwnProp(e,r)?n(void 0,o):void 0}Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let l={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,o)=>i(ck(e),ck(t),o,!0)};return lN.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;let r=lN.hasOwnProp(l,n)?l[n]:i,a=r(lN.hasOwnProp(e,n)?e[n]:void 0,lN.hasOwnProp(t,n)?t[n]:void 0,n);lN.isUndefined(a)&&r!==s||(o[n]=a)}),lN.hasOwnProp(t,"validateStatus")&&lN.isUndefined(t.validateStatus)&&!1===function(o){let n=lN.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!lN.isUndefined(n)){if(!lN.isPlainObject(n))return;else if(lN.hasOwnProp(n,o))return n[o]}let i=lN.hasOwnProp(e,"transitional")?e.transitional:void 0;if(lN.isPlainObject(i)&&lN.hasOwnProp(i,o))return i[o]}("validateStatusUndefinedResolves")&&(lN.hasOwnProp(e,"validateStatus")?o.validateStatus=n(void 0,e.validateStatus):delete o.validateStatus),o}let cx=["content-type","content-length"],cD=function(e){let t=cA({},e),o=e=>lN.hasOwnProp(t,e)?t[e]:void 0,n=o("data"),i=o("withXSRFToken"),r=o("xsrfHeaderName"),a=o("xsrfCookieName"),s=o("headers"),l=o("auth"),c=o("baseURL"),d=o("allowAbsoluteUrls"),u=o("url");if(t.headers=s=lY.from(s),t.url=l5(cC(c,u,d,t),o("params"),o("paramsSerializer")),l){let t=lN.getSafeProp(l,"username")||"",o=lN.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(o?encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw lG.from(t,lG.ERR_BAD_OPTION_VALUE,e)}}if(lN.isFormData(n))if(cr.hasStandardBrowserEnv||cr.hasStandardBrowserWebWorkerEnv||lN.isReactNative(n))s.setContentType(void 0);else{var f,h;lN.isFunction(n.getHeaders)&&(f=s,h=n.getHeaders(),"content-only"!==o("formDataHeaderPolicy")?f.set(h):Object.entries(h||{}).forEach(([e,t])=>{cx.includes(e.toLowerCase())&&f.set(e,t)}))}if(cr.hasStandardBrowserEnv&&(lN.isFunction(i)&&(i=i(t)),!0===i||null==i&&cv(t.url))){let e=r&&a&&c_.read(a);e&&s.set(r,e)}return t},cS="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,o){var n;let i,r,a,s,l,c,d=cD(e),u=d.data,f=lY.from(d.headers).normalize(),{responseType:h,onUploadProgress:m,onDownloadProgress:b}=d;function p(){s&&s(),l&&l(),d.cancelToken&&d.cancelToken.unsubscribe(i),d.signal&&d.signal.removeEventListener("abort",i)}let F=new XMLHttpRequest;function g(){if(!F)return;let n=lY.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders());ch(function(e){t(e),p()},function(e){o(e),p()},{data:h&&"text"!==h&&"json"!==h?F.response:F.responseText,status:F.status,statusText:F.statusText,headers:n,config:e,request:F}),F=null}F.open(d.method.toUpperCase(),d.url,!0),F.timeout=d.timeout,"onloadend"in F?F.onloadend=g:F.onreadystatechange=function(){!F||4!==F.readyState||(0!==F.status||F.responseURL&&F.responseURL.startsWith("file:"))&&setTimeout(g)},F.onabort=function(){F&&(o(new lG("Request aborted",lG.ECONNABORTED,e,F)),p(),F=null)},F.onerror=function(t){let n=new lG(t&&t.message?t.message:"Network Error",lG.ERR_NETWORK,e,F);n.event=t||null,o(n),p(),F=null},F.ontimeout=function(){let t=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",n=d.transitional||l6;d.timeoutErrorMessage&&(t=d.timeoutErrorMessage),o(new lG(t,n.clarifyTimeoutError?lG.ETIMEDOUT:lG.ECONNABORTED,e,F)),p(),F=null},void 0===u&&f.setContentType(null),"setRequestHeader"in F&&lN.forEach(l$(f),function(e,t){F.setRequestHeader(t,e)}),lN.isUndefined(d.withCredentials)||(F.withCredentials=!!d.withCredentials),h&&"json"!==h&&(F.responseType=d.responseType),b&&([a,l]=cp(b,!0),F.addEventListener("progress",a)),m&&F.upload&&([r,s]=cp(m),F.upload.addEventListener("progress",r),F.upload.addEventListener("loadend",s)),(d.cancelToken||d.signal)&&(i=t=>{F&&(o(!t||t.type?new cf(null,e,F):t),F.abort(),p(),F=null)},d.cancelToken&&d.cancelToken.subscribe(i),d.signal&&(d.signal.aborted?i():d.signal.addEventListener("abort",i)));let v=(n=d.url,(c=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n))&&c[1]||"");if(v&&!cr.protocols.includes(v)){o(new lG("Unsupported protocol "+v+":",lG.ERR_BAD_REQUEST,e)),p();return}F.send(u||null)})},cT=function*(e,t){let o,n=e.byteLength;if(!t||n<t)return void(yield e);let i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},cO=async function*(e,t){for await(let o of cI(e))yield*cT(o,t)},cI=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},cB=(e,t,o,n)=>{let i,r=cO(e,t),a=0,s=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await r.next();if(t){s(),e.close();return}let i=n.byteLength;if(o){let e=a+=i;o(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},cR=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cP=(e,t,o)=>t+2<o&&cR(e.charCodeAt(t+1))&&cR(e.charCodeAt(t+2)),{isFunction:cN}=lN,cL=e=>{if(!lN.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},cM=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cU=e=>{let t,o=void 0!==lN.global&&null!==lN.global?lN.global:globalThis,{ReadableStream:n,TextEncoder:i}=o,{fetch:r,Request:a,Response:s}=e=lN.merge.call({skipUndefined:!0},{Request:o.Request,Response:o.Response},e),l=r?cN(r):"function"==typeof fetch,c=cN(a),d=cN(s);if(!l)return!1;let u=l&&cN(n),f=l&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),h=c&&u&&cM(()=>{let e=!1,t=new a(cr.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),m=d&&u&&cM(()=>lN.isReadableStream(new s("").body)),b={stream:m&&(e=>e.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{b[e]||(b[e]=(t,o)=>{let n=t&&t[e];if(n)return n.call(t);throw new lG(`Response type '${e}' is not supported`,lG.ERR_NOT_SUPPORT,o)})});let p=async e=>{if(null==e)return 0;if(lN.isBlob(e))return e.size;if(lN.isSpecCompliantForm(e)){let t=new a(cr.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return lN.isArrayBufferView(e)||lN.isArrayBuffer(e)?e.byteLength:(lN.isURLSearchParams(e)&&(e+=""),lN.isString(e))?(await f(e)).byteLength:void 0},F=async(e,t)=>{let o=lN.toFiniteNumber(e.getContentLength());return null==o?p(t):o};return async e=>{let t,{url:o,method:n,data:l,signal:d,cancelToken:f,timeout:g,onDownloadProgress:v,onUploadProgress:_,responseType:y,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:k,maxBodyLength:A}=cD(e),x=lN.isNumber(k)&&k>-1,D=lN.isNumber(A)&&A>-1,S=r||fetch;y=y?(y+"").toLowerCase():"text";let T=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let o=new AbortController,n=!1,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof lG?t:new cf(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new lG(`timeout of ${t}ms exceeded`,lG.ETIMEDOUT))},t),a=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i,{once:!0}));let{signal:s}=o;return s.unsubscribe=()=>lN.asap(a),s})([d,f&&f.toAbortSignal()],g),O=null,I=T&&T.unsubscribe&&(()=>{T.unsubscribe()}),B=null,R=()=>new lG("Request body larger than maxBodyLength limit",lG.ERR_BAD_REQUEST,e,O);try{var P;let r,d,f,g,N=(d="auth",lN.hasOwnProp(e,d)?e[d]:void 0);if(N){let e=lN.getSafeProp(N,"username")||"",t=lN.getSafeProp(N,"password")||"";r={username:e,password:t}}if(f=(P=o).indexOf("://"),g=P,-1!==f&&(g=g.slice(f+3)),g.includes("@")||g.includes(":")){let e=new URL(o,cr.origin);if(!r&&(e.username||e.password)){let t=cL(e.username),o=cL(e.password);r={username:t,password:o}}(e.username||e.password)&&(e.username="",e.password="",o=e.href)}if(r){let e;w.delete("authorization"),w.set("Authorization","Basic "+btoa((e=(r.username||"")+":"+(r.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(x&&"string"==typeof o&&o.startsWith("data:")&&function(e){if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let o=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(o)){let e=n.length,t=n.length;for(let o=0;o<t;o++)if(37===n.charCodeAt(o)&&o+2<t){let t=n.charCodeAt(o+1),i=n.charCodeAt(o+2);cR(t)&&cR(i)&&(e-=2,o+=2)}let o=0,i=t-1,r=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));i>=0&&(61===n.charCodeAt(i)?(o++,i--):r(i)&&(o++,i-=3)),1===o&&i>=0&&(61===n.charCodeAt(i)?o++:r(i)&&o++);let a=3*Math.floor(e/4)-(o||0);return a>0?a:0}let i=0;for(let e=0,t=n.length;e<t;e++){let o=n.charCodeAt(e);if(37===o&&cP(n,e,t))i+=1,e+=2;else if(o<128)i+=1;else if(o<2048)i+=2;else if(o>=55296&&o<=56319&&e+1<t){let t=n.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}(o)>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O);if(D&&"get"!==n&&"head"!==n){let e=await p(l);if("number"==typeof e&&isFinite(e)&&(t=e,e>A))throw R()}let L=D&&(lN.isReadableStream(l)||lN.isStream(l)),M=(e,t,o)=>cB(e,65536,e=>{if(D&&e>A)throw B=R();t&&t(e)},o);if(h&&"get"!==n&&"head"!==n&&(_||L)){if(t=null==t?await F(w,l):t,0!==t||L){let e,n=new a(o,{method:"POST",body:l,duplex:"half"});if(lN.isFormData(l)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){let[e,o]=_&&cF(t,cp(cg(_)))||[];l=M(n.body,e,o)}}}else if(L&&!c&&u&&"get"!==n&&"head"!==n)l=M(l);else if(L&&c&&!h&&"get"!==n&&"head"!==n)throw new lG("Stream request bodies are not supported by the current fetch implementation",lG.ERR_NOT_SUPPORT,e,O);lN.isString(E)||(E=E?"include":"omit");let U=c&&"credentials"in a.prototype;if(lN.isFormData(l)){let e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...C,signal:T,method:n.toUpperCase(),headers:l$(w.normalize()),body:l,duplex:"half",credentials:U?E:void 0};O=c&&new a(o,j);let $=await (c?S(O,C):S(o,j)),V=lY.from($.headers);if(x){let t=lN.toFiniteNumber(V.getContentLength());if(null!=t&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O)}let z=m&&("stream"===y||"response"===y);if(m&&$.body&&(v||x||z&&I)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=$[e]});let o=lN.toFiniteNumber(V.getContentLength()),[n,i]=v&&cF(o,cp(cg(v),!0))||[];$=new s(cB($.body,65536,t=>{if(x&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O);n&&n(t)},()=>{i&&i(),I&&I()}),t)}y=y||"text";let q=await b[lN.findKey(b,y)||"text"]($,e);if(x&&!m&&!z){let t;if(null!=q&&("number"==typeof q.byteLength?t=q.byteLength:"number"==typeof q.size?t=q.size:"string"==typeof q&&(t="function"==typeof i?new i().encode(q).byteLength:q.length)),"number"==typeof t&&t>k)throw new lG("maxContentLength size of "+k+" exceeded",lG.ERR_BAD_RESPONSE,e,O)}return!z&&I&&I(),await new Promise((t,o)=>{ch(t,o,{data:q,headers:lY.from($.headers),status:$.status,statusText:$.statusText,config:e,request:O})})}catch(t){if(I&&I(),T&&T.aborted&&T.reason instanceof lG){let o=T.reason;throw o.config=e,O&&(o.request=O),t!==o&&Object.defineProperty(o,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),o}if(B)throw O&&!B.request&&(B.request=O),B;if(t instanceof lG)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let o=new lG("Network Error",lG.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(o,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),o}throw lG.from(t,t&&t.code,e,O,t&&t.response)}}},cj=new Map,c$=e=>{let t=e&&e.env||{},{fetch:o,Request:n,Response:i}=t,r=[n,i,o],a=r.length,s,l,c=cj;for(;a--;)s=r[a],void 0===(l=c.get(s))&&c.set(s,l=a?new Map:cU(t)),c=l;return l};c$();let cV={http:null,xhr:cS,fetch:{get:c$}};lN.forEach(cV,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let cz=e=>`- ${e}`,cq=e=>lN.isFunction(e)||null===e||!1===e,cH=function(e,t){let o,n,{length:i}=e=lN.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(n=o=e[a],!cq(o)&&void 0===(n=cV[(i=String(o)).toLowerCase()]))throw new lG(`Unknown adapter '${i}'`);if(n&&(lN.isFunction(n)||(n=n.get(t))))break;r[i||"#"+a]=n}if(!n){let e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new lG("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(cz).join("\n"):" "+cz(e[0]):"as no adapter specified"),lG.ERR_NOT_SUPPORT)}return n};function cY(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cf(null,e)}function cW(e){return cY(e),e.headers=lY.from(e.headers),e.data=cd.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),cH(e.adapter||cc.adapter,e)(e).then(function(t){cY(e),e.response=t;try{t.data=cd.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=lY.from(t.headers),t},function(t){if(!cu(t)&&(cY(e),t&&t.response)){e.response=t.response;try{t.response.data=cd.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=lY.from(t.response.headers)}return Promise.reject(t)})}let cG={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{cG[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});let cK={};cG.transitional=function(e,t,o){function n(e,t){return"[Axios v1.18.1] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,i,r)=>{if(!1===e)throw new lG(n(i," has been removed"+(t?" in "+t:"")),lG.ERR_DEPRECATED);return t&&!cK[i]&&(cK[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,i,r)}},cG.spelling=function(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};let cJ=function(e,t,o){if("object"!=typeof e||null===e)throw new lG("options must be an object",lG.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let r=n[i],a=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(a){let t=e[r],o=void 0===t||a(t,r,e);if(!0!==o)throw new lG("option "+r+" must be "+o,lG.ERR_BAD_OPTION_VALUE);continue}if(!0!==o)throw new lG("Unknown option "+r,lG.ERR_BAD_OPTION)}};class cX{constructor(e){this.defaults=e||{},this.interceptors={request:new l4,response:new l4}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let o=(()=>{if(!t.stack)return"";let e=t.stack.indexOf("\n");return -1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(o){let t=o.indexOf("\n"),n=-1===t?-1:o.indexOf("\n",t+1),i=-1===n?"":o.slice(n+1);String(e.stack).endsWith(i)||(e.stack+="\n"+o)}}else e.stack=o}catch(e){}}throw e}}_request(e,t){let o,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cA(this.defaults,t);void 0!==i&&cJ(i,{silentJSONParsing:cG.transitional(cG.boolean),forcedJSONParsing:cG.transitional(cG.boolean),clarifyTimeoutError:cG.transitional(cG.boolean),legacyInterceptorReqResOrdering:cG.transitional(cG.boolean),advertiseZstdAcceptEncoding:cG.transitional(cG.boolean),validateStatusUndefinedResolves:cG.transitional(cG.boolean)},!1),null!=r&&(lN.isFunction(r)?t.paramsSerializer={serialize:r}:cJ(r,{encode:cG.function,serialize:cG.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cJ(t,{baseUrl:cG.spelling("baseURL"),withXsrfToken:cG.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&lN.merge(a.common,a[t.method]);a&&lN.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete a[e]}),t.headers=lY.concat(s,a);let l=[],c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;let o=t.transitional||l6;o&&o.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let d=[];this.interceptors.response.forEach(function(e){d.push(e.fulfilled,e.rejected)});let u=0;if(!c){let e=[cW.bind(this),void 0];for(e.unshift(...l),e.push(...d),n=e.length,o=Promise.resolve(t);u<n;)o=o.then(e[u++],e[u++]);return o}n=l.length;let f=t;for(;u<n;){let e=l[u++],t=l[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{o=cW.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,n=d.length;u<n;)o=o.then(d[u++],d[u++]);return o}getUri(e){return l5(cC((e=cA(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}lN.forEach(["delete","get","head","options"],function(e){cX.prototype[e]=function(t,o){return this.request(cA(o||{},{method:e,url:t,data:o&&lN.hasOwnProp(o,"data")?o.data:void 0}))}}),lN.forEach(["post","put","patch","query"],function(e){function t(t){return function(o,n,i){return this.request(cA(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}cX.prototype[e]=t(),"query"!==e&&(cX.prototype[e+"Form"]=t(!0))});let cQ=class e{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const o=this;this.promise.then(e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null}),this.promise.then=e=>{let t,n=new Promise(e=>{o.subscribe(e),t=e}).then(e);return n.cancel=function(){o.unsubscribe(t)},n},e(function(e,n,i){o.reason||(o.reason=new cf(e,n,i),t(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},cZ={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(cZ).forEach(([e,t])=>{cZ[t]=e});let c0=function e(t){let o=new cX(t),n=s3(cX.prototype.request,o);return lN.extend(n,cX.prototype,o,{allOwnKeys:!0}),lN.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return e(cA(t,o))},n}(cc);c0.Axios=cX,c0.CanceledError=cf,c0.CancelToken=cQ,c0.isCancel=cu,c0.VERSION="1.18.1",c0.toFormData=lZ,c0.AxiosError=lG,c0.Cancel=c0.CanceledError,c0.all=function(e){return Promise.all(e)},c0.spread=function(e){return function(t){return e.apply(null,t)}},c0.isAxiosError=function(e){return lN.isObject(e)&&!0===e.isAxiosError},c0.mergeConfig=cA,c0.AxiosHeaders=lY,c0.formToJSON=e=>cs(lN.isHTMLForm(e)?new FormData(e):e),c0.getAdapter=cH,c0.HttpStatusCode=cZ,c0.default=c0;class c1{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:dm`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:dm`info`,options:e})}}class c2{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:dm`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:dm`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:dm`flow/${e}`,options:t})}}class c3{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:dm`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:dm`configuration/manager`,data:e,options:t})}fileUpload(e,t,o){return this.httpClient.request({method:"POST",url:dm`configuration/manager/file`,queryParams:t,data:e,options:o})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:dm`configuration/manager/image/${e}`,options:t})}}class c5{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:dm`agent/assetDiscovery/${e}`,queryParams:t,options:o})}doProtocolAssetImport(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`agent/assetImport/${e}`,queryParams:o,data:t,options:n})}doProtocolInstanceDiscovery(e,t,o){return this.httpClient.request({method:"GET",url:dm`agent/instanceDiscovery/${e}`,queryParams:t,options:o})}}class c4{constructor(e){this.httpClient=e}createAlarm(e,t,o){return this.httpClient.request({method:"POST",url:dm`alarm`,queryParams:t,data:e,options:o})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:dm`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:dm`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:dm`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:dm`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:dm`alarm/${e}`,options:t})}updateAlarm(e,t,o){return this.httpClient.request({method:"PUT",url:dm`alarm/${e}`,data:t,options:o})}getAssetLinks(e,t,o){return this.httpClient.request({method:"GET",url:dm`alarm/${e}/assets`,queryParams:t,options:o})}}class c6{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:dm`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:dm`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:dm`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:dm`map/getCustomMapInfo`,options:e})}getTile(e,t,o,n){return this.httpClient.request({method:"GET",url:dm`map/tile/${e}/${t}/${o}`,options:n})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:dm`map/upload`,queryParams:e,options:t})}}class c8{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:dm`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:dm`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:dm`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:dm`service/global`,data:e,options:t})}deregisterService(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`service/${e}/${t}`,options:o})}getService(e,t,o){return this.httpClient.request({method:"GET",url:dm`service/${e}/${t}`,options:o})}heartbeat(e,t,o){return this.httpClient.request({method:"PUT",url:dm`service/${e}/${t}`,options:o})}}class c9{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:dm`console/register`,data:e,options:t})}}class c7{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:dm`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,o){return this.httpClient.request({method:"GET",url:dm`rules/asset/for/${e}`,queryParams:t,options:o})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/asset/${e}`,data:t,options:o})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:dm`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:dm`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:dm`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:dm`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:dm`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,o){return this.httpClient.request({method:"GET",url:dm`rules/realm/for/${e}`,queryParams:t,options:o})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/realm/${e}`,data:t,options:o})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:dm`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:dm`rules/${e}`,options:t})}updateGlobalRuleset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`rules/${e}`,data:t,options:o})}}class de{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:dm`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:dm`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:dm`dashboard/query`,data:e,options:t})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`dashboard/${e}/${t}`,options:o})}get(e,t,o){return this.httpClient.request({method:"GET",url:dm`dashboard/${e}/${t}`,options:o})}}class dt{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,o){return this.httpClient.request({method:"GET",url:dm`model/assetInfo/${e}`,queryParams:t,options:o})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:dm`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:dm`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:dm`model/valueDescriptors`,queryParams:e,options:t})}}class dn{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:dm`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:dm`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:dm`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:dm`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:dm`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:dm`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:dm`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:dm`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`user/${e}/disconnect/${t}`,options:o})}requestPasswordReset(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/request-password-reset/${t}`,options:o})}updatePassword(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/reset-password/${t}`,data:o,options:n})}resetSecret(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/reset-secret/${t}`,options:o})}updateRoles(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/roles`,data:t,options:o})}getUserRealmRoles(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/userRealmRoles/${t}`,options:o})}updateUserRealmRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/userRealmRoles/${t}`,data:o,options:n})}getUserClientRoles(e,t,o,n){return this.httpClient.request({method:"GET",url:dm`user/${e}/userRoles/${t}/${o}`,options:n})}updateUserClientRoles(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:dm`user/${e}/userRoles/${t}/${o}`,data:n,options:i})}getUserSessions(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/userSessions/${t}`,options:o})}create(e,t,o){return this.httpClient.request({method:"POST",url:dm`user/${e}/users`,data:t,options:o})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`user/${e}/users`,data:t,options:o})}delete(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`user/${e}/users/${t}`,options:o})}getClientRoles(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/${t}/roles`,options:o})}updateClientRoles(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`user/${e}/${t}/roles`,data:o,options:n})}get(e,t,o){return this.httpClient.request({method:"GET",url:dm`user/${e}/${t}`,options:o})}}class di{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:dm`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:dm`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:dm`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,o){return this.httpClient.request({method:"PUT",url:dm`provisioning/${e}`,data:t,options:o})}}class dr{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:dm`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:dm`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:dm`notification/alert`,data:e,options:t})}getNotificationsCount(e,t){return this.httpClient.request({method:"GET",url:dm`notification/count`,queryParams:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:dm`notification/${e}`,options:t})}notificationAcknowledged(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`notification/${e}/acknowledged`,queryParams:o,data:t,options:n})}notificationDelivered(e,t,o){return this.httpClient.request({method:"PUT",url:dm`notification/${e}/delivered`,queryParams:t,options:o})}}class da{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:dm`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,o){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}/${t}`,options:o})}getActiveTunnelInfo(e,t,o,n,i){return this.httpClient.request({method:"GET",url:dm`gateway/tunnel/${e}/${t}/${o}/${n}`,options:i})}}class ds{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:dm`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:dm`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/connection/${e}`,options:t})}setConnection(e,t,o){return this.httpClient.request({method:"PUT",url:dm`gateway/connection/${e}`,data:t,options:o})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:dm`gateway/status/${e}`,options:t})}}class dl{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:dm`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:dm`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`asset/datapoint/${e}/${t}`,data:o,options:n})}}class dc{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:dm`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:dm`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:dm`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:dm`realm/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`realm/${e}`,data:t,options:o})}}class dd{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"POST",url:dm`asset/predicted/${e}/${t}`,data:o,options:n})}writePredictedDatapoints(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`asset/predicted/${e}/${t}`,data:o,options:n})}}class du{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:dm`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:dm`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:dm`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:dm`syslog/event`,queryParams:e,options:t})}}class df{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:dm`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:dm`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:dm`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:dm`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:dm`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:dm`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:dm`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:dm`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:dm`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:dm`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:dm`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:dm`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:dm`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,o){return this.httpClient.request({method:"DELETE",url:dm`asset/user/link/${e}/${t}`,options:o})}deleteUserAssetLink(e,t,o,n){return this.httpClient.request({method:"DELETE",url:dm`asset/user/link/${e}/${t}/${o}`,options:n})}get(e,t){return this.httpClient.request({method:"GET",url:dm`asset/${e}`,options:t})}update(e,t,o){return this.httpClient.request({method:"PUT",url:dm`asset/${e}`,data:t,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,o,n){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/attribute/${t}`,data:o,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,o,n,i){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/attribute/${t}/${o}`,data:n,options:i})}updateParent(e,t,o){return this.httpClient.request({method:"PUT",url:dm`asset/${e}/child`,queryParams:t,options:o})}}class dh{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:dm`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:dm`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:dm`apps/info`,options:e})}}function dm(e,...t){let o="";for(let n=0;n<t.length;n++)o+=e[n],o+=encodeURIComponent(t[n]);return o+e[e.length-1]}class db{constructor(e,t=c0.create()){this._statusResource=new dF(e,t),this._flowResource=new dg(e,t),this._configurationResource=new dv(e,t),this._agentResource=new d_(e,t),this._alarmResource=new dy(e,t),this._mapResource=new dw(e,t),this._externalServiceResource=new dE(e,t),this._consoleResource=new dC(e,t),this._rulesResource=new dk(e,t),this._dashboardResource=new dA(e,t),this._assetModelResource=new dx(e,t),this._userResource=new dD(e,t),this._provisioningResource=new dS(e,t),this._notificationResource=new dT(e,t),this._gatewayServiceResource=new dO(e,t),this._gatewayClientResource=new dI(e,t),this._assetDatapointResource=new dB(e,t),this._realmResource=new dR(e,t),this._assetPredictedDatapointResource=new dP(e,t),this._syslogResource=new dN(e,t),this._assetResource=new dL(e,t),this._appResource=new dM(e,t),this._assetResource=new dL(e,t)}get StatusResource(){return this._statusResource}get FlowResource(){return this._flowResource}get ConfigurationResource(){return this._configurationResource}get AgentResource(){return this._agentResource}get AlarmResource(){return this._alarmResource}get MapResource(){return this._mapResource}get ExternalServiceResource(){return this._externalServiceResource}get ConsoleResource(){return this._consoleResource}get RulesResource(){return this._rulesResource}get DashboardResource(){return this._dashboardResource}get AssetModelResource(){return this._assetModelResource}get UserResource(){return this._userResource}get ProvisioningResource(){return this._provisioningResource}get NotificationResource(){return this._notificationResource}get GatewayServiceResource(){return this._gatewayServiceResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetDatapointResource(){return this._assetDatapointResource}get RealmResource(){return this._realmResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get SyslogResource(){return this._syslogResource}get AssetResource(){return this._assetResource}get AppResource(){return this._appResource}}class dp{constructor(e){this.axios=e}request(e){let t={};t.method=e.method,t.url=e.url,t.params=e.queryParams,t.data=e.data,function(e,t){if(void 0!=t)for(let o in t)t.hasOwnProperty(o)&&(e[o]=t[o])}(t,e.options);let o=e.copyFn;return this.axios.request(t).then(e=>(o&&e.data&&(e.originalData=e.data,e.data=o(e.data)),e))}}class dF extends c1{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dg extends c2{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dv extends c3{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class d_ extends c5{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dy extends c4{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dw extends c6{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dE extends c8{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dC extends c9{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dk extends c7{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dA extends de{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dx extends dt{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dD extends dn{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dS extends di{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dT extends dr{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dO extends da{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dI extends ds{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dB extends dl{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dR extends dc{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dP extends dd{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dN extends du{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dL extends df{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}class dM extends dh{constructor(e,t=c0.create()){t.defaults.baseURL=e,super(new dp(t))}}var dU=o(8183),dj=o.n(dU);c0.isAxiosError;let d$=new class{get api(){return this._client}constructor(){this._axiosInstance=c0.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>dj().stringify(e,{arrayFormat:"repeat"}),e))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(e){this._axiosInstance.defaults.timeout=e}addRequestInterceptor(e){this._axiosInstance.interceptors.request.use(e)}initialise(e){this._baseUrl=e,this._client=new db(e,this._axiosInstance)}};var dV=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};(ey=tA||(tA={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let dz="SUBSCRIBED:",dq="UNAUTHORIZED:",dH="TRIGGERED:",dY="EVENT:";class dW{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=dG.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tA.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(e){this._statusCallbacks.push(e)}unsubscribeStatusChange(e){!function(e,t){if(0===e.length)return;let o=e.indexOf(t);o>=0&&e.splice(o,1)}(this._statusCallbacks,e)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tA.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tA.CONNECTING),this._connectingDeferred=new sX,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=dG.MIN_RECONNECT_DELAY,this._onStatusChanged(tA.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),t.resolve(e)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tA.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let o={eventSubscription:e,callback:t,deferred:new sX};return null!=this._pendingSubscription||this._status!==tA.CONNECTED?(this._queuedSubscriptions.push(o),o.deferred.promise):(this._pendingSubscription=o,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.resolve(e)}},e=>{if(console.error(e),this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let o=t.deferred;t.deferred=null,o&&o.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return dV(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(e))return void this._doUnsubscribe(e);if(this._assetEventCallbackMap.delete(e)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let e=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(e)}return}if(this._attributeEventCallbackMap.delete(e)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}})}sendEvent(e){this._status===tA.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tA.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,o){return dV(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+dW._subscriptionCounter++;if(!this._assetEventPromise){let e;ud.authenticated||(e={filterType:"asset",realm:ud.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(i,e=>{let t=e.asset.id;n?n.find(e=>t===e)&&o(e):e.asset.realm===ud.displayRealm&&o(e)}),this._assetEventPromise.then(()=>{try{if(n&&t){let e={messageID:"read-assets:"+n.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:n}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{o({eventType:"asset",asset:e,cause:"READ"})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),i&&this.unsubscribe(i),t}return i})})}subscribeAttributeEvents(e,t,o){return dV(this,void 0,void 0,function*(){let n=e&&"string"!=typeof e[0],i=n?e.map(e=>e.id):e,r=n?e:void 0,a="AttributeEvent"+dW._subscriptionCounter++;if(!this._attributeEventPromise){let e;ud.authenticated||(e={filterType:"asset",realm:ud.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let s=t=>{let r=t.ref;n?e.forEach(e=>{r.id===e.id&&r.name===e.name&&o(t)}):i?i.find(e=>r.id===e)&&o(t):t.realm===ud.displayRealm&&o(t)};return this._attributeEventCallbackMap.set(a,s),this._attributeEventPromise.then(()=>{try{if(t&&i){let e={messageID:"read-assets:"+i.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._attributeEventCallbackMap.has(a)&&e.assets.forEach(e=>{e.attributes&&Object.entries(e.attributes).forEach(([t,o])=>{(!r||r.find(o=>o.id===e.id&&o.name===t))&&s({eventType:"attribute",timestamp:o.timestamp,value:o.value,ref:{id:e.id,name:t}})})})})}}catch(t){throw console.error("Failed to subscribe to asset events for assets: "+e),a&&this.unsubscribe(a),t}return a})})}_processNextSubscription(){this._status===tA.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let o=e.deferred;e.deferred=null,o&&o.resolve(t)},t=>{let o=e.deferred;e.deferred=null,o&&o.reject(t)})},0)}_onStatusChanged(e){e!==this._status&&(console.debug("Event provider status changed: "+e),this._status=e,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(t=>t(e))},0))}_onMessageReceived(e,t){let o=this._subscriptionMap.get(e);o&&o.callback(t)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let e in this._subscriptionMap)this._subscriptionMap.has(e)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(e));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tA.CONNECTED&&this._onStatusChanged(tA.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tA.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<dG.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(dG.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}dW.MIN_RECONNECT_DELAY=0,dW.MAX_RECONNECT_DELAY=3e4,dW._subscriptionCounter=0;class dG extends dW{get endpointUrl(){return this._endpointUrl}constructor(e){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(e.startsWith("https:")?"wss":"ws")+"://"+e.substr(e.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let e=this._endpointUrl+"?Realm="+ud.config.realm;return this._connectDeferred=new sX,(ud.authenticated?ud.retrieveAuthorizationHeader().then(t=>{e+="&Authorization="+t}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(e),this._webSocket.onopen=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(console.error("Event provider error:",e),this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=e=>{let t=e.data;if(t&&t.startsWith(dz)){let e=JSON.parse(t.substring(dz.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&o.resolve(e.subscriptionId)}else if(t.startsWith(dq)){let e=JSON.parse(t.substring(dq.length)),o=this._subscribeDeferred;this._subscribeDeferred=null,o&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),o.reject("Unauthorized"))}else if(t.startsWith(dH)){let e=JSON.parse(t.substring(dH.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(dY)){let e=JSON.parse(t.substring(dY.length));if(e.messageID){let t=this._repliesDeferred.get(e.messageID);this._repliesDeferred.delete(e.messageID),t&&t.resolve(e)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var e;null==(e=this._webSocket)||e.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(e){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new sX,e.subscriptionId||(e.subscriptionId=dG._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(e)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(e){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:e}))}_doSend(e){let t=dY+JSON.stringify(e);this._webSocket.send(t)}_doSendWithReply(e){if(e.messageID||(e.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(e.messageID))return Promise.reject("There's already a pending send and reply with this ID");let t=new sX;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(dY+JSON.stringify(e)),t.promise}}dG._subscriptionCounter=1;let dK=["__proto__","constructor","prototype"];function dJ(e){return!("string"!=typeof e||0===e.length||e.length>128||dK.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function dX(e){return!(!dJ(e)||e.indexOf("/")>-1)}let dQ={lng:dX,ns:function(e){return dJ(e)}};function dZ(e){return"string"!=typeof e?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function d0(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let d1=/\{\{(.+?)\}\}/g;function d2(e,t){let o=!1,n=e.replace(d1,(e,n)=>{let i=n.trim();if(dK.indexOf(i)>-1)return e;let r=t[i];if(null==r)return e;let a=dQ[i]||dX,s=String(r).split("+");for(let t of s)if(!a(t))return o=!0,e;return s.join("+")});return o?null:n}let d3="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?i=fetch:d3&&"function"==typeof d3.fetch&&(i=d3.fetch);let d5=d0()&&d3?d3.XMLHttpRequest:void 0,d4="function"==typeof ActiveXObject&&d3?d3.ActiveXObject:void 0,d6=["__proto__","constructor","prototype"],d8=(e,t)=>{if(t&&"object"==typeof t){let o="";for(let e of Object.keys(t))d6.indexOf(e)>-1||(o+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t[e]));if(!o)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+o.slice(1)}return e},d9=(e,t,o,n)=>{let r=e=>{if(!e.ok)return o(e.statusText||"Error",{status:e.status});e.text().then(t=>{o(null,{status:e.status,data:t})}).catch(o)};if(n){let i=n(e,t);if(i instanceof Promise)return void i.then(r).catch(o)}"function"==typeof fetch?fetch(e,t).then(r).catch(o):i(e,t).then(r).catch(o)},d7=(e,t,o,n)=>{if("function"==typeof o&&(n=o,o=void 0),n=n||(()=>{}),i&&0!==t.indexOf("file:")){var r=t,a=o,s=n;e.queryStringParams&&(r=d8(r,e.queryStringParams));let i={..."function"==typeof e.customHeaders?e.customHeaders():e.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),a&&(i["Content-Type"]="application/json");let l="function"==typeof e.requestOptions?e.requestOptions(a):e.requestOptions,c={method:a?"POST":"GET",body:a?e.stringify(a):void 0,headers:i,...e._omitFetchOptions?{}:l},d="function"==typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{d9(r,c,s,d)}catch(t){if(!l||0===Object.keys(l).length||!t.message||0>t.message.indexOf("not implemented"))return s(t);try{Object.keys(l).forEach(e=>{delete c[e]}),d9(r,c,s,d),e._omitFetchOptions=!0}catch(e){s(e)}}return}if(d0()||"function"==typeof ActiveXObject){var l=t,c=o,d=n;c&&"object"==typeof c&&(c=d8("",c).slice(1)),e.queryStringParams&&(l=d8(l,e.queryStringParams));try{let t=d5?new d5:new d4("MSXML2.XMLHTTP.3.0");t.open(c?"POST":"GET",l,1),e.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!e.withCredentials,c&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let o=e.customHeaders;if(o="function"==typeof o?o():o)for(let e of Object.keys(o))d6.indexOf(e)>-1||t.setRequestHeader(e,o[e]);t.onreadystatechange=()=>{t.readyState>3&&d(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(c)}catch(e){console&&console.log(e)}return}n(Error("No fetch and no xhr implementation found!"))};var ue=class{constructor(e,t={},o={}){this.services=e,this.options=t,this.allOptions=o,this.type="backend",this.init(e,t,o)}init(e,t={},o={}){if(this.services=e,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,o)=>({[t]:o||""}),parseLoadPayload:(e,t)=>void 0,request:d7,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...t},this.allOptions=o,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof e&&"function"==typeof e.unref&&e.unref()}}readMulti(e,t,o){this._readAny(e,e,t,t,o)}read(e,t,o){this._readAny([e],e,[t],t,o)}_readAny(e,t,o,n,i){var r,a;let s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,o)),(s=(a=r=s)&&"function"==typeof a.then?r:Promise.resolve(r)).then(r=>{if(!r)return i(null,{});let a=d2(r,{lng:e.join("+"),ns:o.join("+")});if(null==a)return i(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+e.map(dZ).join(", ")+"] namespaces=["+o.map(dZ).join(", ")+"]"),!1);this.loadUrl(a,i,t,n)})}loadUrl(e,t,o,n){let i=this.options.parseLoadPayload("string"==typeof o?[o]:o,"string"==typeof n?[n]:n),r=dZ(function(e){if("string"!=typeof e||0===e.length)return e;try{let t=new URL(e);if(t.username||t.password)return t.username="",t.password="",t.toString();return e}catch(t){return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(e));this.options.request(this.options,e,i,(e,i)=>{let a,s;if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+r+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+r+"; status code: "+i.status,!1);if(!i&&e&&e.message){let o=e.message.toLowerCase();if(["failed","fetch","network","load"].find(e=>o.indexOf(e)>-1))return t("failed loading "+r+": "+dZ(e.message),!0)}if(e)return t(e,!1);try{a="string"==typeof i.data?this.options.parse(i.data,o,n):i.data}catch(e){s="failed parsing "+r+" to json"}if(s)return t(s,!1);t(null,a)})}create(e,t,o,n,i){if(!this.options.addPath)return;"string"==typeof e&&(e=[e]);let r=this.options.parsePayload(t,o,n),a=0,s=[],l=[];e.forEach(o=>{let n=this.options.addPath;"function"==typeof this.options.addPath&&(n=this.options.addPath(o,t));let c=d2(n,{lng:o,ns:t});if(null==c){a+=1,i&&a===e.length&&i(s,l);return}this.options.request(this.options,c,r,(t,o)=>{a+=1,s.push(t),l.push(o),a===e.length&&"function"==typeof i&&i(s,l)})})}reload(){let{backendConnector:e,languageUtils:t,logger:o}=this.services,n=e.language;if(n&&"cimode"===n.toLowerCase())return;let i=[],r=e=>{t.toResolveHierarchy(e).forEach(e=>{0>i.indexOf(e)&&i.push(e)})};r(n),this.allOptions.preload&&this.allOptions.preload.forEach(e=>r(e)),i.forEach(t=>{this.allOptions.ns.forEach(n=>{e.read(t,n,"read",null,null,(i,r)=>{i&&o.warn(`loading namespace ${n} for language ${t} failed`,i),!i&&r&&o.log(`loaded namespace ${n} for language ${t}`,r),e.loaded(`${t}|${n}`,i,r)})})})}};ue.type="backend";var ut=o(4954);class uo extends Error{}function un(e,t){let o;if("string"!=typeof e)throw new uo("Invalid token specified: must be a string");t||(t={});let n=+(!0!==t.header),i=e.split(".")[n];if("string"!=typeof i)throw new uo(`Invalid token specified: missing part #${n+1}`);try{o=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var o;return o=t,decodeURIComponent(atob(o).replace(/(.)/g,(e,t)=>{let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}catch(e){return atob(t)}}(i)}catch(e){throw new uo(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new uo(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(uo.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function ui(e){if(!(this instanceof ui))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,o,n=this,i=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),s=0;s<a.length;s++)(-1!==a[s].src.indexOf("keycloak.js")||-1!==a[s].src.indexOf("keycloak.min.js"))&&-1!==a[s].src.indexOf("version=")&&(n.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var l=!0,c=x(console.info),d=x(console.warn);function u(e,t){for(var o=function(e){var t=null,o=window.crypto||window.msCrypto;if(o&&o.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),o.getRandomValues(t),t;t=Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=Array(e),i=0;i<e;i++)n[i]=t.charCodeAt(o[i]%t.length);return String.fromCharCode.apply(null,n)}function f(){return void 0===n.authServerUrl?void 0:"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm)}function h(e,t){var o=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)n.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};n.onAuthError&&n.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=n.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&o){var d="code="+o+"&grant_type=authorization_code",u=n.endpoints.token(),f=new XMLHttpRequest;f.open("POST",u,!0),f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),d+="&client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(d+="&code_verifier="+e.pkceCodeVerifier),f.withCredentials=!0,f.onreadystatechange=function(){if(4==f.readyState)if(200==f.status){var e=JSON.parse(f.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),y()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},f.send(d)}function h(o,i,r,s){b(o,i,r,a=(a+new Date().getTime())/2),l&&n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce?(c("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):s&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function m(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function b(e,t,o,i){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=un(t)):(delete n.refreshToken,delete n.refreshTokenParsed),o?(n.idToken=o,n.idTokenParsed=un(o)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=un(e),n.sessionId=n.tokenParsed.sid,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,i&&(n.timeSkew=Math.floor(i/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(c("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var r=(n.tokenParsed.exp-new Date().getTime()/1e3+n.timeSkew)*1e3;c("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,r)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function p(){var e="0123456789abcdef",t=u(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function F(e){var t=function(e){switch(n.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var t,o,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===n.responseMode&&-1!==r?(o=e.substring(0,r),""!==(i=g(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(o+="?"+i.paramsString),-1!==a&&(o+=e.substring(a))):"fragment"===n.responseMode&&-1!==a&&(o=e.substring(0,a),""!==(i=g(e.substring(a+1),t)).paramsString&&(o+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===n.flow||"hybrid"===n.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}else if("implicit"===n.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=o,i.oauthParams}}(e);if(t){var i=o.get(t.state);return i&&(t.valid=!0,t.redirectUri=i.redirectUri,t.storedNonce=i.nonce,t.prompt=i.prompt,t.pkceCodeVerifier=i.pkceCodeVerifier,t.loginOptions=i.loginOptions),t}}function g(e,t){for(var o=e.split("&"),n={paramsString:"",oauthParams:{}},i=0;i<o.length;i++){var r=o[i].indexOf("="),a=o[i].slice(0,r);-1!==t.indexOf(a)?n.oauthParams[a]=o[i].slice(r+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=o[i])}return n}function v(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,o){e.resolve=t,e.reject=o}),e}function _(){var e=v();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var o=n.endpoints.checkSessionIframe();return t.setAttribute("src",o),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),o=t.length-1;o>=0;--o){var i=t[o];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&n.token&&setTimeout(function(){w().then(function(e){e&&y()})},1e3*r.interval)}function w(){var e=v();if(r.iframe&&r.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");r.callbackList.push(e);var o=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,o)}else e.setSuccess();return e.promise}function E(){var e,t,o,i=v();if(r.enable||n.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var s=function(e){a.contentWindow===e.source&&("supported"===e.data||"unsupported"===e.data)&&("unsupported"===e.data&&(d("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),r.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",s),i.setSuccess())};window.addEventListener("message",s,!1)}else i.setSuccess();return e=i.promise,t=n.messageReceiveTimeout,o=null,Promise.race([e,new Promise(function(e,n){o=setTimeout(function(){n({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(o)})}function C(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),v().promise},logout:async function(e){if("GET"===(e?.logoutMethod??n.logoutMethod))return void window.location.replace(n.createLogoutUrl(e));let o=n.createLogoutUrl(e),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:n.idToken,client_id:n.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(i.redirected){window.location.href=i.url;return}if(i.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(n.createRegisterUrl(e)),v().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return v().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var o=function(e,t,o){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,o):window.open(e,t,o)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,o){return t[o]=e.cordovaOptions[o],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,o){return e.push(o+"="+t[o]),e},[]).join(",")},a=function(){return n.redirectUri||"http://localhost"};return{login:function(e){var t=v(),r=i(e),s=o(n.createLoginUrl(e),"_blank",r),l=!1,c=!1,d=function(){c=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(h(F(e.url),t),d(),l=!0)}),s.addEventListener("loaderror",function(e){l||(0==e.url.indexOf(a())?(h(F(e.url),t),d(),l=!0):(t.setError(),d()))}),s.addEventListener("exit",function(e){c||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=v(),r=o(n.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(a())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?i.setError():(n.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=v(),r=o(n.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),h(F(e.url),t))}),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e){var t=o(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return a()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=v(),o=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},logout:function(e){var t=v(),o=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(o),t.promise},register:function(e){var t=v(),o=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),h(F(e.url),t)}),window.cordova.plugins.browsertab.openUrl(o),t.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0!==e)window.cordova.plugins.browsertab.openUrl(e);else throw"Not supported by the OIDC server"},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(i){if(n.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(n.didInitialize=!0,n.authenticated=!1,o=function(){try{return new k}catch(e){}return new A}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?C(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?C("cordova"):C(),i){if(void 0!==i.useNonce&&(l=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(n.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)n.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=i.flow}if(null!=i.timeSkew&&(n.timeSkew=i.timeSkew),i.redirectUri&&(n.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?n.silentCheckSsoFallback=i.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,void 0!==i.pkceMethod){if("S256"!==i.pkceMethod&&!1!==i.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${i.pkceMethod}.`);n.pkceMethod=i.pkceMethod}else n.pkceMethod="S256";"boolean"==typeof i.enableLogging?n.enableLogging=i.enableLogging:n.enableLogging=!1,"POST"===i.logoutMethod?n.logoutMethod="POST":n.logoutMethod="GET","string"==typeof i.scope&&(n.scope=i.scope),"string"==typeof i.acrValues&&(n.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?n.messageReceiveTimeout=i.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var a=v(),s=v();s.promise.then(function(){n.onReady&&n.onReady(n.authenticated),a.setSuccess(n.authenticated)}).catch(function(e){a.setError(e)});var c=function(){var t=v();function o(e){e?n.endpoints={authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:n.endpoints={authorize:function(){return f()+"/protocol/openid-connect/auth"},token:function(){return f()+"/protocol/openid-connect/token"},logout:function(){return f()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=f()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=f()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return f()+"/protocol/openid-connect/registrations"},userinfo:function(){return f()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(a=e):a="keycloak.json",a){var i=new XMLHttpRequest;i.open("GET",a,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){if(4==i.readyState)if(200==i.status||m(i)){var e=JSON.parse(i.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,o(null),t.setSuccess()}else t.setError()},i.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var r=e.oidcProvider;if(r)if("string"==typeof r){var a,s="/"==r.charAt(r.length-1)?r+".well-known/openid-configuration":r+"/.well-known/openid-configuration",i=new XMLHttpRequest;i.open("GET",s,!0),i.setRequestHeader("Accept","application/json"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||m(i)?(o(JSON.parse(i.responseText)),t.setSuccess()):t.setError())},i.send()}else o(r),t.setSuccess();else{if(!e.url){for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++)if(l[c].src.match(/.*keycloak\.js/)){e.url=l[c].src.substr(0,l[c].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";n.authServerUrl=e.url,n.realm=e.realm,o(null),t.setSuccess()}}return t.promise}();function d(){var e=function(e){e||(o.prompt="none"),i&&i.locale&&(o.locale=i.locale),n.login(o).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var o=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(h(F(t.data),s),document.body.removeChild(e),window.removeEventListener("message",o))};window.addEventListener("message",o)},o={};switch(i.onLoad){case"check-sso":r.enable?_().then(function(){w().then(function(o){o?s.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function u(){var e=F(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return _().then(function(){h(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(b(i.token,i.refreshToken,i.idToken),r.enable?_().then(function(){w().then(function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):n.updateToken(-1).then(function(){n.onAuthSuccess&&n.onAuthSuccess(),s.setSuccess()}).catch(function(e){n.onAuthError&&n.onAuthError(),i.onLoad?d():s.setError(e)})):i.onLoad?d():s.setSuccess():s.setSuccess()}return c.then(function(){var e,t;(e=v(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(E).then(u).catch(function(e){a.setError(e)})}),c.catch(function(e){a.setError(e)}),a.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var i,r=p(),a=p(),s=t.redirectUri(e),c={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.prompt=e.prompt),i=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var d=e&&e.scope||n.scope;d?-1===d.indexOf("openid")&&(d="openid "+d):d="openid";var f=i+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(d);if(l&&(f=f+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(f+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(f+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(f+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(f+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(f+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(f+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(f+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||n.acrValues)&&(f+="&acr_values="+encodeURIComponent(e.acrValues||n.acrValues)),n.pkceMethod){var h=u(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,f+="&code_challenge="+function(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return btoa(String.fromCodePoint(...new Uint8Array(ut.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(n.pkceMethod,h)+"&code_challenge_method="+n.pkceMethod}return o.add(c),f},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??n.logoutMethod))return n.endpoints.logout();var o=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(o+="&id_token_hint="+encodeURIComponent(n.idToken)),o},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var o=f(),i=void 0;return void 0!==o&&(i=o+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var o=n.resourceAccess[t||n.clientId];return!!o&&o.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=f()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),o.setSuccess(n.profile)):o.setError())},t.send(),o.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var o=v();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),o.setSuccess(n.userInfo)):o.setError())},t.send(),o.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return c("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=v();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var o=function(){var o=!1;if(-1==e?(o=!0,c("[KEYCLOAK] Refreshing token: forced refresh")):(!n.tokenParsed||n.isTokenExpired(e))&&(o=!0,c("[KEYCLOAK] Refreshing token: token expired")),o){var r="grant_type=refresh_token&refresh_token="+n.refreshToken,a=n.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(n.clientId);var l=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){c("[KEYCLOAK] Token refreshed"),l=(l+new Date().getTime())/2;var e=JSON.parse(s.responseText);b(e.access_token,e.refresh_token,e.id_token,l),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{d("[KEYCLOAK] Failed to refresh token"),400==s.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?w().then(function(){o()}).catch(function(e){t.setError(e)}):o(),t.promise},n.clearToken=function(){n.token&&(b(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var k=function(){if(!(this instanceof k))return new k;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var o=localStorage.key(t);if(o&&0==o.indexOf("kc-callback-")){var n=localStorage.getItem(o);if(n)try{var i=JSON.parse(n).expires;(!i||i<e)&&localStorage.removeItem(o)}catch(e){localStorage.removeItem(o)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var o="kc-callback-"+t,n=localStorage.getItem(o);return n&&(localStorage.removeItem(o),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var o="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(o,JSON.stringify(t))}},A=function(){if(!(this instanceof A))return new A;this.get=function(n){if(n){var i=t("kc-callback-"+n);if(o("kc-callback-"+n,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){o("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){o(t,"",e(-100))};var e=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},t=function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},o=function(e,t,o){var n=e+"="+t+"; expires="+o.toUTCString()+"; ";document.cookie=n}};function x(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var ur=function(e,t,o,n){return new(o||(o=Promise))(function(i,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})};let ua="openremote";(ew=tx||(tx={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ew.AUTH_FAILED="AUTH_FAILED",ew.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ew.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ew.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ew.TRANSLATION_ERROR="TRANSLATION_ERROR",(eE=tD||(tD={})).ERROR="ERROR",eE.READY="READY",eE.ONLINE="ONLINE",eE.OFFLINE="OFFLINE",eE.CONNECTING="CONNECTING",eE.CONSOLE_INIT="CONSOLE_INIT",eE.CONSOLE_READY="CONSOLE_READY",eE.TRANSLATE_INIT="TRANSLATE_INIT",eE.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",eE.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED",eE.LOGIN="LOGIN";let us={cn:"zh-cn"};class ul{constructor(){this._authenticated=!1,this._ready=!1,this._name="",this._username="",this._keycloakUpdateTokenInterval=void 0,this._managerVersion="",this._authServerUrl="",this._listeners=[],this._disconnected=!1}get username(){return this._username}get error(){return this._error}get authenticated(){return this._authenticated}get ready(){return this._ready}get config(){return this._config}get roles(){let e=new Map;return this._keycloak&&this._keycloak.resourceAccess&&this._config.clientId&&this._keycloak.resourceAccess&&Object.entries(this._keycloak.resourceAccess).forEach(([t,o])=>{let n=o.roles;e.set(t,n)}),e}get managerVersion(){return this._managerVersion}get isManagerAvailable(){return this._managerVersion&&""!==this._managerVersion}get managerUrl(){var e;return null==(e=this._config)?void 0:e.managerUrl}get keycloakUrl(){var e;return null==(e=this._config)?void 0:e.keycloakUrl}get isError(){return!!this._error}get connectionStatus(){return this._events&&this._events.status}get console(){return this._console}get consoleAppConfig(){return this._consoleAppConfig}get events(){return this._events}get rest(){return d$}get language(){return nY.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(nY.changeLanguage(e),this.console.storeData("LANGUAGE",e),this.authenticated&&this.updateKeycloakUserLanguage(e).catch(e=>console.error(e)))}get displayRealm(){return this._displayRealm||this._config.realm}set displayRealm(e){this.isSuperUser()&&this._displayRealm!==e&&(this._displayRealm=e,this._emitEvent(tD.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||ua}getEventProvider(){return this.events}isManagerSameOrigin(){if(!this.ready)return!1;let e=new URL(this._config.managerUrl),t=window.location;return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}addListener(e){0>this._listeners.indexOf(e)&&this._listeners.push(e)}removeListener(e){let t=this._listeners.indexOf(e);t>=0&&this._listeners.splice(t,1)}init(e){return ur(this,void 0,void 0,function*(){let t;this._config&&console.debug("Already initialised"),this._config=((t=e?Object.assign({},e):{}).managerUrl&&""!==t.managerUrl?t.managerUrl=t.managerUrl.replace(/\/+$/,""):t.managerUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+window.location.pathname.replace(/\/[^/]+\/?$/,""),t.realm&&""!==t.realm||(t.realm="master"),t.auth||(t.auth="KEYCLOAK"),void 0===t.consoleAutoEnable&&(t.consoleAutoEnable=!0),void 0===t.applyConfigToAdmin&&(t.applyConfigToAdmin=!0),t.eventProviderType||(t.eventProviderType="WEBSOCKET"),(!t.pollingIntervalMillis||t.pollingIntervalMillis<5e3)&&(t.pollingIntervalMillis=1e4),void 0===t.loadIcons&&(t.loadIcons=!0),void 0===t.loadTranslations&&(t.loadTranslations=["or"]),void 0===t.translationsLoadPath&&(t.translationsLoadPath="locales/{{lng}}/{{ns}}.json"),void 0===t.loadDescriptors&&(t.loadDescriptors=!0),void 0===t.clientId&&(t.clientId=ua),t);let o=yield this.loadManagerInfo(),n=new s2(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tD.CONSOLE_READY)});if(this._console=n,"KEYCLOAK"===this._config.auth){if(!this._config.keycloakUrl&&this._authServerUrl){let e,t=new URL(this._config.managerUrl);this._authServerUrl.startsWith("//")?(this._authServerUrl=t.protocol+this._authServerUrl,this._config.keycloakUrl=this._authServerUrl):this._authServerUrl.startsWith("http")?this._config.keycloakUrl=this._authServerUrl:((e=new URL(t)).pathname=this._authServerUrl,e.protocol||(e.protocol=t.protocol),e.hostname||(e.hostname=t.hostname),e.port||(e.port=t.port),this._config.keycloakUrl=e.toString())}this._config.keycloakUrl||(this._config.keycloakUrl=this._config.managerUrl+"/auth"),this._config.keycloakUrl=this._config.keycloakUrl.replace(/\/+$/,""),o=yield this.doAuthInit()}return!!o&&(o&&(o=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(o=(yield this.doTranslateInit())&&o)&&(o=yield this.doDescriptorsInit(),o=yield this.getConsoleAppConfig()),this.doIconInit(),o?(o=yield this.doEventsSubscriptionInit(),this._ready=!0,this._emitEvent(tD.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",o)})}loadManagerInfo(){return ur(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let o=new XMLHttpRequest;o.addEventListener("load",()=>{e(JSON.parse(o.responseText))}),o.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),o.open("GET",this._config.managerUrl+"/api/master/info"),o.send()});return this._managerVersion=e&&e.version?e.version:"",this._authServerUrl=e&&e.authServerUrl?e.authServerUrl:"",!0}catch(e){return console.error("Failed to contact the manager",e),this._setError(tx.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return ur(this,void 0,void 0,function*(){if(nY.isInitialized)return!0;nY.on("initialized",e=>{this._emitEvent(tD.TRANSLATE_INIT)}),nY.on("languageChanged",e=>{var t;sJ().locale(null!=(t=us[e])?t:e),this._emitEvent(tD.TRANSLATE_LANGUAGE_CHANGED)});let e={lng:(yield this.getConsolePreferredLanguage())||(yield this.getUserPreferredLanguage())||this.config.defaultLanguage||"en",fallbackLng:"en",defaultNS:"app",fallbackNS:"or",ns:this.config.loadTranslations,interpolation:{format:(e,t,o)=>"uppercase"===t?e.toUpperCase():e instanceof Date?sJ()(e).format(t):e},backend:{loadPath:(e,t)=>1===t.length&&"or"===t[0]?this.config.managerUrl+"/shared/locales/{{lng}}/{{ns}}.json":this.config.translationsLoadPath?this.config.translationsLoadPath:"locales/{{lng}}/{{ns}}.json"}};this.config.configureTranslationsOptions&&this.config.configureTranslationsOptions(e);try{yield nY.use(ue).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return ur(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield d$.api.AssetModelResource.getAssetInfos(),t=yield d$.api.AssetModelResource.getMetaItemDescriptors(),o=yield d$.api.AssetModelResource.getValueDescriptors();oq._assetTypeInfos=e.data,oq._metaItemDescriptors=Object.values(t.data),oq._valueDescriptors=Object.values(o.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return ur(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(d$.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return d$.setTimeout(2e4),d$.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return ur(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new dG(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(tx.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===tA.DISCONNECTED?this.events.connect().catch(e=>{console.error("Failed to connect EventProvider."),console.error(e)}):console.warn("Tried to connect EventProvider, but it wasn't disconnected!")}_onEventProviderStatusChanged(e){switch(e){case tA.DISCONNECTED:this._onDisconnect();break;case tA.CONNECTED:break;case tA.CONNECTING:this._emitEvent(tD.CONNECTING)}}doConsoleInit(){return ur(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tD.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(oG.addIconSet("mdi",(e=uc.managerUrl,{getIconTemplate:e=>of`<span style="font-family: 'Material Design Icons';" class="mdi-${e}"></span>`,onAdd(){let t=document.createElement("style");t.id="mdiFontStyle",t.textContent='@font-face {\n font-family: "Material Design Icons";\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot");\n src: url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.eot") format("embedded-opentype"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff2") format("woff2"), url("'+e+'/shared/fonts/Material Design Icons/fonts/materialdesignicons-webfont.woff") format("woff"), url("'+e+'/shared/fonts/Material Design Icons//fonts/materialdesignicons-webfont.ttf") format("truetype");\n font-weight: normal;\n font-style: normal;\n}',document.head.appendChild(t)}})),oG.addIconSet("or",{getIconTemplate:e=>{let t=oH[e];return t?of`
|
|
2120
2120
|
<svg
|
|
2121
2121
|
xmlns="http://www.w3.org/2000/svg"
|
|
2122
2122
|
viewBox="0 0 ${24} ${24}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-scheduler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0-snapshot.20260928140716",
|
|
4
4
|
"description": "OpenRemote scheduler UI component",
|
|
5
5
|
"customElements": "build/custom-elements.json",
|
|
6
6
|
"main": "build/dist/umd/index.bundle.js",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"license": "AGPL-3.0-or-later",
|
|
26
26
|
"repository": "https://github.com/openremote/openremote",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@openremote/core": "1.
|
|
29
|
-
"@openremote/model": "1.
|
|
30
|
-
"@openremote/or-element": "1.
|
|
31
|
-
"@openremote/or-icon": "1.
|
|
32
|
-
"@openremote/or-translate": "1.
|
|
33
|
-
"@openremote/or-vaadin-components": "1.
|
|
34
|
-
"@openremote/theme": "1.
|
|
28
|
+
"@openremote/core": "1.32.0-snapshot.20260928140716",
|
|
29
|
+
"@openremote/model": "1.32.0-snapshot.20260928140716",
|
|
30
|
+
"@openremote/or-element": "1.32.0-snapshot.20260928140716",
|
|
31
|
+
"@openremote/or-icon": "1.32.0-snapshot.20260928140716",
|
|
32
|
+
"@openremote/or-translate": "1.32.0-snapshot.20260928140716",
|
|
33
|
+
"@openremote/or-vaadin-components": "1.32.0-snapshot.20260928140716",
|
|
34
|
+
"@openremote/theme": "1.32.0-snapshot.20260928140716",
|
|
35
35
|
"lit": "^3.3.1",
|
|
36
36
|
"moment": "^2.29.4",
|
|
37
37
|
"rrule": "^2.6.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@openremote/util": "1.
|
|
40
|
+
"@openremote/util": "1.32.0-snapshot.20260928140716"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|