@openremote/or-asset-tree 1.13.0-snapshot.20260112105718 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -575,7 +575,7 @@
|
|
|
575
575
|
.draggable:active[draggable="true"] {
|
|
576
576
|
cursor: grabbing;
|
|
577
577
|
}
|
|
578
|
-
`},1191:function(e,t,n){"use strict";n.d(t,{XA:()=>a,ZT:()=>o,fl:()=>s,pi:()=>r});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}},488:function(e,t,n){!function(e){"use strict";var t,n=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),i=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),r=n&&"size"in n.prototype,a="__URLSearchParams__",c=!n||function(){var e=new n;return e.append("s"," &"),"s=+%26"===e.toString()}(),s=u.prototype,d=!!(e.Symbol&&e.Symbol.iterator);if(!n||!i||!o||!c||!r){s.append=function(e,t){_(this[a],e,t)},s.delete=function(e){delete this[a][e]},s.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},s.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},s.has=function(e){return y(this[a],e)},s.set=function(e,t){this[a][e]=[""+t]},s.toString=function(){var e,t,n,i,o=this[a],r=[];for(t in o)for(e=0,n=f(t),i=o[t];e<i.length;e++)r.push(n+"="+f(i[e]));return r.join("&")};var l=e.Proxy&&n&&(!o||!c||!i||!r);l?(t=new Proxy(n,{construct:function(e,t){return new e(new u(t[0]).toString())}})).toString=Function.prototype.toString.bind(u):t=u,Object.defineProperty(e,"URLSearchParams",{value:t});var m=e.URLSearchParams.prototype;m.polyfill=!0,!l&&e.Symbol&&(m[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in m||(m.forEach=function(e,t){var n=b(this.toString());Object.getOwnPropertyNames(n).forEach(function(i){n[i].forEach(function(n){e.call(t,n,i,this)},this)},this)}),"sort"in m||(m.sort=function(){var e,t,n,i=b(this.toString()),o=[];for(e in i)o.push(e);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var r=o[t],a=i[r];for(n=0;n<a.length;n++)this.append(r,a[n])}}),"keys"in m||(m.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),h(e)}),"values"in m||(m.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),h(e)}),"entries"in m||(m.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),h(e)}),d&&(m[e.Symbol.iterator]=m[e.Symbol.iterator]||m.entries),"size"in m||Object.defineProperty(m,"size",{get:function(){var e=b(this.toString());if(m===this)throw TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce(function(t,n){return t+e[n].length},0)}})}function u(e){((e=e||"")instanceof URLSearchParams||e instanceof u)&&(e=e.toString()),this[a]=b(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function p(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/ig,function(e){return decodeURIComponent(e)})}function h(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return d&&(n[e.Symbol.iterator]=function(){return n}),n}function b(e){var t={};if("object"==typeof e)if(g(e))for(var n=0;n<e.length;n++){var i=e[n];if(g(i)&&2===i.length)_(t,i[0],i[1]);else throw TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements")}else for(var o in e)e.hasOwnProperty(o)&&_(t,o,e[o]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var r=e.split("&"),a=0;a<r.length;a++){var c=r[a],s=c.indexOf("=");-1<s?_(t,p(c.slice(0,s)),p(c.slice(s+1))):c&&_(t,p(c),"")}}return t}function _(e,t,n){var i="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);y(e,t)?e[t].push(i):e[t]=[i]}function g(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==n.g?n.g:"undefined"!=typeof window?window:this)},5037:function(e,t,n){"use strict";n.d(t,{ZP:()=>nt,Zr:()=>d,l6:()=>t5,Ld:()=>tQ,D8:()=>t3,mV:()=>t4,n7:()=>t1,gd:()=>t2,v5:()=>t0});var i,o,r,a,c,s,d={};n.r(d),n.d(d,{Deferred:()=>_,arrayRemove:()=>S,blobToBase64:()=>ek,camelCaseToSentenceCase:()=>O,capitaliseFirstLetter:()=>R,cronStringToISOString:()=>z,dateToCronString:()=>j,difference:()=>D,dispatchCancellableEvent:()=>eF,formatCronString:()=>H,getAllowedValueLabel:()=>J,getAssetTypeLabel:()=>X,getAttributeLabel:()=>Q,getAttributeUnits:()=>ed,getAttributeValueAsString:()=>en,getAttributeValueConstraints:()=>ec,getAttributeValueFormat:()=>em,getBrowserLanguage:()=>g,getComplexMetaItems:()=>q,getEnumKeyAsString:()=>N,getGeoNotificationsFromRulesSet:()=>F,getMetaItemNameValueHolder:()=>Z,getMetaLabel:()=>ee,getMetaUnits:()=>el,getMetaValue:()=>U,getMetaValueAsString:()=>ei,getMetaValueConstraints:()=>es,getMetaValueFormat:()=>eu,getPrimitiveMetaItems:()=>G,getQueryParameter:()=>v,getQueryParameters:()=>y,getValueAsString:()=>er,getValueDescriptorLabel:()=>K,getWeekNumber:()=>B,hasMetaItem:()=>$,isComplexMetaItem:()=>V,isObject:()=>C,isPrimitiveMetaItem:()=>W,isTimeDuration:()=>A,isTimeDurationNegativeInfinity:()=>L,isTimeDurationPositiveInfinity:()=>T,loadJs:()=>eg,mergeObjects:()=>ef,objectsEqual:()=>M,resolveUnits:()=>ea,sentenceCaseToCamelCase:()=>I,sortByNumber:()=>ey,sortByString:()=>ev,stringMatch:()=>Y,updateAsset:()=>e_}),n(488);var l=n(384),m=n(7998),u=n(3348),f=n.n(u),p=n(3806),h=n.n(p),b=n(2891);class _{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 g(){return navigator.language.split("-")[0]||"en"}function y(e){return f().parse(e,{ignoreQueryPrefix:!0})}function v(e){let t;if(location.search&&""!==location.search&&(t=y(location.search)),location.hash){let e=location.hash.indexOf("?");e>-1&&(t=y(location.hash.substring(e+1)))}return t?t[e]:void 0}function F(e){let t=[];return e.rules.forEach(e=>{if(e.when&&e.then&&e.then.length>0){let n=new Map;for(let i of(k(e.when,0,n),n.size>0&&e.then.forEach(e=>x(e,n)),n.values()))i.forEach(e=>{e.notification&&t.push(e)})}}),t}function k(e,t,n){if(!e)return;let i=[];e.groups&&e.groups.forEach(e=>{e.items&&e.items.forEach(e=>{i.push(e)})}),e.items&&e.items.forEach(e=>{i.push(e)}),i&&i.forEach(e=>{if(e.assets&&e.assets.attributes){let i=[];if(w(e.assets.attributes,i),i.length>0){let o=e.tag||t.toString();n.set(o,i)}}})}function w(e,t){e&&(e.items.forEach(e=>{e.value&&("radial"===e.value.predicateType||"rect"===e.value.predicateType)&&t.push({predicate:e.value})}),e.groups&&e.groups.forEach(e=>w(e,t)))}function x(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){let n=e.target;if(n&&n.conditionAssets){let i=t.get(n.conditionAssets);i&&i.forEach(t=>{t.notification=e.notification.message})}else for(let n of t.values())n.forEach(t=>{t.notification=e.notification.message})}}let E=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function A(e){return!!e&&(e=e.trim()).length>0&&(E.test(e)||T(e)||L(e))}function T(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function L(e){return"-*"===(e=null!=e?e.trim():void 0)}function C(e){return!!e&&"object"==typeof e}function M(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=>M(e[n],t[n]))}return!1}function D(e,t){let n=(e,t)=>(0,b.transform)(e,function(e,i,o){M(i,null==t?void 0:t[o])||(e[o]=C(i)&&C(null==t?void 0:t[o])?n(i,null==t?void 0:t[o]):i)});return n(e,t)}function S(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}function I(e){return null==e?"":e.split(" ").map((e,t)=>0===t?e[0].toLowerCase()+e.substring(1):e[0].toUpperCase()+e.substring(1)).join("")}function O(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,n,i)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!i[n-1]||"_"===i[n-1],o=n+1<i.length&&i[n+1]&&"_"!==i[n+1],r=n+3>i.length||!i[n+1]&&!i[n+3];(!t||o)&&(e=" "+e),!o&&(t||r)||(e=e.toLowerCase())}return e}).join("").trim()}function Y(e,t){if(t===e)return!0;let n=e.endsWith("*"),i=!n&&e.startsWith("*"),o=!n&&!i&&e.startsWith("^")&&e.endsWith("$");if(n&&t.startsWith(e.substr(0,e.length-1))||i&&t.endsWith(e.substr(1)))return!0;if(o)try{return new RegExp(e).test(t)}catch(e){console.error("Failed to compile needle as a RegExp: "+e)}return!1}function R(e){if(e)return 1===e.length?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function N(e,t){return Object.keys(e).find(n=>e[n]===t)}function B(e){(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))).setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}let P=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function H(e,t,n,i,o,r,a){let c="";if(r?Array.isArray(r)?c+=r.toString().replace(" ",""):c+=r.toString():c+="0",c+=" ",o?Array.isArray(o)?c+=o.toString().replace(" ",""):c+=o.toString():c+="0",c+=" ",i?Array.isArray(i)?c+=i.toString().replace(" ",""):c+=i.toString():c+="0",c+=" ",n?Array.isArray(n)?c+=n.toString().replace(" ",""):c+=n.toString():c+="*",c+=" ",t)if(Array.isArray(t))if("number"==typeof t[0]){let e=[];t.forEach(t=>{e.push(P[t].toString())}),c+=e.toString().replace(" ","")}else c+=t.toString().replace(" ","");else c+=t.toString();else c+="*";return c+=" ",a?c+=a.toString():c+="?",c+=" ",e?Array.isArray(e)?c+=e.toString().replace(" ",""):c+=e:c+="*",c}function j(e){return H(e.getFullYear(),P[e.getMonth()],[e.getDate()],[e.getHours()],[e.getMinutes()])}function z(e,t){let n=e.split(" ");if(!Number.isNaN(Number(n[0]))&&!Number.isNaN(Number(n[1]))&&!Number.isNaN(Number(n[2]))&&(!Number.isNaN(Number(n[3]))||"*"==n[3])){let e=(!Number.isNaN(Number(n[6]))?n[6]:new Date().getFullYear()).toString(),i="";i=1==(i="*"!=n[4]?P.indexOf(n[4]).toString():new Date().getMonth().toString()).length?"0"+i:i;let o=1==n[3].length&&"*"!=n[3]?"0"+n[3]:n[3].replace("*","01"),r=1==n[2].length&&"*"!=n[2]?"0"+n[2]:n[2].replace("*","00"),a=1==n[1].length&&"*"!=n[1]?"0"+n[1]:n[1].replace("*","00"),c=1==n[0].length&&"*"!=n[0]?"0"+n[0]:n[0].replace("*","00");if(e.length>0&&i.length>0)if(t)return h().utc({year:Number(e),month:Number(i),date:Number(o),hour:Number(r),minute:Number(a),second:Number(c)}).toISOString();else return h()({year:Number(e),month:Number(i),date:Number(o),hour:Number(r),minute:Number(a),second:Number(c)}).toISOString()}}function U(e,t,n){let i="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(i)?t.meta[i]:n&&n.meta?n.meta[i]:void 0}function $(e,t,n){let i="string"==typeof e?e:e.name;return!!(t&&t.meta&&t.meta.hasOwnProperty(i)||n&&n.meta&&n.meta.hasOwnProperty(i))}function W(e){return!V(e)}function V(e){return!!((null==e?void 0:e.jsonType)==="object"||(null==e?void 0:e.arrayDimensions)&&e.arrayDimensions>0)}function G(){return l.NS.getMetaItemDescriptors().filter(e=>W(l.NS.getValueDescriptor(e.type)))}function q(){return l.NS.getMetaItemDescriptors().filter(e=>V(l.NS.getValueDescriptor(e.type)))}function X(e){return("string"==typeof e&&(e=l.NS.getAssetDescriptor(e)),e)?m.ZP.t("label.asset."+e.name,{defaultValue:O(e.name)}):""}function K(e){if(!e)return m.ZP.t("label.value.unknown",{defaultValue:"Unknown"});let t="string"==typeof e?e:e.name;return m.ZP.t("label.value."+t,{defaultValue:O(t||"")})}function J(e,t){if(e)return m.ZP.t("label.allowedValue."+e,{defaultValue:t||O(e||""),nsSeparator:!1})}function Z(e,t){let n="string"==typeof e?l.NS.getMetaItemDescriptor(e):e;return n?{name:n.name,type:n.type,value:t}:{name:typeof e,type:l.NS.resolveValueTypeFromValue(t),value:t}}function Q(e,t,n,i,o){return et(e,t,n,i,!0,o)}function ee(e,t,n,i,o){return et(e||Z(t,null),t,n,i,!1,o)}function et(e,t,n,i,o,r){let a=eb("label",e,t,n,o),c="";if(a||(a=U("label",e,t&&t.meta?t:void 0)),i&&(c=ea(eh("units",e,t,n,o))),!a){let n=e?e.name:t?"string"==typeof t?t:t.name:void 0;a=r||(n?O(n):void 0)}return a?a+(c?" ("+c+")":""):c}function en(e,t,n,i,o){return eo(e,t,n,i,!0,o)}function ei(e,t,n,i,o){return eo(e||Z(t,null),t,n,i,!1,o)}function eo(e,t,n,i,o,r){let a=er(e?e.value:void 0,()=>eh("format",e,t,n,o),void 0,r),c=ed(e,t,n);return i&&c&&c.length&&(a=ea(eh("units",e,t,n,o),a)),a}function er(e,t,n,i){let o="";if(null==e)o=i||"";else if("string"==typeof e)o=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let i=t&&t();if(i&&0!==Object.keys(i).length)switch("number"==typeof e?i.asBoolean?e=!!e:i.asDate&&(e=new Date(e)):"boolean"==typeof e&&i.asNumber&&(e=+!!e),typeof e){case"number":o=new Intl.NumberFormat(n||m.ZP.language,i).format(e);break;case"boolean":i.asOnOff&&(o=e?m.ZP.t("on"):m.ZP.t("off")),i.asOpenClosed&&(o=e?m.ZP.t("open"):m.ZP.t("closed")),i.asPressedReleased&&(o=e?m.ZP.t("pressed"):m.ZP.t("released"));break;case"object":if(i.momentJsFormat)o=h()(e).format(i.momentJsFormat);else if(i.iso8601)o=e.toISOString();else if(i.week){let t=B(e);o="2-digit"===i.week?String(t).padStart(2,"0"):Number(t).toString(10)}else o=new Intl.DateTimeFormat(n||m.ZP.language,i).format(e)}else o=Object(e).toString()}return o}function ea(e,t){if(!e)return"";t||(t="");let n=e.map((e,n)=>{if(3!==e.length||e.toUpperCase()!==e)return m.ZP.t(["units."+e,"or:units."+e]);{let i=new Intl.NumberFormat(m.ZP.language,{currency:e,style:"currency"}).formatToParts();if(0!==n||"currency"!==i[0].type)return"currency"===i[0].type?i[0].value:i[i.length-1].value;if(!t)return i[0].value;t=i[0].value+t}}).join("");return t.length>0?t+" "+n:n}function ec(e,t,n){return eh("constraints",e,t,n,!0)}function es(e,t,n){return eh("constraints",e||Z(t,null),t,n,!1)}function ed(e,t,n){return eh("units",e,t,n,!0)}function el(e,t,n){return eh("units",e||Z(t,null),t,n,!1)}function em(e,t,n){return eh("format",e,t,n,!0)}function eu(e,t,n){return eh("format",e||Z(t,null),t,n,!1)}function ef(e,t,n){if(e&&!t)return Object.assign({},e);if(t&&!e)return Object.assign({},t);let i=Object.assign({},e),o=[];return Object.entries(t).forEach(([e,t])=>{ep(i,o,e,t,n)}),i}function ep(e,t,n,i,o){let r=e;t.forEach(e=>{r.hasOwnProperty(e)||(r[e]={}),r=r[e]}),r&&(r.hasOwnProperty(n)?null==i?delete r[n]:Array.isArray(r[n])?o?r[n]=[...r[n],...i]:r[n]=[...i]:"object"==typeof i?r[n]=ef(Object.assign({},r[n]),i,o):r[n]=i:null==i?delete r[n]:Array.isArray(i)?r[n]=[...i]:"object"==typeof i?r[n]=Object.assign({},i):r[n]=i)}function eh(e,t,n,i,o){let r,a=[],c=eb(e,t&&"string"==typeof t?t:t?t.name:n?"string"==typeof n?n:n.name:void 0,n,i,o);if(c&&(r=JSON.parse(c)))if("format"!==e)return r;else a.push(r);if(t&&t.meta&&(r=U(e,t,n)))if("format"!==e)return r;else a.push(r);if(n&&"string"!=typeof n&&n.hasOwnProperty(e)){if(r=n[e],"format"!==e)return r;a.push(r)}if(n&&n.type){if(r=l.NS.getValueDescriptor(n.type)[e],"format"!==e)return r;a.push(r)}if("format"!==e||0===a.length)return r;let s={};return a.reverse().forEach(e=>{s=Object.assign(Object.assign({},s),e)}),s}function eb(e,t,n,i,o,r){let a;if(t?a="string"==typeof t?t:t.name:n&&(a="string"==typeof n?n:n.name),!a)return;let c=[],s=e+"."+(o?"attribute":"meta")+".";if(i&&c.push(s+i+"."+a),n&&"string"!=typeof n&&(c.push(s+n.type+"."+a),c.push(s+n.type)),c.push(s+a),c.length>0)return m.ZP.t(c,{defaultValue:r||""})}function e_(e,t){let n=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[n];else{let i=e.attributes[n];i&&(i.value=t.value,i.timestamp=t.timestamp)}return Object.assign({},e)}function eg(e){return new Promise((t,n)=>{let i=document.createElement("script");i.type="text/javascript",i.src=e,i.addEventListener("load",e=>t(e),!1),i.addEventListener("error",e=>n(e),!1),document.body.appendChild(i)})}function ey(e){return(t,n)=>{let i=e(t),o=e(n);return i||o?i&&!o?1:!i&&o?-1:i-o:0}}function ev(e){return(t,n)=>{let i=e(t),o=e(n);return i||o?i&&!o?1:!i&&o?-1:i.localeCompare(o):0}}function eF(e,t){let n=new _;return e.dispatchEvent(t),window.setTimeout(()=>{n.resolve(t.detail)}),n.promise}function ek(e){return new Promise((t,n)=>{let i=new FileReader;i.readAsDataURL(e),i.onload=()=>{t(i.result)},i.onerror=e=>{n(e)}})}var ew=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let ex=n(9916);class eE{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 i=new URLSearchParams(window.location.search),o=i.get("consoleName"),r=i.get("consoleVersion"),a=i.get("consolePlatform"),c=i.get("consoleProviders"),s=i.get("consoleAutoEnable"),d=c&&c.length>0?c.split(" "):["push"];this._pendingProviderEnables=d;let l=eE._createConsoleRegistration(),m=window.localStorage.getItem("OpenRemoteConsole:"+e);if(m)try{let e=JSON.parse(m);e.id&&(l.id=e.id),e.name&&(l.name=e.name),e.providers&&(l.providers=e.providers),e.apps&&(l.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let u=l.providers;for(let e of(l.providers={},d)){let t=u&&u.hasOwnProperty(e)?u[e]:{enabled:!1,disabled:!1};l.providers[e]=t}let f=nt.getAppName();f.length>0&&0>l.apps.indexOf(f)&&l.apps.push(f),this._registration=l,o&&(l.name=o),r&&(l.version=r),a&&(l.platform=a),s&&(this._autoEnable="TRUE"===s||"true"===s)}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 ew(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 ew(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 ew(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},i=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=i.hasPermission,this._registration.providers[e].success=i.success,this._registration.providers[e].enabled=i.success,this._registration.providers[e].data=i.data;let o=this._pendingProviderEnables.indexOf(e);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),i})}disableProvider(e){return ew(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 ew(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 i=new _,o=()=>{delete this._pendingProviderPromises[n],i.reject("No response from provider")};return this._pendingProviderPromises[n]=[i,window.setTimeout(o,5e3)],this._doSendProviderMessage(e),i.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={}),nt.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 ew(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,i=t.action,o=this._pendingProviderPromises[n+i];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[n+i],o[0].resolve(t));let r=this._providerMessageListeners[n+i];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:ex.name,version:ex.version,platform:ex.os.toString(),apps:[],model:((ex.manufacturer?ex.manufacturer+" ":"")+(ex.product?ex.product:"")).trim()}}_initialiseProvider(e){return ew(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)}})}}var eA=n(3653),eT=n.n(eA);class eL{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:eK`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,i,o){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}/${t}/${n}/${i}`,options:o})}}class eC{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:eK`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:eK`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:eK`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:eK`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:eK`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:eK`service/${e}/${t}`,options:n})}}class eM{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:eK`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:eK`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`asset/datapoint/${e}/${t}`,data:n,options:i})}}class eD{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:eK`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:eK`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:eK`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:eK`configuration/manager/image/${e}`,options:t})}}class eS{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:eK`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:eK`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:eK`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:eK`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`realm/${e}`,data:t,options:n})}}class eI{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:eK`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:eK`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:eK`flow/${e}`,options:t})}}class eO{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:eK`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:eK`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:eK`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:eK`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:eK`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:eK`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:eK`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:eK`alarm/${e}/assets`,queryParams:t,options:n})}}class eY{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`asset/predicted/${e}/${t}`,data:n,options:i})}writePredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`asset/predicted/${e}/${t}`,data:n,options:i})}}class eR{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:eK`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:eK`info`,options:e})}}class eN{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:eK`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:eK`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:eK`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:eK`dashboard/${e}/${t}`,options:n})}}class eB{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:eK`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:eK`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:eK`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:eK`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:eK`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:eK`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:eK`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/${e}`,data:t,options:n})}}class eP{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:eK`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`agent/assetImport/${e}`,queryParams:n,data:t,options:i})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:eK`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class eH{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:eK`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:eK`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:eK`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:eK`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:eK`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:eK`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:eK`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:eK`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/reset-password/${t}`,data:n,options:i})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/userRealmRoles/${t}`,data:n,options:i})}getUserClientRoles(e,t,n,i){return this.httpClient.request({method:"GET",url:eK`user/${e}/userRoles/${t}/${n}`,options:i})}updateUserClientRoles(e,t,n,i,o){return this.httpClient.request({method:"PUT",url:eK`user/${e}/userRoles/${t}/${n}`,data:i,options:o})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:eK`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/${t}/roles`,data:n,options:i})}get(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/${t}`,options:n})}}class ej{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:eK`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:eK`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:eK`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:eK`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`notification/${e}/acknowledged`,queryParams:n,data:t,options:i})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:eK`notification/${e}/delivered`,queryParams:t,options:n})}}class ez{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:eK`console/register`,data:e,options:t})}}class eU{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:eK`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:eK`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/status/${e}`,options:t})}}class e${constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:eK`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:eK`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:eK`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/valueDescriptors`,queryParams:e,options:t})}}class eW{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:eK`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:eK`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:eK`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:eK`provisioning/${e}`,data:t,options:n})}}class eV{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:eK`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:eK`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:eK`apps/info`,options:e})}}class eG{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:eK`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:eK`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:eK`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:eK`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:eK`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:eK`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:eK`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:eK`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:eK`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:eK`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:eK`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:eK`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,i){return this.httpClient.request({method:"DELETE",url:eK`asset/user/link/${e}/${t}/${n}`,options:i})}get(e,t){return this.httpClient.request({method:"GET",url:eK`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/attribute/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,i,o){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/attribute/${t}/${n}`,data:i,options:o})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/child`,queryParams:t,options:n})}}class eq{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:eK`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:eK`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:eK`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:eK`syslog/event`,queryParams:e,options:t})}}class eX{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:eK`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:eK`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:eK`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:eK`map/getCustomMapInfo`,options:e})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:eK`map/js`,options:e})}getTile(e,t,n,i){return this.httpClient.request({method:"GET",url:eK`map/tile/${e}/${t}/${n}`,options:i})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:eK`map/upload`,queryParams:e,options:t})}}function eK(e,...t){let n="";for(let i=0;i<t.length;i++)n+=e[i],n+=encodeURIComponent(t[i]);return n+e[e.length-1]}class eJ{constructor(e,t=eT().create()){this._gatewayServiceResource=new eQ(e,t),this._externalServiceResource=new e0(e,t),this._assetDatapointResource=new e1(e,t),this._configurationResource=new e2(e,t),this._realmResource=new e5(e,t),this._flowResource=new e3(e,t),this._alarmResource=new e4(e,t),this._assetPredictedDatapointResource=new e6(e,t),this._statusResource=new e8(e,t),this._dashboardResource=new e7(e,t),this._rulesResource=new e9(e,t),this._agentResource=new te(e,t),this._userResource=new tt(e,t),this._notificationResource=new tn(e,t),this._consoleResource=new ti(e,t),this._gatewayClientResource=new to(e,t),this._assetModelResource=new tr(e,t),this._provisioningResource=new ta(e,t),this._appResource=new tc(e,t),this._assetResource=new ts(e,t),this._syslogResource=new td(e,t),this._mapResource=new tl(e,t),this._assetResource=new ts(e,t)}get GatewayServiceResource(){return this._gatewayServiceResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetDatapointResource(){return this._assetDatapointResource}get ConfigurationResource(){return this._configurationResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AlarmResource(){return this._alarmResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get StatusResource(){return this._statusResource}get DashboardResource(){return this._dashboardResource}get RulesResource(){return this._rulesResource}get AgentResource(){return this._agentResource}get UserResource(){return this._userResource}get NotificationResource(){return this._notificationResource}get ConsoleResource(){return this._consoleResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetModelResource(){return this._assetModelResource}get ProvisioningResource(){return this._provisioningResource}get AppResource(){return this._appResource}get AssetResource(){return this._assetResource}get SyslogResource(){return this._syslogResource}get MapResource(){return this._mapResource}}class eZ{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 eQ extends eL{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e0 extends eC{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e1 extends eM{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e2 extends eD{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e5 extends eS{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e3 extends eI{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e4 extends eO{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e6 extends eY{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e8 extends eR{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e7 extends eN{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e9 extends eB{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class te extends eP{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tt extends eH{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tn extends ej{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ti extends ez{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class to extends eU{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tr extends e${constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ta extends eW{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tc extends eV{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ts extends eG{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class td extends eq{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tl extends eX{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}eT().isAxiosError;class tm{get api(){return this._client}constructor(){this._axiosInstance=eT().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>f().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 eJ(e,this._axiosInstance)}}let tu=new tm;var tf=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};!function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING"}(i||(i={}));let tp="SUBSCRIBED:",th="UNAUTHORIZED:",tb="TRIGGERED:",t_="EVENT:";class tg{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=ty.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=i.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){S(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===i.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(i.CONNECTING),this._connectingDeferred=new _,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=ty.MIN_RECONNECT_DELAY,this._onStatusChanged(i.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!==i.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new _};return null!=this._pendingSubscription||this._status!==i.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 tf(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===i.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==i.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return tf(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,o="AssetEvent"+tg._subscriptionCounter++;if(!this._assetEventPromise){let e;nt.authenticated||(e={filterType:"asset",realm:nt.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(o,e=>{let t=e.asset.id;i?i.find(e=>t===e)&&n(e):e.asset.realm===nt.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(i&&t){let e={messageID:"read-assets:"+i.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(o)&&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),o&&this.unsubscribe(o),t}return o})})}subscribeAttributeEvents(e,t,n){return tf(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0],o=i?e.map(e=>e.id):e,r=i?e:void 0,a="AttributeEvent"+tg._subscriptionCounter++;if(!this._attributeEventPromise){let e;nt.authenticated||(e={filterType:"asset",realm:nt.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let c=t=>{let r=t.ref;i?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):o?o.find(e=>r.id===e)&&n(t):t.realm===nt.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,c),this._attributeEventPromise.then(()=>{try{if(t&&o){let e={messageID:"read-assets:"+o.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:o}};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))&&c({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===i.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===i.CONNECTED&&this._onStatusChanged(i.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(i.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<ty.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(ty.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}tg.MIN_RECONNECT_DELAY=0,tg.MAX_RECONNECT_DELAY=3e4,tg._subscriptionCounter=0;class ty extends tg{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="+nt.config.realm;return nt.authenticated&&(e+="&Authorization="+nt.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new _,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(tp)){let e=JSON.parse(t.substring(tp.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(th)){let e=JSON.parse(t.substring(th.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(tb)){let e=JSON.parse(t.substring(tb.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(t_)){let e=JSON.parse(t.substring(t_.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 _,e.subscriptionId||(e.subscriptionId=ty._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=t_+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 _;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(t_+JSON.stringify(e)),t.promise}}function tv(e){return(tv="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)}ty._subscriptionCounter=1;var tF=[],tk=tF.forEach,tw=tF.slice;function tx(e){return tk.call(tw.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function tE(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":tv(XMLHttpRequest))==="object"}function tA(e){return!!e&&"function"==typeof e.then}function tT(e){return tA(e)?e:Promise.resolve(e)}var tL=n(6850),tC=n.t(tL,2);function tM(e){return(tM="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&&(o="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),tE()&&("undefined"!=typeof global&&global.XMLHttpRequest?r=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(r=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?a=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(a=window.ActiveXObject)),o||!tC||r||a||(o=tL||tC),"function"!=typeof o&&(o=void 0);var tD=function(e,t){if(t&&"object"===tM(t)){var n="";for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},tS=function(e,t,n){o(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)},tI=!1,tO=function(e,t,n,i){e.queryStringParams&&(t=tD(t,e.queryStringParams));var o=tx({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var r="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=tx({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},tI?{}:r);try{tS(t,a,i)}catch(e){if(!r||0===Object.keys(r).length||!e.message||0>e.message.indexOf("not implemented"))return i(e);try{Object.keys(r).forEach(function(e){delete a[e]}),tS(t,a,i),tI=!0}catch(e){i(e)}}},tY=function(e,t,n,i){n&&"object"===tM(n)&&(n=tD("",n).slice(1)),e.queryStringParams&&(t=tD(t,e.queryStringParams));try{(o=r?new r:new a("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var o,c=e.customHeaders;if(c="function"==typeof c?c():c)for(var s in c)o.setRequestHeader(s,c[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(e){console&&console.log(e)}};let tR=function(e,t,n,i){return("function"==typeof n&&(i=n,n=void 0),i=i||function(){},o)?tO(e,t,n,i):tE()||"function"==typeof ActiveXObject?tY(e,t,n,i):void i(Error("No fetch and no xhr implementation found!"))};function tN(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tB(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tP(e,t,n){return t&&tB(e.prototype,t),n&&tB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tj=function(){return{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){return tH({},t,n||"")},request:tR,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},tz=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};tN(this,e),this.services=t,this.options=n,this.allOptions=i,this.type="backend",this.init(t,n,i)}return tP(e,[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=tx(n,this.options||{},tj()),this.allOptions=i,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,i,o){var r=this,a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,n)),(a=tT(a)).then(function(a){if(!a)return o(null,{});var c=r.services.interpolator.interpolate(a,{lng:e.join("+"),ns:n.join("+")});r.loadUrl(c,o,t,i)})}},{key:"loadUrl",value:function(e,t,n,i){var o=this;this.options.request(this.options,e,void 0,function(r,a){var c,s;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{c="string"==typeof a.data?o.options.parse(a.data,n,i):a.data}catch(t){s="failed parsing "+e+" to json"}if(s)return t(s,!1);t(null,c)})}},{key:"create",value:function(e,t,n,i,o){var r=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,i),c=0,s=[],d=[];e.forEach(function(n){var i=r.options.addPath;"function"==typeof r.options.addPath&&(i=r.options.addPath(n,t));var l=r.services.interpolator.interpolate(i,{lng:n,ns:t});r.options.request(r.options,l,a,function(t,n){c+=1,s.push(t),d.push(n),c===e.length&&o&&o(s,d)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,i=t.languageUtils,o=t.logger,r=n.language;if(!r||"cimode"!==r.toLowerCase()){var a=[],c=function(e){i.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};c(r),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return c(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(i,r){i&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),i),!i&&r&&o.log("loaded namespace ".concat(e," for language ").concat(t),r),n.loaded("".concat(t,"|").concat(e),i,r)})})})}}}]),e}();tz.type="backend";let tU=tz;var t$=n(4846),tW=n(921);class tV extends Error{}function tG(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function tq(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{return tG(t)}catch(e){return atob(t)}}function tX(e,t){let n;if("string"!=typeof e)throw new tV("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),o=e.split(".")[i];if("string"!=typeof o)throw new tV(`Invalid token specified: missing part #${i+1}`);try{n=tq(o)}catch(e){throw new tV(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new tV(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}if(tV.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function tK(e){if(!(this instanceof tK))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,i=this,o=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),c=0;c<a.length;c++)(-1!==a[c].src.indexOf("keycloak.js")||-1!==a[c].src.indexOf("keycloak.min.js"))&&-1!==a[c].src.indexOf("version=")&&(i.iframeVersion=a[c].src.substring(a[c].src.indexOf("version=")+8).split("&")[0]);var s=!0,d=R(console.info),l=R(console.warn);function m(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 i=0;i<t.length;i++)t[i]=Math.floor(256*Math.random());return t}function u(e){return f(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function f(e,t){for(var n=m(e),i=Array(e),o=0;o<e;o++)i[o]=t.charCodeAt(n[o]%t.length);return String.fromCharCode.apply(null,i)}function p(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return tJ(new Uint8Array(tW.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}function h(e){return JSON.stringify({id_token:{acr:e}})}function b(){return void 0===i.authServerUrl?void 0:"/"==i.authServerUrl.charAt(i.authServerUrl.length-1)?i.authServerUrl+"realms/"+encodeURIComponent(i.realm):i.authServerUrl+"/realms/"+encodeURIComponent(i.realm)}function _(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function g(e,t){var n=e.code,o=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&i.onActionUpdate&&i.onActionUpdate(e.kc_action_status),o){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)i.login(e.loginOptions);else{var c={error:o,error_description:e.error_description};i.onAuthError&&i.onAuthError(c),t&&t.setError(c)}else t&&t.setSuccess();return}if("standard"!=i.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=i.flow&&n){var l="code="+n+"&grant_type=authorization_code",m=i.endpoints.token(),u=new XMLHttpRequest;u.open("POST",m,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),u.withCredentials=!0,u.onreadystatechange=function(){if(4==u.readyState)if(200==u.status){var e=JSON.parse(u.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===i.flow),C()}else i.onAuthError&&i.onAuthError(),t&&t.setError()},u.send(l)}function f(n,o,r,c){F(n,o,r,a=(a+new Date().getTime())/2),s&&i.idTokenParsed&&i.idTokenParsed.nonce!=e.storedNonce?(d("[KEYCLOAK] Invalid nonce, clearing token"),i.clearToken(),t&&t.setError()):c&&(i.onAuthSuccess&&i.onAuthSuccess(),t&&t.setSuccess())}}function y(t){var n=A();function o(e){e?i.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}}:i.endpoints={authorize:function(){return b()+"/protocol/openid-connect/auth"},token:function(){return b()+"/protocol/openid-connect/token"},logout:function(){return b()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=b()+"/protocol/openid-connect/login-status-iframe.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=b()+"/protocol/openid-connect/3p-cookies/step1.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},register:function(){return b()+"/protocol/openid-connect/registrations"},userinfo:function(){return b()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(c=e):c="keycloak.json",c){var r=new XMLHttpRequest;r.open("GET",c,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||v(r)){var e=JSON.parse(r.responseText);i.authServerUrl=e["auth-server-url"],i.realm=e.realm,i.clientId=e.resource,o(null),n.setSuccess()}else n.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";i.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var c,s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||v(r)?(o(JSON.parse(r.responseText)),n.setSuccess()):n.setError())},r.send()}else o(a),n.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";i.authServerUrl=e.url,i.realm=e.realm,o(null),n.setSuccess()}}return n.promise}function v(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function F(e,t,n,o){if(i.tokenTimeoutHandle&&(clearTimeout(i.tokenTimeoutHandle),i.tokenTimeoutHandle=null),t?(i.refreshToken=t,i.refreshTokenParsed=tX(t)):(delete i.refreshToken,delete i.refreshTokenParsed),n?(i.idToken=n,i.idTokenParsed=tX(n)):(delete i.idToken,delete i.idTokenParsed),e){if(i.token=e,i.tokenParsed=tX(e),i.sessionId=i.tokenParsed.sid,i.authenticated=!0,i.subject=i.tokenParsed.sub,i.realmAccess=i.tokenParsed.realm_access,i.resourceAccess=i.tokenParsed.resource_access,o&&(i.timeSkew=Math.floor(o/1e3)-i.tokenParsed.iat),null!=i.timeSkew&&(d("[KEYCLOAK] Estimated time difference between browser and server is "+i.timeSkew+" seconds"),i.onTokenExpired)){var r=(i.tokenParsed.exp-new Date().getTime()/1e3+i.timeSkew)*1e3;d("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?i.onTokenExpired():i.tokenTimeoutHandle=setTimeout(i.onTokenExpired,r)}}else delete i.token,delete i.tokenParsed,delete i.subject,delete i.realmAccess,delete i.resourceAccess,i.authenticated=!1}function k(){var e="0123456789abcdef",t=f(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 w(e){var t=x(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 x(e){switch(i.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,o,r=e.indexOf("?"),a=e.indexOf("#");if("query"===i.responseMode&&-1!==r?(n=e.substring(0,r),""!==(o=E(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+o.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===i.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(o=E(e.substring(a+1),t)).paramsString&&(n+="#"+o.paramsString)),o&&o.oauthParams){if("standard"===i.flow||"hybrid"===i.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=n,o.oauthParams}else if("implicit"===i.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=n,o.oauthParams}}function E(e,t){for(var n=e.split("&"),i={paramsString:"",oauthParams:{}},o=0;o<n.length;o++){var r=n[o].indexOf("="),a=n[o].slice(0,r);-1!==t.indexOf(a)?i.oauthParams[a]=n[o].slice(r+1):(""!==i.paramsString&&(i.paramsString+="&"),i.paramsString+=n[o])}return i}function A(){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 T(e,t,n){var i=null;return Promise.race([e,new Promise(function(e,o){i=setTimeout(function(){o({error:n})},t)})]).finally(function(){clearTimeout(i)})}function L(){var e=A();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=i.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=_():r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=i.endpoints.checkSessionIframe();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);var o=function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&i.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var o=t[n];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}};return window.addEventListener("message",o,!1),e.promise}function C(){r.enable&&i.token&&setTimeout(function(){M().then(function(e){e&&C()})},1e3*r.interval)}function M(){var e=A();if(r.iframe&&r.iframeOrigin){var t=i.clientId+" "+(i.sessionId?i.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 D(){var e=A();if(r.enable||i.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",i.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(o){t.contentWindow===o.source&&("supported"===o.data||"unsupported"===o.data)&&("unsupported"===o.data&&(l("[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,i.silentCheckSsoFallback&&(i.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess())};window.addEventListener("message",n,!1)}else e.setSuccess();return T(e.promise,i.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function S(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(i.createLoginUrl(e)),A().promise},logout:async function(e){if("GET"===(e?.logoutMethod??i.logoutMethod))return void window.location.replace(i.createLogoutUrl(e));let n=i.createLogoutUrl(e),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:i.idToken,client_id:i.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(o.redirected){window.location.href=o.url;return}if(o.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(i.createRegisterUrl(e)),A().promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return A().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.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)},o=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{}},a=function(e){return Object.keys(e).reduce(function(t,n){return t.push(n+"="+e[n]),t},[]).join(",")},c=function(e){var t=o(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),a(t)},s=function(){return i.redirectUri||"http://localhost"};return{login:function(e){var t=A(),o=c(e),r=n(i.createLoginUrl(e),"_blank",o),a=!1,d=!1,l=function(){d=!0,r.close()};return r.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(g(w(e.url),t),l(),a=!0)}),r.addEventListener("loaderror",function(e){a||(0==e.url.indexOf(s())?(g(w(e.url),t),l(),a=!0):(t.setError(),l()))}),r.addEventListener("exit",function(e){d||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,o=A(),r=n(i.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(s())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?o.setError():(i.clearToken(),o.setSuccess())}),o.promise},register:function(e){var t=A(),o=n(i.createRegisterUrl(),"_blank",c(e));return o.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(o.close(),g(w(e.url),t))}),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return s()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=A(),n=i.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(w(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=A(),n=i.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),i.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=A(),n=i.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(w(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=i.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:i.redirectUri?i.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}i.init=function(e){if(i.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");i.didInitialize=!0,i.authenticated=!1,n=Y();var o=["default","cordova","cordova-native"];if(t=e&&o.indexOf(e.adapter)>-1?S(e.adapter):e&&"object"==typeof e.adapter?e.adapter:window.Cordova||window.cordova?S("cordova"):S(),e){if(void 0!==e.useNonce&&(s=e.useNonce),void 0!==e.checkLoginIframe&&(r.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(r.interval=e.checkLoginIframeInterval),"login-required"===e.onLoad&&(i.loginRequired=!0),e.responseMode)if("query"===e.responseMode||"fragment"===e.responseMode)i.responseMode=e.responseMode;else throw"Invalid value for responseMode";if(e.flow){switch(e.flow){case"standard":i.responseType="code";break;case"implicit":i.responseType="id_token token";break;case"hybrid":i.responseType="code id_token token";break;default:throw"Invalid value for flow"}i.flow=e.flow}if(null!=e.timeSkew&&(i.timeSkew=e.timeSkew),e.redirectUri&&(i.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(i.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),"boolean"==typeof e.silentCheckSsoFallback?i.silentCheckSsoFallback=e.silentCheckSsoFallback:i.silentCheckSsoFallback=!0,void 0!==e.pkceMethod){if("S256"!==e.pkceMethod&&!1!==e.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${e.pkceMethod}.`);i.pkceMethod=e.pkceMethod}else i.pkceMethod="S256";"boolean"==typeof e.enableLogging?i.enableLogging=e.enableLogging:i.enableLogging=!1,"POST"===e.logoutMethod?i.logoutMethod="POST":i.logoutMethod="GET","string"==typeof e.scope&&(i.scope=e.scope),"string"==typeof e.acrValues&&(i.acrValues=e.acrValues),"number"==typeof e.messageReceiveTimeout&&e.messageReceiveTimeout>0?i.messageReceiveTimeout=e.messageReceiveTimeout:i.messageReceiveTimeout=1e4}i.responseMode||(i.responseMode="fragment"),i.responseType||(i.responseType="code",i.flow="standard");var a=A(),c=A();c.promise.then(function(){i.onReady&&i.onReady(i.authenticated),a.setSuccess(i.authenticated)}).catch(function(e){a.setError(e)});var d=y();function l(){var t=function(t){t||(o.prompt="none"),e&&e.locale&&(o.locale=e.locale),i.login(o).then(function(){c.setSuccess()}).catch(function(e){c.setError(e)})},n=function(){var e=document.createElement("iframe"),t=i.createLoginUrl({prompt:"none",redirectUri:i.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){if(t.origin===window.location.origin&&e.contentWindow===t.source){var i=w(t.data);g(i,c),document.body.removeChild(e),window.removeEventListener("message",n)}};window.addEventListener("message",n)},o={};switch(e.onLoad){case"check-sso":r.enable?L().then(function(){M().then(function(e){e?c.setSuccess():i.silentCheckSsoRedirectUri?n():t(!1)}).catch(function(e){c.setError(e)})}):i.silentCheckSsoRedirectUri?n():t(!1);break;case"login-required":t(!0);break;default:throw"Invalid value for onLoad"}}function m(){var t=w(window.location.href);if(t&&window.history.replaceState(window.history.state,null,t.newUrl),t&&t.valid)return L().then(function(){g(t,c)}).catch(function(e){c.setError(e)});e?e.token&&e.refreshToken?(F(e.token,e.refreshToken,e.idToken),r.enable?L().then(function(){M().then(function(e){e?(i.onAuthSuccess&&i.onAuthSuccess(),c.setSuccess(),C()):c.setSuccess()}).catch(function(e){c.setError(e)})}):i.updateToken(-1).then(function(){i.onAuthSuccess&&i.onAuthSuccess(),c.setSuccess()}).catch(function(t){i.onAuthError&&i.onAuthError(),e.onLoad?l():c.setError(t)})):e.onLoad?l():c.setSuccess():c.setSuccess()}function u(){var e=A(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise}return d.then(function(){u().then(D).then(m).catch(function(e){a.setError(e)})}),d.catch(function(e){a.setError(e)}),a.promise},i.login=function(e){return t.login(e)},i.createLoginUrl=function(e){var o,r=k(),a=k(),c=t.redirectUri(e),d={state:r,nonce:a,redirectUri:encodeURIComponent(c),loginOptions:e};e&&e.prompt&&(d.prompt=e.prompt),o=e&&"register"==e.action?i.endpoints.register():i.endpoints.authorize();var l=e&&e.scope||i.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var m=o+"?client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+encodeURIComponent(c)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(i.responseMode)+"&response_type="+encodeURIComponent(i.responseType)+"&scope="+encodeURIComponent(l);if(s&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(h(e.acr))),(e&&e.acrValues||i.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||i.acrValues)),i.pkceMethod){var f=u(96);d.pkceCodeVerifier=f,m+="&code_challenge="+p(i.pkceMethod,f)+"&code_challenge_method="+i.pkceMethod}return n.add(d),m},i.logout=function(e){return t.logout(e)},i.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??i.logoutMethod))return i.endpoints.logout();var n=i.endpoints.logout()+"?client_id="+encodeURIComponent(i.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return i.idToken&&(n+="&id_token_hint="+encodeURIComponent(i.idToken)),n},i.register=function(e){return t.register(e)},i.createRegisterUrl=function(e){return e||(e={}),e.action="register",i.createLoginUrl(e)},i.createAccountUrl=function(e){var n=b(),o=void 0;return void 0!==n&&(o=n+"/account?referrer="+encodeURIComponent(i.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},i.accountManagement=function(){return t.accountManagement()},i.hasRealmRole=function(e){var t=i.realmAccess;return!!t&&t.roles.indexOf(e)>=0},i.hasResourceRole=function(e,t){if(!i.resourceAccess)return!1;var n=i.resourceAccess[t||i.clientId];return!!n&&n.roles.indexOf(e)>=0},i.loadUserProfile=function(){var e=b()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=A();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.profile=JSON.parse(t.responseText),n.setSuccess(i.profile)):n.setError())},t.send(),n.promise},i.loadUserInfo=function(){var e=i.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=A();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.userInfo=JSON.parse(t.responseText),n.setSuccess(i.userInfo)):n.setError())},t.send(),n.promise},i.isTokenExpired=function(e){if(!i.tokenParsed||!i.refreshToken&&"implicit"!=i.flow)throw"Not authenticated";if(null==i.timeSkew)return d("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=i.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+i.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},i.updateToken=function(e){var t=A();if(!i.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,d("[KEYCLOAK] Refreshing token: forced refresh")):(!i.tokenParsed||i.isTokenExpired(e))&&(n=!0,d("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+i.refreshToken,a=i.endpoints.token();if(o.push(t),1==o.length){var c=new XMLHttpRequest;c.open("POST",a,!0),c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.withCredentials=!0,r+="&client_id="+encodeURIComponent(i.clientId);var s=new Date().getTime();c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status){d("[KEYCLOAK] Token refreshed"),s=(s+new Date().getTime())/2;var e=JSON.parse(c.responseText);F(e.access_token,e.refresh_token,e.id_token,s),i.onAuthRefreshSuccess&&i.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{l("[KEYCLOAK] Failed to refresh token"),400==c.status&&i.clearToken(),i.onAuthRefreshError&&i.onAuthRefreshError();for(var t=o.pop();null!=t;t=o.pop())t.setError(!0)}},c.send(r)}}else t.setSuccess(!1)};return r.enable?M().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},i.clearToken=function(){i.token&&(F(null,null,null),i.onAuthLogout&&i.onAuthLogout(),i.loginRequired&&i.login())};var I=function(){if(!(this instanceof I))return new I;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var e=this;function t(){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 i=localStorage.getItem(n);if(i)try{var o=JSON.parse(i).expires;(!o||o<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}e.get=function(e){if(e){var n="kc-callback-"+e,i=localStorage.getItem(n);return i&&(localStorage.removeItem(n),i=JSON.parse(i)),t(),i}},e.add=function(e){t();var n="kc-callback-"+e.state;e.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(e))}},O=function(){if(!(this instanceof O))return new O;var e=this;e.get=function(e){if(e){var o=n("kc-callback-"+e);if(i("kc-callback-"+e,"",t(-100)),o)return JSON.parse(o)}},e.add=function(e){i("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){i(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},i=function(e,t,n){var i=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=i}};function Y(){try{return new I}catch(e){}return new O}function R(e){return function(){i.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}function tJ(e){return btoa(String.fromCodePoint(...e))}var tZ=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let tQ=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=i.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){if(!e.getEventProvider())return void console.log("No event provider available so cannot subscribe");this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect())}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return tZ(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===i.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case i.DISCONNECTED:this._onEventsDisconnect();break;case i.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return tZ(this,void 0,void 0,function*(){let t=!!this._attributeRefs,n=!!this._assetIds,i=this._attributeRefs?this._attributeRefs:this._assetIds;if(i&&i.length>0){if(this._subscriptionIds=[],n){let t=yield e.getEventProvider().subscribeAssetEvents(i,!0,e=>this._onEvent(e)),n=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!M(i,n))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let o=yield e.getEventProvider().subscribeAttributeEvents(i,t,e=>this._onEvent(e)),r=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!M(i,r))return void e.getEventProvider().unsubscribe(o);this._subscriptionIds.push(o)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){M(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){M(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},t0="#4d9d2a",t1="#FFFFFF",t2="#F9F9F9",t5="#CCCCCC",t3="#FFFFFF",t4="#4c4c4c";var t6=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let t8="openremote";function t7(e){let t=e?Object.assign({},e):{};return t.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=t8),t}!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(c||(c={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(s||(s={}));class t9{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 i=n.roles;e.set(t,i)}):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 tu}get language(){return m.ZP.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(m.ZP.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(s.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||t8}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}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 t6(this,void 0,void 0,function*(){this._config&&console.debug("Already initialised"),this._config=t7(e);let t=yield this.loadManagerInfo(),n=new eE(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(s.CONSOLE_READY)});if(this._console=n,"BASIC"===this._config.auth)t=(yield this.doTranslateInit())&&t,t=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(/\/+$/,""),(t=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",t=yield this.doAuthInit())}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(t=(yield this.doTranslateInit())&&t)&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(t=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(s.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)})}loadManagerInfo(){return t6(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(c.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return t6(this,void 0,void 0,function*(){if(m.ZP.isInitialized)return!0;m.ZP.on("initialized",e=>{this._emitEvent(s.TRANSLATE_INIT)}),m.ZP.on("languageChanged",e=>{h().locale(e),this._emitEvent(s.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?h()(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 m.ZP.use(tU).init(e)}catch(e){return console.error(e),this._setError(c.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return t6(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield tu.api.AssetModelResource.getAssetInfos(),t=yield tu.api.AssetModelResource.getMetaItemDescriptors(),n=yield tu.api.AssetModelResource.getValueDescriptors();l.NS._assetTypeInfos=e.data,l.NS._metaItemDescriptors=Object.values(t.data),l.NS._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return t6(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(c.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(tu.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return tu.setTimeout(2e4),tu.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return t6(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new ty(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(c.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===i.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 i.DISCONNECTED:this._onDisconnect();break;case i.CONNECTED:break;case i.CONNECTING:this._emitEvent(s.CONNECTING)}}doConsoleInit(){return t6(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(s.CONSOLE_INIT),!0}catch(e){return this._setError(c.CONSOLE_ERROR),!1}})}doIconInit(){this._config.loadIcons&&(t$.d5.addIconSet("mdi",(0,t$.aT)(ne.managerUrl)),t$.d5.addIconSet("or",(0,t$.bx)(t$.dE.size,t$.dE.icons)))}getConsoleAppConfig(){return t6(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=ne.managerUrl)?e:"")+"/consoleappconfig/"+ne.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return t6(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return t6(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=(null==e?void 0:e.profile)||(yield null==e?void 0:e.loadUserProfile());if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return t6(this,arguments,void 0,function*(e,t=this.rest){return this.authenticated?t?void(yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}})):void console.warn("Tried updating user language, but the REST API is not initialized yet."):void console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload()))}login(e){switch(this._config.auth){case"BASIC":e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}}initialiseBasicAuth(){return t6(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return t6(this,void 0,void 0,function*(){var e,t,n,i;if(!this.config.basicLoginProvider)return;let o={username:(null==(e=this.config.credentials)?void 0:e.username)?null==(t=this.config.credentials)?void 0:t.username:"",password:(null==(n=this.config.credentials)?void 0:n.password)?null==(i=this.config.credentials)?void 0:i.password:"",cancel:!1},r=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!r;){if((o=yield this.config.basicLoginProvider(o.username,o.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!o.username||!o.password)continue;this._basicIdentity.token=btoa(o.username+":"+o.password);let e=!1;try{let t=yield tu.api.UserResource.getCurrent();200===t.status&&(e=!0,this._basicIdentity.user=t.data),e||401!==t.status&&403!==t.status||console.debug("Basic authentication invalid credentials, trying again")}catch(e){console.error("Basic auth failed: ",e)}if(e){console.debug("Basic authentication successful"),r=!0;let e=yield tu.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=e.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}r&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let n=this.roles;return n&&n.has(t)&&n.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return t6(this,void 0,void 0,function*(){var e,t,n,i;try{this._keycloak=new tK({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let o=yield this._getNativeOfflineRefreshToken(),r=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!r&&o)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=o,r=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(r)this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(i=null==(n=this._keycloak)?void 0:n.refreshTokenParsed)?void 0:i.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){return this._authenticated=!1,this._setError(c.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>t6(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return t6(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return t6(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(s.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;this.isMobile()&&(null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return t6(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(s.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(s.ONLINE)}reconnect(){return t6(this,arguments,void 0,function*(e=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>t6(this,void 0,void 0,function*(){var e;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(t){let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e;try{yield this._updateKeycloakAccessToken()}catch(e){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let t=this.events&&this.events.status===i.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+t),!t||(yield null==(e=this.events)?void 0:e.connect())}),n=yield t();if(void 0!==n){if(!n){console.debug("Scheduling another reconnect attempt in (ms): "+(e=Math.min(t9.MAX_RECONNECT_DELAY,e+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return t6(this,arguments,void 0,function*(e=2e3){let t=new AbortController,n=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),n=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===n.status}catch(e){return!1}finally{clearTimeout(n)}})}}t9.MAX_RECONNECT_DELAY=45e3;let ne=new t9,nt=ne},384:function(e,t,n){"use strict";var i,o,r,a,c,s,d,l,m,u,f,p,h,b,_,g,y,v,F,k,w,x,E,A,T,L,C,M,D,S,I,O,Y,R,N,B,P,H,j,z,U,$,W,V,G,q,X,K,J,Z,Q,ee,et,en,ei,eo,er,ea,ec,es,ed,el,em,eu,ef;n.d(t,{NS:()=>ep}),function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(i||(i={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(o||(o={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(r||(r={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(a||(a={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(c||(c={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(s||(s={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(d||(d={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(l||(l={})),function(e){e.EV="EV",e.PHEV="PHEV"}(m||(m={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(u||(u={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(f||(f={})),function(e){e.REQUEST_START="REQUEST_START",e.REQUEST_REPEATING="REQUEST_REPEATING",e.REQUEST_CANCEL="REQUEST_CANCEL",e.READY="READY",e.COMPLETED="COMPLETED",e.RUNNING="RUNNING",e.CANCELLED="CANCELLED"}(p||(p={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(h||(h={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(b||(b={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(_||(_={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(g||(g={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(y||(y={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(v||(v={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX",e.DIFFERENCE="DIFFERENCE",e.COUNT="COUNT",e.SUM="SUM",e.MODE="MODE",e.MEDIAN="MEDIAN"}(F||(F={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(k||(k={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(x||(x={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(E||(E={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(A||(A={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(T||(T={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}(L||(L={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(C||(C={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(M||(M={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(D||(D={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(S||(S={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(I||(I={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(O||(O={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(Y||(Y={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(R||(R={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(N||(N={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(B||(B={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(P||(P={})),function(e){e.AND="AND",e.OR="OR"}(H||(H={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(j||(j={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(z||(z={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(U||(U={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}($||($={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(W||(W={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(V||(V={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(G||(G={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(q||(q={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(X||(X={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(K||(K={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(J||(J={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.READ_SERVICES="read:services",e.WRITE_SERVICES="write:services",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(Z||(Z={})),function(e){e.REGISTER="REGISTER",e.UPDATE="UPDATE",e.DEREGISTER="DEREGISTER"}(Q||(Q={})),function(e){e.AVAILABLE="AVAILABLE",e.UNAVAILABLE="UNAVAILABLE"}(ee||(ee={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(et||(et={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(en||(en={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(ei||(ei={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(eo||(eo={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(er||(er={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(ea||(ea={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(ec||(ec={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.THETHINGSSTACKAGENT="TheThingsStackAgent",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.TCPAGENT="TCPAgent",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.MICROPHONEASSET="MicrophoneAsset",e.MODBUSTCPAGENT="ModbusTcpAgent",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.ROOMASSET="RoomAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.KNXAGENT="KNXAgent",e.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",e.CHIRPSTACKAGENT="ChirpStackAgent",e.WEATHERASSET="WeatherAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.GATEWAYASSET="GatewayAsset",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.MODBUSSERIALAGENT="ModbusSerialAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.ZWAVEAGENT="ZWaveAgent",e.THERMOSTATASSET="ThermostatAsset",e.SHIPASSET="ShipAsset"}(es||(es={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.MQTTPORT="MQTTPort",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.ATMOSPHERICPRESSURE="atmosphericPressure",e.TAGS="tags",e.UNLOCK="unlock",e.MILEAGEMIN="mileageMin",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONSOLENAME="consoleName",e.CONNECTHEADERS="connectHeaders",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.WINDGUSTSPEED="windGustSpeed",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.SOURCEADDRESS="sourceAddress",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.UNITID="unitId",e.STOPBITS="stopBits",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.DATABITS="dataBits",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.SUBSCRIBEQOS="subscribeQos",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.CLOUDCOVERAGE="cloudCoverage",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.APPLICATIONID="applicationId",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.PROXYADDRESS="proxyAddress",e.MQTTHOST="MQTTHost",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.APIKEY="ApiKey",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.ATTRIBUTION="Attribution",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.TENANTID="tenantId",e.HOST="host",e.COUNTOUTMINUTE="countOutMinute",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.COUNTIN="countIn",e.MILEAGECHARGED="mileageCharged",e.PROVISIONWEATHERASSET="ProvisionWeatherAsset",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.SECUREMODE="secureMode",e.MILEAGECAPACITY="mileageCapacity",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.LASTWILLPAYLOAD="lastWillPayload",e.GROUPID="groupId",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex",e.PUBLISHQOS="publishQos"}(ed||(ed={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.AGENTLINKCONFIG="agentLinkConfig",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(el||(el={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.MQTTQOS="MQTTQos",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(em||(em={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(eu||(eu={})),ef||(ef={});class ep{static getAssetDescriptors(){return ep._assetTypeInfos.map(e=>e.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find(t=>t.assetDescriptor.name===e))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;let t=this._assetTypeInfos.find(t=>t.assetDescriptor.name===e);return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;let n=this.getAssetTypeInfo(t||"ThingAsset");if(n&&n.attributeDescriptors)return n.attributeDescriptors.find(t=>t.name===e)}static getValueDescriptor(e){let t;if(!e)return;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find(t=>t.name===e);return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=ep.getValueDescriptor(t)),n=t.jsonType?t:ep.getValueDescriptor(t.type)),!n&&e&&(n=ep.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find(e=>null!=e);for(;Array.isArray(n);)n=n.find(e=>null!=e),t++;let i=this.resolveValueTypeFromValue(n);if(!i)return;for(;t>0;)i+="[]",t--;return i}if(e instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(e,t,n){let i,o;if(t&&"string"!=typeof t)i=t;else{let o=this.getAssetTypeInfo(e||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof t&&(i=this.getAttributeDescriptor(t,o)),!i&&n&&(i={type:n.type,name:n.name,meta:n.meta})}return i&&(o=this.getValueDescriptor(i.type)),[i,o]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find(t=>t.name===e)}static getAssetDescriptorColour(e,t){let n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){let n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}ep._assetTypeInfos=[],ep._metaItemDescriptors=[],ep._valueDescriptors=[]},4846:function(e,t,n){"use strict";n.d(t,{aT:()=>b,bx:()=>h,d5:()=>g,dE:()=>m,s3:()=>y});var i=n(538),o=n(9019),r=n(9069);class a extends o.Xe{constructor(e){if(super(e),this.it=r.Ld,e.type!==o.pX.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===r.Ld||null==e)return this._t=void 0,this.it=e;if(e===r.Jb)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}a.directiveName="unsafeHTML",a.resultType=1,(0,o.XM)(a);class c extends a{}c.directiveName="unsafeSVG",c.resultType=2;let s=(0,o.XM)(c);var d=n(3176),l=n(384);let m={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};var u=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a};let f=n(7319);class p extends CustomEvent{constructor(){super(p.NAME,{bubbles:!0,composed:!0})}}function h(e,t){return{getIconTemplate:n=>{let o=t[n];return o?(0,i.dy)`
|
|
578
|
+
`},1191:function(e,t,n){"use strict";n.d(t,{XA:()=>a,ZT:()=>o,fl:()=>s,pi:()=>r});var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}},488:function(e,t,n){!function(e){"use strict";var t,n=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),i=n&&"a=1"===new n({a:1}).toString(),o=n&&"+"===new n("s=%2B").get("s"),r=n&&"size"in n.prototype,a="__URLSearchParams__",c=!n||function(){var e=new n;return e.append("s"," &"),"s=+%26"===e.toString()}(),s=u.prototype,d=!!(e.Symbol&&e.Symbol.iterator);if(!n||!i||!o||!c||!r){s.append=function(e,t){_(this[a],e,t)},s.delete=function(e){delete this[a][e]},s.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},s.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},s.has=function(e){return y(this[a],e)},s.set=function(e,t){this[a][e]=[""+t]},s.toString=function(){var e,t,n,i,o=this[a],r=[];for(t in o)for(e=0,n=f(t),i=o[t];e<i.length;e++)r.push(n+"="+f(i[e]));return r.join("&")};var l=e.Proxy&&n&&(!o||!c||!i||!r);l?(t=new Proxy(n,{construct:function(e,t){return new e(new u(t[0]).toString())}})).toString=Function.prototype.toString.bind(u):t=u,Object.defineProperty(e,"URLSearchParams",{value:t});var m=e.URLSearchParams.prototype;m.polyfill=!0,!l&&e.Symbol&&(m[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in m||(m.forEach=function(e,t){var n=b(this.toString());Object.getOwnPropertyNames(n).forEach(function(i){n[i].forEach(function(n){e.call(t,n,i,this)},this)},this)}),"sort"in m||(m.sort=function(){var e,t,n,i=b(this.toString()),o=[];for(e in i)o.push(e);for(o.sort(),t=0;t<o.length;t++)this.delete(o[t]);for(t=0;t<o.length;t++){var r=o[t],a=i[r];for(n=0;n<a.length;n++)this.append(r,a[n])}}),"keys"in m||(m.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),h(e)}),"values"in m||(m.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),h(e)}),"entries"in m||(m.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),h(e)}),d&&(m[e.Symbol.iterator]=m[e.Symbol.iterator]||m.entries),"size"in m||Object.defineProperty(m,"size",{get:function(){var e=b(this.toString());if(m===this)throw TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce(function(t,n){return t+e[n].length},0)}})}function u(e){((e=e||"")instanceof URLSearchParams||e instanceof u)&&(e=e.toString()),this[a]=b(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function p(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/ig,function(e){return decodeURIComponent(e)})}function h(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return d&&(n[e.Symbol.iterator]=function(){return n}),n}function b(e){var t={};if("object"==typeof e)if(g(e))for(var n=0;n<e.length;n++){var i=e[n];if(g(i)&&2===i.length)_(t,i[0],i[1]);else throw TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements")}else for(var o in e)e.hasOwnProperty(o)&&_(t,o,e[o]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var r=e.split("&"),a=0;a<r.length;a++){var c=r[a],s=c.indexOf("=");-1<s?_(t,p(c.slice(0,s)),p(c.slice(s+1))):c&&_(t,p(c),"")}}return t}function _(e,t,n){var i="string"==typeof n?n:null!=n&&"function"==typeof n.toString?n.toString():JSON.stringify(n);y(e,t)?e[t].push(i):e[t]=[i]}function g(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==n.g?n.g:"undefined"!=typeof window?window:this)},5037:function(e,t,n){"use strict";n.d(t,{ZP:()=>nt,Zr:()=>d,l6:()=>t5,Ld:()=>tQ,D8:()=>t3,mV:()=>t4,n7:()=>t1,gd:()=>t2,v5:()=>t0});var i,o,r,a,c,s,d={};n.r(d),n.d(d,{Deferred:()=>_,arrayRemove:()=>S,blobToBase64:()=>ek,camelCaseToSentenceCase:()=>O,capitaliseFirstLetter:()=>R,cronStringToISOString:()=>z,dateToCronString:()=>j,difference:()=>D,dispatchCancellableEvent:()=>eF,formatCronString:()=>H,getAllowedValueLabel:()=>J,getAssetTypeLabel:()=>X,getAttributeLabel:()=>Q,getAttributeUnits:()=>ed,getAttributeValueAsString:()=>en,getAttributeValueConstraints:()=>ec,getAttributeValueFormat:()=>em,getBrowserLanguage:()=>g,getComplexMetaItems:()=>q,getEnumKeyAsString:()=>N,getGeoNotificationsFromRulesSet:()=>F,getMetaItemNameValueHolder:()=>Z,getMetaLabel:()=>ee,getMetaUnits:()=>el,getMetaValue:()=>U,getMetaValueAsString:()=>ei,getMetaValueConstraints:()=>es,getMetaValueFormat:()=>eu,getPrimitiveMetaItems:()=>G,getQueryParameter:()=>v,getQueryParameters:()=>y,getValueAsString:()=>er,getValueDescriptorLabel:()=>K,getWeekNumber:()=>B,hasMetaItem:()=>$,isComplexMetaItem:()=>V,isObject:()=>C,isPrimitiveMetaItem:()=>W,isTimeDuration:()=>A,isTimeDurationNegativeInfinity:()=>L,isTimeDurationPositiveInfinity:()=>T,loadJs:()=>eg,mergeObjects:()=>ef,objectsEqual:()=>M,resolveUnits:()=>ea,sentenceCaseToCamelCase:()=>I,sortByNumber:()=>ey,sortByString:()=>ev,stringMatch:()=>Y,updateAsset:()=>e_}),n(488);var l=n(384),m=n(7998),u=n(3348),f=n.n(u),p=n(3806),h=n.n(p),b=n(2891);class _{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 g(){return navigator.language.split("-")[0]||"en"}function y(e){return f().parse(e,{ignoreQueryPrefix:!0})}function v(e){let t;if(location.search&&""!==location.search&&(t=y(location.search)),location.hash){let e=location.hash.indexOf("?");e>-1&&(t=y(location.hash.substring(e+1)))}return t?t[e]:void 0}function F(e){let t=[];return e.rules.forEach(e=>{if(e.when&&e.then&&e.then.length>0){let n=new Map;for(let i of(k(e.when,0,n),n.size>0&&e.then.forEach(e=>x(e,n)),n.values()))i.forEach(e=>{e.notification&&t.push(e)})}}),t}function k(e,t,n){if(!e)return;let i=[];e.groups&&e.groups.forEach(e=>{e.items&&e.items.forEach(e=>{i.push(e)})}),e.items&&e.items.forEach(e=>{i.push(e)}),i&&i.forEach(e=>{if(e.assets&&e.assets.attributes){let i=[];if(w(e.assets.attributes,i),i.length>0){let o=e.tag||t.toString();n.set(o,i)}}})}function w(e,t){e&&(e.items.forEach(e=>{e.value&&("radial"===e.value.predicateType||"rect"===e.value.predicateType)&&t.push({predicate:e.value})}),e.groups&&e.groups.forEach(e=>w(e,t)))}function x(e,t){if(e&&"notification"===e.action&&e.notification&&e.notification.message&&"push"===e.notification.message.type){let n=e.target;if(n&&n.conditionAssets){let i=t.get(n.conditionAssets);i&&i.forEach(t=>{t.notification=e.notification.message})}else for(let n of t.values())n.forEach(t=>{t.notification=e.notification.message})}}let E=/([+-])?((\d+)[Dd])?\s*((\d+)[Hh])?\s*((\d+)[Mm]$)?\s*((\d+)[Ss])?\s*((\d+)([Mm][Ss]$))?\s*((\d+)[Ww])?\s*((\d+)[Mm][Nn])?\s*((\d+)[Yy])?/;function A(e){return!!e&&(e=e.trim()).length>0&&(E.test(e)||T(e)||L(e))}function T(e){return"*"===(e=null!=e?e.trim():void 0)||"+*"===e}function L(e){return"-*"===(e=null!=e?e.trim():void 0)}function C(e){return!!e&&"object"==typeof e}function M(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=>M(e[n],t[n]))}return!1}function D(e,t){let n=(e,t)=>(0,b.transform)(e,function(e,i,o){M(i,null==t?void 0:t[o])||(e[o]=C(i)&&C(null==t?void 0:t[o])?n(i,null==t?void 0:t[o]):i)});return n(e,t)}function S(e,t){if(0===e.length)return;let n=e.indexOf(t);n>=0&&e.splice(n,1)}function I(e){return null==e?"":e.split(" ").map((e,t)=>0===t?e[0].toLowerCase()+e.substring(1):e[0].toUpperCase()+e.substring(1)).join("")}function O(e){if(null==e)return"";let t=!1;return e.split(/([A-Z]|\d)/).map((e,n,i)=>{if(!e)return e;if(!t)return t=!0,e.charAt(0).toUpperCase()+e.slice(1);if("_"===e)return" ";if(1===e.length&&e===e.toUpperCase()){let t=!i[n-1]||"_"===i[n-1],o=n+1<i.length&&i[n+1]&&"_"!==i[n+1],r=n+3>i.length||!i[n+1]&&!i[n+3];(!t||o)&&(e=" "+e),!o&&(t||r)||(e=e.toLowerCase())}return e}).join("").trim()}function Y(e,t){if(t===e)return!0;let n=e.endsWith("*"),i=!n&&e.startsWith("*"),o=!n&&!i&&e.startsWith("^")&&e.endsWith("$");if(n&&t.startsWith(e.substr(0,e.length-1))||i&&t.endsWith(e.substr(1)))return!0;if(o)try{return new RegExp(e).test(t)}catch(e){console.error("Failed to compile needle as a RegExp: "+e)}return!1}function R(e){if(e)return 1===e.length?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1)}function N(e,t){return Object.keys(e).find(n=>e[n]===t)}function B(e){(e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))).setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));let t=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-t.getTime())/864e5+1)/7)}let P=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];function H(e,t,n,i,o,r,a){let c="";if(r?Array.isArray(r)?c+=r.toString().replace(" ",""):c+=r.toString():c+="0",c+=" ",o?Array.isArray(o)?c+=o.toString().replace(" ",""):c+=o.toString():c+="0",c+=" ",i?Array.isArray(i)?c+=i.toString().replace(" ",""):c+=i.toString():c+="0",c+=" ",n?Array.isArray(n)?c+=n.toString().replace(" ",""):c+=n.toString():c+="*",c+=" ",t)if(Array.isArray(t))if("number"==typeof t[0]){let e=[];t.forEach(t=>{e.push(P[t].toString())}),c+=e.toString().replace(" ","")}else c+=t.toString().replace(" ","");else c+=t.toString();else c+="*";return c+=" ",a?c+=a.toString():c+="?",c+=" ",e?Array.isArray(e)?c+=e.toString().replace(" ",""):c+=e:c+="*",c}function j(e){return H(e.getFullYear(),P[e.getMonth()],[e.getDate()],[e.getHours()],[e.getMinutes()])}function z(e,t){let n=e.split(" ");if(!Number.isNaN(Number(n[0]))&&!Number.isNaN(Number(n[1]))&&!Number.isNaN(Number(n[2]))&&(!Number.isNaN(Number(n[3]))||"*"==n[3])){let e=(!Number.isNaN(Number(n[6]))?n[6]:new Date().getFullYear()).toString(),i="";i=1==(i="*"!=n[4]?P.indexOf(n[4]).toString():new Date().getMonth().toString()).length?"0"+i:i;let o=1==n[3].length&&"*"!=n[3]?"0"+n[3]:n[3].replace("*","01"),r=1==n[2].length&&"*"!=n[2]?"0"+n[2]:n[2].replace("*","00"),a=1==n[1].length&&"*"!=n[1]?"0"+n[1]:n[1].replace("*","00"),c=1==n[0].length&&"*"!=n[0]?"0"+n[0]:n[0].replace("*","00");if(e.length>0&&i.length>0)if(t)return h().utc({year:Number(e),month:Number(i),date:Number(o),hour:Number(r),minute:Number(a),second:Number(c)}).toISOString();else return h()({year:Number(e),month:Number(i),date:Number(o),hour:Number(r),minute:Number(a),second:Number(c)}).toISOString()}}function U(e,t,n){let i="string"==typeof e?e:e.name;return t&&t.meta&&t.meta.hasOwnProperty(i)?t.meta[i]:n&&n.meta?n.meta[i]:void 0}function $(e,t,n){let i="string"==typeof e?e:e.name;return!!(t&&t.meta&&t.meta.hasOwnProperty(i)||n&&n.meta&&n.meta.hasOwnProperty(i))}function W(e){return!V(e)}function V(e){return!!((null==e?void 0:e.jsonType)==="object"||(null==e?void 0:e.arrayDimensions)&&e.arrayDimensions>0)}function G(){return l.NS.getMetaItemDescriptors().filter(e=>W(l.NS.getValueDescriptor(e.type)))}function q(){return l.NS.getMetaItemDescriptors().filter(e=>V(l.NS.getValueDescriptor(e.type)))}function X(e){return("string"==typeof e&&(e=l.NS.getAssetDescriptor(e)),e)?m.ZP.t("label.asset."+e.name,{defaultValue:O(e.name)}):""}function K(e){if(!e)return m.ZP.t("label.value.unknown",{defaultValue:"Unknown"});let t="string"==typeof e?e:e.name;return m.ZP.t("label.value."+t,{defaultValue:O(t||"")})}function J(e,t){if(e)return m.ZP.t("label.allowedValue."+e,{defaultValue:t||O(e||""),nsSeparator:!1})}function Z(e,t){let n="string"==typeof e?l.NS.getMetaItemDescriptor(e):e;return n?{name:n.name,type:n.type,value:t}:{name:typeof e,type:l.NS.resolveValueTypeFromValue(t),value:t}}function Q(e,t,n,i,o){return et(e,t,n,i,!0,o)}function ee(e,t,n,i,o){return et(e||Z(t,null),t,n,i,!1,o)}function et(e,t,n,i,o,r){let a=eb("label",e,t,n,o),c="";if(a||(a=U("label",e,t&&t.meta?t:void 0)),i&&(c=ea(eh("units",e,t,n,o))),!a){let n=e?e.name:t?"string"==typeof t?t:t.name:void 0;a=r||(n?O(n):void 0)}return a?a+(c?" ("+c+")":""):c}function en(e,t,n,i,o){return eo(e,t,n,i,!0,o)}function ei(e,t,n,i,o){return eo(e||Z(t,null),t,n,i,!1,o)}function eo(e,t,n,i,o,r){let a=er(e?e.value:void 0,()=>eh("format",e,t,n,o),void 0,r),c=ed(e,t,n);return i&&c&&c.length&&(a=ea(eh("units",e,t,n,o),a)),a}function er(e,t,n,i){let o="";if(null==e)o=i||"";else if("string"==typeof e)o=e;else if("number"==typeof e||"boolean"==typeof e||e instanceof Date){let i=t&&t();if(i&&0!==Object.keys(i).length)switch("number"==typeof e?i.asBoolean?e=!!e:i.asDate&&(e=new Date(e)):"boolean"==typeof e&&i.asNumber&&(e=+!!e),typeof e){case"number":o=new Intl.NumberFormat(n||m.ZP.language,i).format(e);break;case"boolean":i.asOnOff&&(o=e?m.ZP.t("on"):m.ZP.t("off")),i.asOpenClosed&&(o=e?m.ZP.t("open"):m.ZP.t("closed")),i.asPressedReleased&&(o=e?m.ZP.t("pressed"):m.ZP.t("released"));break;case"object":if(i.momentJsFormat)o=h()(e).format(i.momentJsFormat);else if(i.iso8601)o=e.toISOString();else if(i.week){let t=B(e);o="2-digit"===i.week?String(t).padStart(2,"0"):Number(t).toString(10)}else o=new Intl.DateTimeFormat(n||m.ZP.language,i).format(e)}else o=Object(e).toString()}return o}function ea(e,t){if(!e)return"";t||(t="");let n=e.map((e,n)=>{if(3!==e.length||e.toUpperCase()!==e)return m.ZP.t(["units."+e,"or:units."+e]);{let i=new Intl.NumberFormat(m.ZP.language,{currency:e,style:"currency"}).formatToParts();if(0!==n||"currency"!==i[0].type)return"currency"===i[0].type?i[0].value:i[i.length-1].value;if(!t)return i[0].value;t=i[0].value+t}}).join("");return t.length>0?t+" "+n:n}function ec(e,t,n){return eh("constraints",e,t,n,!0)}function es(e,t,n){return eh("constraints",e||Z(t,null),t,n,!1)}function ed(e,t,n){return eh("units",e,t,n,!0)}function el(e,t,n){return eh("units",e||Z(t,null),t,n,!1)}function em(e,t,n){return eh("format",e,t,n,!0)}function eu(e,t,n){return eh("format",e||Z(t,null),t,n,!1)}function ef(e,t,n){if(e&&!t)return Object.assign({},e);if(t&&!e)return Object.assign({},t);let i=Object.assign({},e),o=[];return Object.entries(t).forEach(([e,t])=>{ep(i,o,e,t,n)}),i}function ep(e,t,n,i,o){let r=e;t.forEach(e=>{r.hasOwnProperty(e)||(r[e]={}),r=r[e]}),r&&(r.hasOwnProperty(n)?null==i?delete r[n]:Array.isArray(r[n])?o?r[n]=[...r[n],...i]:r[n]=[...i]:"object"==typeof i?r[n]=ef(Object.assign({},r[n]),i,o):r[n]=i:null==i?delete r[n]:Array.isArray(i)?r[n]=[...i]:"object"==typeof i?r[n]=Object.assign({},i):r[n]=i)}function eh(e,t,n,i,o){let r,a=[],c=eb(e,t&&"string"==typeof t?t:t?t.name:n?"string"==typeof n?n:n.name:void 0,n,i,o);if(c&&(r=JSON.parse(c)))if("format"!==e)return r;else a.push(r);if(t&&t.meta&&(r=U(e,t,n)))if("format"!==e)return r;else a.push(r);if(n&&"string"!=typeof n&&n.hasOwnProperty(e)){if(r=n[e],"format"!==e)return r;a.push(r)}if(n&&n.type){if(r=l.NS.getValueDescriptor(n.type)[e],"format"!==e)return r;a.push(r)}if("format"!==e||0===a.length)return r;let s={};return a.reverse().forEach(e=>{s=Object.assign(Object.assign({},s),e)}),s}function eb(e,t,n,i,o,r){let a;if(t?a="string"==typeof t?t:t.name:n&&(a="string"==typeof n?n:n.name),!a)return;let c=[],s=e+"."+(o?"attribute":"meta")+".";if(i&&c.push(s+i+"."+a),n&&"string"!=typeof n&&(c.push(s+n.type+"."+a),c.push(s+n.type)),c.push(s+a),c.length>0)return m.ZP.t(c,{defaultValue:r||""})}function e_(e,t){let n=t.ref.name;if(e.attributes)if(t.deleted)delete e.attributes[n];else{let i=e.attributes[n];i&&(i.value=t.value,i.timestamp=t.timestamp)}return Object.assign({},e)}function eg(e){return new Promise((t,n)=>{let i=document.createElement("script");i.type="text/javascript",i.src=e,i.addEventListener("load",e=>t(e),!1),i.addEventListener("error",e=>n(e),!1),document.body.appendChild(i)})}function ey(e){return(t,n)=>{let i=e(t),o=e(n);return i||o?i&&!o?1:!i&&o?-1:i-o:0}}function ev(e){return(t,n)=>{let i=e(t),o=e(n);return i||o?i&&!o?1:!i&&o?-1:i.localeCompare(o):0}}function eF(e,t){let n=new _;return e.dispatchEvent(t),window.setTimeout(()=>{n.resolve(t.detail)}),n.promise}function ek(e){return new Promise((t,n)=>{let i=new FileReader;i.readAsDataURL(e),i.onload=()=>{t(i.result)},i.onerror=e=>{n(e)}})}var ew=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let ex=n(9916);class eE{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 i=new URLSearchParams(window.location.search),o=i.get("consoleName"),r=i.get("consoleVersion"),a=i.get("consolePlatform"),c=i.get("consoleProviders"),s=i.get("consoleAutoEnable"),d=c&&c.length>0?c.split(" "):["push"];this._pendingProviderEnables=d;let l=eE._createConsoleRegistration(),m=window.localStorage.getItem("OpenRemoteConsole:"+e);if(m)try{let e=JSON.parse(m);e.id&&(l.id=e.id),e.name&&(l.name=e.name),e.providers&&(l.providers=e.providers),e.apps&&(l.apps=e.apps)}catch(e){console.error("Failed to deserialise console registration")}let u=l.providers;for(let e of(l.providers={},d)){let t=u&&u.hasOwnProperty(e)?u[e]:{enabled:!1,disabled:!1};l.providers[e]=t}let f=nt.getAppName();f.length>0&&0>l.apps.indexOf(f)&&l.apps.push(f),this._registration=l,o&&(l.name=o),r&&(l.version=r),a&&(l.platform=a),s&&(this._autoEnable="TRUE"===s||"true"===s)}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 ew(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 ew(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 ew(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},i=yield this.sendProviderMessage(n,!0);this._registration.providers[e].hasPermission=i.hasPermission,this._registration.providers[e].success=i.success,this._registration.providers[e].enabled=i.success,this._registration.providers[e].data=i.data;let o=this._pendingProviderEnables.indexOf(e);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),i})}disableProvider(e){return ew(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 ew(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 i=new _,o=()=>{delete this._pendingProviderPromises[n],i.reject("No response from provider")};return this._pendingProviderPromises[n]=[i,window.setTimeout(o,5e3)],this._doSendProviderMessage(e),i.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={}),nt.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 ew(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,i=t.action,o=this._pendingProviderPromises[n+i];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[n+i],o[0].resolve(t));let r=this._providerMessageListeners[n+i];r&&r(t)}_callCompletedCallback(){let e=this._enableCompleteCallback;this._enableCompleteCallback=null,e&&window.setTimeout(()=>{e()},0)}static _createConsoleRegistration(){return{name:ex.name,version:ex.version,platform:ex.os.toString(),apps:[],model:((ex.manufacturer?ex.manufacturer+" ":"")+(ex.product?ex.product:"")).trim()}}_initialiseProvider(e){return ew(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)}})}}var eA=n(3653),eT=n.n(eA);class eL{constructor(e){this.httpClient=e}getConfig(e){return this.httpClient.request({method:"GET",url:eK`syslog/config`,options:e})}updateConfig(e,t){return this.httpClient.request({method:"PUT",url:eK`syslog/config`,data:e,options:t})}clearEvents(e){return this.httpClient.request({method:"DELETE",url:eK`syslog/event`,options:e})}getEvents(e,t){return this.httpClient.request({method:"GET",url:eK`syslog/event`,queryParams:e,options:t})}}class eC{constructor(e){this.httpClient=e}getSettings(e){return this.httpClient.request({method:"GET",url:eK`map`,options:e})}saveSettings(e,t){return this.httpClient.request({method:"PUT",url:eK`map`,data:e,options:t})}deleteMap(e){return this.httpClient.request({method:"DELETE",url:eK`map/deleteMap`,options:e})}getCustomMapInfo(e){return this.httpClient.request({method:"GET",url:eK`map/getCustomMapInfo`,options:e})}getSettingsJs(e){return this.httpClient.request({method:"GET",url:eK`map/js`,options:e})}getTile(e,t,n,i){return this.httpClient.request({method:"GET",url:eK`map/tile/${e}/${t}/${n}`,options:i})}uploadMap(e,t){return this.httpClient.request({method:"POST",url:eK`map/upload`,queryParams:e,options:t})}}class eM{constructor(e){this.httpClient=e}getHealthStatus(e){return this.httpClient.request({method:"GET",url:eK`health`,options:e})}getInfo(e){return this.httpClient.request({method:"GET",url:eK`info`,options:e})}}class eD{constructor(e){this.httpClient=e}getManagerConfig(e){return this.httpClient.request({method:"GET",url:eK`configuration/manager`,options:e})}update(e,t){return this.httpClient.request({method:"PUT",url:eK`configuration/manager`,data:e,options:t})}fileUpload(e,t,n){return this.httpClient.request({method:"POST",url:eK`configuration/manager/file`,queryParams:t,data:e,options:n})}getManagerConfigImage(e,t){return this.httpClient.request({method:"GET",url:eK`configuration/manager/image/${e}`,options:t})}}class eS{constructor(e){this.httpClient=e}deleteConnections(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/connection`,queryParams:e,options:t})}getConnections(e){return this.httpClient.request({method:"GET",url:eK`gateway/connection`,options:e})}deleteConnection(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/connection/${e}`,options:t})}getConnection(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/connection/${e}`,options:t})}setConnection(e,t,n){return this.httpClient.request({method:"PUT",url:eK`gateway/connection/${e}`,data:t,options:n})}getConnectionStatus(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/status/${e}`,options:t})}}class eI{constructor(e){this.httpClient=e}getPredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`asset/predicted/${e}/${t}`,data:n,options:i})}writePredictedDatapoints(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`asset/predicted/${e}/${t}`,data:n,options:i})}}class eO{constructor(e){this.httpClient=e}createAlarm(e,t,n){return this.httpClient.request({method:"POST",url:eK`alarm`,queryParams:t,data:e,options:n})}getAlarms(e,t){return this.httpClient.request({method:"GET",url:eK`alarm`,queryParams:e,options:t})}removeAlarms(e,t){return this.httpClient.request({method:"DELETE",url:eK`alarm`,data:e,options:t})}setAssetLinks(e,t){return this.httpClient.request({method:"PUT",url:eK`alarm/assets`,data:e,options:t})}getAlarm(e,t){return this.httpClient.request({method:"GET",url:eK`alarm/${e}`,options:t})}removeAlarm(e,t){return this.httpClient.request({method:"DELETE",url:eK`alarm/${e}`,options:t})}updateAlarm(e,t,n){return this.httpClient.request({method:"PUT",url:eK`alarm/${e}`,data:t,options:n})}getAssetLinks(e,t,n){return this.httpClient.request({method:"GET",url:eK`alarm/${e}/assets`,queryParams:t,options:n})}}class eY{constructor(e){this.httpClient=e}createGlobalRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules`,data:e,options:t})}getGlobalRulesets(e,t){return this.httpClient.request({method:"GET",url:eK`rules`,queryParams:e,options:t})}createAssetRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules/asset`,data:e,options:t})}getAssetRulesets(e,t,n){return this.httpClient.request({method:"GET",url:eK`rules/asset/for/${e}`,queryParams:t,options:n})}deleteAssetRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/asset/${e}`,options:t})}getAssetRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/asset/${e}`,options:t})}updateAssetRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/asset/${e}`,data:t,options:n})}getAssetGeofences(e,t){return this.httpClient.request({method:"GET",url:eK`rules/geofences/${e}`,options:t})}getAssetEngineInfo(e,t){return this.httpClient.request({method:"GET",url:eK`rules/info/asset/${e}`,options:t})}getGlobalEngineInfo(e){return this.httpClient.request({method:"GET",url:eK`rules/info/global`,options:e})}getRealmEngineInfo(e,t){return this.httpClient.request({method:"GET",url:eK`rules/info/realm/${e}`,options:t})}createRealmRuleset(e,t){return this.httpClient.request({method:"POST",url:eK`rules/realm`,data:e,options:t})}getRealmRulesets(e,t,n){return this.httpClient.request({method:"GET",url:eK`rules/realm/for/${e}`,queryParams:t,options:n})}deleteRealmRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/realm/${e}`,options:t})}getRealmRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/realm/${e}`,options:t})}updateRealmRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/realm/${e}`,data:t,options:n})}deleteGlobalRuleset(e,t){return this.httpClient.request({method:"DELETE",url:eK`rules/${e}`,options:t})}getGlobalRuleset(e,t){return this.httpClient.request({method:"GET",url:eK`rules/${e}`,options:t})}updateGlobalRuleset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`rules/${e}`,data:t,options:n})}}class eR{constructor(e){this.httpClient=e}getNotifications(e,t){return this.httpClient.request({method:"GET",url:eK`notification`,queryParams:e,options:t})}removeNotifications(e,t){return this.httpClient.request({method:"DELETE",url:eK`notification`,queryParams:e,options:t})}sendNotification(e,t){return this.httpClient.request({method:"POST",url:eK`notification/alert`,data:e,options:t})}removeNotification(e,t){return this.httpClient.request({method:"DELETE",url:eK`notification/${e}`,options:t})}notificationAcknowledged(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`notification/${e}/acknowledged`,queryParams:n,data:t,options:i})}notificationDelivered(e,t,n){return this.httpClient.request({method:"PUT",url:eK`notification/${e}/delivered`,queryParams:t,options:n})}}class eN{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`asset`,data:e,options:t})}delete(e,t){return this.httpClient.request({method:"DELETE",url:eK`asset`,queryParams:e,options:t})}writeAttributeValues(e,t){return this.httpClient.request({method:"PUT",url:eK`asset/attributes`,data:e,options:t})}writeAttributeEvents(e,t){return this.httpClient.request({method:"PUT",url:eK`asset/attributes/timestamp`,data:e,options:t})}queryCount(e,t){return this.httpClient.request({method:"POST",url:eK`asset/count`,data:e,options:t})}updateNoneParent(e,t){return this.httpClient.request({method:"DELETE",url:eK`asset/parent`,queryParams:e,options:t})}getPartial(e,t){return this.httpClient.request({method:"GET",url:eK`asset/partial/${e}`,options:t})}queryAssets(e,t){return this.httpClient.request({method:"POST",url:eK`asset/query`,data:e,options:t})}queryAssetTree(e,t){return this.httpClient.request({method:"POST",url:eK`asset/tree`,data:e,options:t})}getCurrentUserAssets(e){return this.httpClient.request({method:"GET",url:eK`asset/user/current`,options:e})}createUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:eK`asset/user/link`,data:e,options:t})}getUserAssetLinks(e,t){return this.httpClient.request({method:"GET",url:eK`asset/user/link`,queryParams:e,options:t})}deleteUserAssetLinks(e,t){return this.httpClient.request({method:"POST",url:eK`asset/user/link/delete`,data:e,options:t})}deleteAllUserAssetLinks(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`asset/user/link/${e}/${t}`,options:n})}deleteUserAssetLink(e,t,n,i){return this.httpClient.request({method:"DELETE",url:eK`asset/user/link/${e}/${t}/${n}`,options:i})}get(e,t){return this.httpClient.request({method:"GET",url:eK`asset/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`asset/${e}`,data:t,options:n})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/attribute/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(e,t,n,i,o){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/attribute/${t}/${n}`,data:i,options:o})}updateParent(e,t,n){return this.httpClient.request({method:"PUT",url:eK`asset/${e}/child`,queryParams:t,options:n})}}class eB{constructor(e){this.httpClient=e}getAllNodeDefinitions(e){return this.httpClient.request({method:"GET",url:eK`flow`,options:e})}getNodeDefinition(e,t){return this.httpClient.request({method:"GET",url:eK`flow/${e}`,options:t})}getAllNodeDefinitionsByType(e,t){return this.httpClient.request({method:"GET",url:eK`flow/${e}`,options:t})}}class eP{constructor(e){this.httpClient=e}startTunnel(e,t){return this.httpClient.request({method:"POST",url:eK`gateway/tunnel`,data:e,options:t})}stopTunnel(e,t){return this.httpClient.request({method:"DELETE",url:eK`gateway/tunnel`,data:e,options:t})}getAllActiveTunnelInfos(e,t){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}`,options:t})}getGatewayActiveTunnelInfos(e,t,n){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}/${t}`,options:n})}getActiveTunnelInfo(e,t,n,i,o){return this.httpClient.request({method:"GET",url:eK`gateway/tunnel/${e}/${t}/${n}/${i}`,options:o})}}class eH{constructor(e){this.httpClient=e}updateCurrentUserLocale(e,t){return this.httpClient.request({method:"PUT",url:eK`user/locale`,data:e,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:eK`user/query`,data:e,options:t})}requestPasswordResetCurrent(e){return this.httpClient.request({method:"PUT",url:eK`user/request-password-reset`,options:e})}updatePasswordCurrent(e,t){return this.httpClient.request({method:"PUT",url:eK`user/reset-password`,data:e,options:t})}updateCurrent(e,t){return this.httpClient.request({method:"PUT",url:eK`user/update`,data:e,options:t})}getCurrent(e){return this.httpClient.request({method:"GET",url:eK`user/user`,options:e})}getCurrentUserRealmRoles(e){return this.httpClient.request({method:"GET",url:eK`user/userRealmRoles`,options:e})}getCurrentUserClientRoles(e,t){return this.httpClient.request({method:"GET",url:eK`user/userRoles/${e}`,options:t})}disconnectUserSession(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/disconnect/${t}`,options:n})}requestPasswordReset(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/request-password-reset/${t}`,options:n})}updatePassword(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/reset-password/${t}`,data:n,options:i})}resetSecret(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/reset-secret/${t}`,options:n})}updateRoles(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/roles`,data:t,options:n})}getUserRealmRoles(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/userRealmRoles/${t}`,options:n})}updateUserRealmRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/userRealmRoles/${t}`,data:n,options:i})}getUserClientRoles(e,t,n,i){return this.httpClient.request({method:"GET",url:eK`user/${e}/userRoles/${t}/${n}`,options:i})}updateUserClientRoles(e,t,n,i,o){return this.httpClient.request({method:"PUT",url:eK`user/${e}/userRoles/${t}/${n}`,data:i,options:o})}getUserSessions(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/userSessions/${t}`,options:n})}create(e,t,n){return this.httpClient.request({method:"POST",url:eK`user/${e}/users`,data:t,options:n})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`user/${e}/users`,data:t,options:n})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`user/${e}/users/${t}`,options:n})}getClientRoles(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/${t}/roles`,options:n})}updateClientRoles(e,t,n,i){return this.httpClient.request({method:"PUT",url:eK`user/${e}/${t}/roles`,data:n,options:i})}get(e,t,n){return this.httpClient.request({method:"GET",url:eK`user/${e}/${t}`,options:n})}}class ej{constructor(e){this.httpClient=e}createProvisioningConfig(e,t){return this.httpClient.request({method:"POST",url:eK`provisioning`,data:e,options:t})}getProvisioningConfigs(e){return this.httpClient.request({method:"GET",url:eK`provisioning`,options:e})}deleteProvisioningConfig(e,t){return this.httpClient.request({method:"DELETE",url:eK`provisioning/${e}`,options:t})}updateProvisioningConfig(e,t,n){return this.httpClient.request({method:"PUT",url:eK`provisioning/${e}`,data:t,options:n})}}class ez{constructor(e){this.httpClient=e}getDatapointExport(e,t){return this.httpClient.request({method:"GET",url:eK`asset/datapoint/export`,queryParams:e,options:t})}getDatapointPeriod(e,t){return this.httpClient.request({method:"GET",url:eK`asset/datapoint/periods`,queryParams:e,options:t})}getDatapoints(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`asset/datapoint/${e}/${t}`,data:n,options:i})}}class eU{constructor(e){this.httpClient=e}getApps(e){return this.httpClient.request({method:"GET",url:eK`apps`,options:e})}getConsoleConfig(e){return this.httpClient.request({method:"GET",url:eK`apps/consoleConfig`,options:e})}getAppInfos(e){return this.httpClient.request({method:"GET",url:eK`apps/info`,options:e})}}class e${constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`dashboard`,data:e,options:t})}update(e,t){return this.httpClient.request({method:"PUT",url:eK`dashboard`,data:e,options:t})}getAllRealmDashboards(e,t){return this.httpClient.request({method:"GET",url:eK`dashboard/all/${e}`,options:t})}query(e,t){return this.httpClient.request({method:"POST",url:eK`dashboard/query`,data:e,options:t})}delete(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`dashboard/${e}/${t}`,options:n})}get(e,t,n){return this.httpClient.request({method:"GET",url:eK`dashboard/${e}/${t}`,options:n})}}class eW{constructor(e){this.httpClient=e}getAssetDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/assetDescriptors`,queryParams:e,options:t})}getAssetInfo(e,t,n){return this.httpClient.request({method:"GET",url:eK`model/assetInfo/${e}`,queryParams:t,options:n})}getAssetInfos(e,t){return this.httpClient.request({method:"GET",url:eK`model/assetInfos`,queryParams:e,options:t})}getValueDescriptorSchema(e,t){return this.httpClient.request({method:"GET",url:eK`model/getValueDescriptorSchema`,queryParams:e,options:t})}getMetaItemDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/metaItemDescriptors`,queryParams:e,options:t})}getValueDescriptors(e,t){return this.httpClient.request({method:"GET",url:eK`model/valueDescriptors`,queryParams:e,options:t})}}class eV{constructor(e){this.httpClient=e}create(e,t){return this.httpClient.request({method:"POST",url:eK`realm`,data:e,options:t})}getAll(e){return this.httpClient.request({method:"GET",url:eK`realm`,options:e})}getAccessible(e){return this.httpClient.request({method:"GET",url:eK`realm/accessible`,options:e})}delete(e,t){return this.httpClient.request({method:"DELETE",url:eK`realm/${e}`,options:t})}get(e,t){return this.httpClient.request({method:"GET",url:eK`realm/${e}`,options:t})}update(e,t,n){return this.httpClient.request({method:"PUT",url:eK`realm/${e}`,data:t,options:n})}}class eG{constructor(e){this.httpClient=e}getServices(e,t){return this.httpClient.request({method:"GET",url:eK`service`,queryParams:e,options:t})}registerService(e,t){return this.httpClient.request({method:"POST",url:eK`service`,data:e,options:t})}getGlobalServices(e){return this.httpClient.request({method:"GET",url:eK`service/global`,options:e})}registerGlobalService(e,t){return this.httpClient.request({method:"POST",url:eK`service/global`,data:e,options:t})}deregisterService(e,t,n){return this.httpClient.request({method:"DELETE",url:eK`service/${e}/${t}`,options:n})}getService(e,t,n){return this.httpClient.request({method:"GET",url:eK`service/${e}/${t}`,options:n})}heartbeat(e,t,n){return this.httpClient.request({method:"PUT",url:eK`service/${e}/${t}`,options:n})}}class eq{constructor(e){this.httpClient=e}doProtocolAssetDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:eK`agent/assetDiscovery/${e}`,queryParams:t,options:n})}doProtocolAssetImport(e,t,n,i){return this.httpClient.request({method:"POST",url:eK`agent/assetImport/${e}`,queryParams:n,data:t,options:i})}doProtocolInstanceDiscovery(e,t,n){return this.httpClient.request({method:"GET",url:eK`agent/instanceDiscovery/${e}`,queryParams:t,options:n})}}class eX{constructor(e){this.httpClient=e}register(e,t){return this.httpClient.request({method:"POST",url:eK`console/register`,data:e,options:t})}}function eK(e,...t){let n="";for(let i=0;i<t.length;i++)n+=e[i],n+=encodeURIComponent(t[i]);return n+e[e.length-1]}class eJ{constructor(e,t=eT().create()){this._syslogResource=new eQ(e,t),this._mapResource=new e0(e,t),this._statusResource=new e1(e,t),this._configurationResource=new e2(e,t),this._gatewayClientResource=new e5(e,t),this._assetPredictedDatapointResource=new e3(e,t),this._alarmResource=new e4(e,t),this._rulesResource=new e6(e,t),this._notificationResource=new e8(e,t),this._assetResource=new e7(e,t),this._flowResource=new e9(e,t),this._gatewayServiceResource=new te(e,t),this._userResource=new tt(e,t),this._provisioningResource=new tn(e,t),this._assetDatapointResource=new ti(e,t),this._appResource=new to(e,t),this._dashboardResource=new tr(e,t),this._assetModelResource=new ta(e,t),this._realmResource=new tc(e,t),this._externalServiceResource=new ts(e,t),this._agentResource=new td(e,t),this._consoleResource=new tl(e,t),this._assetResource=new e7(e,t)}get SyslogResource(){return this._syslogResource}get MapResource(){return this._mapResource}get StatusResource(){return this._statusResource}get ConfigurationResource(){return this._configurationResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AlarmResource(){return this._alarmResource}get RulesResource(){return this._rulesResource}get NotificationResource(){return this._notificationResource}get AssetResource(){return this._assetResource}get FlowResource(){return this._flowResource}get GatewayServiceResource(){return this._gatewayServiceResource}get UserResource(){return this._userResource}get ProvisioningResource(){return this._provisioningResource}get AssetDatapointResource(){return this._assetDatapointResource}get AppResource(){return this._appResource}get DashboardResource(){return this._dashboardResource}get AssetModelResource(){return this._assetModelResource}get RealmResource(){return this._realmResource}get ExternalServiceResource(){return this._externalServiceResource}get AgentResource(){return this._agentResource}get ConsoleResource(){return this._consoleResource}}class eZ{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 eQ extends eL{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e0 extends eC{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e1 extends eM{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e2 extends eD{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e5 extends eS{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e3 extends eI{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e4 extends eO{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e6 extends eY{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e8 extends eR{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e7 extends eN{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class e9 extends eB{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class te extends eP{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tt extends eH{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tn extends ej{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ti extends ez{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class to extends eU{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tr extends e${constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ta extends eW{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tc extends eV{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class ts extends eG{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class td extends eq{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}class tl extends eX{constructor(e,t=eT().create()){t.defaults.baseURL=e,super(new eZ(t))}}eT().isAxiosError;class tm{get api(){return this._client}constructor(){this._axiosInstance=eT().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(e=>(e.paramsSerializer=e=>f().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 eJ(e,this._axiosInstance)}}let tu=new tm;var tf=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};!function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING"}(i||(i={}));let tp="SUBSCRIBED:",th="UNAUTHORIZED:",tb="TRIGGERED:",t_="EVENT:";class tg{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=ty.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=i.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){S(this._statusCallbacks,e)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===i.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(i.CONNECTING),this._connectingDeferred=new _,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=ty.MIN_RECONNECT_DELAY,this._onStatusChanged(i.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!==i.DISCONNECTED&&this._doDisconnect())}subscribe(e,t){let n={eventSubscription:e,callback:t,deferred:new _};return null!=this._pendingSubscription||this._status!==i.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 tf(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===i.CONNECTED&&this._doSend(e)}sendEventWithReply(e){return this._status!==i.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(e)}subscribeAssetEvents(e,t,n){return tf(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0]?e.map(e=>e.id):e,o="AssetEvent"+tg._subscriptionCounter++;if(!this._assetEventPromise){let e;nt.authenticated||(e={filterType:"asset",realm:nt.displayRealm});let t={eventType:"asset",filter:e};this._assetEventPromise=this.subscribe(t,e=>{this._assetEventCallbackMap.forEach(t=>t(e))})}return this._assetEventCallbackMap.set(o,e=>{let t=e.asset.id;i?i.find(e=>t===e)&&n(e):e.asset.realm===nt.displayRealm&&n(e)}),this._assetEventPromise.then(()=>{try{if(i&&t){let e={messageID:"read-assets:"+i.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:i}};this.sendEventWithReply(e).then(e=>{e.assets&&this._assetEventCallbackMap.has(o)&&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),o&&this.unsubscribe(o),t}return o})})}subscribeAttributeEvents(e,t,n){return tf(this,void 0,void 0,function*(){let i=e&&"string"!=typeof e[0],o=i?e.map(e=>e.id):e,r=i?e:void 0,a="AttributeEvent"+tg._subscriptionCounter++;if(!this._attributeEventPromise){let e;nt.authenticated||(e={filterType:"asset",realm:nt.displayRealm});let t={eventType:"attribute",filter:e};this._attributeEventPromise=this.subscribe(t,e=>{this._attributeEventCallbackMap.forEach(t=>t(e))})}let c=t=>{let r=t.ref;i?e.forEach(e=>{r.id===e.id&&r.name===e.name&&n(t)}):o?o.find(e=>r.id===e)&&n(t):t.realm===nt.displayRealm&&n(t)};return this._attributeEventCallbackMap.set(a,c),this._attributeEventPromise.then(()=>{try{if(t&&o){let e={messageID:"read-assets:"+o.join(",")+":"+a,eventType:"read-assets",assetQuery:{ids:o}};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))&&c({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===i.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===i.CONNECTED&&this._onStatusChanged(i.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(i.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<ty.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(ty.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}tg.MIN_RECONNECT_DELAY=0,tg.MAX_RECONNECT_DELAY=3e4,tg._subscriptionCounter=0;class ty extends tg{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="+nt.config.realm;return nt.authenticated&&(e+="&Authorization="+nt.getAuthorizationHeader()),this._webSocket=new WebSocket(e),this._connectDeferred=new _,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(tp)){let e=JSON.parse(t.substring(tp.length)),n=this._subscribeDeferred;this._subscribeDeferred=null,n&&n.resolve(e.subscriptionId)}else if(t.startsWith(th)){let e=JSON.parse(t.substring(th.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(tb)){let e=JSON.parse(t.substring(tb.length));e.events&&e.events.forEach(t=>{this._onMessageReceived(e.subscriptionId,t)})}else if(t.startsWith(t_)){let e=JSON.parse(t.substring(t_.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 _,e.subscriptionId||(e.subscriptionId=ty._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=t_+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 _;return this._repliesDeferred.set(e.messageID,t),this._webSocket.send(t_+JSON.stringify(e)),t.promise}}function tv(e){return(tv="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)}ty._subscriptionCounter=1;var tF=[],tk=tF.forEach,tw=tF.slice;function tx(e){return tk.call(tw.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e}function tE(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":tv(XMLHttpRequest))==="object"}function tA(e){return!!e&&"function"==typeof e.then}function tT(e){return tA(e)?e:Promise.resolve(e)}var tL=n(6850),tC=n.t(tL,2);function tM(e){return(tM="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&&(o="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),tE()&&("undefined"!=typeof global&&global.XMLHttpRequest?r=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(r=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?a=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(a=window.ActiveXObject)),o||!tC||r||a||(o=tL||tC),"function"!=typeof o&&(o=void 0);var tD=function(e,t){if(t&&"object"===tM(t)){var n="";for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},tS=function(e,t,n){o(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)},tI=!1,tO=function(e,t,n,i){e.queryStringParams&&(t=tD(t,e.queryStringParams));var o=tx({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var r="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=tx({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},tI?{}:r);try{tS(t,a,i)}catch(e){if(!r||0===Object.keys(r).length||!e.message||0>e.message.indexOf("not implemented"))return i(e);try{Object.keys(r).forEach(function(e){delete a[e]}),tS(t,a,i),tI=!0}catch(e){i(e)}}},tY=function(e,t,n,i){n&&"object"===tM(n)&&(n=tD("",n).slice(1)),e.queryStringParams&&(t=tD(t,e.queryStringParams));try{(o=r?new r:new a("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var o,c=e.customHeaders;if(c="function"==typeof c?c():c)for(var s in c)o.setRequestHeader(s,c[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(e){console&&console.log(e)}};let tR=function(e,t,n,i){return("function"==typeof n&&(i=n,n=void 0),i=i||function(){},o)?tO(e,t,n,i):tE()||"function"==typeof ActiveXObject?tY(e,t,n,i):void i(Error("No fetch and no xhr implementation found!"))};function tN(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function tB(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tP(e,t,n){return t&&tB(e.prototype,t),n&&tB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tj=function(){return{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){return tH({},t,n||"")},request:tR,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},tz=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};tN(this,e),this.services=t,this.options=n,this.allOptions=i,this.type="backend",this.init(t,n,i)}return tP(e,[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=tx(n,this.options||{},tj()),this.allOptions=i,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,i,o){var r=this,a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,n)),(a=tT(a)).then(function(a){if(!a)return o(null,{});var c=r.services.interpolator.interpolate(a,{lng:e.join("+"),ns:n.join("+")});r.loadUrl(c,o,t,i)})}},{key:"loadUrl",value:function(e,t,n,i){var o=this;this.options.request(this.options,e,void 0,function(r,a){var c,s;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{c="string"==typeof a.data?o.options.parse(a.data,n,i):a.data}catch(t){s="failed parsing "+e+" to json"}if(s)return t(s,!1);t(null,c)})}},{key:"create",value:function(e,t,n,i,o){var r=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,i),c=0,s=[],d=[];e.forEach(function(n){var i=r.options.addPath;"function"==typeof r.options.addPath&&(i=r.options.addPath(n,t));var l=r.services.interpolator.interpolate(i,{lng:n,ns:t});r.options.request(r.options,l,a,function(t,n){c+=1,s.push(t),d.push(n),c===e.length&&o&&o(s,d)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,i=t.languageUtils,o=t.logger,r=n.language;if(!r||"cimode"!==r.toLowerCase()){var a=[],c=function(e){i.toResolveHierarchy(e).forEach(function(e){0>a.indexOf(e)&&a.push(e)})};c(r),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return c(e)}),a.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(i,r){i&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),i),!i&&r&&o.log("loaded namespace ".concat(e," for language ").concat(t),r),n.loaded("".concat(t,"|").concat(e),i,r)})})})}}}]),e}();tz.type="backend";let tU=tz;var t$=n(4846),tW=n(921);class tV extends Error{}function tG(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function tq(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{return tG(t)}catch(e){return atob(t)}}function tX(e,t){let n;if("string"!=typeof e)throw new tV("Invalid token specified: must be a string");t||(t={});let i=+(!0!==t.header),o=e.split(".")[i];if("string"!=typeof o)throw new tV(`Invalid token specified: missing part #${i+1}`);try{n=tq(o)}catch(e){throw new tV(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new tV(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}if(tV.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function tK(e){if(!(this instanceof tK))throw Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,i=this,o=[],r={enable:!0,callbackList:[],interval:5},a=document.getElementsByTagName("script"),c=0;c<a.length;c++)(-1!==a[c].src.indexOf("keycloak.js")||-1!==a[c].src.indexOf("keycloak.min.js"))&&-1!==a[c].src.indexOf("version=")&&(i.iframeVersion=a[c].src.substring(a[c].src.indexOf("version=")+8).split("&")[0]);var s=!0,d=R(console.info),l=R(console.warn);function m(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 i=0;i<t.length;i++)t[i]=Math.floor(256*Math.random());return t}function u(e){return f(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function f(e,t){for(var n=m(e),i=Array(e),o=0;o<e;o++)i[o]=t.charCodeAt(n[o]%t.length);return String.fromCharCode.apply(null,i)}function p(e,t){if("S256"!==e)throw TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return tJ(new Uint8Array(tW.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}function h(e){return JSON.stringify({id_token:{acr:e}})}function b(){return void 0===i.authServerUrl?void 0:"/"==i.authServerUrl.charAt(i.authServerUrl.length-1)?i.authServerUrl+"realms/"+encodeURIComponent(i.realm):i.authServerUrl+"/realms/"+encodeURIComponent(i.realm)}function _(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function g(e,t){var n=e.code,o=e.error,r=e.prompt,a=new Date().getTime();if(e.kc_action_status&&i.onActionUpdate&&i.onActionUpdate(e.kc_action_status),o){if("none"!=r)if(e.error_description&&"authentication_expired"===e.error_description)i.login(e.loginOptions);else{var c={error:o,error_description:e.error_description};i.onAuthError&&i.onAuthError(c),t&&t.setError(c)}else t&&t.setSuccess();return}if("standard"!=i.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=i.flow&&n){var l="code="+n+"&grant_type=authorization_code",m=i.endpoints.token(),u=new XMLHttpRequest;u.open("POST",m,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),u.withCredentials=!0,u.onreadystatechange=function(){if(4==u.readyState)if(200==u.status){var e=JSON.parse(u.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===i.flow),C()}else i.onAuthError&&i.onAuthError(),t&&t.setError()},u.send(l)}function f(n,o,r,c){F(n,o,r,a=(a+new Date().getTime())/2),s&&i.idTokenParsed&&i.idTokenParsed.nonce!=e.storedNonce?(d("[KEYCLOAK] Invalid nonce, clearing token"),i.clearToken(),t&&t.setError()):c&&(i.onAuthSuccess&&i.onAuthSuccess(),t&&t.setSuccess())}}function y(t){var n=A();function o(e){e?i.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}}:i.endpoints={authorize:function(){return b()+"/protocol/openid-connect/auth"},token:function(){return b()+"/protocol/openid-connect/token"},logout:function(){return b()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=b()+"/protocol/openid-connect/login-status-iframe.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=b()+"/protocol/openid-connect/3p-cookies/step1.html";return i.iframeVersion&&(e=e+"?version="+i.iframeVersion),e},register:function(){return b()+"/protocol/openid-connect/registrations"},userinfo:function(){return b()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(c=e):c="keycloak.json",c){var r=new XMLHttpRequest;r.open("GET",c,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status||v(r)){var e=JSON.parse(r.responseText);i.authServerUrl=e["auth-server-url"],i.realm=e.realm,i.clientId=e.resource,o(null),n.setSuccess()}else n.setError()},r.send()}else{if(!e.clientId)throw"clientId missing";i.clientId=e.clientId;var a=e.oidcProvider;if(a)if("string"==typeof a){var c,s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",r=new XMLHttpRequest;r.open("GET",s,!0),r.setRequestHeader("Accept","application/json"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||v(r)?(o(JSON.parse(r.responseText)),n.setSuccess()):n.setError())},r.send()}else o(a),n.setSuccess();else{if(!e.url){for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++)if(d[l].src.match(/.*keycloak\.js/)){e.url=d[l].src.substr(0,d[l].src.indexOf("/js/keycloak.js"));break}}if(!e.realm)throw"realm missing";i.authServerUrl=e.url,i.realm=e.realm,o(null),n.setSuccess()}}return n.promise}function v(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function F(e,t,n,o){if(i.tokenTimeoutHandle&&(clearTimeout(i.tokenTimeoutHandle),i.tokenTimeoutHandle=null),t?(i.refreshToken=t,i.refreshTokenParsed=tX(t)):(delete i.refreshToken,delete i.refreshTokenParsed),n?(i.idToken=n,i.idTokenParsed=tX(n)):(delete i.idToken,delete i.idTokenParsed),e){if(i.token=e,i.tokenParsed=tX(e),i.sessionId=i.tokenParsed.sid,i.authenticated=!0,i.subject=i.tokenParsed.sub,i.realmAccess=i.tokenParsed.realm_access,i.resourceAccess=i.tokenParsed.resource_access,o&&(i.timeSkew=Math.floor(o/1e3)-i.tokenParsed.iat),null!=i.timeSkew&&(d("[KEYCLOAK] Estimated time difference between browser and server is "+i.timeSkew+" seconds"),i.onTokenExpired)){var r=(i.tokenParsed.exp-new Date().getTime()/1e3+i.timeSkew)*1e3;d("[KEYCLOAK] Token expires in "+Math.round(r/1e3)+" s"),r<=0?i.onTokenExpired():i.tokenTimeoutHandle=setTimeout(i.onTokenExpired,r)}}else delete i.token,delete i.tokenParsed,delete i.subject,delete i.realmAccess,delete i.resourceAccess,i.authenticated=!1}function k(){var e="0123456789abcdef",t=f(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 w(e){var t=x(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 x(e){switch(i.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,o,r=e.indexOf("?"),a=e.indexOf("#");if("query"===i.responseMode&&-1!==r?(n=e.substring(0,r),""!==(o=E(e.substring(r+1,-1!==a?a:e.length),t)).paramsString&&(n+="?"+o.paramsString),-1!==a&&(n+=e.substring(a))):"fragment"===i.responseMode&&-1!==a&&(n=e.substring(0,a),""!==(o=E(e.substring(a+1),t)).paramsString&&(n+="#"+o.paramsString)),o&&o.oauthParams){if("standard"===i.flow||"hybrid"===i.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=n,o.oauthParams}else if("implicit"===i.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=n,o.oauthParams}}function E(e,t){for(var n=e.split("&"),i={paramsString:"",oauthParams:{}},o=0;o<n.length;o++){var r=n[o].indexOf("="),a=n[o].slice(0,r);-1!==t.indexOf(a)?i.oauthParams[a]=n[o].slice(r+1):(""!==i.paramsString&&(i.paramsString+="&"),i.paramsString+=n[o])}return i}function A(){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 T(e,t,n){var i=null;return Promise.race([e,new Promise(function(e,o){i=setTimeout(function(){o({error:n})},t)})]).finally(function(){clearTimeout(i)})}function L(){var e=A();if(!r.enable||r.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");r.iframe=t,t.onload=function(){var t=i.endpoints.authorize();"/"===t.charAt(0)?r.iframeOrigin=_():r.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=i.endpoints.checkSessionIframe();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);var o=function(e){if(e.origin===r.iframeOrigin&&r.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&i.clearToken();for(var t=r.callbackList.splice(0,r.callbackList.length),n=t.length-1;n>=0;--n){var o=t[n];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}};return window.addEventListener("message",o,!1),e.promise}function C(){r.enable&&i.token&&setTimeout(function(){M().then(function(e){e&&C()})},1e3*r.interval)}function M(){var e=A();if(r.iframe&&r.iframeOrigin){var t=i.clientId+" "+(i.sessionId?i.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 D(){var e=A();if(r.enable||i.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",i.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(o){t.contentWindow===o.source&&("supported"===o.data||"unsupported"===o.data)&&("unsupported"===o.data&&(l("[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,i.silentCheckSsoFallback&&(i.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess())};window.addEventListener("message",n,!1)}else e.setSuccess();return T(e.promise,i.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function S(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(i.createLoginUrl(e)),A().promise},logout:async function(e){if("GET"===(e?.logoutMethod??i.logoutMethod))return void window.location.replace(i.createLogoutUrl(e));let n=i.createLogoutUrl(e),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:i.idToken,client_id:i.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(o.redirected){window.location.href=o.url;return}if(o.ok)return void window.location.reload();throw Error("Logout failed, request returned an error code.")},register:function(e){return window.location.assign(i.createRegisterUrl(e)),A().promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e)window.location.href=e;else throw"Not supported by the OIDC server";return A().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:i.redirectUri?i.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)},o=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce(function(t,n){return t[n]=e.cordovaOptions[n],t},{}):{}},a=function(e){return Object.keys(e).reduce(function(t,n){return t.push(n+"="+e[n]),t},[]).join(",")},c=function(e){var t=o(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),a(t)},s=function(){return i.redirectUri||"http://localhost"};return{login:function(e){var t=A(),o=c(e),r=n(i.createLoginUrl(e),"_blank",o),a=!1,d=!1,l=function(){d=!0,r.close()};return r.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(g(w(e.url),t),l(),a=!0)}),r.addEventListener("loaderror",function(e){a||(0==e.url.indexOf(s())?(g(w(e.url),t),l(),a=!0):(t.setError(),l()))}),r.addEventListener("exit",function(e){d||t.setError({reason:"closed_by_user"})}),t.promise},logout:function(e){var t,o=A(),r=n(i.createLogoutUrl(e),"_blank","location=no,hidden=yes,clearcache=yes");return r.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&r.close()}),r.addEventListener("loaderror",function(e){0==e.url.indexOf(s())||(t=!0),r.close()}),r.addEventListener("exit",function(e){t?o.setError():(i.clearToken(),o.setSuccess())}),o.promise},register:function(e){var t=A(),o=n(i.createRegisterUrl(),"_blank",c(e));return o.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&(o.close(),g(w(e.url),t))}),t.promise},accountManagement:function(){var e=i.createAccountUrl();if(void 0!==e){var t=n(e,"_blank","location=no");t.addEventListener("loadstart",function(e){0==e.url.indexOf(s())&&t.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(e){return s()}}}if("cordova-native"==e)return r.enable=!1,{login:function(e){var t=A(),n=i.createLoginUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(w(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=A(),n=i.createLogoutUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),i.clearToken(),t.setSuccess()}),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=A(),n=i.createRegisterUrl(e);return universalLinks.subscribe("keycloak",function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(w(e.url),t)}),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=i.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:i.redirectUri?i.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}i.init=function(e){if(i.didInitialize)throw Error("A 'Keycloak' instance can only be initialized once.");i.didInitialize=!0,i.authenticated=!1,n=Y();var o=["default","cordova","cordova-native"];if(t=e&&o.indexOf(e.adapter)>-1?S(e.adapter):e&&"object"==typeof e.adapter?e.adapter:window.Cordova||window.cordova?S("cordova"):S(),e){if(void 0!==e.useNonce&&(s=e.useNonce),void 0!==e.checkLoginIframe&&(r.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(r.interval=e.checkLoginIframeInterval),"login-required"===e.onLoad&&(i.loginRequired=!0),e.responseMode)if("query"===e.responseMode||"fragment"===e.responseMode)i.responseMode=e.responseMode;else throw"Invalid value for responseMode";if(e.flow){switch(e.flow){case"standard":i.responseType="code";break;case"implicit":i.responseType="id_token token";break;case"hybrid":i.responseType="code id_token token";break;default:throw"Invalid value for flow"}i.flow=e.flow}if(null!=e.timeSkew&&(i.timeSkew=e.timeSkew),e.redirectUri&&(i.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(i.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),"boolean"==typeof e.silentCheckSsoFallback?i.silentCheckSsoFallback=e.silentCheckSsoFallback:i.silentCheckSsoFallback=!0,void 0!==e.pkceMethod){if("S256"!==e.pkceMethod&&!1!==e.pkceMethod)throw TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${e.pkceMethod}.`);i.pkceMethod=e.pkceMethod}else i.pkceMethod="S256";"boolean"==typeof e.enableLogging?i.enableLogging=e.enableLogging:i.enableLogging=!1,"POST"===e.logoutMethod?i.logoutMethod="POST":i.logoutMethod="GET","string"==typeof e.scope&&(i.scope=e.scope),"string"==typeof e.acrValues&&(i.acrValues=e.acrValues),"number"==typeof e.messageReceiveTimeout&&e.messageReceiveTimeout>0?i.messageReceiveTimeout=e.messageReceiveTimeout:i.messageReceiveTimeout=1e4}i.responseMode||(i.responseMode="fragment"),i.responseType||(i.responseType="code",i.flow="standard");var a=A(),c=A();c.promise.then(function(){i.onReady&&i.onReady(i.authenticated),a.setSuccess(i.authenticated)}).catch(function(e){a.setError(e)});var d=y();function l(){var t=function(t){t||(o.prompt="none"),e&&e.locale&&(o.locale=e.locale),i.login(o).then(function(){c.setSuccess()}).catch(function(e){c.setError(e)})},n=function(){var e=document.createElement("iframe"),t=i.createLoginUrl({prompt:"none",redirectUri:i.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){if(t.origin===window.location.origin&&e.contentWindow===t.source){var i=w(t.data);g(i,c),document.body.removeChild(e),window.removeEventListener("message",n)}};window.addEventListener("message",n)},o={};switch(e.onLoad){case"check-sso":r.enable?L().then(function(){M().then(function(e){e?c.setSuccess():i.silentCheckSsoRedirectUri?n():t(!1)}).catch(function(e){c.setError(e)})}):i.silentCheckSsoRedirectUri?n():t(!1);break;case"login-required":t(!0);break;default:throw"Invalid value for onLoad"}}function m(){var t=w(window.location.href);if(t&&window.history.replaceState(window.history.state,null,t.newUrl),t&&t.valid)return L().then(function(){g(t,c)}).catch(function(e){c.setError(e)});e?e.token&&e.refreshToken?(F(e.token,e.refreshToken,e.idToken),r.enable?L().then(function(){M().then(function(e){e?(i.onAuthSuccess&&i.onAuthSuccess(),c.setSuccess(),C()):c.setSuccess()}).catch(function(e){c.setError(e)})}):i.updateToken(-1).then(function(){i.onAuthSuccess&&i.onAuthSuccess(),c.setSuccess()}).catch(function(t){i.onAuthError&&i.onAuthError(),e.onLoad?l():c.setError(t)})):e.onLoad?l():c.setSuccess():c.setSuccess()}function u(){var e=A(),t=function(){("interactive"===document.readyState||"complete"===document.readyState)&&(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise}return d.then(function(){u().then(D).then(m).catch(function(e){a.setError(e)})}),d.catch(function(e){a.setError(e)}),a.promise},i.login=function(e){return t.login(e)},i.createLoginUrl=function(e){var o,r=k(),a=k(),c=t.redirectUri(e),d={state:r,nonce:a,redirectUri:encodeURIComponent(c),loginOptions:e};e&&e.prompt&&(d.prompt=e.prompt),o=e&&"register"==e.action?i.endpoints.register():i.endpoints.authorize();var l=e&&e.scope||i.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var m=o+"?client_id="+encodeURIComponent(i.clientId)+"&redirect_uri="+encodeURIComponent(c)+"&state="+encodeURIComponent(r)+"&response_mode="+encodeURIComponent(i.responseMode)+"&response_type="+encodeURIComponent(i.responseType)+"&scope="+encodeURIComponent(l);if(s&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr&&(m+="&claims="+encodeURIComponent(h(e.acr))),(e&&e.acrValues||i.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||i.acrValues)),i.pkceMethod){var f=u(96);d.pkceCodeVerifier=f,m+="&code_challenge="+p(i.pkceMethod,f)+"&code_challenge_method="+i.pkceMethod}return n.add(d),m},i.logout=function(e){return t.logout(e)},i.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??i.logoutMethod))return i.endpoints.logout();var n=i.endpoints.logout()+"?client_id="+encodeURIComponent(i.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return i.idToken&&(n+="&id_token_hint="+encodeURIComponent(i.idToken)),n},i.register=function(e){return t.register(e)},i.createRegisterUrl=function(e){return e||(e={}),e.action="register",i.createLoginUrl(e)},i.createAccountUrl=function(e){var n=b(),o=void 0;return void 0!==n&&(o=n+"/account?referrer="+encodeURIComponent(i.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},i.accountManagement=function(){return t.accountManagement()},i.hasRealmRole=function(e){var t=i.realmAccess;return!!t&&t.roles.indexOf(e)>=0},i.hasResourceRole=function(e,t){if(!i.resourceAccess)return!1;var n=i.resourceAccess[t||i.clientId];return!!n&&n.roles.indexOf(e)>=0},i.loadUserProfile=function(){var e=b()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=A();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.profile=JSON.parse(t.responseText),n.setSuccess(i.profile)):n.setError())},t.send(),n.promise},i.loadUserInfo=function(){var e=i.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+i.token);var n=A();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(i.userInfo=JSON.parse(t.responseText),n.setSuccess(i.userInfo)):n.setError())},t.send(),n.promise},i.isTokenExpired=function(e){if(!i.tokenParsed||!i.refreshToken&&"implicit"!=i.flow)throw"Not authenticated";if(null==i.timeSkew)return d("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=i.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+i.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},i.updateToken=function(e){var t=A();if(!i.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,d("[KEYCLOAK] Refreshing token: forced refresh")):(!i.tokenParsed||i.isTokenExpired(e))&&(n=!0,d("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+i.refreshToken,a=i.endpoints.token();if(o.push(t),1==o.length){var c=new XMLHttpRequest;c.open("POST",a,!0),c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.withCredentials=!0,r+="&client_id="+encodeURIComponent(i.clientId);var s=new Date().getTime();c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status){d("[KEYCLOAK] Token refreshed"),s=(s+new Date().getTime())/2;var e=JSON.parse(c.responseText);F(e.access_token,e.refresh_token,e.id_token,s),i.onAuthRefreshSuccess&&i.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{l("[KEYCLOAK] Failed to refresh token"),400==c.status&&i.clearToken(),i.onAuthRefreshError&&i.onAuthRefreshError();for(var t=o.pop();null!=t;t=o.pop())t.setError(!0)}},c.send(r)}}else t.setSuccess(!1)};return r.enable?M().then(function(){n()}).catch(function(e){t.setError(e)}):n(),t.promise},i.clearToken=function(){i.token&&(F(null,null,null),i.onAuthLogout&&i.onAuthLogout(),i.loginRequired&&i.login())};var I=function(){if(!(this instanceof I))return new I;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var e=this;function t(){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 i=localStorage.getItem(n);if(i)try{var o=JSON.parse(i).expires;(!o||o<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}e.get=function(e){if(e){var n="kc-callback-"+e,i=localStorage.getItem(n);return i&&(localStorage.removeItem(n),i=JSON.parse(i)),t(),i}},e.add=function(e){t();var n="kc-callback-"+e.state;e.expires=new Date().getTime()+36e5,localStorage.setItem(n,JSON.stringify(e))}},O=function(){if(!(this instanceof O))return new O;var e=this;e.get=function(e){if(e){var o=n("kc-callback-"+e);if(i("kc-callback-"+e,"",t(-100)),o)return JSON.parse(o)}},e.add=function(e){i("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){i(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},i=function(e,t,n){var i=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=i}};function Y(){try{return new I}catch(e){}return new O}function R(e){return function(){i.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}function tJ(e){return btoa(String.fromCodePoint(...e))}var tZ=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let tQ=e=>t=>class extends t{constructor(){super(...arguments),this._connectRequested=!1,this._status=i.DISCONNECTED,this._statusCallback=e=>this._onEventProviderStatusChanged(e)}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.connectEvents()}disconnectedCallback(){this.disconnectEvents(),super.disconnectedCallback&&super.disconnectedCallback()}connectEvents(){if(!e.getEventProvider())return void console.log("No event provider available so cannot subscribe");this._connectRequested||(this._connectRequested=!0,e.getEventProvider().subscribeStatusChange(this._statusCallback),this._doConnect())}disconnectEvents(){this._connectRequested&&(this._connectRequested=!1,e.getEventProvider().unsubscribeStatusChange(this._statusCallback),this._onEventsDisconnect())}_doConnect(){return tZ(this,void 0,void 0,function*(){this.eventsConnected&&this._onEventsConnect()})}get eventsConnected(){return this._connectRequested&&e.getEventProvider().status===i.CONNECTED}_onEventProviderStatusChanged(e){switch(e){case i.DISCONNECTED:this._onEventsDisconnect();break;case i.CONNECTED:this._doConnect()}}_onEventsConnect(){this._addEventSubscriptions(),this.onEventsConnect()}_onEventsDisconnect(){this._removeEventSubscriptions(),this.onEventsDisconnect()}_addEventSubscriptions(){return tZ(this,void 0,void 0,function*(){let t=!!this._attributeRefs,n=!!this._assetIds,i=this._attributeRefs?this._attributeRefs:this._assetIds;if(i&&i.length>0){if(this._subscriptionIds=[],n){let t=yield e.getEventProvider().subscribeAssetEvents(i,!0,e=>this._onEvent(e)),n=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!M(i,n))return void e.getEventProvider().unsubscribe(t);this._subscriptionIds.push(t)}let o=yield e.getEventProvider().subscribeAttributeEvents(i,t,e=>this._onEvent(e)),r=this._attributeRefs?this._attributeRefs:this._assetIds;if(!this._subscriptionIds||!M(i,r))return void e.getEventProvider().unsubscribe(o);this._subscriptionIds.push(o)}})}_removeEventSubscriptions(){this._subscriptionIds&&(this._subscriptionIds.forEach(t=>{e.getEventProvider().unsubscribe(t)}),this._subscriptionIds=void 0)}_refreshEventSubscriptions(){this._removeEventSubscriptions(),this._addEventSubscriptions()}set assetIds(e){M(this._assetIds,e)||(this._assetIds=e,this._refreshEventSubscriptions(),this.requestUpdate("assetIds"))}get assetIds(){return this._assetIds}set attributeRefs(e){M(this._attributeRefs,e)||(this._attributeRefs=e,this._refreshEventSubscriptions())}get attributeRefs(){return this._attributeRefs}_sendEvent(t){e.getEventProvider().sendEvent(t)}_sendEventWithReply(t){return e.getEventProvider().sendEventWithReply(t)}onEventsConnect(){}onEventsDisconnect(){}_onEvent(e){}},t0="#4d9d2a",t1="#FFFFFF",t2="#F9F9F9",t5="#CCCCCC",t3="#FFFFFF",t4="#4c4c4c";var t6=function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})};let t8="openremote";function t7(e){let t=e?Object.assign({},e):{};return t.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=t8),t}!function(e){e.MANAGER_FAILED_TO_LOAD="MANAGER_FAILED_TO_LOAD",e.AUTH_FAILED="AUTH_FAILED",e.AUTH_TYPE_UNSUPPORTED="AUTH_TYPE_UNSUPPORTED",e.CONSOLE_ERROR="CONSOLE_INIT_ERROR",e.EVENTS_CONNECTION_ERROR="EVENTS_CONNECTION_ERROR",e.TRANSLATION_ERROR="TRANSLATION_ERROR"}(c||(c={})),function(e){e.ERROR="ERROR",e.READY="READY",e.ONLINE="ONLINE",e.OFFLINE="OFFLINE",e.CONNECTING="CONNECTING",e.CONSOLE_INIT="CONSOLE_INIT",e.CONSOLE_READY="CONSOLE_READY",e.TRANSLATE_INIT="TRANSLATE_INIT",e.TRANSLATE_LANGUAGE_CHANGED="TRANSLATE_LANGUAGE_CHANGED",e.DISPLAY_REALM_CHANGED="DISPLAY_REALM_CHANGED"}(s||(s={}));class t9{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 i=n.roles;e.set(t,i)}):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 tu}get language(){return m.ZP.language}set language(e){console.debug(`Changing language to ${e}.`),e&&(m.ZP.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(s.DISPLAY_REALM_CHANGED))}get clientId(){return this._config.clientId||t8}getEventProvider(){return this.events}get mapType(){return this._config.mapType||"VECTOR"}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 t6(this,void 0,void 0,function*(){this._config&&console.debug("Already initialised"),this._config=t7(e);let t=yield this.loadManagerInfo(),n=new eE(this._config.realm,this._config.consoleAutoEnable,()=>{this._emitEvent(s.CONSOLE_READY)});if(this._console=n,"BASIC"===this._config.auth)t=(yield this.doTranslateInit())&&t,t=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(/\/+$/,""),(t=yield this.doAuthInit())||this._config.skipFallbackToBasicAuth||(console.debug("Falling back to basic auth"),this._config.auth="BASIC",t=yield this.doAuthInit())}return!!t&&(t&&(t=this.doRestApiInit()),(yield this.doConsoleInit())&&this._clearWebHistory(),(t=(yield this.doTranslateInit())&&t)&&(t=yield this.doDescriptorsInit(),t=yield this.getConsoleAppConfig()),this.doIconInit(),t?(t=yield this.doEventsSubscriptionInit(),this._readyCallback&&(yield this._readyCallback()),this._ready=!0,this._emitEvent(s.READY)):(this._config=void 0,console.warn("Failed to initialise the manager")),this.displayRealm=e.realm||"master",t)})}loadManagerInfo(){return t6(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(c.MANAGER_FAILED_TO_LOAD),!1}})}doTranslateInit(){return t6(this,void 0,void 0,function*(){if(m.ZP.isInitialized)return!0;m.ZP.on("initialized",e=>{this._emitEvent(s.TRANSLATE_INIT)}),m.ZP.on("languageChanged",e=>{h().locale(e),this._emitEvent(s.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?h()(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 m.ZP.use(tU).init(e)}catch(e){return console.error(e),this._setError(c.TRANSLATION_ERROR),!1}return!0})}doDescriptorsInit(){return t6(this,void 0,void 0,function*(){if(!this.config.loadDescriptors)return!0;try{let e=yield tu.api.AssetModelResource.getAssetInfos(),t=yield tu.api.AssetModelResource.getMetaItemDescriptors(),n=yield tu.api.AssetModelResource.getValueDescriptors();l.NS._assetTypeInfos=e.data,l.NS._metaItemDescriptors=Object.values(t.data),l.NS._valueDescriptors=Object.values(n.data)}catch(e){return console.error(e),!1}return!0})}doAuthInit(){return t6(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(c.AUTH_TYPE_UNSUPPORTED),!1}return!!e&&(tu.addRequestInterceptor(e=>{if(!e.headers.Authorization){let t=this.getAuthorizationHeader();t&&(e.headers.Authorization=t)}return e}),e)})}doRestApiInit(){return tu.setTimeout(2e4),tu.initialise(this.getApiBaseUrl()),!0}doEventsSubscriptionInit(){return t6(this,void 0,void 0,function*(){let e=!1;return"WEBSOCKET"===this._config.eventProviderType&&(this._events=new ty(this._config.managerUrl),this._events.subscribeStatusChange(e=>this._onEventProviderStatusChanged(e)),e=yield this._events.connect()),e||this._setError(c.EVENTS_CONNECTION_ERROR),e})}_connectEvents(){var e;(null==(e=this.events)?void 0:e.status)===i.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 i.DISCONNECTED:this._onDisconnect();break;case i.CONNECTED:break;case i.CONNECTING:this._emitEvent(s.CONNECTING)}}doConsoleInit(){return t6(this,void 0,void 0,function*(){try{return yield this.console.initialise(),this._emitEvent(s.CONSOLE_INIT),!0}catch(e){return this._setError(c.CONSOLE_ERROR),!1}})}doIconInit(){this._config.loadIcons&&(t$.d5.addIconSet("mdi",(0,t$.aT)(ne.managerUrl)),t$.d5.addIconSet("or",(0,t$.bx)(t$.dE.size,t$.dE.icons)))}getConsoleAppConfig(){return t6(this,void 0,void 0,function*(){var e;try{let t=yield fetch((null!=(e=ne.managerUrl)?e:"")+"/consoleappconfig/"+ne.displayRealm+".json");return this._consoleAppConfig=yield t.json(),!0}catch(e){return!0}})}getConsolePreferredLanguage(){return t6(this,arguments,void 0,function*(e=this.console){return e.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return t6(this,arguments,void 0,function*(e=this._keycloak){if(e&&e.authenticated){let t=(null==e?void 0:e.profile)||(yield null==e?void 0:e.loadUserProfile());if(null==t?void 0:t.attributes){let e=new Map(Object.entries(t.attributes));if(e.has("locale")){let t=e.get("locale");if("string"==typeof t[0])return t[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(e){return t6(this,arguments,void 0,function*(e,t=this.rest){return this.authenticated?t?void(yield t.api.UserResource.updateCurrentUserLocale(e,{headers:{"Content-Type":"application/json"}})):void console.warn("Tried updating user language, but the REST API is not initialized yet."):void console.warn("Tried updating user language, but the user is not authenticated.")})}logout(e){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(e&&""!==e?{redirectUri:e}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,e?window.location.href=e:window.location.reload()))}login(e){switch(this._config.auth){case"BASIC":e&&e.credentials&&(this._config.credentials=Object.assign({},e.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let t={};e&&e.redirectUrl&&""!==e.redirectUrl&&(t.redirectUri=e.redirectUrl),(null==e?void 0:e.action)&&""!==e.action&&(t.action=e.action),this.isMobile()&&(t.scope="offline_access"),this._keycloak.login(t)}}}initialiseBasicAuth(){return t6(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return t6(this,void 0,void 0,function*(){var e,t,n,i;if(!this.config.basicLoginProvider)return;let o={username:(null==(e=this.config.credentials)?void 0:e.username)?null==(t=this.config.credentials)?void 0:t.username:"",password:(null==(n=this.config.credentials)?void 0:n.password)?null==(i=this.config.credentials)?void 0:i.password:"",cancel:!1},r=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!r;){if((o=yield this.config.basicLoginProvider(o.username,o.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!o.username||!o.password)continue;this._basicIdentity.token=btoa(o.username+":"+o.password);let e=!1;try{let t=yield tu.api.UserResource.getCurrent();200===t.status&&(e=!0,this._basicIdentity.user=t.data),e||401!==t.status&&403!==t.status||console.debug("Basic authentication invalid credentials, trying again")}catch(e){console.error("Basic auth failed: ",e)}if(e){console.debug("Basic authentication successful"),r=!0;let e=yield tu.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=e.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}r&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let e=location.pathname.split("/");return e.length>=1?e[1]:""}hasRealmRole(e){return this.isKeycloak()&&this._keycloak.hasRealmRole(e)}hasRole(e,t=this._config.clientId){let n=this.roles;return n&&n.has(t)&&n.get(t).indexOf(e)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return t6(this,void 0,void 0,function*(){var e,t,n,i;try{this._keycloak=new tK({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let o=yield this._getNativeOfflineRefreshToken(),r=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!r&&o)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=o,r=yield this._updateKeycloakAccessToken()}catch(e){console.error("Failed to authenticate using offline token")}if(r)this._name=null==(e=this._keycloak.tokenParsed)?void 0:e.name,this._username=null==(t=this._keycloak.tokenParsed)?void 0:t.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(i=null==(n=this._keycloak)?void 0:n.refreshTokenParsed)?void 0:i.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(e){return this._authenticated=!1,this._setError(c.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+e),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>t6(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return t6(this,void 0,void 0,function*(){let e=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+e),e&&this._onAuthenticated(),e})}_getNativeOfflineRefreshToken(){return t6(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(e){window.setTimeout(()=>{for(let t of this._listeners)t(e)},0)}_setError(e){this._error=e,this._emitEvent(s.ERROR),console.warn("Error set: "+e)}_clearWebHistory(){var e;this.isMobile()&&(null==(e=this.console)||e._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return t6(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(s.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(s.ONLINE)}reconnect(){return t6(this,arguments,void 0,function*(e=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let t=()=>t6(this,void 0,void 0,function*(){var e;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(t){let e=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=e;try{yield this._updateKeycloakAccessToken()}catch(e){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let t=this.events&&this.events.status===i.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+t),!t||(yield null==(e=this.events)?void 0:e.connect())}),n=yield t();if(void 0!==n){if(!n){console.debug("Scheduling another reconnect attempt in (ms): "+(e=Math.min(t9.MAX_RECONNECT_DELAY,e+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(e),e);return}this._onReconnected()}})}isKeycloakReachable(){return t6(this,arguments,void 0,function*(e=2e3){let t=new AbortController,n=setTimeout(()=>t.abort(),e);try{let e=this._keycloak.endpoints.token(),n=yield fetch(e,{method:"OPTIONS",signal:t.signal});return 200===n.status}catch(e){return!1}finally{clearTimeout(n)}})}}t9.MAX_RECONNECT_DELAY=45e3;let ne=new t9,nt=ne},384:function(e,t,n){"use strict";var i,o,r,a,c,s,d,l,m,u,f,p,h,b,_,g,y,v,F,k,w,x,E,A,T,L,C,M,D,S,I,O,Y,R,N,B,P,H,j,z,U,$,W,V,G,q,X,K,J,Z,Q,ee,et,en,ei,eo,er,ea,ec,es,ed,el,em,eu,ef;n.d(t,{NS:()=>ep}),function(e){e.CREATE="CREATE",e.UPDATE="UPDATE",e.DELETE="DELETE"}(i||(i={})),function(e){e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"}(o||(o={})),function(e){e.MANUAL="MANUAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET",e.AGENT="AGENT"}(r||(r={})),function(e){e.OPEN="OPEN",e.ACKNOWLEDGED="ACKNOWLEDGED",e.IN_PROGRESS="IN_PROGRESS",e.RESOLVED="RESOLVED",e.CLOSED="CLOSED"}(a||(a={})),function(e){e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(c||(c={})),function(e){e.CREATE="CREATE",e.READ="READ",e.UPDATE="UPDATE",e.DELETE="DELETE"}(s||(s={})),function(e){e.NONE="NONE",e.FORECAST="FORECAST",e.SETPOINT="SETPOINT"}(d||(d={})),function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTING="DISCONNECTING",e.CONNECTED="CONNECTED",e.DISABLED="DISABLED",e.WAITING="WAITING",e.ERROR="ERROR",e.STOPPED="STOPPED"}(l||(l={})),function(e){e.EV="EV",e.PHEV="PHEV"}(m||(m={})),function(e){e.YAZAKI="YAZAKI",e.MENNEKES="MENNEKES",e.LE_GRAND="LE_GRAND",e.CHADEMO="CHADEMO",e.COMBO="COMBO",e.SCHUKO="SCHUKO",e.ENERGYLOCK="ENERGYLOCK"}(u||(u={})),function(e){e.SOUTH="SOUTH",e.EAST_WEST="EAST_WEST"}(f||(f={})),function(e){e.REQUEST_START="REQUEST_START",e.REQUEST_REPEATING="REQUEST_REPEATING",e.REQUEST_CANCEL="REQUEST_CANCEL",e.READY="READY",e.COMPLETED="COMPLETED",e.RUNNING="RUNNING",e.CANCELLED="CANCELLED"}(p||(p={})),function(e){e.TOGGLE="TOGGLE",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.NEGATE="NEGATE"}(h||(h={})),function(e){e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",e.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",e.INVALID_VALUE="INVALID_VALUE",e.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",e.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",e.CANNOT_PROCESS="CANNOT_PROCESS",e.QUEUE_FULL="QUEUE_FULL",e.UNKNOWN="UNKNOWN",e.ASSET_ID_MISSING="ASSET_ID_MISSING",e.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(b||(b={})),function(e){e.PUBLIC="PUBLIC",e.SHARED="SHARED",e.PRIVATE="PRIVATE"}(_||(_={})),function(e){e.OFF="OFF",e.ONE_MIN="ONE_MIN",e.FIVE_MIN="FIVE_MIN",e.QUARTER="QUARTER",e.ONE_HOUR="ONE_HOUR"}(g||(g={})),function(e){e.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",e.KEEP_LAYOUT="KEEP_LAYOUT",e.REDIRECT="REDIRECT",e.BLOCK_DEVICE="BLOCK_DEVICE"}(y||(y={})),function(e){e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e.WEEK="WEEK",e.MONTH="MONTH",e.YEAR="YEAR"}(v||(v={})),function(e){e.MIN="MIN",e.AVG="AVG",e.MAX="MAX",e.DIFFERENCE="DIFFERENCE",e.COUNT="COUNT",e.SUM="SUM",e.MODE="MODE",e.MEDIAN="MEDIAN"}(F||(F={})),function(e){e.TERMINATING="TERMINATING",e.DISABLED="DISABLED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.UNRECOGNISED="UNRECOGNISED",e.PERMANENT_ERROR="PERMANENT_ERROR",e.SYNC_ERROR="SYNC_ERROR"}(k||(k={})),function(e){e.HTTPS="HTTPS",e.HTTP="HTTP",e.TCP="TCP"}(w||(w={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.OPTIONS="OPTIONS",e.PATCH="PATCH"}(x||(x={})),function(e){e.KEYCLOAK="KEYCLOAK",e.BASIC="BASIC",e.NONE="NONE"}(E||(E={})),function(e){e.WEBSOCKET="WEBSOCKET",e.POLLING="POLLING"}(A||(A={})),function(e){e.VECTOR="VECTOR",e.RASTER="RASTER"}(T||(T={})),function(e){e.INTERNAL="INTERNAL",e.CLIENT="CLIENT",e.GLOBAL_RULESET="GLOBAL_RULESET",e.REALM_RULESET="REALM_RULESET",e.ASSET_RULESET="ASSET_RULESET"}(L||(L={})),function(e){e.REALM="REALM",e.USER="USER",e.ASSET="ASSET",e.CUSTOM="CUSTOM"}(C||(C={})),function(e){e.NORMAL="NORMAL",e.HIGH="HIGH"}(M||(M={})),function(e){e.DEVICE="DEVICE",e.TOPIC="TOPIC",e.CONDITION="CONDITION"}(D||(D={})),function(e){e.ALWAYS="ALWAYS",e.ONCE="ONCE",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.ANNUALLY="ANNUALLY"}(S||(S={})),function(e){e.MESSAGE_INVALID="MESSAGE_INVALID",e.CERTIFICATE_INVALID="CERTIFICATE_INVALID",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",e.CONFIG_DISABLED="CONFIG_DISABLED",e.USER_DISABLED="USER_DISABLED",e.SERVER_ERROR="SERVER_ERROR",e.ASSET_ERROR="ASSET_ERROR",e.SERVER_BUSY="SERVER_BUSY"}(I||(I={})),function(e){e.PRIVATE="PRIVATE",e.PROTECTED="PROTECTED",e.PUBLIC="PUBLIC"}(O||(O={})),function(e){e.EXACT="EXACT",e.BEGIN="BEGIN",e.END="END",e.CONTAINS="CONTAINS"}(Y||(Y={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_EQUALS="GREATER_EQUALS",e.LESS_THAN="LESS_THAN",e.LESS_EQUALS="LESS_EQUALS",e.BETWEEN="BETWEEN"}(R||(R={})),function(e){e.CREATED_ON="CREATED_ON",e.NAME="NAME",e.ASSET_TYPE="ASSET_TYPE",e.PARENT_ID="PARENT_ID",e.REALM="REALM"}(N||(N={})),function(e){e.RESTRICTED="RESTRICTED",e.LINKED="LINKED",e.REALM="REALM"}(B||(B={})),function(e){e.AT_LEAST_ONE="AT_LEAST_ONE",e.ALL="ALL",e.NONE="NONE"}(P||(P={})),function(e){e.AND="AND",e.OR="OR"}(H||(H={})),function(e){e.CREATED_ON="CREATED_ON",e.FIRST_NAME="FIRST_NAME",e.LAST_NAME="LAST_NAME",e.USERNAME="USERNAME",e.EMAIL="EMAIL"}(j||(j={})),function(e){e.STOPPED="STOPPED",e.RUNNING="RUNNING",e.ERROR="ERROR"}(z||(z={})),function(e){e.JAVASCRIPT="JAVASCRIPT",e.GROOVY="GROOVY",e.JSON="JSON",e.FLOW="FLOW"}(U||(U={})),function(e){e.READY="READY",e.DEPLOYED="DEPLOYED",e.COMPILATION_ERROR="COMPILATION_ERROR",e.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",e.EXECUTION_ERROR="EXECUTION_ERROR",e.LOOP_ERROR="LOOP_ERROR",e.DISABLED="DISABLED",e.PAUSED="PAUSED",e.EXPIRED="EXPIRED",e.REMOVED="REMOVED",e.EMPTY="EMPTY"}($||($={})),function(e){e.SUNRISE="SUNRISE",e.SUNSET="SUNSET",e.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",e.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",e.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",e.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",e.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",e.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",e.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",e.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",e.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",e.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",e.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",e.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",e.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",e.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",e.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",e.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",e.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",e.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}(W||(W={})),function(e){e.NUMBER="NUMBER",e.NUMBER_ARRAY="NUMBER_ARRAY",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.TRIGGER="TRIGGER",e.COLOR="COLOR",e.ANY="ANY"}(V||(V={})),function(e){e.NEW_LINE="NEW_LINE",e.SPACER="SPACER"}(G||(G={})),function(e){e.INPUT="INPUT",e.PROCESSOR="PROCESSOR",e.OUTPUT="OUTPUT",e.THEN="THEN"}(q||(q={})),function(e){e.TEXT="TEXT",e.MULTILINE="MULTILINE",e.NUMBER="NUMBER",e.DROPDOWN="DROPDOWN",e.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",e.CHECKBOX="CHECKBOX",e.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",e.COLOR="COLOR",e.DATE="DATE"}(X||(X={})),function(e){e.ADD="ADD",e.ADD_OR_REPLACE="ADD_OR_REPLACE",e.REPLACE="REPLACE",e.DELETE="DELETE",e.CLEAR="CLEAR"}(K||(K={})),function(e){e.PER_ASSET="PER_ASSET",e.GLOBAL="GLOBAL"}(J||(J={})),function(e){e.READ_ADMIN="read:admin",e.READ_LOGS="read:logs",e.READ_USERS="read:users",e.READ_MAP="read:map",e.READ_ASSETS="read:assets",e.READ_RULES="read:rules",e.READ_INSIGHTS="read:insights",e.READ_ALARMS="read:alarms",e.READ_SERVICES="read:services",e.WRITE_SERVICES="write:services",e.WRITE_USER="write:user",e.WRITE_ADMIN="write:admin",e.WRITE_LOGS="write:logs",e.WRITE_ASSETS="write:assets",e.WRITE_ATTRIBUTES="write:attributes",e.WRITE_RULES="write:rules",e.WRITE_INSIGHTS="write:insights",e.WRITE_ALARMS="write:alarms",e.READ="read",e.WRITE="write"}(Z||(Z={})),function(e){e.REGISTER="REGISTER",e.UPDATE="UPDATE",e.DEREGISTER="DEREGISTER"}(Q||(Q={})),function(e){e.AVAILABLE="AVAILABLE",e.UNAVAILABLE="UNAVAILABLE"}(ee||(ee={})),function(e){e.ASSET="ASSET",e.AGENT="AGENT",e.NOTIFICATION="NOTIFICATION",e.ALARM="ALARM",e.RULES="RULES",e.PROTOCOL="PROTOCOL",e.GATEWAY="GATEWAY",e.MODEL_AND_VALUES="MODEL_AND_VALUES",e.API="API",e.DATA="DATA"}(et||(et={})),function(e){e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(en||(en={})),function(e){e.NUMERIC="numeric",e.DIGIT_2="2-digit",e.FULL="full",e.LONG="long",e.MEDIUM="medium",e.SHORT="short",e.NARROW="narrow"}(ei||(ei={})),function(e){e.SECONDLY="SECONDLY",e.MINUTELY="MINUTELY",e.HOURLY="HOURLY",e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.YEARLY="YEARLY"}(eo||(eo={})),function(e){e.OMIT="OMIT",e.BACKWARD="BACKWARD",e.FORWARD="FORWARD"}(er||(er={})),function(e){e.JAPANESE="JAPANESE",e.BUDDHIST="BUDDHIST",e.ROC="ROC",e.ISLAMIC="ISLAMIC",e.ISO8601="ISO8601",e.CHINESE="CHINESE",e.ETHIOPIC="ETHIOPIC",e.HEBREW="HEBREW",e.GREGORIAN="GREGORIAN"}(ea||(ea={})),function(e){e.SU="SU",e.MO="MO",e.TU="TU",e.WE="WE",e.TH="TH",e.FR="FR",e.SA="SA"}(ec||(ec={})),function(e){e.PEOPLECOUNTERASSET="PeopleCounterAsset",e.STORAGESIMULATORAGENT="StorageSimulatorAgent",e.CITYASSET="CityAsset",e.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",e.ELECTRICVEHICLEASSET="ElectricVehicleAsset",e.CONSOLEASSET="ConsoleAsset",e.PRESENCESENSORASSET="PresenceSensorAsset",e.LIGHTASSET="LightAsset",e.THETHINGSSTACKAGENT="TheThingsStackAgent",e.PLUGASSET="PlugAsset",e.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",e.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",e.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",e.TCPAGENT="TCPAgent",e.SERIALAGENT="SerialAgent",e.BLUETOOTHMESHAGENT="BluetoothMeshAgent",e.SNMPAGENT="SNMPAgent",e.GROUPASSET="GroupAsset",e.BUILDINGASSET="BuildingAsset",e.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",e.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",e.MQTTAGENT="MQTTAgent",e.MICROPHONEASSET="MicrophoneAsset",e.MODBUSTCPAGENT="ModbusTcpAgent",e.HTTPAGENT="HTTPAgent",e.DOORASSET="DoorAsset",e.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",e.MAILAGENT="MailAgent",e.UDPAGENT="UDPAgent",e.ROOMASSET="RoomAsset",e.VENTILATIONASSET="VentilationAsset",e.TRADFRILIGHTASSET="TradfriLightAsset",e.KNXAGENT="KNXAgent",e.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",e.CHIRPSTACKAGENT="ChirpStackAgent",e.WEATHERASSET="WeatherAsset",e.THINGASSET="ThingAsset",e.WEBSOCKETAGENT="WebsocketAgent",e.GATEWAYASSET="GatewayAsset",e.PARKINGASSET="ParkingAsset",e.TRADFRIPLUGASSET="TradfriPlugAsset",e.SIMULATORAGENT="SimulatorAgent",e.MODBUSSERIALAGENT="ModbusSerialAgent",e.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",e.VELBUSTCPAGENT="VelbusTCPAgent",e.ARTNETLIGHTASSET="ArtnetLightAsset",e.VELBUSSERIALAGENT="VelbusSerialAgent",e.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",e.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",e.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",e.ZWAVEAGENT="ZWaveAgent",e.THERMOSTATASSET="ThermostatAsset",e.SHIPASSET="ShipAsset"}(es||(es={})),function(e){e.SUPPORTSEXPORT="supportsExport",e.MQTTPORT="MQTTPort",e.ENERGYSELFCONSUMPTION="energySelfConsumption",e.LASTACCESS="lastAccess",e.CHARGERID="chargerID",e.POSITION="position",e.CARBONSAVING="carbonSaving",e.ROUTINGMODE="routingMode",e.LASTWILLRETAIN="lastWillRetain",e.LASTWILLTOPIC="lastWillTopic",e.SERIALBAUDRATE="serialBaudrate",e.BASEURL="baseURL",e.REQUIREDVALUES="requiredValues",e.FINANCIALSAVING="financialSaving",e.FLEETCATEGORY="fleetCategory",e.GATEWAYSTATUS="gatewayStatus",e.NO2LEVEL="NO2Level",e.ATMOSPHERICPRESSURE="atmosphericPressure",e.TAGS="tags",e.UNLOCK="unlock",e.MILEAGEMIN="mileageMin",e.CHECKINTERVALSECONDS="checkIntervalSeconds",e.LOCATION="location",e.CLIENTSECRET="clientSecret",e.WINDDIRECTION="windDirection",e.WINDSPEED="windSpeed",e.PARTICLESPM10="particlesPM10",e.APPLICATIONKEY="applicationKey",e.POWEREXPORTMAX="powerExportMax",e.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",e.WATERLEVEL="waterLevel",e.CONSOLENAME="consoleName",e.CONNECTHEADERS="connectHeaders",e.WEBSOCKETQUERY="websocketQuery",e.PREFERHTML="preferHTML",e.COOLING="cooling",e.POLLINGMILLIS="pollingMillis",e.SOILTEMPERATURE="soilTemperature",e.SUNIRRADIANCE="sunIrradiance",e.ODOMETER="odometer",e.SUPPORTSIMPORT="supportsImport",e.MESSAGEMAXLENGTH="messageMaxLength",e.WINDGUSTSPEED="windGustSpeed",e.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",e.LIGHTID="lightId",e.POWER="power",e.STREET="street",e.DELETEPROCESSEDMAIL="deleteProcessedMail",e.WINDSPEEDMIN="windSpeedMin",e.POWERSETPOINT="powerSetpoint",e.PRESENCE="presence",e.SPACESOCCUPIED="spacesOccupied",e.STARTTLS="startTLS",e.AGENTSTATUS="agentStatus",e.MESSAGECHARSET="messageCharset",e.CERTIFICATEALIAS="certificateAlias",e.PANELPITCH="panelPitch",e.EMAIL="email",e.BINDPORT="bindPort",e.PARTICLESPM1="particlesPM1",e.SPEED="speed",e.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",e.MESSAGESTRIPDELIMITER="messageStripDelimiter",e.AREA="area",e.COUNTRY="country",e.SHIPTYPE="shipType",e.CONNECTSUBSCRIPTIONS="connectSubscriptions",e.RELATIVEHUMIDITY="relativeHumidity",e.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",e.SOURCEADDRESS="sourceAddress",e.RAINFALL="rainfall",e.ENERGYIMPORTTOTAL="energyImportTotal",e.OAUTHGRANT="oAuthGrant",e.OZONELEVEL="ozoneLevel",e.COUNTINMINUTE="countInMinute",e.PORT="port",e.TUNNELINGSUPPORTED="tunnelingSupported",e.ENINUMBER="ENINumber",e.AGENTDISABLED="agentDisabled",e.DISABLED="disabled",e.FORCECHARGE="forceCharge",e.TIMEINJECTIONINTERVAL="timeInjectionInterval",e.FINANCIALWEIGHTING="financialWeighting",e.ENERGYLEVELPERCENTAGE="energyLevelPercentage",e.SPACESBUFFER="spacesBuffer",e.VEHICLECATEGORY="vehicleCategory",e.FANSPEED="fanSpeed",e.FINANCIALCOST="financialCost",e.NOTES="notes",e.MAILFOLDERNAME="mailFolderName",e.TEMPERATURE="temperature",e.AVAILABLECHARGINGSPACES="availableChargingSpaces",e.ENERGYCAPACITY="energyCapacity",e.POWERIMPORTMIN="powerImportMin",e.INTERVALSIZE="intervalSize",e.SNMPVERSIONVALUE="SNMPVersionValue",e.SOUNDLEVEL="soundLevel",e.UNITID="unitId",e.STOPBITS="stopBits",e.CONNECTURL="connectURL",e.CLIENTID="clientId",e.VEHICLEID="vehicleID",e.SUNAZIMUTH="sunAzimuth",e.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",e.WEBSOCKETMODE="websocketMode",e.COLOURTEMPERATURE="colourTemperature",e.VEHICLECONNECTED="vehicleConnected",e.DATABITS="dataBits",e.MILEAGEMINIMUM="mileageMinimum",e.COLOURRGB="colourRGB",e.CARBONIMPORT="carbonImport",e.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",e.PRICEHOURLY="priceHourly",e.WINDSPEEDMAX="windSpeedMax",e.PINGDISABLED="pingDisabled",e.FLOW="flow",e.CHILDASSETTYPE="childAssetType",e.NETWORKKEY="networkKey",e.UNIVERSE="universe",e.MSSINUMBER="MSSINumber",e.SUBSCRIBEQOS="subscribeQos",e.LEDCOUNT="lEDCount",e.LOCKED="locked",e.CLOUDCOVERAGE="cloudCoverage",e.PROTOCOL="protocol",e.TARIFFIMPORT="tariffImport",e.ENERGYRENEWABLESHARE="energyRenewableShare",e.REGION="region",e.CONSOLEPLATFORM="consolePlatform",e.POWEREXPORTMIN="powerExportMin",e.EFFICIENCYEXPORT="efficiencyExport",e.CHARGECYCLES="chargeCycles",e.SERIALPORT="serialPort",e.APPLICATIONID="applicationId",e.PANELORIENTATION="panelOrientation",e.LENGTH="length",e.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",e.USERNAMEPASSWORD="usernamePassword",e.POWERFORECAST="powerForecast",e.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",e.REQUESTQUERYPARAMETERS="requestQueryParameters",e.PROXYADDRESS="proxyAddress",e.MQTTHOST="MQTTHost",e.ENERGYLOCAL="energyLocal",e.ENERGYAUTARKY="energyAutarky",e.MODEL="model",e.MANUFACTURER="manufacturer",e.ONOFF="onOff",e.RESUMESESSION="resumeSession",e.TARIFFEXPORT="tariffExport",e.APIKEY="ApiKey",e.CITY="city",e.CONNECTORTYPE="connectorType",e.ENERGYEXPORTTOTAL="energyExportTotal",e.CARBONEXPORT="carbonExport",e.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",e.ENERGYLEVEL="energyLevel",e.OPTIMISATIONDISABLED="optimisationDisabled",e.WEBSOCKETPATH="websocketPath",e.WINDSPEEDREFERENCE="windSpeedReference",e.PRICEDAILY="priceDaily",e.COUNTGROWTHMINUTE="countGrowthMinute",e.IMONUMBER="IMONumber",e.ATTRIBUTION="Attribution",e.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",e.REQUESTHEADERS="requestHeaders",e.TENANTID="tenantId",e.HOST="host",e.COUNTOUTMINUTE="countOutMinute",e.ENERGYTYPE="energyType",e.CONSOLEVERSION="consoleVersion",e.MTU="mtu",e.PANELAZIMUTH="panelAzimuth",e.SEQUENCENUMBER="sequenceNumber",e.SUNALTITUDE="sunAltitude",e.COUNTOUT="countOut",e.CHARGERCONNECTED="chargerConnected",e.ROOMNUMBER="roomNumber",e.PARTICLESPM2_5="particlesPM2_5",e.MESSAGESOURCEADDRESS="messageSourceAddress",e.COUNTIN="countIn",e.MILEAGECHARGED="mileageCharged",e.PROVISIONWEATHERASSET="ProvisionWeatherAsset",e.TEMPERATURESETPOINT="temperatureSetpoint",e.CONSOLEPROVIDERS="consoleProviders",e.POWERIMPORTMAX="powerImportMax",e.COUNTTOTAL="countTotal",e.SPACESTOTAL="spacesTotal",e.BINDHOST="bindHost",e.MESSAGECONVERTBINARY="messageConvertBinary",e.MESSAGEDELIMITERS="messageDelimiters",e.EFFICIENCYIMPORT="efficiencyImport",e.SUNZENITH="sunZenith",e.BRIGHTNESS="brightness",e.POSTALCODE="postalCode",e.SPACESOPEN="spacesOpen",e.HUMIDITY="humidity",e.SECUREMODE="secureMode",e.MILEAGECAPACITY="mileageCapacity",e.DIRECTION="direction",e.ENERGYLEVELSCHEDULE="energyLevelSchedule",e.UVINDEX="uVIndex",e.NATMODE="NATMode",e.UPDATEONWRITE="updateOnWrite",e.LASTWILLPAYLOAD="lastWillPayload",e.GROUPID="groupId",e.FOLLOWREDIRECTS="followRedirects",e.CARBONCOST="carbonCost",e.MESSAGECONVERTHEX="messageConvertHex",e.PUBLISHQOS="publishQos"}(ed||(ed={})),function(e){e.FORMAT="format",e.RULESTATE="ruleState",e.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",e.STOREDATAPOINTS="storeDataPoints",e.LABEL="label",e.CONSTRAINTS="constraints",e.SHOWONDASHBOARD="showOnDashboard",e.READONLY="readOnly",e.MULTILINE="multiline",e.ACCESSPUBLICWRITE="accessPublicWrite",e.MOMENTARY="momentary",e.AGENTLINK="agentLink",e.ACCESSRESTRICTEDREAD="accessRestrictedRead",e.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",e.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",e.SECRET="secret",e.ATTRIBUTELINKS="attributeLinks",e.RULERESETIMMEDIATE="ruleResetImmediate",e.AGENTLINKCONFIG="agentLinkConfig",e.FORECAST="forecast",e.UNITS="units",e.USERCONNECTED="userConnected",e.ACCESSPUBLICREAD="accessPublicRead"}(el||(el={})),function(e){e.WSURL="WS_URL",e.POSITIVENUMBER="positiveNumber",e.VALUEDESCRIPTOR="valueDescriptor",e.LONG="long",e.BOOLEANMAP="booleanMap",e.MQTTQOS="MQTTQos",e.GEOJSONPOINT="GEO_JSONPoint",e.SNMPVERSION="SNMPVersion",e.ASSETTYPE="assetType",e.JSONOBJECT="JSONObject",e.BIGNUMBER="bigNumber",e.IPADDRESS="IPAddress",e.EMAIL="email",e.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",e.ATTRIBUTEREFERENCE="attributeReference",e.INTEGER="integer",e.OAUTHGRANT="oAuthGrant",e.NUMBER="number",e.TEXTMAP="textMap",e.WEBSOCKETSUBSCRIPTION="websocketSubscription",e.BOOLEAN="boolean",e.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",e.TIMESTAMPISO8601="timestampISO8601",e.MULTIVALUEDTEXTMAP="multivaluedTextMap",e.JSON="JSON",e.INTEGERBYTE="integerByte",e.AGENTLINK="agentLink",e.CALENDAREVENT="calendarEvent",e.CONNECTIONSTATUS="connectionStatus",e.VALUECONSTRAINT="valueConstraint",e.ASSETQUERY="assetQuery",e.COLOURRGB="colourRGB",e.VALUEFORMAT="valueFormat",e.TEXT="text",e.BYTE="byte",e.USERNAMEANDPASSWORD="usernameAndPassword",e.HTTPURL="HTTP_URL",e.ATTRIBUTELINK="attributeLink",e.ASSETID="assetID",e.NUMBERMAP="numberMap",e.HTTPMETHOD="HTTPMethod",e.PANELORIENTATION="panelOrientation",e.ATTRIBUTESTATE="attributeState",e.POSITIVEINTEGER="positiveInteger",e.EXECUTIONSTATUS="executionStatus",e.BIGINTEGER="bigInteger",e.PERIODDURATIONISO8601="periodDurationISO8601",e.DATEANDTIME="dateAndTime",e.CONNECTORTYPE="connectorType",e.NEGATIVEINTEGER="negativeInteger",e.TCPIPPORTNUMBER="TCP_IPPortNumber",e.INTEGERMAP="integerMap",e.ENERGYTYPE="energyType",e.TIMESTAMP="timestamp",e.UUID="UUID",e.FORECASTCONFIGURATION="forecastConfiguration",e.TIMEDURATIONISO8601="timeDurationISO8601",e.CONSOLEPROVIDERS="consoleProviders",e.NEGATIVENUMBER="negativeNumber",e.CRONEXPRESSION="CRONExpression",e.DIRECTION="direction",e.HOSTORIPADDRESS="hostOrIPAddress"}(em||(em={})),function(e){e.MONTH="month",e.MILE_SCANDINAVIAN="mile_scandinavian",e.YEAR="year",e.VOLT="volt",e.HERTZ="hertz",e.MILE="mile",e.BTU="btu",e.FOOT="foot",e.MEGA="mega",e.INCH="inch",e.IN_HG="inch_mercury",e.CENTI="centi",e.GRAM="gram",e.KNOT="knot",e.METRE="metre",e.LITRE="litre",e.FLUID_OUNCE="fluid_ounce",e.CELSIUS="celsius",e.DECIBEL="decibel",e.FAHRENHEIT="fahrenheit",e.WATT="watt",e.PEAK="peak",e.MICRO="micro",e.PER="per",e.STONE="stone",e.VAR="var",e.OUNCE="ounce",e.HECTARE="hectare",e.YARD="yard",e.JOULE="joule",e.DEGREE="degree",e.KILO="kilo",e.KELVIN="kelvin",e.CARBON="carbon",e.DECIBEL_ATTENUATED="decibel_attenuated",e.SQUARED="squared",e.PERCENTAGE="percentage",e.CUBED="cubed",e.DAY="day",e.RADIAN="radian",e.OHM="ohm",e.MINUTE="minute",e.PART_PER_MILLION="ppm",e.AMP="amp",e.MASS_POUND="pound",e.HOUR="hour",e.ACRE="acre",e.RPM="rpm",e.PASCAL="pascal",e.LUMEN="lumen",e.WEEK="week",e.GALLON="gallon",e.LUX="lux",e.MILLI="milli",e.BAR="bar",e.HECTO="hecto",e.SECOND="second"}(eu||(eu={})),ef||(ef={});class ep{static getAssetDescriptors(){return ep._assetTypeInfos.map(e=>e.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(e){if(e)return e.assetDescriptor?e:("string"!=typeof e&&(e=e.name),this._assetTypeInfos.find(t=>t.assetDescriptor.name===e))}static getAssetDescriptor(e){if(!e)return;if(e.assetDescriptor)return e.assetDescriptor;if("string"!=typeof e)return e;let t=this._assetTypeInfos.find(t=>t.assetDescriptor.name===e);return t?t.assetDescriptor:void 0}static getAttributeDescriptor(e,t){if(!e)return;let n=this.getAssetTypeInfo(t||"ThingAsset");if(n&&n.attributeDescriptors)return n.attributeDescriptors.find(t=>t.name===e)}static getValueDescriptor(e){let t;if(!e)return;if(e.endsWith("[]"))for(t=0;e.endsWith("[]");)e=e.substring(0,e.length-2),t++;let n=this._valueDescriptors.find(t=>t.name===e);return n&&t&&(n=Object.assign(Object.assign({},n),{arrayDimensions:t})),n}static resolveValueDescriptor(e,t){let n;return t&&("string"==typeof t&&(n=ep.getValueDescriptor(t)),n=t.jsonType?t:ep.getValueDescriptor(t.type)),!n&&e&&(n=ep.getValueDescriptor("JSON")),n}static resolveValueTypeFromValue(e){if(null!=e){if("number"==typeof e)return"number";if("string"==typeof e)return"text";if("boolean"==typeof e)return"boolean";if(Array.isArray(e)){let t=1,n=e.find(e=>null!=e);for(;Array.isArray(n);)n=n.find(e=>null!=e),t++;let i=this.resolveValueTypeFromValue(n);if(!i)return;for(;t>0;)i+="[]",t--;return i}if(e instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(e,t,n){let i,o;if(t&&"string"!=typeof t)i=t;else{let o=this.getAssetTypeInfo(e||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof t&&(i=this.getAttributeDescriptor(t,o)),!i&&n&&(i={type:n.type,name:n.name,meta:n.meta})}return i&&(o=this.getValueDescriptor(i.type)),[i,o]}static getMetaItemDescriptor(e){if(e)return this._metaItemDescriptors.find(t=>t.name===e)}static getAssetDescriptorColour(e,t){let n=this.getAssetDescriptor(e);return n&&n.colour?n.colour:t}static getAssetDescriptorIcon(e,t){let n=this.getAssetDescriptor(e);return n&&n.icon?n.icon:t}}ep._assetTypeInfos=[],ep._metaItemDescriptors=[],ep._valueDescriptors=[]},4846:function(e,t,n){"use strict";n.d(t,{aT:()=>b,bx:()=>h,d5:()=>g,dE:()=>m,s3:()=>y});var i=n(538),o=n(9019),r=n(9069);class a extends o.Xe{constructor(e){if(super(e),this.it=r.Ld,e.type!==o.pX.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===r.Ld||null==e)return this._t=void 0,this.it=e;if(e===r.Jb)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}a.directiveName="unsafeHTML",a.resultType=1,(0,o.XM)(a);class c extends a{}c.directiveName="unsafeSVG",c.resultType=2;let s=(0,o.XM)(c);var d=n(3176),l=n(384);let m={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};var u=function(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a};let f=n(7319);class p extends CustomEvent{constructor(){super(p.NAME,{bubbles:!0,composed:!0})}}function h(e,t){return{getIconTemplate:n=>{let o=t[n];return o?(0,i.dy)`
|
|
579
579
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
580
580
|
viewBox="0 0 ${e} ${e}" preserveAspectRatio="xMidYMid meet" focusable="false">
|
|
581
581
|
${s(o.startsWith("<")?o:'<path xmlns="http://www.w3.org/2000/svg" d="'+o+'" />')}
|