@openremote/or-scheduler 1.20.0 → 1.20.1

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.
@@ -3538,7 +3538,7 @@
3538
3538
  >
3539
3539
  <slot name="overlay"></slot>
3540
3540
  </vaadin-multi-select-combo-box-overlay>
3541
- `}}o0(ln);let lo=class extends ln{};lo=function(e,t,n,o){var i,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}([n$("or-vaadin-multi-select-combo-box")],lo);let li=class extends sL{};function lr(e,t,n){return e?t(e):n?.(e)}li=function(e,t,n,o){var i,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}([n$("or-vaadin-time-picker")],li),i(4532);var la=i(8183),ls=i.n(la),ld=i(4867),ll=i.n(ld);i(3472);class lc{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 lh(e,t,n=!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(n){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>lh(e[n],t[n]))}return!1}var lu=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let lm=i(4461);class lf{constructor(e,t,n){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=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),i=o.get("consoleName"),r=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=lf._createConsoleRegistration(),h=window.localStorage.getItem("OpenRemoteConsole:"+e);if(h)try{let e=JSON.parse(h);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let u=c.providers;for(let e of(c.providers={},l)){let t=u&&u.hasOwnProperty(e)?u[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let m=up.getAppName();m.length>0&&0>c.apps.indexOf(m)&&c.apps.push(m),this._registration=c,i&&(c.name=i),r&&(c.version=r),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}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 lu(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(0)),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 lu(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 lu(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 n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),o})}disableProvider(e){return lu(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 lu(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 n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new lc,i=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(e=void 0!==e?e:2e3)+"ms"),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),up.rest.api.ConsoleResource.register(this._registration).then(t=>{if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()})}catch(e){console.error("Failed to register console"),t("Failed to register console")}})})}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return lu(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 n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_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 n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}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),n=t.provider,o=t.action,i=this._pendingProviderPromises[n+o];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[n+o],i[0].resolve(t));let r=this._providerMessageListeners[n+o];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:lm.name,version:lm.version,platform:lm.os.toString(),apps:[],model:((lm.manufacturer?lm.manufacturer+" ":"")+(lm.product?lm.product:"")).trim()}}_initialiseProvider(e){return lu(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 lp(e,t){return function(){return e.apply(t,arguments)}}let{toString:lb}=Object.prototype,{getPrototypeOf:lv}=Object,{iterator:l_,toStringTag:lg}=Symbol,lF=(n=Object.create(null),e=>{let t=lb.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}),ly=e=>(e=e.toLowerCase(),t=>lF(t)===e),lM=e=>t=>typeof t===e,{isArray:lw}=Array,lk=lM("undefined");function lE(e){return null!==e&&!lk(e)&&null!==e.constructor&&!lk(e.constructor)&&lL(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let lD=ly("ArrayBuffer"),lC=lM("string"),lL=lM("function"),lA=lM("number"),lT=e=>null!==e&&"object"==typeof e,lx=e=>{if("object"!==lF(e))return!1;let t=lv(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(lg in e)&&!(l_ in e)},lz=ly("Date"),lS=ly("File"),lY=ly("Blob"),lO=ly("FileList"),lI="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lB=void 0!==lI.FormData?lI.FormData:void 0,lP=ly("URLSearchParams"),[lR,lN,lj,lH]=["ReadableStream","Request","Response","Headers"].map(ly);function lU(e,t,{allOwnKeys:n=!1}={}){let o,i;if(null!=e)if("object"!=typeof e&&(e=[e]),lw(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{let i;if(lE(e))return;let r=n?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(o=0;o<a;o++)i=r[o],t.call(null,e[i],i,e)}}function l$(e,t){let n;if(lE(e))return null;t=t.toLowerCase();let o=Object.keys(e),i=o.length;for(;i-- >0;)if(t===(n=o[i]).toLowerCase())return n;return null}let lW="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lV=e=>!lk(e)&&e!==lW,lq=(o="u">typeof Uint8Array&&lv(Uint8Array),e=>o&&e instanceof o),lG=ly("HTMLFormElement"),lK=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lJ=ly("RegExp"),lX=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lU(n,(n,i)=>{let r;!1!==(r=t(n,i,e))&&(o[i]=r||n)}),Object.defineProperties(e,o)},lZ=ly("AsyncFunction"),lQ=(u="function"==typeof setImmediate,m=lL(lW.postMessage),u?setImmediate:m?(f=`axios@${Math.random()}`,p=[],lW.addEventListener("message",({source:e,data:t})=>{e===lW&&t===f&&p.length&&p.shift()()},!1),e=>{p.push(e),lW.postMessage(f,"*")}):e=>setTimeout(e)),l0="u">typeof queueMicrotask?queueMicrotask.bind(lW):"u">typeof process&&process.nextTick||lQ,l1={isArray:lw,isArrayBuffer:lD,isBuffer:lE,isFormData:e=>{let t;return e&&(lB&&e instanceof lB||lL(e.append)&&("formdata"===(t=lF(e))||"object"===t&&lL(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lD(e.buffer)},isString:lC,isNumber:lA,isBoolean:e=>!0===e||!1===e,isObject:lT,isPlainObject:lx,isEmptyObject:e=>{if(!lT(e)||lE(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lR,isRequest:lN,isResponse:lj,isHeaders:lH,isUndefined:lk,isDate:lz,isFile:lS,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lY,isRegExp:lJ,isFunction:lL,isStream:e=>lT(e)&&lL(e.pipe),isURLSearchParams:lP,isTypedArray:lq,isFileList:lO,forEach:lU,merge:function e(){let{caseless:t,skipUndefined:n}=lV(this)&&this||{},o={},i=(i,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=t&&l$(o,r)||r;lx(o[a])&&lx(i)?o[a]=e(o[a],i):lx(i)?o[a]=e({},i):lw(i)?o[a]=i.slice():n&&lk(i)||(o[a]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&lU(arguments[e],i);return o},extend:(e,t,n,{allOwnKeys:o}={})=>(lU(t,(t,o)=>{n&&lL(t)?Object.defineProperty(e,o,{value:lp(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),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,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{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],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&lv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:lF,kindOfTest:ly,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(lw(e))return e;let t=e.length;if(!lA(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[l_]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:lG,hasOwnProperty:lK,hasOwnProp:lK,reduceDescriptors:lX,freezeMethods:e=>{lX(e,(t,n)=>{if(lL(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(lL(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(lw(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:l$,global:lW,isContextDefined:lV,isSpecCompliantForm:function(e){return!!(e&&lL(e.append)&&"FormData"===e[lg]&&e[l_])},toJSONObject:e=>{let t=Array(10),n=(e,o)=>{if(lT(e)){if(t.indexOf(e)>=0)return;if(lE(e))return e;if(!("toJSON"in e)){t[o]=e;let i=lw(e)?[]:{};return lU(e,(e,t)=>{let r=n(e,o+1);lk(r)||(i[t]=r)}),t[o]=void 0,i}}return e};return n(e,0)},isAsyncFn:lZ,isThenable:e=>e&&(lT(e)||lL(e))&&lL(e.then)&&lL(e.catch),setImmediate:lQ,asap:l0,isIterable:e=>null!=e&&lL(e[l_])};class l2 extends Error{static from(e,t,n,o,i,r){let a=new l2(e.message,t||e.code,n,o,i);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l1.toJSONObject(this.config),code:this.code,status:this.status}}}l2.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",l2.ERR_BAD_OPTION="ERR_BAD_OPTION",l2.ECONNABORTED="ECONNABORTED",l2.ETIMEDOUT="ETIMEDOUT",l2.ERR_NETWORK="ERR_NETWORK",l2.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",l2.ERR_DEPRECATED="ERR_DEPRECATED",l2.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",l2.ERR_BAD_REQUEST="ERR_BAD_REQUEST",l2.ERR_CANCELED="ERR_CANCELED",l2.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",l2.ERR_INVALID_URL="ERR_INVALID_URL";let l3=l2;function l4(e){return l1.isPlainObject(e)||l1.isArray(e)}function l5(e){return l1.endsWith(e,"[]")?e.slice(0,-2):e}function l6(e,t,n){return e?e.concat(t).map(function(e,t){return e=l5(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let l8=l1.toFlatObject(l1,{},null,function(e){return/^is[A-Z]/.test(e)}),l7=function(e,t,n){if(!l1.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=l1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!l1.isUndefined(t[e])})).metaTokens,i=n.visitor||l,r=n.dots,a=n.indexes,s=(n.Blob||"u">typeof Blob&&Blob)&&l1.isSpecCompliantForm(t);if(!l1.isFunction(i))throw TypeError("visitor must be a function");function d(e){if(null===e)return"";if(l1.isDate(e))return e.toISOString();if(l1.isBoolean(e))return e.toString();if(!s&&l1.isBlob(e))throw new l3("Blob is not supported. Use a Buffer instead.");return l1.isArrayBuffer(e)||l1.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(l1.isReactNative(t)&&l1.isReactNativeBlob(e))return t.append(l6(i,n,r),d(e)),!1;if(e&&!i&&"object"==typeof e)if(l1.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else{var l;if(l1.isArray(e)&&(l=e,l1.isArray(l)&&!l.some(l4))||(l1.isFileList(e)||l1.endsWith(n,"[]"))&&(s=l1.toArray(e)))return n=l5(n),s.forEach(function(e,o){l1.isUndefined(e)||null===e||t.append(!0===a?l6([n],o,r):null===a?n:n+"[]",d(e))}),!1}return!!l4(e)||(t.append(l6(i,n,r),d(e)),!1)}let c=[],h=Object.assign(l8,{defaultVisitor:l,convertValue:d,isVisitable:l4});if(!l1.isObject(e))throw TypeError("data must be an object");return!function e(n,o){if(!l1.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),l1.forEach(n,function(n,r){!0===(!(l1.isUndefined(n)||null===n)&&i.call(t,n,l1.isString(r)?r.trim():r,o,h))&&e(n,o?o.concat(r):[r])}),c.pop()}}(e),t};function l9(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ce(e,t){this._pairs=[],e&&l7(e,this,t)}let ct=ce.prototype;function cn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function co(e,t,n){let o;if(!t)return e;let i=n&&n.encode||cn,r=l1.isFunction(n)?{serialize:n}:n,a=r&&r.serialize;if(o=a?a(t,r):l1.isURLSearchParams(t)?t.toString():new ce(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}ct.append=function(e,t){this._pairs.push([e,t])},ct.toString=function(e){let t=e?function(t){return e.call(this,t,l9)}:l9;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let ci=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){l1.forEach(this.handlers,function(t){null!==t&&e(t)})}},cr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ca="u">typeof URLSearchParams?URLSearchParams:ce,cs="u">typeof FormData?FormData:null,cd="u">typeof Blob?Blob:null,cl="u">typeof window&&"u">typeof document,cc="object"==typeof navigator&&navigator||void 0,ch=cl&&(!cc||0>["ReactNative","NativeScript","NS"].indexOf(cc.product)),cu="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cm=cl&&window.location.href||"http://localhost",cf={...tI,isBrowser:!0,classes:{URLSearchParams:ca,FormData:cs,Blob:cd},protocols:["http","https","file","blob","url","data"]},cp=function(e){if(l1.isFormData(e)&&l1.isFunction(e.entries)){let t={};return l1.forEachEntry(e,(e,n)=>{!function e(t,n,o,i){let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&l1.isArray(o)?o.length:r,s)?l1.hasOwnProp(o,r)?o[r]=[o[r],n]:o[r]=n:(o[r]&&l1.isObject(o[r])||(o[r]=[]),e(t,n,o[r],i)&&l1.isArray(o[r])&&(o[r]=function(e){let t,n,o={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)o[n=i[t]]=e[n];return o}(o[r]))),!a}(l1.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null},cb={transitional:cr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",i=o.indexOf("application/json")>-1,r=l1.isObject(e);if(r&&l1.isHTMLForm(e)&&(e=new FormData(e)),l1.isFormData(e))return i?JSON.stringify(cp(e)):e;if(l1.isArrayBuffer(e)||l1.isBuffer(e)||l1.isStream(e)||l1.isFile(e)||l1.isBlob(e)||l1.isReadableStream(e))return e;if(l1.isArrayBufferView(e))return e.buffer;if(l1.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1){var a,s;return(a=e,s=this.formSerializer,l7(a,new cf.classes.URLSearchParams,{visitor:function(e,t,n,o){return cf.isNode&&l1.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...s})).toString()}if((n=l1.isFileList(e))||o.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return l7(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(r||i){t.setContentType("application/json",!1);var d=e;if(l1.isString(d))try{return(0,JSON.parse)(d),l1.trim(d)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(d)}return e}],transformResponse:[function(e){let t=this.transitional||cb.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(l1.isResponse(e)||l1.isReadableStream(e))return e;if(e&&l1.isString(e)&&(n&&!this.responseType||o)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!n&&o){if("SyntaxError"===e.name)throw l3.from(e,l3.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cf.classes.FormData,Blob:cf.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l1.forEach(["delete","get","head","post","put","patch"],e=>{cb.headers[e]={}});let cv=l1.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"]),c_=Symbol("internals");function cg(e){return e&&String(e).trim().toLowerCase()}function cF(e){return!1===e||null==e?e:l1.isArray(e)?e.map(cF):String(e)}function cy(e,t,n,o,i){if(l1.isFunction(o))return o.call(this,t,n);if(i&&(t=n),l1.isString(t)){if(l1.isString(o))return -1!==t.indexOf(o);if(l1.isRegExp(o))return o.test(t)}}class cM{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function i(e,t,n){let i=cg(t);if(!i)throw Error("header name must be a non-empty string");let r=l1.findKey(o,i);r&&void 0!==o[r]&&!0!==n&&(void 0!==n||!1===o[r])||(o[r||t]=cF(e))}let r=(e,t)=>l1.forEach(e,(e,n)=>i(e,n,t));if(l1.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let o;if(l1.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim(),!n||s[n]&&cv[n]||("set-cookie"===n?s[n]?s[n].push(o):s[n]=[o]:s[n]=s[n]?s[n]+", "+o:o)}),s),t)}else if(l1.isObject(e)&&l1.isIterable(e)){let n={},o,i;for(let t of e){if(!l1.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(o=n[i])?l1.isArray(o)?[...o,t[1]]:[o,t[1]]:t[1]}r(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=cg(e)){let n=l1.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(l1.isFunction(t))return t.call(this,e,n);if(l1.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cg(e)){let n=l1.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||cy(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function i(e){if(e=cg(e)){let i=l1.findKey(n,e);i&&(!t||cy(n,n[i],i,t))&&(delete n[i],o=!0)}}return l1.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let i=t[n];(!e||cy(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,n={};return l1.forEach(this,(o,i)=>{let r=l1.findKey(n,i);if(r){t[r]=cF(o),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();a!==i&&delete t[i],t[a]=cF(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return l1.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&l1.isArray(n)?n.join(", "):n)}),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 n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[c_]=this[c_]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=cg(e);if(!t[o]){let i;i=l1.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{value:function(n,o,i){return this[t].call(this,e,n,o,i)},configurable:!0})}),t[o]=!0}}return l1.isArray(e)?e.forEach(o):o(e),this}}function cw(e,t){let n=this||cb,o=t||n,i=cM.from(o.headers),r=o.data;return l1.forEach(e,function(e){r=e.call(n,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function ck(e){return!!(e&&e.__CANCEL__)}cM.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l1.reduceDescriptors(cM.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),l1.freezeMethods(cM);let cE=class extends l3{constructor(e,t,n){super(null==e?"canceled":e,l3.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function cD(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new l3("Request failed with status code "+n.status,[l3.ERR_BAD_REQUEST,l3.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}let cC=function(e,t){let n,o=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=i[a];n||(n=d),o[r]=s,i[r]=d;let c=a,h=0;for(;c!==r;)h+=o[c++],c%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let u=l&&d-l;return u?Math.round(1e3*h/u):void 0}},cL=function(e,t){let n,o,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},r-s)))},()=>n&&a(n)]},cA=(e,t,n=3)=>{let o=0,i=cC(50,250);return cL(n=>{let r=n.loaded,a=n.lengthComputable?n.total:void 0,s=r-o,d=i(s);o=r,e({loaded:r,total:a,progress:a?r/a:void 0,bytes:s,rate:d||void 0,estimated:d&&a&&r<=a?(a-r)/d:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},cT=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},cx=e=>(...t)=>l1.asap(()=>e(...t)),cz=cf.hasStandardBrowserEnv?(a=new URL(cf.origin),s=cf.navigator&&/(msie|trident)/i.test(cf.navigator.userAgent),e=>(e=new URL(e,cf.origin),a.protocol===e.protocol&&a.host===e.host&&(s||a.port===e.port))):()=>!0,cS=cf.hasStandardBrowserEnv?{write(e,t,n,o,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];l1.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),l1.isString(o)&&s.push(`path=${o}`),l1.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),l1.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function cY(e,t,n){let o=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(o||!1==n)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let cO=e=>e instanceof cM?{...e}:e;function cI(e,t){t=t||{};let n={};function o(e,t,n,o){return l1.isPlainObject(e)&&l1.isPlainObject(t)?l1.merge.call({caseless:o},e,t):l1.isPlainObject(t)?l1.merge({},t):l1.isArray(t)?t.slice():t}function i(e,t,n,i){return l1.isUndefined(t)?l1.isUndefined(e)?void 0:o(void 0,e,n,i):o(e,t,n,i)}function r(e,t){if(!l1.isUndefined(t))return o(void 0,t)}function a(e,t){return l1.isUndefined(t)?l1.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,i,r){return r in t?o(n,i):r in e?o(void 0,n):void 0}let d={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,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(cO(e),cO(t),n,!0)};return l1.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let r=l1.hasOwnProp(d,o)?d[o]:i,a=r(e[o],t[o],o);l1.isUndefined(a)&&r!==s||(n[o]=a)}),n}let cB=e=>{let t=cI({},e),{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:s}=t;if(t.headers=a=cM.from(a),t.url=co(cY(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),l1.isFormData(n)){if(cf.hasStandardBrowserEnv||cf.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(l1.isFunction(n.getHeaders)){let e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}}if(cf.hasStandardBrowserEnv&&(o&&l1.isFunction(o)&&(o=o(t)),o||!1!==o&&cz(t.url))){let e=i&&r&&cS.read(r);e&&a.set(i,e)}return t},cP="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let i,r,a,s,d,l,c=cB(e),h=c.data,u=cM.from(c.headers).normalize(),{responseType:m,onUploadProgress:f,onDownloadProgress:p}=c;function b(){s&&s(),d&&d(),c.cancelToken&&c.cancelToken.unsubscribe(i),c.signal&&c.signal.removeEventListener("abort",i)}let v=new XMLHttpRequest;function _(){if(!v)return;let o=cM.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());cD(function(e){t(e),b()},function(e){n(e),b()},{data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:o,config:e,request:v}),v=null}v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=_:v.onreadystatechange=function(){!v||4!==v.readyState||(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(_)},v.onabort=function(){v&&(n(new l3("Request aborted",l3.ECONNABORTED,e,v)),v=null)},v.onerror=function(t){let o=new l3(t&&t.message?t.message:"Network Error",l3.ERR_NETWORK,e,v);o.event=t||null,n(o),v=null},v.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",o=c.transitional||cr;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new l3(t,o.clarifyTimeoutError?l3.ETIMEDOUT:l3.ECONNABORTED,e,v)),v=null},void 0===h&&u.setContentType(null),"setRequestHeader"in v&&l1.forEach(u.toJSON(),function(e,t){v.setRequestHeader(t,e)}),l1.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),m&&"json"!==m&&(v.responseType=c.responseType),p&&([a,d]=cA(p,!0),v.addEventListener("progress",a)),f&&v.upload&&([r,s]=cA(f),v.upload.addEventListener("progress",r),v.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(i=t=>{v&&(n(!t||t.type?new cE(null,e,v):t),v.abort(),v=null)},c.cancelToken&&c.cancelToken.subscribe(i),c.signal&&(c.signal.aborted?i():c.signal.addEventListener("abort",i)));let g=(o=c.url,(l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o))&&l[1]||"");g&&-1===cf.protocols.indexOf(g)?n(new l3("Unsupported protocol "+g+":",l3.ERR_BAD_REQUEST,e)):v.send(h||null)})},cR=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let i=0;for(;i<o;)n=i+t,yield e.slice(i,n),i=n},cN=async function*(e,t){for await(let n of cj(e))yield*cR(n,t)},cj=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},cH=(e,t,n,o)=>{let i,r=cN(e,t),a=0,s=e=>{!i&&(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await r.next();if(t){s(),e.close();return}let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},{isFunction:cU}=l1,c$=(({Request:e,Response:t})=>({Request:e,Response:t}))(l1.global),{ReadableStream:cW,TextEncoder:cV}=l1.global,cq=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cG=e=>{let t,{fetch:n,Request:o,Response:i}=e=l1.merge.call({skipUndefined:!0},c$,e),r=n?cU(n):"function"==typeof fetch,a=cU(o),s=cU(i);if(!r)return!1;let d=r&&cU(cW),l=r&&("function"==typeof cV?(t=new cV,e=>t.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer())),c=a&&d&&cq(()=>{let e=!1,t=new o(cf.origin,{body:new cW,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=s&&d&&cq(()=>l1.isReadableStream(new i("").body)),u={stream:h&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{u[e]||(u[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new l3(`Response type '${e}' is not supported`,l3.ERR_NOT_SUPPORT,n)})});let m=async e=>{if(null==e)return 0;if(l1.isBlob(e))return e.size;if(l1.isSpecCompliantForm(e)){let t=new o(cf.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return l1.isArrayBufferView(e)||l1.isArrayBuffer(e)?e.byteLength:(l1.isURLSearchParams(e)&&(e+=""),l1.isString(e))?(await l(e)).byteLength:void 0},f=async(e,t)=>{let n=l1.toFiniteNumber(e.getContentLength());return null==n?m(t):n};return async e=>{let t,{url:r,method:s,data:d,signal:l,cancelToken:m,timeout:p,onDownloadProgress:b,onUploadProgress:v,responseType:_,headers:g,withCredentials:F="same-origin",fetchOptions:y}=cB(e),M=n||fetch;_=_?(_+"").toLowerCase():"text";let w=((e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof l3?t:new cE(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new l3(`timeout of ${t}ms exceeded`,l3.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));let{signal:s}=o;return s.unsubscribe=()=>l1.asap(a),s}})([l,m&&m.toAbortSignal()],p),k=null,E=w&&w.unsubscribe&&(()=>{w.unsubscribe()});try{if(v&&c&&"get"!==s&&"head"!==s&&0!==(t=await f(g,d))){let e,n=new o(r,{method:"POST",body:d,duplex:"half"});if(l1.isFormData(d)&&(e=n.headers.get("content-type"))&&g.setContentType(e),n.body){let[e,o]=cT(t,cA(cx(v)));d=cH(n.body,65536,e,o)}}l1.isString(F)||(F=F?"include":"omit");let n=a&&"credentials"in o.prototype,l={...y,signal:w,method:s.toUpperCase(),headers:g.normalize().toJSON(),body:d,duplex:"half",credentials:n?F:void 0};k=a&&new o(r,l);let m=await (a?M(k,y):M(r,l)),p=h&&("stream"===_||"response"===_);if(h&&(b||p&&E)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=m[t]});let t=l1.toFiniteNumber(m.headers.get("content-length")),[n,o]=b&&cT(t,cA(cx(b),!0))||[];m=new i(cH(m.body,65536,n,()=>{o&&o(),E&&E()}),e)}_=_||"text";let D=await u[l1.findKey(u,_)||"text"](m,e);return!p&&E&&E(),await new Promise((t,n)=>{cD(t,n,{data:D,headers:cM.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:k})})}catch(t){if(E&&E(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new l3("Network Error",l3.ERR_NETWORK,e,k,t&&t.response),{cause:t.cause||t});throw l3.from(t,t&&t.code,e,k,t&&t.response)}}},cK=new Map,cJ=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:i}=t,r=[o,i,n],a=r.length,s,d,l=cK;for(;a--;)s=r[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cG(t)),l=d;return d};cJ();let cX={http:null,xhr:cP,fetch:{get:cJ}};l1.forEach(cX,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let cZ=e=>`- ${e}`,cQ=e=>l1.isFunction(e)||null===e||!1===e,c0=function(e,t){let n,o,{length:i}=e=l1.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(o=n=e[a],!cQ(n)&&void 0===(o=cX[(i=String(n)).toLowerCase()]))throw new l3(`Unknown adapter '${i}'`);if(o&&(l1.isFunction(o)||(o=o.get(t))))break;r[i||"#"+a]=o}if(!o){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 l3("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"),"ERR_NOT_SUPPORT")}return o};function c1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cE(null,e)}function c2(e){return c1(e),e.headers=cM.from(e.headers),e.data=cw.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c0(e.adapter||cb.adapter,e)(e).then(function(t){return c1(e),t.data=cw.call(e,e.transformResponse,t),t.headers=cM.from(t.headers),t},function(t){return!ck(t)&&(c1(e),t&&t.response&&(t.response.data=cw.call(e,e.transformResponse,t.response),t.response.headers=cM.from(t.response.headers))),Promise.reject(t)})}let c3={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{c3[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let c4={};c3.transitional=function(e,t,n){function o(e,t){return"[Axios v1.13.6] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,r)=>{if(!1===e)throw new l3(o(i," has been removed"+(t?" in "+t:"")),l3.ERR_DEPRECATED);return t&&!c4[i]&&(c4[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,r)}},c3.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let c5=function(e,t,n){if("object"!=typeof e)throw new l3("options must be an object",l3.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),i=o.length;for(;i-- >0;){let r=o[i],a=t[r];if(a){let t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new l3("option "+r+" must be "+n,l3.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new l3("Unknown option "+r,l3.ERR_BAD_OPTION)}};class c6{constructor(e){this.defaults=e||{},this.interceptors={request:new ci,response:new ci}}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 n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cI(this.defaults,t);void 0!==i&&c5(i,{silentJSONParsing:c3.transitional(c3.boolean),forcedJSONParsing:c3.transitional(c3.boolean),clarifyTimeoutError:c3.transitional(c3.boolean),legacyInterceptorReqResOrdering:c3.transitional(c3.boolean)},!1),null!=r&&(l1.isFunction(r)?t.paramsSerializer={serialize:r}:c5(r,{encode:c3.function,serialize:c3.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c5(t,{baseUrl:c3.spelling("baseURL"),withXsrfToken:c3.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&l1.merge(a.common,a[t.method]);a&&l1.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=cM.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||cr;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let h=0;if(!l){let e=[c2.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);h<o;)n=n.then(e[h++],e[h++]);return n}o=d.length;let u=t;for(;h<o;){let e=d[h++],t=d[h++];try{u=e(u)}catch(e){t.call(this,e);break}}try{n=c2.call(this,u)}catch(e){return Promise.reject(e)}for(h=0,o=c.length;h<o;)n=n.then(c[h++],c[h++]);return n}getUri(e){return co(cY((e=cI(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}l1.forEach(["delete","get","head","options"],function(e){c6.prototype[e]=function(t,n){return this.request(cI(n||{},{method:e,url:t,data:(n||{}).data}))}}),l1.forEach(["post","put","patch"],function(e){function t(t){return function(n,o,i){return this.request(cI(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}c6.prototype[e]=t(),c6.prototype[e+"Form"]=t(!0)});class c8{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new cE(e,o,i),t(n.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 e;return{token:new c8(function(t){e=t}),cancel:e}}}let c7={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(c7).forEach(([e,t])=>{c7[t]=e});let c9=function e(t){let n=new c6(t),o=lp(c6.prototype.request,n);return l1.extend(o,c6.prototype,n,{allOwnKeys:!0}),l1.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cI(t,n))},o}(cb);c9.Axios=c6,c9.CanceledError=cE,c9.CancelToken=c8,c9.isCancel=ck,c9.VERSION="1.13.6",c9.toFormData=l7,c9.AxiosError=l3,c9.Cancel=c9.CanceledError,c9.all=function(e){return Promise.all(e)},c9.spread=function(e){return function(t){return e.apply(null,t)}},c9.isAxiosError=function(e){return l1.isObject(e)&&!0===e.isAxiosError},c9.mergeConfig=cI,c9.AxiosHeaders=cM,c9.formToJSON=e=>cp(l1.isHTMLForm(e)?new FormData(e):e),c9.getAdapter=c0,c9.HttpStatusCode=c7,c9.default=c9;class he{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:hM`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:hM`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/status/${e}`,options:t})}}class ht{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:hM`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:hM`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:hM`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:hM`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`realm/${e}`,data:t,options:n})}}class hn{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:hM`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:hM`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:hM`flow/${e}`,options:t})}}class ho{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:hM`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:hM`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class hi{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:hM`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:hM`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:hM`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:hM`dashboard/${e}/${t}`,options:n})}}class hr{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:hM`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:hM`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:hM`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:hM`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:hM`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:hM`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:hM`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:hM`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:hM`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:hM`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:hM`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:hM`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:hM`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:hM`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/attribute/${t}/${n}`,data:o,options:i})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/child`,queryParams:t,options:n})}}class ha{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:hM`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:hM`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:hM`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:hM`syslog/event`,queryParams:e,options:t})}}class hs{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`asset/predicted/${e}/${t}`,data:n,options:o})}}class hd{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:hM`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:hM`info`,options:e})}}class hl{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:hM`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:hM`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:hM`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:hM`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:hM`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:hM`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:hM`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:hM`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:hM`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:hM`user/${e}/userRoles/${t}/${n}`,data:o,options:i})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:hM`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/${t}`,options:n})}}class hc{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:hM`console/register`,data:e,options:t})}}class hh{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:hM`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:hM`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:hM`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:hM`configuration/manager/image/${e}`,options:t})}}class hu{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:hM`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:hM`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:hM`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:hM`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:hM`notification/${e}/delivered`,queryParams:t,options:n})}}class hm{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:hM`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:hM`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:hM`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/valueDescriptors`,queryParams:e,options:t})}}class hf{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:hM`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:hM`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:hM`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:hM`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:hM`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:hM`map/upload`,queryParams:e,options:t})}}class hp{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:hM`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:hM`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`asset/datapoint/${e}/${t}`,data:n,options:o})}}class hb{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:hM`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,i){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}/${t}/${n}/${o}`,options:i})}}class hv{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:hM`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:hM`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:hM`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:hM`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:hM`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:hM`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:hM`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:hM`alarm/${e}/assets`,queryParams:t,options:n})}}class h_{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:hM`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:hM`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:hM`apps/info`,options:e})}}class hg{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:hM`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:hM`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:hM`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:hM`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:hM`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:hM`service/${e}/${t}`,options:n})}}class hF{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:hM`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:hM`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:hM`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:hM`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:hM`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:hM`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:hM`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/${e}`,data:t,options:n})}}class hy{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:hM`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:hM`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:hM`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:hM`provisioning/${e}`,data:t,options:n})}}function hM(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class hw{constructor(e,t=c9.create()){this._gatewayClientResource=new hE(e,t),this._realmResource=new hD(e,t),this._flowResource=new hC(e,t),this._agentResource=new hL(e,t),this._dashboardResource=new hA(e,t),this._assetResource=new hT(e,t),this._syslogResource=new hx(e,t),this._assetPredictedDatapointResource=new hz(e,t),this._statusResource=new hS(e,t),this._userResource=new hY(e,t),this._consoleResource=new hO(e,t),this._configurationResource=new hI(e,t),this._notificationResource=new hB(e,t),this._assetModelResource=new hP(e,t),this._mapResource=new hR(e,t),this._assetDatapointResource=new hN(e,t),this._gatewayServiceResource=new hj(e,t),this._alarmResource=new hH(e,t),this._appResource=new hU(e,t),this._externalServiceResource=new h$(e,t),this._rulesResource=new hW(e,t),this._provisioningResource=new hV(e,t),this._assetResource=new hT(e,t)}get GatewayClientResource(){return this._gatewayClientResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AgentResource(){return this._agentResource}get DashboardResource(){return this._dashboardResource}get AssetResource(){return this._assetResource}get SyslogResource(){return this._syslogResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get ConsoleResource(){return this._consoleResource}get ConfigurationResource(){return this._configurationResource}get NotificationResource(){return this._notificationResource}get AssetModelResource(){return this._assetModelResource}get MapResource(){return this._mapResource}get AssetDatapointResource(){return this._assetDatapointResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AlarmResource(){return this._alarmResource}get AppResource(){return this._appResource}get ExternalServiceResource(){return this._externalServiceResource}get RulesResource(){return this._rulesResource}get ProvisioningResource(){return this._provisioningResource}}class hk{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 n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class hE extends he{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hD extends ht{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hC extends hn{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hL extends ho{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hA extends hi{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hT extends hr{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hx extends ha{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hz extends hs{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hS extends hd{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hY extends hl{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hO extends hc{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hI extends hh{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hB extends hu{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hP extends hm{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hR extends hf{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hN extends hp{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hj extends hb{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hH extends hv{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hU extends h_{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class h$ extends hg{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hW extends hF{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hV extends hy{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}c9.isAxiosError;let hq=new class{get api(){return this._client}constructor(){this._axiosInstance=c9.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>ls().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 hw(e,this._axiosInstance)}};var hG=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ew=tC||(tC={})).DISCONNECTED="DISCONNECTED",ew.CONNECTED="CONNECTED",ew.CONNECTING="CONNECTING";let hK="SUBSCRIBED:",hJ="UNAUTHORIZED:",hX="TRIGGERED:",hZ="EVENT:";class hQ{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=h0.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tC.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 n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tC.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(tC.CONNECTING),this._connectingDeferred=new lc,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=h0.MIN_RECONNECT_DELAY,this._onStatusChanged(tC.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}})),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!==tC.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new lc};return null!=this._pendingSubscription||this._status!==tC.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return hG(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)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===tC.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tC.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return hG(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+hQ._subscriptionCounter++;if(!this._assetEventPromise){let e;up.authenticated||(e={filterType:"asset",realm:up.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;o?o.find(e=>t===e)&&n(e):e.asset.realm===up.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{n({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,n){return hG(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],i=o?e.map(e=>e.id):e,r=o?e:void 0,a="AttributeEvent"+hQ._subscriptionCounter++;if(!this._attributeEventPromise){let e;up.authenticated||(e={filterType:"asset",realm:up.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;o?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):i?i.find(e=>r.id===e)&&n(t):t.realm===up.displayRealm&&n(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,n])=>{(!r||r.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.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===tC.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.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 n=this._subscriptionMap.get(e);n&&n.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===tC.CONNECTED&&this._onStatusChanged(tC.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tC.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<h0.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(h0.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}hQ.MIN_RECONNECT_DELAY=0,hQ.MAX_RECONNECT_DELAY=3e4,hQ._subscriptionCounter=0;class h0 extends hQ{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="+up.config.realm;return up.authenticated&&(e+="&Authorization="+up.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new lc,this._webSocket.onopen=()=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(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(hK)){let e=JSON.parse(t.substring(hK.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(hJ)){let e=JSON.parse(t.substring(hJ.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(hX)){let e=JSON.parse(t.substring(hX.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(hZ)){let e=JSON.parse(t.substring(hZ.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 lc,e.subscriptionId||(e.subscriptionId=h0._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=hZ+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 lc;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(hZ+JSON.stringify(e)),t.promise}}function h1(e){return(h1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}h0._subscriptionCounter=1;var h2=[],h3=h2.forEach,h4=h2.slice;function h5(e){return h3.call(h4.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function h6(){return"function"==typeof XMLHttpRequest||("u"<typeof XMLHttpRequest?"undefined":h1(XMLHttpRequest))==="object"}var h8=i(4550),h7=i.t(h8,2);function h9(e){return(h9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof fetch&&(tL="u">typeof global&&global.fetch?global.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),h6()&&("u">typeof global&&global.XMLHttpRequest?tA=global.XMLHttpRequest:"u">typeof window&&window.XMLHttpRequest&&(tA=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("u">typeof global&&global.ActiveXObject?tT=global.ActiveXObject:"u">typeof window&&window.ActiveXObject&&(tT=window.ActiveXObject)),tL||!h7||tA||tT||(tL=h8||h7),"function"!=typeof tL&&(tL=void 0);var ue=function(e,t){if(t&&"object"===h9(t)){var n="";for(var o in t)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},ut=function(e,t,n){tL(e,t).then(function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(function(t){n(null,{status:e.status,data:t})}).catch(n)}).catch(n)},un=!1,uo=function(e,t,n,o){e.queryStringParams&&(t=ue(t,e.queryStringParams));var i=h5({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(i["Content-Type"]="application/json");var r="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=h5({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:i},un?{}:r);try{ut(t,a,o)}catch(e){if(!r||0===Object.keys(r).length||!e.message||0>e.message.indexOf("not implemented"))return o(e);try{Object.keys(r).forEach(function(e){delete a[e]}),ut(t,a,o),un=!0}catch(e){o(e)}}},ui=function(e,t,n,o){n&&"object"===h9(n)&&(n=ue("",n).slice(1)),e.queryStringParams&&(t=ue(t,e.queryStringParams));try{(i=tA?new tA:new tT("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var i,r=e.customHeaders;if(r="function"==typeof r?r():r)for(var a in r)i.setRequestHeader(a,r[a]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}};let ur=function(e,t,n,o){return("function"==typeof n&&(o=n,n=void 0),o=o||function(){},tL)?uo(e,t,n,o):h6()||"function"==typeof ActiveXObject?ui(e,t,n,o):void o(Error("No fetch and no xhr implementation found!"))};var ua=function(){var e;function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.services=e,this.options=n,this.allOptions=o,this.type="backend",this.init(e,n,o)}return e=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=h5(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){var o,i;return o={},i=n||"",t in o?Object.defineProperty(o,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[t]=i,o},request:ur,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return t.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,o,i){var r,a,s=this,d=this.options.loadPath;"function"==typeof this.options.loadPath&&(d=this.options.loadPath(e,n)),(d=(a=r=d)&&"function"==typeof a.then?r:Promise.resolve(r)).then(function(r){if(!r)return i(null,{});var a=s.services.interpolator.interpolate(r,{lng:e.join("+"),ns:n.join("+")});s.loadUrl(a,i,t,o)})}},{key:"loadUrl",value:function(e,t,n,o){var i=this;this.options.request(this.options,e,void 0,function(r,a){var s,d;if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&r&&r.message&&r.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+r.message,!0);if(r)return t(r,!1);try{s="string"==typeof a.data?i.options.parse(a.data,n,o):a.data}catch(t){d="failed parsing "+e+" to json"}if(d)return t(d,!1);t(null,s)})}},{key:"create",value:function(e,t,n,o,i){var r=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,o),s=0,d=[],l=[];e.forEach(function(n){var o=r.options.addPath;"function"==typeof r.options.addPath&&(o=r.options.addPath(n,t));var c=r.services.interpolator.interpolate(o,{lng:n,ns:t});r.options.request(r.options,c,a,function(t,n){s+=1,d.push(t),l.push(n),s===e.length&&i&&i(d,l)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,o=t.languageUtils,i=t.logger,r=n.language;if(!r||"cimode"!==r.toLowerCase()){var a=[],s=function(e){o.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};s(r),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return s(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(o,r){o&&i.warn("loading namespace ".concat(e," for language ").concat(t," failed"),o),!o&&r&&i.log("loaded namespace ".concat(e," for language ").concat(t),r),n.loaded("".concat(t,"|").concat(e),o,r)})})})}}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();ua.type="backend";var us=i(4954);class ud extends Error{}function ul(e,t){let n;if("string"!=typeof e)throw new ud("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),i=e.split(".")[o];if("string"!=typeof i)throw new ud(`Invalid token specified: missing part #${o+1}`);try{n=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 n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(i)}catch(e){throw new ud(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new ud(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(ud.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function uc(e){if(!(this instanceof uc))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=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=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=C(console.info),c=C(console.warn);function h(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),i=0;i<e;i++)o[i]=t.charCodeAt(n[i]%t.length);return String.fromCharCode.apply(null,o)}function u(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function m(e,t){var n=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&m(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",h=o.endpoints.token(),u=new XMLHttpRequest;u.open("POST",h,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),u.withCredentials=!0,u.onreadystatechange=function(){if(4==u.readyState)if(200==u.status){var e=JSON.parse(u.responseText);m(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),y()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},u.send(c)}function m(n,i,r,s){p(n,i,r,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function p(e,t,n,i){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=ul(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=ul(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=ul(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,i&&(o.timeSkew=Math.floor(i/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var r=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,r)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function b(){var e="0123456789abcdef",t=h(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 v(e){var t=function(e){switch(o.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,n,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==r?(n=e.substring(0,r),""!==(i=_(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+i.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(i=_(e.substring(a+1),t)).paramsString&&(n+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}else if("implicit"===o.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}}(e);if(t){var i=n.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 _(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},i=0;i<n.length;i++){var r=n[i].indexOf("="),a=n[i].slice(0,r);-1!==t.indexOf(a)?o.oauthParams[a]=n[i].slice(r+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[i])}return o}function g(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function F(){var e=g();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=o.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 n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),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&&o.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var i=t[n];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&o.token&&setTimeout(function(){M().then(function(e){e&&y()})},1e3*r.interval)}function M(){var e=g();if(r.iframe&&r.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");r.callbackList.push(e);var n=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function w(){var e,t,n,i=g();if(r.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.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&&(c("[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,o.silentCheckSsoFallback&&(o.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=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function k(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),g().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.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(o.createRegisterUrl(e)),g().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return g().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=g(),r=i(e),s=n(o.createLoginUrl(e),"_blank",r),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(m(v(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(m(v(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=g(),r=n(o.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():(o.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=g(),r=n(o.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),m(v(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(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=g(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(v(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=g(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=g(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(v(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.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:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(i){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new E}catch(e){}return new D}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?k(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?k("cordova"):k(),i){if(void 0!==i.useNonce&&(d=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(o.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)o.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=i.flow}if(null!=i.timeSkew&&(o.timeSkew=i.timeSkew),i.redirectUri&&(o.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?o.silentCheckSsoFallback=i.silentCheckSsoFallback:o.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}.`);o.pkceMethod=i.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof i.enableLogging?o.enableLogging=i.enableLogging:o.enableLogging=!1,"POST"===i.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof i.scope&&(o.scope=i.scope),"string"==typeof i.acrValues&&(o.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?o.messageReceiveTimeout=i.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=g(),s=g();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(t){var n=g();function i(e){e?o.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}}:o.endpoints={authorize:function(){return u()+"/protocol/openid-connect/auth"},token:function(){return u()+"/protocol/openid-connect/token"},logout:function(){return u()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=u()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=u()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return u()+"/protocol/openid-connect/registrations"},userinfo:function(){return u()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||f(r)){var e=JSON.parse(r.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),n.setSuccess()}else n.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var s,d="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",d,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||f(r)?(i(JSON.parse(r.responseText)),n.setSuccess()):n.setError())},r.send()}else i(a),n.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";o.authServerUrl=e.url,o.realm=e.realm,i(null),n.setSuccess()}}return n.promise}();function c(){var e=function(e){e||(n.prompt="none"),i&&i.locale&&(n.locale=i.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.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 n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(v(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(i.onLoad){case"check-sso":r.enable?F().then(function(){M().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function h(){var e=v(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return F().then(function(){m(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(p(i.token,i.refreshToken,i.idToken),r.enable?F().then(function(){M().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),i.onLoad?c():s.setError(e)})):i.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=g(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(w).then(h).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,r=b(),a=b(),s=t.redirectUri(e),l={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var u=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(u=u+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(u+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(u+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(u+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(u+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(u+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(u+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(u+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(u+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var m=h(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=m,u+="&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(us.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,m)+"&code_challenge_method="+o.pkceMethod}return n.add(l),u},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=u(),i=void 0;return void 0!==n&&(i=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=u()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=g();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.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(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);p(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?M().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(p(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var E=function(){if(!(this instanceof E))return new E;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var i=JSON.parse(o).expires;(!i||i<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},D=function(){if(!(this instanceof D))return new D;this.get=function(o){if(o){var i=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(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+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function C(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var uh=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let uu="openremote";(ek=tx||(tx={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ek.AUTH_FAILED="AUTH_FAILED",ek.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ek.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ek.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ek.TRANSLATION_ERROR="TRANSLATION_ERROR",(eE=tz||(tz={})).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";class um{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,n])=>{let o=n.roles;e.set(t,o)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),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 hq}get language(){return oJ.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oJ.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(tz.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||uu}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 uh(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=uu),t);let n=yield this.loadManagerInfo(),o=new lf(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tz.CONSOLE_READY)});if(this._console=o,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("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);try{e=new URL(this._authServerUrl)}catch(n){(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(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(tz.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return uh(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.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 uh(this,void 0,void 0,function*(){if(oJ.isInitialized)return!0;oJ.on("initialized",e=>{this._emitEvent(tz.TRANSLATE_INIT)}),oJ.on("languageChanged",e=>{ll().locale(e),this._emitEvent(tz.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,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?ll()(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 oJ.use(ua).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return uh(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield hq.api.AssetModelResource.getAssetInfos(),t=yield hq.api.AssetModelResource.getMetaItemDescriptors(),n=yield hq.api.AssetModelResource.getValueDescriptors();nG._assetTypeInfos=e.data,nG._metaItemDescriptors=Object.values(t.data),nG._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return uh(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(hq.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return hq.setTimeout(2e4),hq.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return uh(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new h0(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)===tC.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 tC.DISCONNECTED:this._onDisconnect();break;case tC.CONNECTED:break;case tC.CONNECTING:this._emitEvent(tz.CONNECTING)}}doConsoleInit(){return uh(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tz.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nZ.addIconSet("mdi",(e=uf.managerUrl,{getIconTemplate:e=>nv`<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)}})),nZ.addIconSet("or",{getIconTemplate:e=>{let t=nK[e];return t?nv`
3541
+ `}}o0(ln);let lo=class extends ln{};lo=function(e,t,n,o){var i,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}([n$("or-vaadin-multi-select-combo-box")],lo);let li=class extends sL{};function lr(e,t,n){return e?t(e):n?.(e)}li=function(e,t,n,o){var i,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}([n$("or-vaadin-time-picker")],li),i(4532);var la=i(8183),ls=i.n(la),ld=i(4867),ll=i.n(ld);i(3472);class lc{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 lh(e,t,n=!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(n){let n=Object.keys(e);return Object.keys(t).every(e=>-1!==n.indexOf(e))&&n.every(n=>lh(e[n],t[n]))}return!1}var lu=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let lm=i(4461);class lf{constructor(e,t,n){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=n,window.OpenRemoteConsole=this;let o=new URLSearchParams(window.location.search),i=o.get("consoleName"),r=o.get("consoleVersion"),a=o.get("consolePlatform"),s=o.get("consoleProviders"),d=o.get("consoleAutoEnable"),l=s&&s.length>0?s.split(" "):["push"];this._pendingProviderEnables=l;let c=lf._createConsoleRegistration(),h=window.localStorage.getItem("OpenRemoteConsole:"+e);if(h)try{let e=JSON.parse(h);e.id&&(c.id=e.id),e.name&&(c.name=e.name),e.providers&&(c.providers=e.providers),e.apps&&(c.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let u=c.providers;for(let e of(c.providers={},l)){let t=u&&u.hasOwnProperty(e)?u[e]:{enabled:!1,disabled:!1};c.providers[e]=t}let m=up.getAppName();m.length>0&&0>c.apps.indexOf(m)&&c.apps.push(m),this._registration=c,i&&(c.name=i),r&&(c.version=r),a&&(c.platform=a),d&&(this._autoEnable="TRUE"===d||"true"===d)}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 lu(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(0)),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 lu(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 lu(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 n={provider:e,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:t},o=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=o.hasPermission,this._registration.providers[e].success=o.success,this._registration.providers[e].enabled=o.success,this._registration.providers[e].data=o.data;let i=this._pendingProviderEnables.indexOf(e);return i>=0&&(this._pendingProviderEnables.splice(i,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),o})}disableProvider(e){return lu(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 lu(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 n=e.provider+e.action;if(this._pendingProviderPromises[n])throw Error("Message already pending for provider '"+e.provider+"' with action '"+e.action+"'");let o=new lc,i=()=>{delete this._pendingProviderPromises[n],o.reject("No response from provider")};return this._pendingProviderPromises[n]=[o,window.setTimeout(i,5e3)],this._doSendProviderMessage(e),o.promise})}sendRegistration(e){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(e=void 0!==e?e:2e3)+"ms"),new Promise((e,t)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{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={}),up.rest.api.ConsoleResource.register(this._registration).then(t=>{if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),e()})}catch(e){console.error("Failed to register console"),t("Failed to register console")}})})}storeData(e,t){this.sendProviderMessage({provider:"storage",action:"STORE",key:e,value:t},!1)}retrieveData(e){return lu(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 n={type:e,data:t};this.isMobile?this._postNativeShellMessage(n):console.warn("Failed to send generic message to console.",n)}_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 n=window.localStorage.getItem(t);if(null!==n)try{n=JSON.parse(n)}catch(e){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:t,value:n}))}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),n=t.provider,o=t.action,i=this._pendingProviderPromises[n+o];i&&(window.clearTimeout(i[1]),delete this._pendingProviderPromises[n+o],i[0].resolve(t));let r=this._providerMessageListeners[n+o];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:lm.name,version:lm.version,platform:lm.os.toString(),apps:[],model:((lm.manufacturer?lm.manufacturer+" ":"")+(lm.product?lm.product:"")).trim()}}_initialiseProvider(e){return lu(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 lp(e,t){return function(){return e.apply(t,arguments)}}let{toString:lb}=Object.prototype,{getPrototypeOf:lv}=Object,{iterator:l_,toStringTag:lg}=Symbol,lF=(n=Object.create(null),e=>{let t=lb.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}),ly=e=>(e=e.toLowerCase(),t=>lF(t)===e),lM=e=>t=>typeof t===e,{isArray:lw}=Array,lk=lM("undefined");function lE(e){return null!==e&&!lk(e)&&null!==e.constructor&&!lk(e.constructor)&&lL(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let lD=ly("ArrayBuffer"),lC=lM("string"),lL=lM("function"),lA=lM("number"),lT=e=>null!==e&&"object"==typeof e,lx=e=>{if("object"!==lF(e))return!1;let t=lv(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(lg in e)&&!(l_ in e)},lz=ly("Date"),lS=ly("File"),lY=ly("Blob"),lO=ly("FileList"),lI="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},lB=void 0!==lI.FormData?lI.FormData:void 0,lP=ly("URLSearchParams"),[lR,lN,lj,lH]=["ReadableStream","Request","Response","Headers"].map(ly);function lU(e,t,{allOwnKeys:n=!1}={}){let o,i;if(null!=e)if("object"!=typeof e&&(e=[e]),lw(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{let i;if(lE(e))return;let r=n?Object.getOwnPropertyNames(e):Object.keys(e),a=r.length;for(o=0;o<a;o++)i=r[o],t.call(null,e[i],i,e)}}function l$(e,t){let n;if(lE(e))return null;t=t.toLowerCase();let o=Object.keys(e),i=o.length;for(;i-- >0;)if(t===(n=o[i]).toLowerCase())return n;return null}let lW="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,lV=e=>!lk(e)&&e!==lW,lq=(o="u">typeof Uint8Array&&lv(Uint8Array),e=>o&&e instanceof o),lG=ly("HTMLFormElement"),lK=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lJ=ly("RegExp"),lX=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),o={};lU(n,(n,i)=>{let r;!1!==(r=t(n,i,e))&&(o[i]=r||n)}),Object.defineProperties(e,o)},lZ=ly("AsyncFunction"),lQ=(u="function"==typeof setImmediate,m=lL(lW.postMessage),u?setImmediate:m?(f=`axios@${Math.random()}`,p=[],lW.addEventListener("message",({source:e,data:t})=>{e===lW&&t===f&&p.length&&p.shift()()},!1),e=>{p.push(e),lW.postMessage(f,"*")}):e=>setTimeout(e)),l0="u">typeof queueMicrotask?queueMicrotask.bind(lW):"u">typeof process&&process.nextTick||lQ,l1={isArray:lw,isArrayBuffer:lD,isBuffer:lE,isFormData:e=>{let t;return e&&(lB&&e instanceof lB||lL(e.append)&&("formdata"===(t=lF(e))||"object"===t&&lL(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&lD(e.buffer)},isString:lC,isNumber:lA,isBoolean:e=>!0===e||!1===e,isObject:lT,isPlainObject:lx,isEmptyObject:e=>{if(!lT(e)||lE(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lR,isRequest:lN,isResponse:lj,isHeaders:lH,isUndefined:lk,isDate:lz,isFile:lS,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lY,isRegExp:lJ,isFunction:lL,isStream:e=>lT(e)&&lL(e.pipe),isURLSearchParams:lP,isTypedArray:lq,isFileList:lO,forEach:lU,merge:function e(){let{caseless:t,skipUndefined:n}=lV(this)&&this||{},o={},i=(i,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=t&&l$(o,r)||r;lx(o[a])&&lx(i)?o[a]=e(o[a],i):lx(i)?o[a]=e({},i):lw(i)?o[a]=i.slice():n&&lk(i)||(o[a]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&lU(arguments[e],i);return o},extend:(e,t,n,{allOwnKeys:o}={})=>(lU(t,(t,o)=>{n&&lL(t)?Object.defineProperty(e,o,{value:lp(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),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,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{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],(!o||o(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==n&&lv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:lF,kindOfTest:ly,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let o=e.indexOf(t,n);return -1!==o&&o===n},toArray:e=>{if(!e)return null;if(lw(e))return e;let t=e.length;if(!lA(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,o=(e&&e[l_]).call(e);for(;(n=o.next())&&!n.done;){let o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let n,o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:lG,hasOwnProperty:lK,hasOwnProp:lK,reduceDescriptors:lX,freezeMethods:e=>{lX(e,(t,n)=>{if(lL(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(lL(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(lw(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:l$,global:lW,isContextDefined:lV,isSpecCompliantForm:function(e){return!!(e&&lL(e.append)&&"FormData"===e[lg]&&e[l_])},toJSONObject:e=>{let t=Array(10),n=(e,o)=>{if(lT(e)){if(t.indexOf(e)>=0)return;if(lE(e))return e;if(!("toJSON"in e)){t[o]=e;let i=lw(e)?[]:{};return lU(e,(e,t)=>{let r=n(e,o+1);lk(r)||(i[t]=r)}),t[o]=void 0,i}}return e};return n(e,0)},isAsyncFn:lZ,isThenable:e=>e&&(lT(e)||lL(e))&&lL(e.then)&&lL(e.catch),setImmediate:lQ,asap:l0,isIterable:e=>null!=e&&lL(e[l_])};class l2 extends Error{static from(e,t,n,o,i,r){let a=new l2(e.message,t||e.code,n,o,i);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),r&&Object.assign(a,r),a}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l1.toJSONObject(this.config),code:this.code,status:this.status}}}l2.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",l2.ERR_BAD_OPTION="ERR_BAD_OPTION",l2.ECONNABORTED="ECONNABORTED",l2.ETIMEDOUT="ETIMEDOUT",l2.ERR_NETWORK="ERR_NETWORK",l2.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",l2.ERR_DEPRECATED="ERR_DEPRECATED",l2.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",l2.ERR_BAD_REQUEST="ERR_BAD_REQUEST",l2.ERR_CANCELED="ERR_CANCELED",l2.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",l2.ERR_INVALID_URL="ERR_INVALID_URL";let l3=l2;function l4(e){return l1.isPlainObject(e)||l1.isArray(e)}function l5(e){return l1.endsWith(e,"[]")?e.slice(0,-2):e}function l6(e,t,n){return e?e.concat(t).map(function(e,t){return e=l5(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let l8=l1.toFlatObject(l1,{},null,function(e){return/^is[A-Z]/.test(e)}),l7=function(e,t,n){if(!l1.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let o=(n=l1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!l1.isUndefined(t[e])})).metaTokens,i=n.visitor||l,r=n.dots,a=n.indexes,s=(n.Blob||"u">typeof Blob&&Blob)&&l1.isSpecCompliantForm(t);if(!l1.isFunction(i))throw TypeError("visitor must be a function");function d(e){if(null===e)return"";if(l1.isDate(e))return e.toISOString();if(l1.isBoolean(e))return e.toString();if(!s&&l1.isBlob(e))throw new l3("Blob is not supported. Use a Buffer instead.");return l1.isArrayBuffer(e)||l1.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(l1.isReactNative(t)&&l1.isReactNativeBlob(e))return t.append(l6(i,n,r),d(e)),!1;if(e&&!i&&"object"==typeof e)if(l1.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=JSON.stringify(e);else{var l;if(l1.isArray(e)&&(l=e,l1.isArray(l)&&!l.some(l4))||(l1.isFileList(e)||l1.endsWith(n,"[]"))&&(s=l1.toArray(e)))return n=l5(n),s.forEach(function(e,o){l1.isUndefined(e)||null===e||t.append(!0===a?l6([n],o,r):null===a?n:n+"[]",d(e))}),!1}return!!l4(e)||(t.append(l6(i,n,r),d(e)),!1)}let c=[],h=Object.assign(l8,{defaultVisitor:l,convertValue:d,isVisitable:l4});if(!l1.isObject(e))throw TypeError("data must be an object");return!function e(n,o){if(!l1.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+o.join("."));c.push(n),l1.forEach(n,function(n,r){!0===(!(l1.isUndefined(n)||null===n)&&i.call(t,n,l1.isString(r)?r.trim():r,o,h))&&e(n,o?o.concat(r):[r])}),c.pop()}}(e),t};function l9(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ce(e,t){this._pairs=[],e&&l7(e,this,t)}let ct=ce.prototype;function cn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function co(e,t,n){let o;if(!t)return e;let i=n&&n.encode||cn,r=l1.isFunction(n)?{serialize:n}:n,a=r&&r.serialize;if(o=a?a(t,r):l1.isURLSearchParams(t)?t.toString():new ce(t,r).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}ct.append=function(e,t){this._pairs.push([e,t])},ct.toString=function(e){let t=e?function(t){return e.call(this,t,l9)}:l9;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let ci=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){l1.forEach(this.handlers,function(t){null!==t&&e(t)})}},cr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ca="u">typeof URLSearchParams?URLSearchParams:ce,cs="u">typeof FormData?FormData:null,cd="u">typeof Blob?Blob:null,cl="u">typeof window&&"u">typeof document,cc="object"==typeof navigator&&navigator||void 0,ch=cl&&(!cc||0>["ReactNative","NativeScript","NS"].indexOf(cc.product)),cu="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,cm=cl&&window.location.href||"http://localhost",cf={...tI,isBrowser:!0,classes:{URLSearchParams:ca,FormData:cs,Blob:cd},protocols:["http","https","file","blob","url","data"]},cp=function(e){if(l1.isFormData(e)&&l1.isFunction(e.entries)){let t={};return l1.forEachEntry(e,(e,n)=>{!function e(t,n,o,i){let r=t[i++];if("__proto__"===r)return!0;let a=Number.isFinite(+r),s=i>=t.length;return(r=!r&&l1.isArray(o)?o.length:r,s)?l1.hasOwnProp(o,r)?o[r]=[o[r],n]:o[r]=n:(o[r]&&l1.isObject(o[r])||(o[r]=[]),e(t,n,o[r],i)&&l1.isArray(o[r])&&(o[r]=function(e){let t,n,o={},i=Object.keys(e),r=i.length;for(t=0;t<r;t++)o[n=i[t]]=e[n];return o}(o[r]))),!a}(l1.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null},cb={transitional:cr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,o=t.getContentType()||"",i=o.indexOf("application/json")>-1,r=l1.isObject(e);if(r&&l1.isHTMLForm(e)&&(e=new FormData(e)),l1.isFormData(e))return i?JSON.stringify(cp(e)):e;if(l1.isArrayBuffer(e)||l1.isBuffer(e)||l1.isStream(e)||l1.isFile(e)||l1.isBlob(e)||l1.isReadableStream(e))return e;if(l1.isArrayBufferView(e))return e.buffer;if(l1.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1){var a,s;return(a=e,s=this.formSerializer,l7(a,new cf.classes.URLSearchParams,{visitor:function(e,t,n,o){return cf.isNode&&l1.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...s})).toString()}if((n=l1.isFileList(e))||o.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return l7(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(r||i){t.setContentType("application/json",!1);var d=e;if(l1.isString(d))try{return(0,JSON.parse)(d),l1.trim(d)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(d)}return e}],transformResponse:[function(e){let t=this.transitional||cb.transitional,n=t&&t.forcedJSONParsing,o="json"===this.responseType;if(l1.isResponse(e)||l1.isReadableStream(e))return e;if(e&&l1.isString(e)&&(n&&!this.responseType||o)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!n&&o){if("SyntaxError"===e.name)throw l3.from(e,l3.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cf.classes.FormData,Blob:cf.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l1.forEach(["delete","get","head","post","put","patch"],e=>{cb.headers[e]={}});let cv=l1.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"]),c_=Symbol("internals");function cg(e){return e&&String(e).trim().toLowerCase()}function cF(e){return!1===e||null==e?e:l1.isArray(e)?e.map(cF):String(e)}function cy(e,t,n,o,i){if(l1.isFunction(o))return o.call(this,t,n);if(i&&(t=n),l1.isString(t)){if(l1.isString(o))return -1!==t.indexOf(o);if(l1.isRegExp(o))return o.test(t)}}class cM{constructor(e){e&&this.set(e)}set(e,t,n){let o=this;function i(e,t,n){let i=cg(t);if(!i)throw Error("header name must be a non-empty string");let r=l1.findKey(o,i);r&&void 0!==o[r]&&!0!==n&&(void 0!==n||!1===o[r])||(o[r||t]=cF(e))}let r=(e,t)=>l1.forEach(e,(e,n)=>i(e,n,t));if(l1.isPlainObject(e)||e instanceof this.constructor)r(e,t);else{let o;if(l1.isString(e)&&(e=e.trim())&&(o=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()))){var a;let n,o,i,s;r((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim(),!n||s[n]&&cv[n]||("set-cookie"===n?s[n]?s[n].push(o):s[n]=[o]:s[n]=s[n]?s[n]+", "+o:o)}),s),t)}else if(l1.isObject(e)&&l1.isIterable(e)){let n={},o,i;for(let t of e){if(!l1.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(o=n[i])?l1.isArray(o)?[...o,t[1]]:[o,t[1]]:t[1]}r(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=cg(e)){let n=l1.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=o.exec(e);)n[t[1]]=t[2];return n}if(l1.isFunction(t))return t.call(this,e,n);if(l1.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cg(e)){let n=l1.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||cy(this,this[n],n,t)))}return!1}delete(e,t){let n=this,o=!1;function i(e){if(e=cg(e)){let i=l1.findKey(n,e);i&&(!t||cy(n,n[i],i,t))&&(delete n[i],o=!0)}}return l1.isArray(e)?e.forEach(i):i(e),o}clear(e){let t=Object.keys(this),n=t.length,o=!1;for(;n--;){let i=t[n];(!e||cy(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){let t=this,n={};return l1.forEach(this,(o,i)=>{let r=l1.findKey(n,i);if(r){t[r]=cF(o),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();a!==i&&delete t[i],t[a]=cF(o),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return l1.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&l1.isArray(n)?n.join(", "):n)}),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 n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[c_]=this[c_]={accessors:{}}).accessors,n=this.prototype;function o(e){let o=cg(e);if(!t[o]){let i;i=l1.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{value:function(n,o,i){return this[t].call(this,e,n,o,i)},configurable:!0})}),t[o]=!0}}return l1.isArray(e)?e.forEach(o):o(e),this}}function cw(e,t){let n=this||cb,o=t||n,i=cM.from(o.headers),r=o.data;return l1.forEach(e,function(e){r=e.call(n,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function ck(e){return!!(e&&e.__CANCEL__)}cM.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l1.reduceDescriptors(cM.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),l1.freezeMethods(cM);let cE=class extends l3{constructor(e,t,n){super(null==e?"canceled":e,l3.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function cD(e,t,n){let o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new l3("Request failed with status code "+n.status,[l3.ERR_BAD_REQUEST,l3.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}let cC=function(e,t){let n,o=Array(e=e||10),i=Array(e),r=0,a=0;return t=void 0!==t?t:1e3,function(s){let d=Date.now(),l=i[a];n||(n=d),o[r]=s,i[r]=d;let c=a,h=0;for(;c!==r;)h+=o[c++],c%=e;if((r=(r+1)%e)===a&&(a=(a+1)%e),d-n<t)return;let u=l&&d-l;return u?Math.round(1e3*h/u):void 0}},cL=function(e,t){let n,o,i=0,r=1e3/t,a=(t,r=Date.now())=>{i=r,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=r?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},r-s)))},()=>n&&a(n)]},cA=(e,t,n=3)=>{let o=0,i=cC(50,250);return cL(n=>{let r=n.loaded,a=n.lengthComputable?n.total:void 0,s=r-o,d=i(s);o=r,e({loaded:r,total:a,progress:a?r/a:void 0,bytes:s,rate:d||void 0,estimated:d&&a&&r<=a?(a-r)/d:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},cT=(e,t)=>{let n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},cx=e=>(...t)=>l1.asap(()=>e(...t)),cz=cf.hasStandardBrowserEnv?(a=new URL(cf.origin),s=cf.navigator&&/(msie|trident)/i.test(cf.navigator.userAgent),e=>(e=new URL(e,cf.origin),a.protocol===e.protocol&&a.host===e.host&&(s||a.port===e.port))):()=>!0,cS=cf.hasStandardBrowserEnv?{write(e,t,n,o,i,r,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];l1.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),l1.isString(o)&&s.push(`path=${o}`),l1.isString(i)&&s.push(`domain=${i}`),!0===r&&s.push("secure"),l1.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function cY(e,t,n){let o=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(o||!1==n)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let cO=e=>e instanceof cM?{...e}:e;function cI(e,t){t=t||{};let n={};function o(e,t,n,o){return l1.isPlainObject(e)&&l1.isPlainObject(t)?l1.merge.call({caseless:o},e,t):l1.isPlainObject(t)?l1.merge({},t):l1.isArray(t)?t.slice():t}function i(e,t,n,i){return l1.isUndefined(t)?l1.isUndefined(e)?void 0:o(void 0,e,n,i):o(e,t,n,i)}function r(e,t){if(!l1.isUndefined(t))return o(void 0,t)}function a(e,t){return l1.isUndefined(t)?l1.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function s(n,i,r){return r in t?o(n,i):r in e?o(void 0,n):void 0}let d={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,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>i(cO(e),cO(t),n,!0)};return l1.forEach(Object.keys({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;let r=l1.hasOwnProp(d,o)?d[o]:i,a=r(e[o],t[o],o);l1.isUndefined(a)&&r!==s||(n[o]=a)}),n}let cB=e=>{let t=cI({},e),{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:r,headers:a,auth:s}=t;if(t.headers=a=cM.from(a),t.url=co(cY(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),l1.isFormData(n)){if(cf.hasStandardBrowserEnv||cf.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(l1.isFunction(n.getHeaders)){let e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}}if(cf.hasStandardBrowserEnv&&(o&&l1.isFunction(o)&&(o=o(t)),o||!1!==o&&cz(t.url))){let e=i&&r&&cS.read(r);e&&a.set(i,e)}return t},cP="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var o;let i,r,a,s,d,l,c=cB(e),h=c.data,u=cM.from(c.headers).normalize(),{responseType:m,onUploadProgress:f,onDownloadProgress:p}=c;function b(){s&&s(),d&&d(),c.cancelToken&&c.cancelToken.unsubscribe(i),c.signal&&c.signal.removeEventListener("abort",i)}let v=new XMLHttpRequest;function _(){if(!v)return;let o=cM.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());cD(function(e){t(e),b()},function(e){n(e),b()},{data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:o,config:e,request:v}),v=null}v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=_:v.onreadystatechange=function(){!v||4!==v.readyState||(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(_)},v.onabort=function(){v&&(n(new l3("Request aborted",l3.ECONNABORTED,e,v)),v=null)},v.onerror=function(t){let o=new l3(t&&t.message?t.message:"Network Error",l3.ERR_NETWORK,e,v);o.event=t||null,n(o),v=null},v.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",o=c.transitional||cr;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new l3(t,o.clarifyTimeoutError?l3.ETIMEDOUT:l3.ECONNABORTED,e,v)),v=null},void 0===h&&u.setContentType(null),"setRequestHeader"in v&&l1.forEach(u.toJSON(),function(e,t){v.setRequestHeader(t,e)}),l1.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),m&&"json"!==m&&(v.responseType=c.responseType),p&&([a,d]=cA(p,!0),v.addEventListener("progress",a)),f&&v.upload&&([r,s]=cA(f),v.upload.addEventListener("progress",r),v.upload.addEventListener("loadend",s)),(c.cancelToken||c.signal)&&(i=t=>{v&&(n(!t||t.type?new cE(null,e,v):t),v.abort(),v=null)},c.cancelToken&&c.cancelToken.subscribe(i),c.signal&&(c.signal.aborted?i():c.signal.addEventListener("abort",i)));let g=(o=c.url,(l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o))&&l[1]||"");g&&-1===cf.protocols.indexOf(g)?n(new l3("Unsupported protocol "+g+":",l3.ERR_BAD_REQUEST,e)):v.send(h||null)})},cR=function*(e,t){let n,o=e.byteLength;if(!t||o<t)return void(yield e);let i=0;for(;i<o;)n=i+t,yield e.slice(i,n),i=n},cN=async function*(e,t){for await(let n of cj(e))yield*cR(n,t)},cj=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},cH=(e,t,n,o)=>{let i,r=cN(e,t),a=0,s=e=>{!i&&(i=!0,o&&o(e))};return new ReadableStream({async pull(e){try{let{done:t,value:o}=await r.next();if(t){s(),e.close();return}let i=o.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw s(e),e}},cancel:e=>(s(e),r.return())},{highWaterMark:2})},{isFunction:cU}=l1,c$=(({Request:e,Response:t})=>({Request:e,Response:t}))(l1.global),{ReadableStream:cW,TextEncoder:cV}=l1.global,cq=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},cG=e=>{let t,{fetch:n,Request:o,Response:i}=e=l1.merge.call({skipUndefined:!0},c$,e),r=n?cU(n):"function"==typeof fetch,a=cU(o),s=cU(i);if(!r)return!1;let d=r&&cU(cW),l=r&&("function"==typeof cV?(t=new cV,e=>t.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer())),c=a&&d&&cq(()=>{let e=!1,t=new o(cf.origin,{body:new cW,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=s&&d&&cq(()=>l1.isReadableStream(new i("").body)),u={stream:h&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{u[e]||(u[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new l3(`Response type '${e}' is not supported`,l3.ERR_NOT_SUPPORT,n)})});let m=async e=>{if(null==e)return 0;if(l1.isBlob(e))return e.size;if(l1.isSpecCompliantForm(e)){let t=new o(cf.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return l1.isArrayBufferView(e)||l1.isArrayBuffer(e)?e.byteLength:(l1.isURLSearchParams(e)&&(e+=""),l1.isString(e))?(await l(e)).byteLength:void 0},f=async(e,t)=>{let n=l1.toFiniteNumber(e.getContentLength());return null==n?m(t):n};return async e=>{let t,{url:r,method:s,data:d,signal:l,cancelToken:m,timeout:p,onDownloadProgress:b,onUploadProgress:v,responseType:_,headers:g,withCredentials:F="same-origin",fetchOptions:y}=cB(e),M=n||fetch;_=_?(_+"").toLowerCase():"text";let w=((e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,o=new AbortController,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;o.abort(t instanceof l3?t:new cE(t instanceof Error?t.message:t))}},r=t&&setTimeout(()=>{r=null,i(new l3(`timeout of ${t}ms exceeded`,l3.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));let{signal:s}=o;return s.unsubscribe=()=>l1.asap(a),s}})([l,m&&m.toAbortSignal()],p),k=null,E=w&&w.unsubscribe&&(()=>{w.unsubscribe()});try{if(v&&c&&"get"!==s&&"head"!==s&&0!==(t=await f(g,d))){let e,n=new o(r,{method:"POST",body:d,duplex:"half"});if(l1.isFormData(d)&&(e=n.headers.get("content-type"))&&g.setContentType(e),n.body){let[e,o]=cT(t,cA(cx(v)));d=cH(n.body,65536,e,o)}}l1.isString(F)||(F=F?"include":"omit");let n=a&&"credentials"in o.prototype,l={...y,signal:w,method:s.toUpperCase(),headers:g.normalize().toJSON(),body:d,duplex:"half",credentials:n?F:void 0};k=a&&new o(r,l);let m=await (a?M(k,y):M(r,l)),p=h&&("stream"===_||"response"===_);if(h&&(b||p&&E)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=m[t]});let t=l1.toFiniteNumber(m.headers.get("content-length")),[n,o]=b&&cT(t,cA(cx(b),!0))||[];m=new i(cH(m.body,65536,n,()=>{o&&o(),E&&E()}),e)}_=_||"text";let D=await u[l1.findKey(u,_)||"text"](m,e);return!p&&E&&E(),await new Promise((t,n)=>{cD(t,n,{data:D,headers:cM.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:k})})}catch(t){if(E&&E(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new l3("Network Error",l3.ERR_NETWORK,e,k,t&&t.response),{cause:t.cause||t});throw l3.from(t,t&&t.code,e,k,t&&t.response)}}},cK=new Map,cJ=e=>{let t=e&&e.env||{},{fetch:n,Request:o,Response:i}=t,r=[o,i,n],a=r.length,s,d,l=cK;for(;a--;)s=r[a],void 0===(d=l.get(s))&&l.set(s,d=a?new Map:cG(t)),l=d;return d};cJ();let cX={http:null,xhr:cP,fetch:{get:cJ}};l1.forEach(cX,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let cZ=e=>`- ${e}`,cQ=e=>l1.isFunction(e)||null===e||!1===e,c0=function(e,t){let n,o,{length:i}=e=l1.isArray(e)?e:[e],r={};for(let a=0;a<i;a++){let i;if(o=n=e[a],!cQ(n)&&void 0===(o=cX[(i=String(n)).toLowerCase()]))throw new l3(`Unknown adapter '${i}'`);if(o&&(l1.isFunction(o)||(o=o.get(t))))break;r[i||"#"+a]=o}if(!o){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 l3("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"),"ERR_NOT_SUPPORT")}return o};function c1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cE(null,e)}function c2(e){return c1(e),e.headers=cM.from(e.headers),e.data=cw.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c0(e.adapter||cb.adapter,e)(e).then(function(t){return c1(e),t.data=cw.call(e,e.transformResponse,t),t.headers=cM.from(t.headers),t},function(t){return!ck(t)&&(c1(e),t&&t.response&&(t.response.data=cw.call(e,e.transformResponse,t.response),t.response.headers=cM.from(t.response.headers))),Promise.reject(t)})}let c3={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{c3[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let c4={};c3.transitional=function(e,t,n){function o(e,t){return"[Axios v1.13.6] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,r)=>{if(!1===e)throw new l3(o(i," has been removed"+(t?" in "+t:"")),l3.ERR_DEPRECATED);return t&&!c4[i]&&(c4[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,r)}},c3.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let c5=function(e,t,n){if("object"!=typeof e)throw new l3("options must be an object",l3.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),i=o.length;for(;i-- >0;){let r=o[i],a=t[r];if(a){let t=e[r],n=void 0===t||a(t,r,e);if(!0!==n)throw new l3("option "+r+" must be "+n,l3.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new l3("Unknown option "+r,l3.ERR_BAD_OPTION)}};class c6{constructor(e){this.defaults=e||{},this.interceptors={request:new ci,response:new ci}}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 n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){let n,o;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:r,headers:a}=t=cI(this.defaults,t);void 0!==i&&c5(i,{silentJSONParsing:c3.transitional(c3.boolean),forcedJSONParsing:c3.transitional(c3.boolean),clarifyTimeoutError:c3.transitional(c3.boolean),legacyInterceptorReqResOrdering:c3.transitional(c3.boolean)},!1),null!=r&&(l1.isFunction(r)?t.paramsSerializer={serialize:r}:c5(r,{encode:c3.function,serialize:c3.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),c5(t,{baseUrl:c3.spelling("baseURL"),withXsrfToken:c3.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&l1.merge(a.common,a[t.method]);a&&l1.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=cM.concat(s,a);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let n=t.transitional||cr;n&&n.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let h=0;if(!l){let e=[c2.bind(this),void 0];for(e.unshift(...d),e.push(...c),o=e.length,n=Promise.resolve(t);h<o;)n=n.then(e[h++],e[h++]);return n}o=d.length;let u=t;for(;h<o;){let e=d[h++],t=d[h++];try{u=e(u)}catch(e){t.call(this,e);break}}try{n=c2.call(this,u)}catch(e){return Promise.reject(e)}for(h=0,o=c.length;h<o;)n=n.then(c[h++],c[h++]);return n}getUri(e){return co(cY((e=cI(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}l1.forEach(["delete","get","head","options"],function(e){c6.prototype[e]=function(t,n){return this.request(cI(n||{},{method:e,url:t,data:(n||{}).data}))}}),l1.forEach(["post","put","patch"],function(e){function t(t){return function(n,o,i){return this.request(cI(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}c6.prototype[e]=t(),c6.prototype[e+"Form"]=t(!0)});class c8{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new cE(e,o,i),t(n.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 e;return{token:new c8(function(t){e=t}),cancel:e}}}let c7={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(c7).forEach(([e,t])=>{c7[t]=e});let c9=function e(t){let n=new c6(t),o=lp(c6.prototype.request,n);return l1.extend(o,c6.prototype,n,{allOwnKeys:!0}),l1.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(cI(t,n))},o}(cb);c9.Axios=c6,c9.CanceledError=cE,c9.CancelToken=c8,c9.isCancel=ck,c9.VERSION="1.13.6",c9.toFormData=l7,c9.AxiosError=l3,c9.Cancel=c9.CanceledError,c9.all=function(e){return Promise.all(e)},c9.spread=function(e){return function(t){return e.apply(null,t)}},c9.isAxiosError=function(e){return l1.isObject(e)&&!0===e.isAxiosError},c9.mergeConfig=cI,c9.AxiosHeaders=cM,c9.formToJSON=e=>cp(l1.isHTMLForm(e)?new FormData(e):e),c9.getAdapter=c0,c9.HttpStatusCode=c7,c9.default=c9;class he{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:hM`console/register`,data:e,options:t})}}class ht{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:hM`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:hM`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:hM`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:hM`map/getCustomMapInfo`,options:e})}getTile(e,t,n,o){return this.httpClient.request({method:"GET",url:hM`map/tile/${e}/${t}/${n}`,options:o})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:hM`map/upload`,queryParams:e,options:t})}}class hn{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:hM`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:hM`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:hM`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:hM`dashboard/${e}/${t}`,options:n})}}class ho{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:hM`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:hM`info`,options:e})}}class hi{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:hM`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`agent/assetImport/${e}`,queryParams:n,data:t,options:o})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:hM`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class hr{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:hM`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:hM`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:hM`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:hM`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:hM`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:hM`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:hM`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:hM`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:hM`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:hM`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`rules/${e}`,data:t,options:n})}}class ha{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:hM`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:hM`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:hM`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:hM`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`notification/${e}/acknowledged`,queryParams:n,data:t,options:o})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:hM`notification/${e}/delivered`,queryParams:t,options:n})}}class hs{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`asset/predicted/${e}/${t}`,data:n,options:o})}writePredictedDatapoints(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`asset/predicted/${e}/${t}`,data:n,options:o})}}class hd{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:hM`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:hM`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:hM`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:hM`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:hM`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:hM`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:hM`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:hM`alarm/${e}/assets`,queryParams:t,options:n})}}class hl{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:hM`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:hM`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/status/${e}`,options:t})}}class hc{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:hM`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:hM`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:hM`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:hM`syslog/event`,queryParams:e,options:t})}}class hh{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:hM`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:hM`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:hM`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:hM`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`realm/${e}`,data:t,options:n})}}class hu{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:hM`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:hM`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:hM`flow/${e}`,options:t})}}class hm{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:hM`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:hM`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,o){return this.httpClient.request({method:"POST",url:hM`asset/datapoint/${e}/${t}`,data:n,options:o})}}class hf{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:hM`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:hM`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:hM`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:hM`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:hM`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:hM`service/${e}/${t}`,options:n})}}class hp{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:hM`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:hM`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:hM`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:hM`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:hM`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:hM`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:hM`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:hM`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:hM`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:hM`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:hM`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:hM`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:hM`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,o){return this.httpClient.request({method:"DELETE",url:hM`asset/user/link/${e}/${t}/${n}`,options:o})}get(e,t){return this.httpClient.request({method:"GET",url:hM`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/attribute/${t}`,data:n,options:o})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/attribute/${t}/${n}`,data:o,options:i})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:hM`asset/${e}/child`,queryParams:t,options:n})}}class hb{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:hM`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:hM`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:hM`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:hM`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:hM`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:hM`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:hM`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:hM`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/reset-password/${t}`,data:n,options:o})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/userRealmRoles/${t}`,data:n,options:o})}getUserClientRoles(e,t,n,o){return this.httpClient.request({method:"GET",url:hM`user/${e}/userRoles/${t}/${n}`,options:o})}updateUserClientRoles(e,t,n,o,i){return this.httpClient.request({method:"PUT",url:hM`user/${e}/userRoles/${t}/${n}`,data:o,options:i})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:hM`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:hM`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:hM`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,o){return this.httpClient.request({method:"PUT",url:hM`user/${e}/${t}/roles`,data:n,options:o})}get(e,t,n){return this.httpClient.request({method:"GET",url:hM`user/${e}/${t}`,options:n})}}class hv{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:hM`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:hM`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:hM`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:hM`model/valueDescriptors`,queryParams:e,options:t})}}class h_{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:hM`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:hM`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:hM`apps/info`,options:e})}}class hg{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:hM`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:hM`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:hM`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:hM`configuration/manager/image/${e}`,options:t})}}class hF{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:hM`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:hM`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:hM`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:hM`provisioning/${e}`,data:t,options:n})}}class hy{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:hM`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:hM`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,o,i){return this.httpClient.request({method:"GET",url:hM`gateway/tunnel/${e}/${t}/${n}/${o}`,options:i})}}function hM(e,...t){let n="";for(let o=0;o<t.length;o++)n+=e[o],n+=encodeURIComponent(t[o]);return n+e[e.length-1]}class hw{constructor(e,t=c9.create()){this._consoleResource=new hE(e,t),this._mapResource=new hD(e,t),this._dashboardResource=new hC(e,t),this._statusResource=new hL(e,t),this._agentResource=new hA(e,t),this._rulesResource=new hT(e,t),this._notificationResource=new hx(e,t),this._assetPredictedDatapointResource=new hz(e,t),this._alarmResource=new hS(e,t),this._gatewayClientResource=new hY(e,t),this._syslogResource=new hO(e,t),this._realmResource=new hI(e,t),this._flowResource=new hB(e,t),this._assetDatapointResource=new hP(e,t),this._externalServiceResource=new hR(e,t),this._assetResource=new hN(e,t),this._userResource=new hj(e,t),this._assetModelResource=new hH(e,t),this._appResource=new hU(e,t),this._configurationResource=new h$(e,t),this._provisioningResource=new hW(e,t),this._gatewayServiceResource=new hV(e,t),this._assetResource=new hN(e,t)}get ConsoleResource(){return this._consoleResource}get MapResource(){return this._mapResource}get DashboardResource(){return this._dashboardResource}get StatusResource(){return this._statusResource}get AgentResource(){return this._agentResource}get RulesResource(){return this._rulesResource}get NotificationResource(){return this._notificationResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AlarmResource(){return this._alarmResource}get GatewayClientResource(){return this._gatewayClientResource}get SyslogResource(){return this._syslogResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AssetDatapointResource(){return this._assetDatapointResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetResource(){return this._assetResource}get UserResource(){return this._userResource}get AssetModelResource(){return this._assetModelResource}get AppResource(){return this._appResource}get ConfigurationResource(){return this._configurationResource}get ProvisioningResource(){return this._provisioningResource}get GatewayServiceResource(){return this._gatewayServiceResource}}class hk{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 n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(t,e.options);let n=e.copyFn;return this.axios.request(t).then(e=>(n&&e.data&&(e.originalData=e.data,e.data=n(e.data)),e))}}class hE extends he{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hD extends ht{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hC extends hn{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hL extends ho{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hA extends hi{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hT extends hr{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hx extends ha{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hz extends hs{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hS extends hd{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hY extends hl{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hO extends hc{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hI extends hh{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hB extends hu{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hP extends hm{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hR extends hf{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hN extends hp{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hj extends hb{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hH extends hv{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hU extends h_{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class h$ extends hg{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hW extends hF{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}class hV extends hy{constructor(e,t=c9.create()){t.defaults.baseURL=e,super(new hk(t))}}c9.isAxiosError;let hq=new class{get api(){return this._client}constructor(){this._axiosInstance=c9.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>ls().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 hw(e,this._axiosInstance)}};var hG=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};(ew=tC||(tC={})).DISCONNECTED="DISCONNECTED",ew.CONNECTED="CONNECTED",ew.CONNECTING="CONNECTING";let hK="SUBSCRIBED:",hJ="UNAUTHORIZED:",hX="TRIGGERED:",hZ="EVENT:";class hQ{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=h0.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tC.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 n=e.indexOf(t);n>=0&&e.splice(n,1)}(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tC.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(tC.CONNECTING),this._connectingDeferred=new lc,this._doConnect().then(e=>{if(this._connectingDeferred){let t=this._connectingDeferred;this._connectingDeferred=null,e?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=h0.MIN_RECONNECT_DELAY,this._onStatusChanged(tC.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),t.resolve(e)}})),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!==tC.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new lc};return null!=this._pendingSubscription||this._status!==tC.CONNECTED?(this._queuedSubscriptions.push(n),n.deferred.promise):(this._pendingSubscription=n,this._doSubscribe(e).then(e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(e,t),this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.resolve(e)}},e=>{if(this._pendingSubscription){let t=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let n=t.deferred;t.deferred=null,n&&n.reject(e)}}),this._pendingSubscription.deferred.promise)}unsubscribe(e){return hG(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)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let e=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(e)}return}})}sendEvent(e){this._status===tC.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==tC.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return hG(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,i="AssetEvent"+hQ._subscriptionCounter++;if(!this._assetEventPromise){let e;up.authenticated||(e={filterType:"asset",realm:up.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;o?o.find(e=>t===e)&&n(e):e.asset.realm===up.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(o&&t){let e={messageID:"read-assets:"+o.join(",")+":"+i,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(i)&&e.assets.forEach(e=>{n({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,n){return hG(this,void 0,void 0,function*(){let o=e&&"string"!=typeof e[0],i=o?e.map(e=>e.id):e,r=o?e:void 0,a="AttributeEvent"+hQ._subscriptionCounter++;if(!this._attributeEventPromise){let e;up.authenticated||(e={filterType:"asset",realm:up.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;o?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):i?i.find(e=>r.id===e)&&n(t):t.realm===up.displayRealm&&n(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,n])=>{(!r||r.find(n=>n.id===e.id&&n.name===t))&&s({eventType:"attribute",timestamp:n.timestamp,value:n.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===tC.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let e=this._queuedSubscriptions.shift();e&&this.subscribe(e.eventSubscription,e.callback).then(t=>{let n=e.deferred;e.deferred=null,n&&n.resolve(t)},t=>{let n=e.deferred;e.deferred=null,n&&n.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 n=this._subscriptionMap.get(e);n&&n.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===tC.CONNECTED&&this._onStatusChanged(tC.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tC.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<h0.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(h0.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}hQ.MIN_RECONNECT_DELAY=0,hQ.MAX_RECONNECT_DELAY=3e4,hQ._subscriptionCounter=0;class h0 extends hQ{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="+up.config.realm;return up.authenticated&&(e+="&Authorization="+up.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new lc,this._webSocket.onopen=()=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!0)}},this._webSocket.onerror=e=>{if(this._connectDeferred){let e=this._connectDeferred;this._connectDeferred=null,e.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(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(hK)){let e=JSON.parse(t.substring(hK.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(hJ)){let e=JSON.parse(t.substring(hJ.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&(console.warn("Unauthorized event subscription: "+JSON.stringify(e,null,2)),n.reject("Unauthorized"))}else if(t.startsWith(hX)){let e=JSON.parse(t.substring(hX.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(hZ)){let e=JSON.parse(t.substring(hZ.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 lc,e.subscriptionId||(e.subscriptionId=h0._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=hZ+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 lc;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(hZ+JSON.stringify(e)),t.promise}}function h1(e){return(h1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}h0._subscriptionCounter=1;var h2=[],h3=h2.forEach,h4=h2.slice;function h5(e){return h3.call(h4.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function h6(){return"function"==typeof XMLHttpRequest||("u"<typeof XMLHttpRequest?"undefined":h1(XMLHttpRequest))==="object"}var h8=i(4550),h7=i.t(h8,2);function h9(e){return(h9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof fetch&&(tL="u">typeof global&&global.fetch?global.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),h6()&&("u">typeof global&&global.XMLHttpRequest?tA=global.XMLHttpRequest:"u">typeof window&&window.XMLHttpRequest&&(tA=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("u">typeof global&&global.ActiveXObject?tT=global.ActiveXObject:"u">typeof window&&window.ActiveXObject&&(tT=window.ActiveXObject)),tL||!h7||tA||tT||(tL=h8||h7),"function"!=typeof tL&&(tL=void 0);var ue=function(e,t){if(t&&"object"===h9(t)){var n="";for(var o in t)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},ut=function(e,t,n){tL(e,t).then(function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(function(t){n(null,{status:e.status,data:t})}).catch(n)}).catch(n)},un=!1,uo=function(e,t,n,o){e.queryStringParams&&(t=ue(t,e.queryStringParams));var i=h5({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(i["Content-Type"]="application/json");var r="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=h5({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:i},un?{}:r);try{ut(t,a,o)}catch(e){if(!r||0===Object.keys(r).length||!e.message||0>e.message.indexOf("not implemented"))return o(e);try{Object.keys(r).forEach(function(e){delete a[e]}),ut(t,a,o),un=!0}catch(e){o(e)}}},ui=function(e,t,n,o){n&&"object"===h9(n)&&(n=ue("",n).slice(1)),e.queryStringParams&&(t=ue(t,e.queryStringParams));try{(i=tA?new tA:new tT("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var i,r=e.customHeaders;if(r="function"==typeof r?r():r)for(var a in r)i.setRequestHeader(a,r[a]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}};let ur=function(e,t,n,o){return("function"==typeof n&&(o=n,n=void 0),o=o||function(){},tL)?uo(e,t,n,o):h6()||"function"==typeof ActiveXObject?ui(e,t,n,o):void o(Error("No fetch and no xhr implementation found!"))};var ua=function(){var e;function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.services=e,this.options=n,this.allOptions=o,this.type="backend",this.init(e,n,o)}return e=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=h5(n,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){var o,i;return o={},i=n||"",t in o?Object.defineProperty(o,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[t]=i,o},request:ur,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return t.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,o,i){var r,a,s=this,d=this.options.loadPath;"function"==typeof this.options.loadPath&&(d=this.options.loadPath(e,n)),(d=(a=r=d)&&"function"==typeof a.then?r:Promise.resolve(r)).then(function(r){if(!r)return i(null,{});var a=s.services.interpolator.interpolate(r,{lng:e.join("+"),ns:n.join("+")});s.loadUrl(a,i,t,o)})}},{key:"loadUrl",value:function(e,t,n,o){var i=this;this.options.request(this.options,e,void 0,function(r,a){var s,d;if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&r&&r.message&&r.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+r.message,!0);if(r)return t(r,!1);try{s="string"==typeof a.data?i.options.parse(a.data,n,o):a.data}catch(t){d="failed parsing "+e+" to json"}if(d)return t(d,!1);t(null,s)})}},{key:"create",value:function(e,t,n,o,i){var r=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,o),s=0,d=[],l=[];e.forEach(function(n){var o=r.options.addPath;"function"==typeof r.options.addPath&&(o=r.options.addPath(n,t));var c=r.services.interpolator.interpolate(o,{lng:n,ns:t});r.options.request(r.options,c,a,function(t,n){s+=1,d.push(t),l.push(n),s===e.length&&i&&i(d,l)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,o=t.languageUtils,i=t.logger,r=n.language;if(!r||"cimode"!==r.toLowerCase()){var a=[],s=function(e){o.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};s(r),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return s(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(o,r){o&&i.warn("loading namespace ".concat(e," for language ").concat(t," failed"),o),!o&&r&&i.log("loaded namespace ".concat(e," for language ").concat(t),r),n.loaded("".concat(t,"|").concat(e),o,r)})})})}}}],function(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();ua.type="backend";var us=i(4954);class ud extends Error{}function ul(e,t){let n;if("string"!=typeof e)throw new ud("Invalid token specified: must be a string");t||(t={});let o=+(!0!==t.header),i=e.split(".")[o];if("string"!=typeof i)throw new ud(`Invalid token specified: missing part #${o+1}`);try{n=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 n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(i)}catch(e){throw new ud(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new ud(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}if(ud.prototype.name="InvalidTokenError","u"<typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function uc(e){if(!(this instanceof uc))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=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=")&&(o.iframeVersion=a[s].src.substring(a[s].src.indexOf("version=")+8).split("&")[0]);var d=!0,l=C(console.info),c=C(console.warn);function h(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=Array(e);for(var o=0;o<t.length;o++)t[o]=Math.floor(256*Math.random());return t}(e),o=Array(e),i=0;i<e;i++)o[i]=t.charCodeAt(n[i]%t.length);return String.fromCharCode.apply(null,o)}function u(){return void 0===o.authServerUrl?void 0:"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function m(e,t){var n=e.code,i=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),i){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:i,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();return}if("standard"!=o.flow&&(e.access_token||e.id_token)&&m(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",h=o.endpoints.token(),u=new XMLHttpRequest;u.open("POST",h,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),u.withCredentials=!0,u.onreadystatechange=function(){if(4==u.readyState)if(200==u.status){var e=JSON.parse(u.responseText);m(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),y()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},u.send(c)}function m(n,i,r,s){p(n,i,r,a=(a+new Date().getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(l("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function f(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function p(e,t,n,i){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=ul(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=ul(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=ul(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,i&&(o.timeSkew=Math.floor(i/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(l("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var r=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;l("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,r)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function b(){var e="0123456789abcdef",t=h(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 v(e){var t=function(e){switch(o.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,n,i,r=e.indexOf("?"),a=e.indexOf("#");if("query"===o.responseMode&&-1!==r?(n=e.substring(0,r),""!==(i=_(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+i.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(i=_(e.substring(a+1),t)).paramsString&&(n+="#"+i.paramsString)),i&&i.oauthParams){if("standard"===o.flow||"hybrid"===o.flow){if((i.oauthParams.code||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}else if("implicit"===o.flow&&(i.oauthParams.access_token||i.oauthParams.error)&&i.oauthParams.state)return i.oauthParams.newUrl=n,i.oauthParams}}(e);if(t){var i=n.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 _(e,t){for(var n=e.split("&"),o={paramsString:"",oauthParams:{}},i=0;i<n.length;i++){var r=n[i].indexOf("="),a=n[i].slice(0,r);-1!==t.indexOf(a)?o.oauthParams[a]=n[i].slice(r+1):(""!==o.paramsString&&(o.paramsString+="&"),o.paramsString+=n[i])}return o}function g(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}function F(){var e=g();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=o.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 n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),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&&o.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var i=t[n];"error"==e.data?i.setError():i.setSuccess("unchanged"==e.data)}}},!1),e.promise}function y(){r.enable&&o.token&&setTimeout(function(){M().then(function(e){e&&y()})},1e3*r.interval)}function M(){var e=g();if(r.iframe&&r.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");r.callbackList.push(e);var n=r.iframeOrigin;1==r.callbackList.length&&r.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function w(){var e,t,n,i=g();if(r.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.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&&(c("[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,o.silentCheckSsoFallback&&(o.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=o.messageReceiveTimeout,n=null,Promise.race([e,new Promise(function(e,o){n=setTimeout(function(){o({error:"Timeout when waiting for 3rd party check iframe message."})},t)})]).finally(function(){clearTimeout(n)})}function k(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),g().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));let n=o.createLogoutUrl(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.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(o.createRegisterUrl(e)),g().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return g().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){r.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},i=function(e){var t=e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{};return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),Object.keys(t).reduce(function(e,n){return e.push(n+"="+t[n]),e},[]).join(",")},a=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=g(),r=i(e),s=n(o.createLoginUrl(e),"_blank",r),d=!1,l=!1,c=function(){l=!0,s.close()};return s.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(m(v(e.url),t),c(),d=!0)}),s.addEventListener("loaderror",function(e){d||(0==e.url.indexOf(a())?(m(v(e.url),t),c(),d=!0):(t.setError(),c()))}),s.addEventListener("exit",function(e){l||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,i=g(),r=n(o.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():(o.clearToken(),i.setSuccess())}),i.promise},register:function(e){var t=g(),r=n(o.createRegisterUrl(),"_blank",i(e));return r.addEventListener("loadstart",function(e){0==e.url.indexOf(a())&&(r.close(),m(v(e.url),t))}),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0!==e){var t=n(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=g(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(v(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=g(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=g(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(v(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.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:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(i){if(o.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new E}catch(e){}return new D}(),t=i&&["default","cordova","cordova-native"].indexOf(i.adapter)>-1?k(i.adapter):i&&"object"==typeof i.adapter?i.adapter:window.Cordova||window.cordova?k("cordova"):k(),i){if(void 0!==i.useNonce&&(d=i.useNonce),void 0!==i.checkLoginIframe&&(r.enable=i.checkLoginIframe),i.checkLoginIframeInterval&&(r.interval=i.checkLoginIframeInterval),"login-required"===i.onLoad&&(o.loginRequired=!0),i.responseMode)if("query"===i.responseMode||"fragment"===i.responseMode)o.responseMode=i.responseMode;else throw"Invalid value for responseMode";if(i.flow){switch(i.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=i.flow}if(null!=i.timeSkew&&(o.timeSkew=i.timeSkew),i.redirectUri&&(o.redirectUri=i.redirectUri),i.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=i.silentCheckSsoRedirectUri),"boolean"==typeof i.silentCheckSsoFallback?o.silentCheckSsoFallback=i.silentCheckSsoFallback:o.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}.`);o.pkceMethod=i.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof i.enableLogging?o.enableLogging=i.enableLogging:o.enableLogging=!1,"POST"===i.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof i.scope&&(o.scope=i.scope),"string"==typeof i.acrValues&&(o.acrValues=i.acrValues),"number"==typeof i.messageReceiveTimeout&&i.messageReceiveTimeout>0?o.messageReceiveTimeout=i.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var a=g(),s=g();s.promise.then(function(){o.onReady&&o.onReady(o.authenticated),a.setSuccess(o.authenticated)}).catch(function(e){a.setError(e)});var l=function(t){var n=g();function i(e){e?o.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}}:o.endpoints={authorize:function(){return u()+"/protocol/openid-connect/auth"},token:function(){return u()+"/protocol/openid-connect/token"},logout:function(){return u()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=u()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=u()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return u()+"/protocol/openid-connect/registrations"},userinfo:function(){return u()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(s=e):s="keycloak.json",s){var r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||f(r)){var e=JSON.parse(r.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),n.setSuccess()}else n.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var s,d="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",d,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||f(r)?(i(JSON.parse(r.responseText)),n.setSuccess()):n.setError())},r.send()}else i(a),n.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";o.authServerUrl=e.url,o.realm=e.realm,i(null),n.setSuccess()}}return n.promise}();function c(){var e=function(e){e||(n.prompt="none"),i&&i.locale&&(n.locale=i.locale),o.login(n).then(function(){s.setSuccess()}).catch(function(e){s.setError(e)})},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.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 n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(v(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(i.onLoad){case"check-sso":r.enable?F().then(function(){M().then(function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)}).catch(function(e){s.setError(e)})}):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function h(){var e=v(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return F().then(function(){m(e,s)}).catch(function(e){s.setError(e)});i?i.token&&i.refreshToken?(p(i.token,i.refreshToken,i.idToken),r.enable?F().then(function(){M().then(function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),y()):s.setSuccess()}).catch(function(e){s.setError(e)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()}).catch(function(e){o.onAuthError&&o.onAuthError(),i.onLoad?c():s.setError(e)})):i.onLoad?c():s.setSuccess():s.setSuccess()}return l.then(function(){var e,t;(e=g(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())},document.addEventListener("readystatechange",t),t(),e.promise).then(w).then(h).catch(function(e){a.setError(e)})}),l.catch(function(e){a.setError(e)}),a.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,r=b(),a=b(),s=t.redirectUri(e),l={state:r,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(l.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var c=e&&e.scope||o.scope;c?-1===c.indexOf("openid")&&(c="openid "+c):c="openid";var u=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(c);if(d&&(u=u+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(u+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(u+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(u+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(u+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(u+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(u+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(u+="&claims="+encodeURIComponent(JSON.stringify({id_token:{acr:e.acr}}))),(e&&e.acrValues||o.acrValues)&&(u+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var m=h(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");l.pkceCodeVerifier=m,u+="&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(us.arrayBuffer(t)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,m)+"&code_challenge_method="+o.pkceMethod}return n.add(l),u},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=u(),i=void 0;return void 0!==n&&(i=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),i},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=u()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=g();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return l("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=g();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,l("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(e))&&(n=!0,l("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.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(o.clientId);var d=new Date().getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){l("[KEYCLOAK] Token refreshed"),d=(d+new Date().getTime())/2;var e=JSON.parse(s.responseText);p(e.access_token,e.refresh_token,e.id_token,d),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{c("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(r)}}else t.setSuccess(!1)};return r.enable?M().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},o.clearToken=function(){o.token&&(p(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var E=function(){if(!(this instanceof E))return new E;function e(){for(var e=new Date().getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var o=localStorage.getItem(n);if(o)try{var i=JSON.parse(o).expires;(!i||i<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,o=localStorage.getItem(n);return o&&(localStorage.removeItem(n),o=JSON.parse(o)),e(),o}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},D=function(){if(!(this instanceof D))return new D;this.get=function(o){if(o){var i=t("kc-callback-"+o);if(n("kc-callback-"+o,"",e(-100)),i)return JSON.parse(i)}},this.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))},this.removeItem=function(t){n(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+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return""},n=function(e,t,n){var o=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=o}};function C(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}var uh=function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function a(e){try{d(o.next(e))}catch(e){r(e)}}function s(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}d((o=o.apply(e,t||[])).next())})};let uu="openremote";(ek=tx||(tx={})).MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",ek.AUTH_FAILED="AUTH_FAILED",ek.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",ek.CONSOLE_ERROR="CONSOLE_INIT_ERROR",ek.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",ek.TRANSLATION_ERROR="TRANSLATION_ERROR",(eE=tz||(tz={})).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";class um{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,n])=>{let o=n.roles;e.set(t,o)}):this._basicIdentity&&this._basicIdentity.roles&&e.set(this._config.clientId,this._basicIdentity.roles),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 hq}get language(){return oJ.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(oJ.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(tz.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||uu}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 uh(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=uu),t);let n=yield this.loadManagerInfo(),o=new lf(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(tz.CONSOLE_READY)});if(this._console=o,"BASIC"===this._config.auth)n=(yield this.doTranslateInit())&&n,n=yield this.doAuthInit();else if("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);try{e=new URL(this._authServerUrl)}catch(n){(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(/\/+$/,""),(n=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",n=yield this.doAuthInit())}return!!n&&(n&&(n=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(n=(yield this.doTranslateInit())&&n)&&(n=yield this.doDescriptorsInit(),n=yield this.getConsoleAppConfig()),this.doIconInit(),n?(n=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(tz.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",n)})}loadManagerInfo(){return uh(this,void 0,void 0,function*(){try{let e=yield new Promise((e,t)=>{let n=new XMLHttpRequest;n.addEventListener("load",()=>{e(JSON.parse(n.responseText))}),n.addEventListener("error",()=>{t(Error("Failed to contact the manager"))}),n.open("GET",this._config.managerUrl+"/api/master/info"),n.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 uh(this,void 0,void 0,function*(){if(oJ.isInitialized)return!0;oJ.on("initialized",e=>{this._emitEvent(tz.TRANSLATE_INIT)}),oJ.on("languageChanged",e=>{ll().locale(e),this._emitEvent(tz.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,n)=>"uppercase"===t?e.toUpperCase():e instanceof Date?ll()(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 oJ.use(ua).init(e)}catch(e){return console.error(e),this._setError(tx.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return uh(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield hq.api.AssetModelResource.getAssetInfos(),t=yield hq.api.AssetModelResource.getMetaItemDescriptors(),n=yield hq.api.AssetModelResource.getValueDescriptors();nG._assetTypeInfos=e.data,nG._metaItemDescriptors=Object.values(t.data),nG._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return uh(this,void 0,void 0,function*(){let e=!0;switch(this._config.auth){case"BASIC":e=yield this.initialiseBasicAuth();break;case"KEYCLOAK":e=yield this.loadAndInitialiseKeycloak();break;case"NONE":return!0;default:return this._setError(tx.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(hq.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return hq.setTimeout(2e4),hq.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return uh(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new h0(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)===tC.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 tC.DISCONNECTED:this._onDisconnect();break;case tC.CONNECTED:break;case tC.CONNECTING:this._emitEvent(tz.CONNECTING)}}doConsoleInit(){return uh(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(tz.CONSOLE_INIT),!0}catch(e){return this._setError(tx.CONSOLE_ERROR),!1}})}doIconInit(){var e;this._config.loadIcons&&(nZ.addIconSet("mdi",(e=uf.managerUrl,{getIconTemplate:e=>nv`<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)}})),nZ.addIconSet("or",{getIconTemplate:e=>{let t=nK[e];return t?nv`
3542
3542
  <svg xmlns="http://www.w3.org/2000/svg"
3543
3543
  viewBox="0 0 ${24} ${24}" preserveAspectRatio="xMidYMid meet" focusable="false">
3544
3544
  ${nU(t.startsWith("<")?t:'<path xmlns="http://www.w3.org/2000/svg" d="'+t+'" />')}