@olympeio/runtime-node 9.4.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -208,764 +208,769 @@ da('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d
208
208
  da('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(this);return ia(c,b-d.length)+d}});da('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ha(this);return d+ia(c,b-d.length)}});da('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
209
209
  da('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});da('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
210
210
  da('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});da('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});
211
- da('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ja=this||self;function B(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={Ij:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.Ij().olympe=olympe;olympe.QA=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const ka=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
212
- (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Na={};olympe.Na.node={};olympe.U={};olympe.U.Ze={};olympe.U.Ze.Wm=class{process(a){const b=Object.keys(a.Yd);let c,d;c=0;for(d=b.length;c<d;c++)if(a.nd(b[c]).Yl())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.Ze.Wm.sa=[olympe.U.Ze.Do];olympe.U.Ze.Xm=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.nd(g),c(g.ei(),h),g=g.Hh,null!==g))for(let k=0,m=g.length;k<m;k++)c(g[k].ei(),h)}function c(g,h){for(let k=0,m=g.length,n;k<m;k++)n=g[k],n instanceof olympe.U.pb&&b(n.W(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Yd);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
213
- !0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.Ze.Xm.sa=[olympe.U.Ze.Do];olympe.U.Ze.Do=class{process(){}};const la=[],ma=[];function na(a){const b=a.ab();b.debug('Registering configurations...');b.C++;la.forEach(c=>{C(a.L,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});oa(b);b.debug('done registering')}function pa(a){const b=a.ab();b.debug('Running run callbacks of container...');b.C++;ma.forEach(c=>{const d=qa(a,c.ei());a.L.debug('Calling run callback '+(c.C?'for module '+c.C:''));c.F.apply(null,d)});oa(b);b.debug('done calling run callbacks. DI process completed!')}
214
- olympe.U.an=class{constructor(){}static C(a,b){la.push(new olympe.U.nk(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});ma.push(new olympe.U.nk(b,c,a))}};olympe.U.config=olympe.U.an.C;olympe.U.run=olympe.U.an.F;olympe.U.ik=class{constructor(){}getValue(){}};olympe.U.nk=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.U.pb(c[d]))}}ei(){return this.G}};function ra(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.U.Cg.C.Yk)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.L.error('Error during instantiation of service '+b),f;}!e.G&&(a.C[b]=d)}return d}function qa(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.L.C++,f=b[e],d[e]=f instanceof olympe.U.ik?f.getValue(a):f,oa(a.L);return d}
215
- olympe.U.Cg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.L=new olympe.U.co(c);a=olympe.U.R.Of;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}ab(){return this.L}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.Cg.C={Yq:'exception',Yk:'null'};function sa(a,b,c){function d(f,g){let h,k,m;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],m=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[m.join('.')]=k:d(k,m))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.L,'Defining service '+b);a.C(b,c,d,!1,!1)}function ta(a,b,c,...d){C(a.L,'Defining service '+b);a.C(b,c,d,!1,!0)}
216
- function E(a,b,c,d,e=!1){C(a.L,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function ua(a,b,c,d=!1){C(a.L,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function va(a,b){C(a.L,'Defining abstract service '+b);a.C(b).F=!0}function wa(a,b){a.parameters[olympe.P.V.Um.toLowerCase()]=b}function F(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
217
- olympe.U.Pq=class{constructor(a){var b=xa,c=ya;this.Yd=Object.create(null);this.parameters=Object.create(null);this.K=[new olympe.U.Ze.Wm,new olympe.U.Ze.Xm];this.F=[];b&&sa(this,b);c&&sa(this,c,'version');a&&sa(this,a);a=this.getParameter(olympe.U.V.cs);this.G=void 0!==a?a:3;this.L=new olympe.U.co(this.G)}ab(){return this.L}C(a,b,c,d,e){const f=a instanceof olympe.U.pb?a.W():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Yd[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
218
- var g=this.Yd[f];g.id=g.id+'!!'+ ++olympe.U.xk.C;g.G=!0;g=g.id;c[h]=g;this.Yd[g]=this.Yd[f]}}this.Yd[f]=new olympe.U.xk(b,c,d||!1,f);return this.Yd[f]}nd(a){a=this.Yd[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.L.debug('Calling '+a.length+' configure callbacks');this.L.C++;a.forEach(b=>{C(this.L,'Calling callback');this.L.C++;b(this);oa(this.L)});oa(this.L);this.L.debug('Configuration summary: '+Object.keys(this.Yd).length+
219
- ' definitions');this.L.debug('Compiling...');this.L.C++;this.K.forEach((b,c)=>{this.L.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});oa(this.L);this.L.debug('Compilation done, returning container');return new olympe.U.Cg(this.Yd,this.parameters,this.G)}};olympe.U.xk=class{constructor(a,b,c,d){this.K=a||null;this.O=!!c;this.C=[];this.F=!1;this.Hh=null;if(b){this.C=b;for(let e=0,f=b.length;e<f;e++)'string'===typeof b[e]&&(b[e]=new olympe.U.pb(b[e]))}this.id=d||'';this.G=!1}W(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.K;let d=qa(a,this.C);const e=()=>{if(this.O)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.ef().run(()=>
220
- e()):e(),g=this.Hh;let h,k,m;if(null!==g&&0<g.length){b.C++;C(b,'Calling configuration callbacks:');k=0;for(m=g.length;k<m;k++)b.C++,h=g[k],C(b,'Calling additional configuration callback '+h.C),d=qa(a,h.ei()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}C(b,'Done instantiating '+this.id);return f}ei(){return this.C}Yl(){return this.F}config(a,b,c){null===this.Hh&&(this.Hh=[]);this.Hh.push(new olympe.U.nk(b,c,a))}};olympe.U.xk.C=0;function oa(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&za(a,'log','DI: '+b)}function za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.U.co=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&za(this,'log','DI: '+a)}info(a){3>=this.F&&za(this,'info','DI: '+a)}warn(a){4>=this.F&&za(this,'warn','DI: '+a)}error(a){5>=this.F&&za(this,'error','DI: '+a)}};olympe.U.ma=class extends olympe.U.ik{constructor(a){super();this.id=a}W(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.pb=class extends olympe.U.ik{constructor(a,b){super();this.id=a;this.C=b||olympe.U.Cg.C.Yq}W(){return this.id}getValue(a){return ra(a,this.id,this.C)}};olympe.U.R={Of:'di.Container',Fy:'di.PublicContainer'};olympe.U.V={cs:'logging.di'};olympe.U.run([olympe.U.R.Of],a=>{olympe.U.getParameter=b=>a.getParameter(b)});olympe.Y={};function Aa(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Ba(){var a=Math.random();return Aa((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Ca=Math.pow(2,32)-1;olympe.Y.hc=function(){return Ba()};olympe.Y.$e=function(){return Ba()};olympe.Y.dB=function(a,b=1){const c=a.substr(12,a.length-12);return Aa(parseInt(a.substr(0,12),16)+b)+c};
221
- olympe.Y.bB=function(a){return Aa(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Da=0,Ea=0;olympe.Y.au=function(){var a=(new Date).getTime();a<=Da?4294967295===Ea?(Ea=Math.floor(Math.random()/4*Ca),Da+=1):Ea=Math.floor(Ea+(4294967295-Ea)/2):(Ea=Math.floor(Math.random()/4*Ca),Da=a);a='00000000'+Ea.toString(16);return Aa(Da)+a.substr(a.length-8,8)};olympe.Y.sB=function(){for(let a=0;1E4>a;a++)console.log(olympe.Y.au())};
222
- olympe.Y.jg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.WA=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.Y.SA=function(a,b){return(b?b:'UI')+'-'+a};olympe.Y.Sn=class{constructor(a){this.id=a||olympe.Y.Sn.C++}Qa(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.Sn.C=0;olympe.Y.iy=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Y.Jg=function(a,b,c,d,e,f,g,h,k,m,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,m,n,p,q,0]};olympe.Y.Jg.F=function(a){return new olympe.Y.Jg(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.Y.Jg.C=function(){return new olympe.Y.Jg(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.Jg.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.Jg.prototype.get=function(a,b){return this.values[5*a+b]};olympe.Y.Promise={};olympe.Y.Promise.Lp=function(){};function Fa(a){return(new TextEncoder).encode(a).buffer}function Ga(a,b){return a.C(Fa(b))}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Y.lk=class{G(){}C(){}K(){}O(){}F(){}T(){}};olympe.Y.Gp=a=>a.replace('+','-').replace('/','_');olympe.Y.Ft=a=>a.replace('-','+').replace('_','/');function Ia(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Ia(a);else{let d;null==(d=a.G)||d.call(a)}},a.K)}function Ja(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function La(a,b){a.F=b;return a}
223
- olympe.Y.rl=class{constructor(a,b=a/2){this.timeout=a;this.K=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ia(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Ma(a,b){a.F=b}function Na(a,b){a.C.G=b}
224
- olympe.Y.ql=class{constructor(a){this.C=La(new olympe.Y.rl(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function Oa(a,b){return a+b&4294967295}
211
+ da('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ja=this||self;function B(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={Mj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.Mj().olympe=olympe;olympe.PA=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const ka=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
212
+ (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Na={};olympe.Na.node={};olympe.U={};olympe.U.$e={};olympe.U.$e.Wm=class{process(a){const b=Object.keys(a.Yd);let c,d;c=0;for(d=b.length;c<d;c++)if(a.rd(b[c]).Yl())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.$e.Wm.sa=[olympe.U.$e.Do];olympe.U.$e.Xm=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.rd(g),c(g.hi(),h),g=g.Kh,null!==g))for(let k=0,m=g.length;k<m;k++)c(g[k].hi(),h)}function c(g,h){for(let k=0,m=g.length,n;k<m;k++)n=g[k],n instanceof olympe.U.pb&&b(n.W(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Yd);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
213
+ !0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.$e.Xm.sa=[olympe.U.$e.Do];olympe.U.$e.Do=class{process(){}};const la=[],ma=[];function na(a){const b=a.ab();b.debug('Registering configurations...');b.C++;la.forEach(c=>{C(a.K,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});oa(b);b.debug('done registering')}function pa(a){const b=a.ab();b.debug('Running run callbacks of container...');b.C++;ma.forEach(c=>{const d=qa(a,c.hi());a.K.debug('Calling run callback '+(c.C?'for module '+c.C:''));c.F.apply(null,d)});oa(b);b.debug('done calling run callbacks. DI process completed!')}
214
+ olympe.U.an=class{constructor(){}static C(a,b){la.push(new olympe.U.qk(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});ma.push(new olympe.U.qk(b,c,a))}};olympe.U.config=olympe.U.an.C;olympe.U.run=olympe.U.an.F;olympe.U.kk=class{constructor(){}getValue(){}};olympe.U.qk=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.U.pb(c[d]))}}hi(){return this.G}};function ra(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.U.Eg.C.$k)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.K.error('Error during instantiation of service '+b),f;}!e.G&&(a.C[b]=d)}return d}function qa(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.K.C++,f=b[e],d[e]=f instanceof olympe.U.kk?f.getValue(a):f,oa(a.K);return d}
215
+ olympe.U.Eg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.K=new olympe.U.co(c);a=olympe.U.R.Pf;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}ab(){return this.K}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.Eg.C={Yq:'exception',$k:'null'};function sa(a,b,c){function d(f,g){let h,k,m;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],m=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[m.join('.')]=k:d(k,m))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!1)}function ta(a,b,c,...d){C(a.K,'Defining service '+b);a.C(b,c,d,!1,!0)}
216
+ function E(a,b,c,d,e=!1){C(a.K,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function ua(a,b,c,d=!1){C(a.K,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function va(a,b){C(a.K,'Defining abstract service '+b);a.C(b).F=!0}function wa(a,b){a.parameters[olympe.O.V.Um.toLowerCase()]=b}function F(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
217
+ olympe.U.Pq=class{constructor(a){var b=xa,c=ya;this.Yd=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.U.$e.Wm,new olympe.U.$e.Xm];this.F=[];b&&sa(this,b);c&&sa(this,c,'version');a&&sa(this,a);a=this.getParameter(olympe.U.V.cs);this.G=void 0!==a?a:3;this.K=new olympe.U.co(this.G)}ab(){return this.K}C(a,b,c,d,e){const f=a instanceof olympe.U.pb?a.W():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Yd[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
218
+ var g=this.Yd[f];g.id=g.id+'!!'+ ++olympe.U.zk.C;g.G=!0;g=g.id;c[h]=g;this.Yd[g]=this.Yd[f]}}this.Yd[f]=new olympe.U.zk(b,c,d||!1,f);return this.Yd[f]}rd(a){a=this.Yd[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.K.debug('Calling '+a.length+' configure callbacks');this.K.C++;a.forEach(b=>{C(this.K,'Calling callback');this.K.C++;b(this);oa(this.K)});oa(this.K);this.K.debug('Configuration summary: '+Object.keys(this.Yd).length+
219
+ ' definitions');this.K.debug('Compiling...');this.K.C++;this.L.forEach((b,c)=>{this.K.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});oa(this.K);this.K.debug('Compilation done, returning container');return new olympe.U.Eg(this.Yd,this.parameters,this.G)}};olympe.U.zk=class{constructor(a,b,c,d){this.L=a||null;this.P=!!c;this.C=[];this.F=!1;this.Kh=null;if(b){this.C=b;for(let e=0,f=b.length;e<f;e++)'string'===typeof b[e]&&(b[e]=new olympe.U.pb(b[e]))}this.id=d||'';this.G=!1}W(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.L;let d=qa(a,this.C);const e=()=>{if(this.P)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.ff().run(()=>
220
+ e()):e(),g=this.Kh;let h,k,m;if(null!==g&&0<g.length){b.C++;C(b,'Calling configuration callbacks:');k=0;for(m=g.length;k<m;k++)b.C++,h=g[k],C(b,'Calling additional configuration callback '+h.C),d=qa(a,h.hi()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}C(b,'Done instantiating '+this.id);return f}hi(){return this.C}Yl(){return this.F}config(a,b,c){null===this.Kh&&(this.Kh=[]);this.Kh.push(new olympe.U.qk(b,c,a))}};olympe.U.zk.C=0;function oa(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&za(a,'log','DI: '+b)}function za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.U.co=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&za(this,'log','DI: '+a)}info(a){3>=this.F&&za(this,'info','DI: '+a)}warn(a){4>=this.F&&za(this,'warn','DI: '+a)}error(a){5>=this.F&&za(this,'error','DI: '+a)}};olympe.U.ma=class extends olympe.U.kk{constructor(a){super();this.id=a}W(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.pb=class extends olympe.U.kk{constructor(a,b){super();this.id=a;this.C=b||olympe.U.Eg.C.Yq}W(){return this.id}getValue(a){return ra(a,this.id,this.C)}};olympe.U.R={Pf:'di.Container',Ey:'di.PublicContainer'};olympe.U.V={cs:'logging.di'};olympe.U.run([olympe.U.R.Pf],a=>{olympe.U.getParameter=b=>a.getParameter(b)});olympe.Y={};function Aa(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Ba(){var a=Math.random();return Aa((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Ca=Math.pow(2,32)-1;olympe.Y.ic=function(){return Ba()};olympe.Y.af=function(){return Ba()};olympe.Y.cB=function(a,b=1){const c=a.substr(12,a.length-12);return Aa(parseInt(a.substr(0,12),16)+b)+c};
221
+ olympe.Y.aB=function(a){return Aa(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Da=0,Ea=0;olympe.Y.$t=function(){var a=(new Date).getTime();a<=Da?4294967295===Ea?(Ea=Math.floor(Math.random()/4*Ca),Da+=1):Ea=Math.floor(Ea+(4294967295-Ea)/2):(Ea=Math.floor(Math.random()/4*Ca),Da=a);a='00000000'+Ea.toString(16);return Aa(Da)+a.substr(a.length-8,8)};olympe.Y.rB=function(){for(let a=0;1E4>a;a++)console.log(olympe.Y.$t())};
222
+ olympe.Y.ig=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.VA=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.Y.RA=function(a,b){return(b?b:'UI')+'-'+a};olympe.Y.Sn=class{constructor(a){this.id=a||olympe.Y.Sn.C++}Pa(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.Sn.C=0;olympe.Y.hy=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Y.Mg=function(a,b,c,d,e,f,g,h,k,m,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,m,n,p,q,0]};olympe.Y.Mg.F=function(a){return new olympe.Y.Mg(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.Y.Mg.C=function(){return new olympe.Y.Mg(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.Mg.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.Mg.prototype.get=function(a,b){return this.values[5*a+b]};olympe.Y.Promise={};olympe.Y.Promise.Lp=function(){};function Fa(a){return(new TextEncoder).encode(a).buffer}function Ga(a,b){return a.C(Fa(b))}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Y.nk=class{G(){}C(){}L(){}P(){}F(){}T(){}};olympe.Y.Gp=a=>a.replace('+','-').replace('/','_');olympe.Y.Et=a=>a.replace('-','+').replace('_','/');function Ia(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Ia(a);else{let d;null==(d=a.G)||d.call(a)}},a.L)}function Ja(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Ka(a,b){a.F=b;return a}
223
+ olympe.Y.rl=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ia(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Ma(a,b){a.F=b}function Na(a,b){a.C.G=b}
224
+ olympe.Y.ql=class{constructor(a){this.C=Ka(new olympe.Y.rl(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function Oa(a,b){return a+b&4294967295}
225
225
  function Pa(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
226
226
  c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
227
227
  e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,b[5],4,-378558);f=I(c^d^e,f,c,b[8],11,-2022574463);e=I(f^c^d,e,f,b[11],16,1839030562);d=I(e^f^c,d,e,b[14],23,-35309556);c=I(d^e^f,c,d,b[1],4,-1530992060);f=I(c^d^e,f,c,b[4],11,1272893353);e=I(f^c^d,e,f,b[7],16,-155497632);d=I(e^f^c,d,e,b[10],23,-1094730640);c=I(d^e^f,c,d,b[13],4,681279174);f=I(c^d^e,f,c,b[0],11,-358537222);e=I(f^c^d,e,f,b[3],16,-722521979);d=I(e^f^c,d,e,b[6],23,76029189);c=I(d^e^f,c,d,b[9],4,-640364487);
228
228
  f=I(c^d^e,f,c,b[12],11,-421815835);e=I(f^c^d,e,f,b[15],16,530742520);d=I(e^f^c,d,e,b[2],23,-995338651);c=K(c,d,e,f,b[0],6,-198630844);f=K(f,c,d,e,b[7],10,1126891415);e=K(e,f,c,d,b[14],15,-1416354905);d=K(d,e,f,c,b[5],21,-57434055);c=K(c,d,e,f,b[12],6,1700485571);f=K(f,c,d,e,b[3],10,-1894986606);e=K(e,f,c,d,b[10],15,-1051523);d=K(d,e,f,c,b[1],21,-2054922799);c=K(c,d,e,f,b[8],6,1873313359);f=K(f,c,d,e,b[15],10,-30611744);e=K(e,f,c,d,b[6],15,-1560198380);d=K(d,e,f,c,b[13],21,1309151649);c=K(c,d,e,f,
229
229
  b[4],6,-145523070);f=K(f,c,d,e,b[11],10,-1120210379);e=K(e,f,c,d,b[2],15,718787259);d=K(d,e,f,c,b[9],21,-343485551);a[0]=Oa(c,a[0]);a[1]=Oa(d,a[1]);a[2]=Oa(e,a[2]);a[3]=Oa(f,a[3])}function I(a,b,c,d,e,f){b=Oa(Oa(b,a),Oa(d,f));return Oa(b<<e|b>>>32-e,c)}function G(a,b,c,d,e,f,g){return I(b&c|~b&d,a,b,e,f,g)}function H(a,b,c,d,e,f,g){return I(b&d|c&~d,a,b,e,f,g)}function K(a,b,c,d,e,f,g){return I(c^(b|~d),a,b,e,f,g)}
230
230
  function Qa(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);Pa(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(Pa(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
231
- Pa(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Qa('hello')&&(Oa=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.jb=Qa;olympe.Y.Rv=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let m=null,n=null;var p=null;g&&(p=g.match(b),m=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
232
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,AA:g||null,oq:m||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,TA:f||null,parameters:b}};olympe.Y.lB=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Y.qB=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
- olympe.Y.Fu=a=>{var b=olympe.P.Zd;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Y.gm=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Y.gm(a[c],d):a[c]=d}};olympe.Y.Qd=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Y.gm(d,e);b(`conf.d/${a}`,f=>{olympe.Y.gm(d,f);c(d)})})};olympe.Y.zA=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Sl(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.Aw=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.Y.gs=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.gs.C={Ux:'left',Ny:'right',yw:'bottom',Wz:'top'};function Ra(a){return`${a.C}.${a.F}.${a.G}`}
234
- olympe.Y.Xe=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.K=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.Xe.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.Xe.C:new olympe.Y.Xe(b,c,d,a[4])}Qj(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}ti(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
235
- a.G}Qa(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.K?`-${this.K}`:'')}};olympe.Y.Xe.C=new olympe.Y.Xe(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={Ag:'utils.binaryConverter',zq:'utils.base64Converter'};olympe.U.config(a=>{va(a,olympe.Y.R.Ag);ua(a,olympe.Y.R.zq,olympe.Y.R.Ag,!0)},'Utils services');olympe.U.run([olympe.Y.R.Ag],a=>{olympe.Y.Pd=()=>a});olympe.ka={};olympe.ka.zb=class{T(){}qa(){}C(){}ga(){}K(){}Ba(){}Z(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ka.zb.prototype.fatal=olympe.ka.zb.prototype.fatal;olympe.ka.zb.prototype.error=olympe.ka.zb.prototype.error;olympe.ka.zb.prototype.warn=olympe.ka.zb.prototype.warn;olympe.ka.zb.prototype.info=olympe.ka.zb.prototype.info;olympe.ka.zb.prototype.log=olympe.ka.zb.prototype.log;olympe.ka.zb.prototype.debug=olympe.ka.zb.prototype.debug;olympe.ka.zb.prototype.trace=olympe.ka.zb.prototype.trace;
236
- olympe.ka.zb.C={dt:0,qf:1,bs:2,Nn:3,pt:4,Fb:5,ar:6,Wk:7};olympe.ka.zb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ka.Ca=class{Dc(){}};olympe.ka.Ud={};function Sa(a,b,c,d){a.Va[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.O.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.O.values())f(e,c,b,...d)}}
237
- olympe.ka.Ud.zb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.O=new Map;this.Va=console}T(){return this.F}qa(){return this.F<=olympe.ka.zb.C.dt}C(){return this.F<=olympe.ka.zb.C.qf}K(){return this.F<=olympe.ka.zb.C.bs}ga(){return this.F<=olympe.ka.zb.C.Nn}Ba(){return this.F<=olympe.ka.zb.C.pt}Z(){return this.F<=olympe.ka.zb.C.Fb}ba(){return this.F<=olympe.ka.zb.C.ar}trace(...a){this.qa()&&Sa(this,'trace',this.G,a)}debug(...a){this.C()&&Sa(this,'debug',this.G,a)}log(...a){this.K()&&
238
- Sa(this,'log',this.G,a)}info(...a){this.ga()&&Sa(this,'info',this.G,a)}warn(...a){this.Ba()&&Sa(this,'warn',this.G,a)}error(...a){this.Z()&&Sa(this,'error',this.G,a)}fatal(...a){this.ba()&&Sa(this,'error',this.G,a)}};olympe.ka.Ud.zb.sa=[olympe.ka.zb];olympe.ka.Ud.Ca=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.L=this.Dc('logging');this.L.info('Logging initialized, global log level is '+olympe.ka.zb.F[b])}Dc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ka.V.Fq}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ka.V.Ts}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
239
- (d=!0===this.C.getParameter(c));b=new olympe.ka.Ud.zb(a,b,d);this.channels.set(a,b)}return b}};olympe.ka.Ud.Ca.sa=[olympe.ka.Ca];olympe.ka.R={Fa:'logging.Manager'};olympe.ka.V={Dn:'logging',En:'logging.showLogLevel',Fq:'logging',Ts:'showLogLevel'};olympe.U.config(function(a){F(a,olympe.ka.V.Dn,olympe.ka.zb.C.Nn);F(a,olympe.ka.V.En,!0);ta(a,olympe.ka.R.Fa,olympe.ka.Ud.Ca,olympe.U.R.Of,new olympe.U.ma(olympe.ka.V.Dn),new olympe.U.ma(olympe.ka.V.En))},'olympe.logging');olympe.U.run([olympe.ka.R.Fa],a=>{olympe.ka.ab=b=>a.Dc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.V={ko:'df.nodeCreationThreshold'};const Ta=[];function Ua(){}function Va(){}olympe.D.H=class a{constructor(b,c,d){this.C=void 0===b?Ua:b;this.F=void 0===c?Ta:c;this.Z=d}static K(){var b=[];return void 0===b||0===b.length?olympe.D.H.ba:new a(Va,b)}K(){return this.C?this.C():void 0}G(){return this.F?this.F:Ta}O(){return null===this.C&&null===this.F}T(){return this.C===Va}};olympe.D.H.Z=new olympe.D.H;olympe.D.H.C=new olympe.D.H(null,null);olympe.D.H.ba=new olympe.D.H(Va);olympe.D.H.G=new olympe.D.H(()=>olympe.D.aa);
240
- olympe.D.H.F=new olympe.D.H(()=>olympe.D.Ja);olympe.D.H.O=new olympe.D.H(()=>olympe.D.ea);olympe.D.H.T=new olympe.D.H(()=>olympe.D.Ib);olympe.D.Fg=class{W(){return''}Ad(){return''}destroy(){}mb(){return!1}zc(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Hf(){}cd(){}ld(){}Dj(){}qa(){}onDestroy(){return''}kf(){}Z(){return''}we(){}};olympe.D.Fg.prototype.offDestroy=olympe.D.Fg.prototype.kf;olympe.D.Fg.prototype.onDestroy=olympe.D.Fg.prototype.onDestroy;let Wa=0;olympe.U.run([new olympe.U.ma(olympe.D.V.ko)],()=>{});
241
- olympe.D.Mb=class{constructor(a='SimpleContext',b){++Wa;this.ub=new Map;this.nb=new Map;this.Va=new Map;this.Vb=0;this.name=a;this.id=String(Wa);this.K=this.Cb=!1;(this.ba=void 0===b?olympe.D.Oa():b)&&this.ba.cd(this);this.debug=!1}W(){return this.id}Ad(){return this.name}run(a,...b){if(!this.Cb){var c=olympe.D.kq(this);a=a(...b);c&&olympe.D.kq(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Cb&&!this.K){this.K=!0;this.qa();for(const a of this.nb.keys())this.nb.has(a)&&this.nb.get(a)();
242
- this.nb.clear();this.Va.clear();this.ba&&(this.ba.ld(this,!1),this.ba=null);this.Cb=!0;this.K=!1;this.qa()}}mb(){return this.Cb}zc(){return this.K}cd(a){if(!this.Cb){var b;olympe.D.Ya(a)?b=a.za:olympe.D.am(a)&&(b=a);b&&this.ub.set(b.W(),b)}}ld(a,b=!0){let c;olympe.D.Ya(a)?c=a.za:olympe.D.am(a)&&(c=a);c&&this.ub.has(c.W())&&(b&&c.Dj(this),this.ub.delete(c.W()))}Dj(){this.ba=null;this.destroy()}qa(){const a=this.ub;for(const b of a.keys())a.has(b)&&a.get(b).Dj(this);this.ub.clear();for(const b of this.Va.keys())this.Va.has(b)&&
243
- this.Va.get(b)();this.Va.clear()}onDestroy(a,b){void 0===b&&(++this.Vb,b=String(this.Vb));this.nb.set(b,a);return b}kf(a){this.nb.delete(a)}Z(a){if(void 0===b){++this.Vb;var b=String(this.Vb)}this.Va.set(b,a);return b}we(a){this.Va.delete(a)}Hf(a){this.ba&&this.ba.ld(this,!1);(this.ba=a||null)&&this.ba.cd(this)}getParent(){return this.ba}};olympe.D.Vo=class extends olympe.D.Mb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}kf(){}};olympe.D.Fg.sa=[olympe.D.Fg];let Xa=0;
244
- function Ya(a,b){a.ga||(a.ga=new Map);a.ga.set(b.W(),b);switch(b.qd()){case olympe.D.Node.C.Kg:break;case olympe.D.Node.C.Qg:break;case olympe.D.Node.C.Yi:case olympe.D.Node.C.sf:olympe.D.L.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Gg:Za(a,olympe.D.Node.C.Gg);break;case olympe.D.Node.C.OBSOLETE:a.qc=!0;a.C!==olympe.D.Node.C.Gg&&Za(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.rf:olympe.D.L.warn('Adding a destroyed node as upstream => should never happen!');break;
245
- default:olympe.D.L.warn('Unknown state, investigate: ',b.qd())}$a(b,a)}
246
- function ab(a){if(a.Yc){var b=[],c=[];if(a.lf)if(a.lf instanceof olympe.D.Node)if(bb(a.lf))b=a.lf.xb;else return;else b=a.lf;else b=null;if(null!==a.Ba){const e=a.Ff;for(let f=0,g=a.Ba.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Ba[f];if(bb(h))c.push(h.xb);else return}else c.push(a.Ba[f])}if(a.Yc instanceof Function)var d=a.Yc;else b&&(b[a.Yc]||olympe.D.L.warn('looks like you forget a cast somewhere around '+a.Yc),d=b[a.Yc]);a.run(()=>{a.qa();if(void 0!==d){const e=d.apply(b,c);e&&e.Bp?
247
- cb(a,e.za):e instanceof olympe.D.Node?cb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Za(a,olympe.D.Node.C.Qg))}else db(a)})}}function N(a){void 0===a.Wb&&(a.Wb=a.valueType===olympe.D.Proxy?eb(void 0,a.ve):eb(a.valueType,a.ve),a.Wb.za=a);return a.Wb}function fb(a){void 0!==a.O&&(gb(a.O,a),a.O=void 0)}function hb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Qg,null!==a.T))for(const b of a.T.values())ib(b)}function Za(a,b){b!==a.C&&(a.C=b)}
248
- function jb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.Yi&&a.C!==olympe.D.Node.C.Kg&&a.C!==olympe.D.Node.C.Gg){Za(a,olympe.D.Node.C.Yi);var b=a.T;if(b)for(const c of b.values())b.has(c.W())&&jb(c);Za(a,olympe.D.Node.C.OBSOLETE)}}function kb(a,b,c){if(a.C!==olympe.D.Node.C.sf)if(b===a.O)L(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.Yi)a.qc=!0;ab(a)}}
249
- function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.L.warn('We are setting the value of a node as a node, that should never happen?'),b=b.xb);a.Ob||c||void 0===a.O||fb(a);if(void 0!==b){if((a.Ob||a.C===olympe.D.Node.C.Qg||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.Ya(b)&&void 0!==a.xb){if(null===b&&null===a.xb){hb(a);return}if(null!==b&&null!==a.xb&&(b.valueOf()===a.xb.valueOf()||a.xb.Qa&&a.xb.Qa(b))){hb(a);return}}if(!0===a.Ob)olympe.D.L.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.W()+') value to get updated !');else{a.C===olympe.D.Node.C.rf&&olympe.D.L.warn(`trying to set a value on a destroyed node (#${a.W()} ${a.Uc?', '+a.Uc:''})`);a.C===olympe.D.Node.C.sf&&olympe.D.L.warn(`trying to set a value on a node being destroyed (#${a.W()} ${a.Uc?', '+a.Uc:''})`);a.Ob=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Ja?(c=olympe.D.rb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.na(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Hb(c),d=!1)));a.xb=c;Za(a,olympe.D.Node.C.Qg);if(b=a.T){d=0;for(const f of b.values())0<d&&jb(f),d++;for(const f of b.values())kb(f,a,c)}a.Ob=!1}}}
252
- function lb(a,b){if(a.C!==olympe.D.Node.C.sf&&a.C!==olympe.D.Node.C.rf&&(a.C!==olympe.D.Node.C.Kg||a.Yc)){var c=void 0!==a.defaultValue;a.Yc&&b!==a.O&&a.qa();if(c)L(a,a.defaultValue,!0);else if(a.xb=void 0,Za(a,olympe.D.Node.C.Kg),b=a.T)for(const d of b.values())lb(d,a)}}function db(a){if(a.C!==olympe.D.Node.C.Gg){Za(a,olympe.D.Node.C.Gg);var b=a.T;if(b)for(const c of b.values())db(c);a.qa();void 0!==a.O&&fb(a);a.xb=a.defaultValue}}function bb(a){return a.C===olympe.D.Node.C.Qg}
253
- function cb(a,b){b===a?olympe.D.L.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.O=b)}function mb(a,b){a.Yc&&(a.Yc=void 0);a.Uc='Repeater';cb(a,b)}function ib(a){a.O?hb(a):null!==a.ga&&0===Array.from(a.ga.values()).filter(b=>!bb(b)).length&&(a.qc&&(a.qc=!1,ab(a)),hb(a))}
254
- function $a(a,b){a.T||(a.T=new Map);a.T.set(b.W(),b);a.C===olympe.D.Node.C.rf&&olympe.D.L.warn('adding a downstream node on a deleted one (#'+a.W()+') !')}function gb(a,b){a.T&&(b=b.W(),a.T.has(b)&&(a.T.delete(b),nb(a)))}function nb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Mb{constructor({valueType:a,Yc:b,Tv:c=!0,lf:d,Xl:e,debug:f=!1,Ff:g=null,Uc:h='Node',$h:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Uc=h;h&&'string'===typeof h||(b?this.Uc=b.name?b.name:'anon()':this.Uc='Node');this.Ba=e&&0<e.length?e:null;this.Ff=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Ob=!1;this.C=olympe.D.Node.C.Kg;this.qc=!1;this.T=this.ga=null;this.Yc=b;this.lf=d||null;this.defaultValue=this.Wb=this.O=void 0;this.$h=k;d&&d instanceof
256
- olympe.D.Node&&Ya(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ya(this,a);c&&ab(this)}yg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Kg&&L(this,a,!0);return this}ai(a){this.valueType=a}Gb(){return this.valueType||Object}qd(){return this.C}mb(){return this.C===olympe.D.Node.C.rf}zc(){return this.C===olympe.D.Node.C.sf}ve(...a){if(this.$h instanceof Function)return this.$h(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.qd();a!==olympe.D.Node.C.sf&&
257
- a!==olympe.D.Node.C.rf||olympe.D.L.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.Ya(g)&&b.push(g.za);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Ug&&(e[g]=f.za,b.push(g));return N(new olympe.D.Node({valueType:d.K(),Yc:c,lf:this,Xl:e,debug:!1,Ff:b,Uc:'Proxy.'+c+'()'}))}Dj(a){if(null===this.getParent())olympe.D.L.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.L.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.Hf(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.sf&&a!==olympe.D.Node.C.rf){Za(this,olympe.D.Node.C.sf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.ga&&b.ga.delete(this.W());b.O&&b.O.W()===this.W()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ga){for(const c of this.ga.values())this.ga.has(c.W())&&gb(c,this);this.ga.clear()}this.ga=null;this.O&&(gb(this.O,this),this.O=void 0);this.xb=void 0;this.Ba&&(this.Ba.length=
259
- 0,this.Ba=null);this.Ff&&(this.Ff.length=0,this.Ff=null);this.$h=this.Yc=void 0;this.defaultValue=this.lf=null;this.Uc=`** Destroyed ** ${this.Uc}`;Za(this,olympe.D.Node.C.rf)}}Ad(){return this.Uc}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Kg:0,Qg:1,Gg:3,Yi:4,OBSOLETE:5,sf:6,rf:7};function eb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.L.error('investigate');c=Object.create(ob(c,a.prototype));c.Aj=a;c.Cp=b;return c}function ob(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.dl)||Object.defineProperty(b,olympe.D.Proxy.dl,{enumerable:!1,configurable:!1,writable:!1,value:pb(a,b)});return b[olympe.D.Proxy.dl]}
260
- function qb(a,b){if(a.Aj!==b){a.Aj=b;b.prototype||olympe.D.L.error('Cast not possible, provided type is not a valid type!');var c=ob(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.za&&a.za.ai(b)}}
261
- function pb(a,b){let c={};if(b.prototype)olympe.D.L.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ob(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].J;null===e||e&&e.O()?c[d]=function(...f){var g=this.za;if(g&&bb(g)&&(g=g.xb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.H.Z,c[d]=function(...f){f=this.Cp.call(this.za,
262
- ...f,e,d);const g=e.Z;if(g){const h=this.za.xb;h&&h[g]&&qb(f,h[g])}return e.T()?this:f})}});return c}function O(a,b){L(a.za,b)}function rb(a){lb(a.za)}function sb(a,b){mb(a.za,olympe.D.hf(b)?b:b.za)}function tb(a,b){olympe.D.Ya(b)||olympe.D.hf(b)?sb(a,b):O(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.za=null;this.Aj=a;this.Cp=b}static Ya(a){return!(!a||!a.Ug)}Qa(a){return olympe.D.ra([this,a],(b,c)=>b===c,Boolean)}ud(a){return olympe.D.ra([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ea.F:olympe.D.ea.C:b.valueOf()===c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea)}Bp(){return this.za}};olympe.D.Proxy.dl='__opp__';olympe.D.Proxy.prototype.Ug=!0;function ub(a,b){a.node.yg(b);return a}olympe.D.Mi=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.Ya(a)?L(this.node,olympe.D.Sa(a)):L(this.node,a);return this}repeat(a){mb(this.node,olympe.D.Ya(a)?a.za:a);return this}clear(){lb(this.node);return this}vb(){return N(this.node)}getContext(){return this.node}};function vb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.aa),g=d||olympe.D.aa.nn.$n;let h,k,m,n;f.update(olympe.D.na(a));const p=window.performance.now(),q=b.valueOf();m=q-a.valueOf();if(0!==m&&void 0===n){const r=()=>{f.getContext().mb()||(m=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+m*g(k,0,1,1),f.update(olympe.D.na(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.vb()}
264
- olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.na(b.value)}tm(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Hb(!this.tm())}wc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.rb(''):olympe.D.rb(this.value.toString())}toString(a,b){return void 0!==
265
- this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.tm()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.na(c))};a.forEach((f,g)=>{olympe.D.nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().mb()){var g=b.get(f);b.delete(f);
266
- g===c&&e()}});return d.vb()}Gd(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()+c.valueOf()),olympe.D.aa,'ONumber.plus')}vg(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()-c.valueOf()),olympe.D.aa,'ONumber.minus')}round(){return olympe.D.na(Math.round(this.valueOf()))}vi(){return olympe.D.na(-this.valueOf())}Vj(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()*c.valueOf()),olympe.D.aa,'ONumber.mul')}bi(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()/
267
- c.valueOf()),olympe.D.aa,'ONumber.div')}zv(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()%c.valueOf()),olympe.D.aa,'ONumber.div')}floor(){return olympe.D.na(Math.floor(this.valueOf()))}ceil(){return olympe.D.na(Math.ceil(this.valueOf()))}trunc(){return olympe.D.na(Math.trunc(this.valueOf()))}log(){return olympe.D.na(Math.log(this.valueOf()))}pow(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(Math.pow(b.valueOf(),c.valueOf())),olympe.D.aa,'ONumber.pow')}exp(){return olympe.D.na(Math.exp(this.valueOf()))}ud(a){return olympe.D.ra([this,
268
- a],(b,c)=>olympe.D.Hb(b.Qa(c)),olympe.D.ea,'ONumber.oEquals')}Qa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Nu(){return this.valueOf()}$l(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isBiggerThan')}Vv(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.na(c),olympe.D.aa,'ONumber.returnsBiggest')}iq(a){return olympe.D.ra([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.na(c),olympe.D.aa,'ONumber.returnsSmallest')}rv(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isSmallerThan')}sin(){return olympe.D.na(Math.sin(this.valueOf()))}cos(){return olympe.D.na(Math.cos(this.valueOf()))}atan2(a){return olympe.D.Ya(a)?olympe.D.Vd([a],b=>olympe.D.na(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.aa):olympe.D.na(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.na(Math.abs(this.valueOf()))}mi(a,
270
- b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.aa):olympe.D.na(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static st(a,b,c,d){'number'===typeof a&&(a=olympe.D.Fd(a));'number'===typeof b&&(b=olympe.D.Fd(b));'number'===typeof c&&(c=olympe.D.Fd(c));let e=0;const f=olympe.D.Fd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.aq(b.$l(c),()=>{olympe.ka.ab('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(m,n)=>{n=olympe.D.Fd(n);const p=olympe.D.aa.animate(n,500);sb(f,p);O(n,olympe.D.na(m));e=m};olympe.D.Vd([a],m=>{e+=m.valueOf();e>h?k(h,e):e<g?k(g,e):sb(f,olympe.D.Fd(e))},olympe.D.aa);void 0!==b&&olympe.D.im(b.valueOf(),m=>{if(g!==m&&(g=m,g>e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.na(g);L(n.za,m);e=g;sb(f,p)}});void 0!==c&&olympe.D.im(c.valueOf(),m=>{if(h!==m&&(h=m,h<e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.na(h);L(n.za,m);e=h;sb(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.Vd([a],c=>{void 0===b&&(b=c);return olympe.D.na(c-b)},olympe.D.aa,'offset')}static Np(a){let b,c,d;return olympe.D.ra([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.na(0);d=window.performance.now();const f=olympe.D.na((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.aa,'derivative')}static mv(a){let b=olympe.D.na(0),c,d,e;return olympe.D.ra([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.na(0);
273
- e=window.performance.now();b=b.Gd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.aa,'integrate')}static Pt(a){let b;return olympe.D.ra([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.na(c.valueOf()-b.valueOf());b=c;return d},olympe.D.aa,'diff')}static Ht(a,b,c){return olympe.D.Vd([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.na(d>=e?d<=f?d:f:e)},olympe.D.aa)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.ra([a],f=>{const g=olympe.D.Sa(b,1E3),h=olympe.D.Sa(e);return void 0===h?olympe.D.na(f):vb(h,f,g,c,k=>{d&&d(k)})},olympe.D.aa)}static Dt(a,b,c){let d,e,f,g,h,k,m=olympe.D.Fd(),n;olympe.D.nc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);O(m,olympe.D.na(g));1===h&&(clearTimeout(n),n=void 0)},0))});return m}static wc(a){return olympe.D.Ya(a)?
275
- olympe.D.ra([a],b=>olympe.D.rb(b.valueOf().toString()),olympe.D.Ja):olympe.D.rb(a)}static vi(a){return olympe.D.Ya(a)?olympe.D.ra([a],b=>olympe.D.na(-b.valueOf()),olympe.D.aa):olympe.D.na(-a.valueOf())}static Gd(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.ra([a,b],(c,d)=>olympe.D.na(c.valueOf()+d.valueOf()),olympe.D.aa,'plus'):olympe.D.na(a.valueOf()+b.valueOf())}static vg(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(c.valueOf()-d.valueOf()),olympe.D.aa,
276
- 'minus'):olympe.D.na(a.valueOf()-b.valueOf())}static bi(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(c.valueOf()/d.valueOf()),olympe.D.aa,'div'):olympe.D.na(a.valueOf()/b.valueOf())}static Sv(a,b){if(void 0===b)return a;olympe.D.nc([b],c=>{c=olympe.D.na(a.za.xb.valueOf()+c.valueOf());L(a.za,c)},'plusEqual');return a}};olympe.D.aa.ZERO=new olympe.D.aa(0);olympe.D.aa.ONE=new olympe.D.aa(1);olympe.D.aa.ft=new olympe.D.aa(2);olympe.D.aa.PI=new olympe.D.aa(Math.PI);
277
- olympe.D.aa.rr=new olympe.D.aa(Infinity);olympe.D.aa.ms=new olympe.D.aa(-Infinity);olympe.D.aa.jo=new olympe.D.aa(NaN);olympe.D.aa.Hy=olympe.D.aa.Sv;olympe.D.aa.pw=olympe.D.aa.st;olympe.D.aa.wy=olympe.D.aa.offset;olympe.D.aa.Ww=olympe.D.aa.Np;olympe.D.aa.LA=olympe.D.aa.Np;olympe.D.aa.Tx=olympe.D.aa.mv;olympe.D.aa.Xw=olympe.D.aa.Pt;olympe.D.aa.Ew=olympe.D.aa.Ht;olympe.D.aa.qw=olympe.D.aa.animate;olympe.D.aa.rw=olympe.D.aa.Dt;olympe.D.aa.Xz=olympe.D.aa.wc;olympe.D.aa.Yz=olympe.D.aa.vi;
278
- olympe.D.aa.Gy=olympe.D.aa.Gd;olympe.D.aa.jy=olympe.D.aa.vg;olympe.D.aa.Yw=olympe.D.aa.bi;
279
- olympe.D.aa.nn={$n:function(a,b,c,d){return c*a/d+b},vx:function(a,b,c,d){a/=d;return c*a*a+b},Fx:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},qx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},jx:function(a,b,c,d){a/=d;return c*a*a*a+b},Bx:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},ox:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},wx:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Gx:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- sx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},xx:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Hx:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},tx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},yx:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Ix:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},ux:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},mx:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Ex:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},px:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},ix:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Ax:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},nx:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},ax:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},bx:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},ex:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},gx:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Dx:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Cx:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},lx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},kx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},zx:function(a,
283
- b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},hx:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};l=olympe.D.aa.prototype;l.toJSON.J=olympe.D.H.C;l.tm.J=olympe.D.H.C;l.isNaN.J=olympe.D.H.O;l.wc.J=olympe.D.H.F;
284
- l.toString.J=new olympe.D.H(()=>String,[]);l.toFixed.J=new olympe.D.H(()=>String,[]);l.Gd.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.vg.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.round.J=olympe.D.H.G;l.vi.J=olympe.D.H.G;l.Vj.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.bi.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.zv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.floor.J=olympe.D.H.G;l.ceil.J=olympe.D.H.G;l.trunc.J=olympe.D.H.G;l.log.J=olympe.D.H.G;l.pow.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.exp.J=olympe.D.H.G;
285
- l.ud.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Qa.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Nu.J=olympe.D.H.C;l.$l.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Vv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.iq.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.rv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.sin.J=olympe.D.H.G;l.cos.J=olympe.D.H.G;l.atan2.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.abs.J=olympe.D.H.G;l.mi.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);olympe.D.Ja=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.rb(b.value)}Jp(a){return olympe.D.Ja.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.ra([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.rb(d)},olympe.D.Ja,'OString.concat')}wc(){return this}iw(a){return olympe.D.na(parseInt(this.value,
286
- a))}mq(){return olympe.D.na(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Qa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}ud(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.Hb(c&&b.valueOf()===c.valueOf()),olympe.D.ea,'OString.oEquals')}hh(){return olympe.D.Hb(!this.value||0===this.value.length)}contains(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.Hb((c instanceof olympe.D.Ja||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
231
+ Pa(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Qa('hello')&&(Oa=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.kb=Qa;olympe.Y.Qv=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let m=null,n=null;var p=null;g&&(p=g.match(b),m=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
232
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,zA:g||null,oq:m||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,SA:f||null,parameters:b}};olympe.Y.kB=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Y.pB=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
+ olympe.Y.Eu=a=>{var b=olympe.O.Zd;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Y.gm=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Y.gm(a[c],d):a[c]=d}};olympe.Y.Qd=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Y.gm(d,e);b(`conf.d/${a}`,f=>{olympe.Y.gm(d,f);c(d)})})};olympe.Y.yA=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Sl(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.zw=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.Y.gs=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.gs.C={Tx:'left',My:'right',xw:'bottom',Vz:'top'};function Ra(a){return`${a.C}.${a.F}.${a.G}`}
234
+ olympe.Y.Ye=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.Ye.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.Ye.C:new olympe.Y.Ye(b,c,d,a[4])}Tj(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}yi(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
235
+ a.G}Pa(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.Y.Ye.C=new olympe.Y.Ye(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={Ag:'utils.binaryConverter',zq:'utils.base64Converter'};olympe.U.config(a=>{va(a,olympe.Y.R.Ag);ua(a,olympe.Y.R.zq,olympe.Y.R.Ag,!0)},'Utils services');olympe.U.run([olympe.Y.R.Ag],a=>{olympe.Y.Pd=()=>a});olympe.ka={};olympe.ka.zb=class{T(){}qa(){}C(){}ga(){}L(){}Ba(){}Z(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ka.zb.prototype.fatal=olympe.ka.zb.prototype.fatal;olympe.ka.zb.prototype.error=olympe.ka.zb.prototype.error;olympe.ka.zb.prototype.warn=olympe.ka.zb.prototype.warn;olympe.ka.zb.prototype.info=olympe.ka.zb.prototype.info;olympe.ka.zb.prototype.log=olympe.ka.zb.prototype.log;olympe.ka.zb.prototype.debug=olympe.ka.zb.prototype.debug;olympe.ka.zb.prototype.trace=olympe.ka.zb.prototype.trace;
236
+ olympe.ka.zb.C={ct:0,qf:1,bs:2,Nn:3,ot:4,Fb:5,ar:6,Yk:7};olympe.ka.zb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ka.Ca=class{Gc(){}};olympe.ka.Ud={};function Sa(a,b,c,d){a.Wa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.P.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.P.values())f(e,c,b,...d)}}
237
+ olympe.ka.Ud.zb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.P=new Map;this.Wa=console}T(){return this.F}qa(){return this.F<=olympe.ka.zb.C.ct}C(){return this.F<=olympe.ka.zb.C.qf}L(){return this.F<=olympe.ka.zb.C.bs}ga(){return this.F<=olympe.ka.zb.C.Nn}Ba(){return this.F<=olympe.ka.zb.C.ot}Z(){return this.F<=olympe.ka.zb.C.Fb}ba(){return this.F<=olympe.ka.zb.C.ar}trace(...a){this.qa()&&Sa(this,'trace',this.G,a)}debug(...a){this.C()&&Sa(this,'debug',this.G,a)}log(...a){this.L()&&
238
+ Sa(this,'log',this.G,a)}info(...a){this.ga()&&Sa(this,'info',this.G,a)}warn(...a){this.Ba()&&Sa(this,'warn',this.G,a)}error(...a){this.Z()&&Sa(this,'error',this.G,a)}fatal(...a){this.ba()&&Sa(this,'error',this.G,a)}};olympe.ka.Ud.zb.sa=[olympe.ka.zb];olympe.ka.Ud.Ca=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.K=this.Gc('logging');this.K.info('Logging initialized, global log level is '+olympe.ka.zb.F[b])}Gc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ka.V.Fq}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ka.V.Ss}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
239
+ (d=!0===this.C.getParameter(c));b=new olympe.ka.Ud.zb(a,b,d);this.channels.set(a,b)}return b}};olympe.ka.Ud.Ca.sa=[olympe.ka.Ca];olympe.ka.R={Fa:'logging.Manager'};olympe.ka.V={Dn:'logging',En:'logging.showLogLevel',Fq:'logging',Ss:'showLogLevel'};olympe.U.config(function(a){F(a,olympe.ka.V.Dn,olympe.ka.zb.C.Nn);F(a,olympe.ka.V.En,!0);ta(a,olympe.ka.R.Fa,olympe.ka.Ud.Ca,olympe.U.R.Pf,new olympe.U.ma(olympe.ka.V.Dn),new olympe.U.ma(olympe.ka.V.En))},'olympe.logging');olympe.U.run([olympe.ka.R.Fa],a=>{olympe.ka.ab=b=>a.Gc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.V={ko:'df.nodeCreationThreshold'};const Ta=[];function Ua(){}function Va(){}olympe.D.H=class a{constructor(b,c,d){this.C=void 0===b?Ua:b;this.F=void 0===c?Ta:c;this.Z=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.H.ba:new a(Va,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Ta}P(){return null===this.C&&null===this.F}T(){return this.C===Va}};olympe.D.H.Z=new olympe.D.H;olympe.D.H.C=new olympe.D.H(null,null);olympe.D.H.ba=new olympe.D.H(Va);olympe.D.H.G=new olympe.D.H(()=>olympe.D.aa);
240
+ olympe.D.H.F=new olympe.D.H(()=>olympe.D.Ja);olympe.D.H.P=new olympe.D.H(()=>olympe.D.ea);olympe.D.H.T=new olympe.D.H(()=>olympe.D.Ib);olympe.D.Hg=class{W(){return''}Ad(){return''}destroy(){}mb(){return!1}Ac(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}If(){}hd(){}pd(){}Hj(){}qa(){}onDestroy(){return''}lf(){}Z(){return''}xe(){}};olympe.D.Hg.prototype.offDestroy=olympe.D.Hg.prototype.lf;olympe.D.Hg.prototype.onDestroy=olympe.D.Hg.prototype.onDestroy;let Wa=0;olympe.U.run([new olympe.U.ma(olympe.D.V.ko)],()=>{});
241
+ olympe.D.Nb=class{constructor(a='SimpleContext',b){++Wa;this.ub=new Map;this.nb=new Map;this.Wa=new Map;this.Wb=0;this.name=a;this.id=String(Wa);this.L=this.Cb=!1;(this.ba=void 0===b?olympe.D.Oa():b)&&this.ba.hd(this);this.debug=!1}W(){return this.id}Ad(){return this.name}run(a,...b){if(!this.Cb){var c=olympe.D.kq(this);a=a(...b);c&&olympe.D.kq(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Cb&&!this.L){this.L=!0;this.qa();for(const a of this.nb.keys())this.nb.has(a)&&this.nb.get(a)();
242
+ this.nb.clear();this.Wa.clear();this.ba&&(this.ba.pd(this,!1),this.ba=null);this.Cb=!0;this.L=!1;this.qa()}}mb(){return this.Cb}Ac(){return this.L}hd(a){if(!this.Cb){var b;olympe.D.Ya(a)?b=a.Aa:olympe.D.am(a)&&(b=a);b&&this.ub.set(b.W(),b)}}pd(a,b=!0){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.am(a)&&(c=a);c&&this.ub.has(c.W())&&(b&&c.Hj(this),this.ub.delete(c.W()))}Hj(){this.ba=null;this.destroy()}qa(){const a=this.ub;for(const b of a.keys())a.has(b)&&a.get(b).Hj(this);this.ub.clear();for(const b of this.Wa.keys())this.Wa.has(b)&&
243
+ this.Wa.get(b)();this.Wa.clear()}onDestroy(a,b){void 0===b&&(++this.Wb,b=String(this.Wb));this.nb.set(b,a);return b}lf(a){this.nb.delete(a)}Z(a){if(void 0===b){++this.Wb;var b=String(this.Wb)}this.Wa.set(b,a);return b}xe(a){this.Wa.delete(a)}If(a){this.ba&&this.ba.pd(this,!1);(this.ba=a||null)&&this.ba.hd(this)}getParent(){return this.ba}};olympe.D.Vo=class extends olympe.D.Nb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}lf(){}};olympe.D.Hg.sa=[olympe.D.Hg];let Xa=0;
244
+ function Ya(a,b){a.ga||(a.ga=new Map);a.ga.set(b.W(),b);switch(b.sd()){case olympe.D.Node.C.Ng:break;case olympe.D.Node.C.Tg:break;case olympe.D.Node.C.aj:case olympe.D.Node.C.sf:olympe.D.K.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ig:Za(a,olympe.D.Node.C.Ig);break;case olympe.D.Node.C.OBSOLETE:a.hc=!0;a.C!==olympe.D.Node.C.Ig&&Za(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.rf:olympe.D.K.warn('Adding a destroyed node as upstream => should never happen!');break;
245
+ default:olympe.D.K.warn('Unknown state, investigate: ',b.sd())}$a(b,a)}
246
+ function ab(a){if(a.bd){var b=[],c=[];if(a.mf)if(a.mf instanceof olympe.D.Node)if(bb(a.mf))b=a.mf.xb;else return;else b=a.mf;else b=null;if(null!==a.Ba){const e=a.Gf;for(let f=0,g=a.Ba.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Ba[f];if(bb(h))c.push(h.xb);else return}else c.push(a.Ba[f])}if(a.bd instanceof Function)var d=a.bd;else b&&(b[a.bd]||olympe.D.K.warn('looks like you forget a cast somewhere around '+a.bd),d=b[a.bd]);a.run(()=>{a.qa();if(void 0!==d){const e=d.apply(b,c);e&&e.Bp?
247
+ cb(a,e.Aa):e instanceof olympe.D.Node?cb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Za(a,olympe.D.Node.C.Tg))}else db(a)})}}function N(a){void 0===a.Xb&&(a.Xb=a.valueType===olympe.D.Proxy?eb(void 0,a.we):eb(a.valueType,a.we),a.Xb.Aa=a);return a.Xb}function fb(a){void 0!==a.P&&(gb(a.P,a),a.P=void 0)}function hb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Tg,null!==a.T))for(const b of a.T.values())ib(b)}function Za(a,b){b!==a.C&&(a.C=b)}
248
+ function jb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.aj&&a.C!==olympe.D.Node.C.Ng&&a.C!==olympe.D.Node.C.Ig){Za(a,olympe.D.Node.C.aj);var b=a.T;if(b)for(const c of b.values())b.has(c.W())&&jb(c);Za(a,olympe.D.Node.C.OBSOLETE)}}function kb(a,b,c){if(a.C!==olympe.D.Node.C.sf)if(b===a.P)L(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.aj)a.hc=!0;ab(a)}}
249
+ function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.K.warn('We are setting the value of a node as a node, that should never happen?'),b=b.xb);a.Ob||c||void 0===a.P||fb(a);if(void 0!==b){if((a.Ob||a.C===olympe.D.Node.C.Tg||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.Ya(b)&&void 0!==a.xb){if(null===b&&null===a.xb){hb(a);return}if(null!==b&&null!==a.xb&&(b.valueOf()===a.xb.valueOf()||a.xb.Pa&&a.xb.Pa(b))){hb(a);return}}if(!0===a.Ob)olympe.D.K.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
+ a.W()+') value to get updated !');else{a.C===olympe.D.Node.C.rf&&olympe.D.K.warn(`trying to set a value on a destroyed node (#${a.W()} ${a.Wc?', '+a.Wc:''})`);a.C===olympe.D.Node.C.sf&&olympe.D.K.warn(`trying to set a value on a node being destroyed (#${a.W()} ${a.Wc?', '+a.Wc:''})`);a.Ob=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Ja?(c=olympe.D.rb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.na(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Hb(c),d=!1)));a.xb=c;Za(a,olympe.D.Node.C.Tg);if(b=a.T){d=0;for(const f of b.values())0<d&&jb(f),d++;for(const f of b.values())kb(f,a,c)}a.Ob=!1}}}
252
+ function lb(a,b){if(a.C!==olympe.D.Node.C.sf&&a.C!==olympe.D.Node.C.rf&&(a.C!==olympe.D.Node.C.Ng||a.bd)){var c=void 0!==a.defaultValue;a.bd&&b!==a.P&&a.qa();if(c)L(a,a.defaultValue,!0);else if(a.xb=void 0,Za(a,olympe.D.Node.C.Ng),b=a.T)for(const d of b.values())lb(d,a)}}function db(a){if(a.C!==olympe.D.Node.C.Ig){Za(a,olympe.D.Node.C.Ig);var b=a.T;if(b)for(const c of b.values())db(c);a.qa();void 0!==a.P&&fb(a);a.xb=a.defaultValue}}function bb(a){return a.C===olympe.D.Node.C.Tg}
253
+ function cb(a,b){b===a?olympe.D.K.error('Setting a node as provider of itself. Ignoring'):(a.P&&a.P!==b&&fb(a),$a(b,a),bb(b)?L(a,b.xb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):lb(a),a.P=b)}function mb(a,b){a.bd&&(a.bd=void 0);a.Wc='Repeater';cb(a,b)}function ib(a){a.P?hb(a):null!==a.ga&&0===Array.from(a.ga.values()).filter(b=>!bb(b)).length&&(a.hc&&(a.hc=!1,ab(a)),hb(a))}
254
+ function $a(a,b){a.T||(a.T=new Map);a.T.set(b.W(),b);a.C===olympe.D.Node.C.rf&&olympe.D.K.warn('adding a downstream node on a deleted one (#'+a.W()+') !')}function gb(a,b){a.T&&(b=b.W(),a.T.has(b)&&(a.T.delete(b),nb(a)))}function nb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
255
+ olympe.D.Node=class extends olympe.D.Nb{constructor({valueType:a,bd:b,Sv:c=!0,mf:d,Xl:e,debug:f=!1,Gf:g=null,Wc:h='Node',ci:k}={}){++Xa;super(String(Xa));this.debug=!!f;this.Wc=h;h&&'string'===typeof h||(b?this.Wc=b.name?b.name:'anon()':this.Wc='Node');this.Ba=e&&0<e.length?e:null;this.Gf=g&&0<g.length?g:null;this.valueType=a;this.xb=void 0;this.Ob=!1;this.C=olympe.D.Node.C.Ng;this.hc=!1;this.T=this.ga=null;this.bd=b;this.mf=d||null;this.defaultValue=this.Xb=this.P=void 0;this.ci=k;d&&d instanceof
256
+ olympe.D.Node&&Ya(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ya(this,a);c&&ab(this)}yg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Ng&&L(this,a,!0);return this}di(a){this.valueType=a}Gb(){return this.valueType||Object}sd(){return this.C}mb(){return this.C===olympe.D.Node.C.rf}Ac(){return this.C===olympe.D.Node.C.sf}we(...a){if(this.ci instanceof Function)return this.ci(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.sd();a!==olympe.D.Node.C.sf&&
257
+ a!==olympe.D.Node.C.rf||olympe.D.K.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.Ya(g)&&b.push(g.Aa);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Xg&&(e[g]=f.Aa,b.push(g));return N(new olympe.D.Node({valueType:d.L(),bd:c,mf:this,Xl:e,debug:!1,Gf:b,Wc:'Proxy.'+c+'()'}))}Hj(a){if(null===this.getParent())olympe.D.K.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.K.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
+ a,this.getParent());return}this.If(null);nb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.sf&&a!==olympe.D.Node.C.rf){Za(this,olympe.D.Node.C.sf);if(a=this.T){for(const c of a.values())if(a.has(c.W())){var b=c;b.ga&&b.ga.delete(this.W());b.P&&b.P.W()===this.W()?b.P=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ga){for(const c of this.ga.values())this.ga.has(c.W())&&gb(c,this);this.ga.clear()}this.ga=null;this.P&&(gb(this.P,this),this.P=void 0);this.xb=void 0;this.Ba&&(this.Ba.length=
259
+ 0,this.Ba=null);this.Gf&&(this.Gf.length=0,this.Gf=null);this.ci=this.bd=void 0;this.defaultValue=this.mf=null;this.Wc=`** Destroyed ** ${this.Wc}`;Za(this,olympe.D.Node.C.rf)}}Ad(){return this.Wc}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Ng:0,Tg:1,Ig:3,aj:4,OBSOLETE:5,sf:6,rf:7};function eb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.K.error('investigate');c=Object.create(ob(c,a.prototype));c.Ej=a;c.Cp=b;return c}function ob(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.dl)||Object.defineProperty(b,olympe.D.Proxy.dl,{enumerable:!1,configurable:!1,writable:!1,value:pb(a,b)});return b[olympe.D.Proxy.dl]}
260
+ function qb(a,b){if(a.Ej!==b){a.Ej=b;b.prototype||olympe.D.K.error('Cast not possible, provided type is not a valid type!');var c=ob(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Aa&&a.Aa.di(b)}}
261
+ function pb(a,b){let c={};if(b.prototype)olympe.D.K.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ob(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].J;null===e||e&&e.P()?c[d]=function(...f){var g=this.Aa;if(g&&bb(g)&&(g=g.xb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.H.Z,c[d]=function(...f){f=this.Cp.call(this.Aa,
262
+ ...f,e,d);const g=e.Z;if(g){const h=this.Aa.xb;h&&h[g]&&qb(f,h[g])}return e.T()?this:f})}});return c}function O(a,b){L(a.Aa,b)}function rb(a){lb(a.Aa)}function sb(a,b){mb(a.Aa,olympe.D.jf(b)?b:b.Aa)}function tb(a,b){olympe.D.Ya(b)||olympe.D.jf(b)?sb(a,b):O(a,b)}
263
+ olympe.D.Proxy=class{constructor(a,b){this.Aa=null;this.Ej=a;this.Cp=b}static Ya(a){return!(!a||!a.Xg)}Pa(a){return olympe.D.ra([this,a],(b,c)=>b===c,Boolean)}vd(a){return olympe.D.ra([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ea.F:olympe.D.ea.C:b.valueOf()===c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea)}Bp(){return this.Aa}};olympe.D.Proxy.dl='__opp__';olympe.D.Proxy.prototype.Xg=!0;function ub(a,b){a.node.yg(b);return a}olympe.D.Qi=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.Ya(a)?L(this.node,olympe.D.Qa(a)):L(this.node,a);return this}repeat(a){mb(this.node,olympe.D.Ya(a)?a.Aa:a);return this}clear(){lb(this.node);return this}vb(){return N(this.node)}getContext(){return this.node}};function vb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.aa),g=d||olympe.D.aa.nn.$n;let h,k,m,n;f.update(olympe.D.na(a));const p=window.performance.now(),q=b.valueOf();m=q-a.valueOf();if(0!==m&&void 0===n){const r=()=>{f.getContext().mb()||(m=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+m*g(k,0,1,1),f.update(olympe.D.na(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.vb()}
264
+ olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.na(b.value)}tm(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Hb(!this.tm())}xc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.rb(''):olympe.D.rb(this.value.toString())}toString(a,b){return void 0!==
265
+ this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.tm()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.na(c))};a.forEach((f,g)=>{olympe.D.oc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().mb()){var g=b.get(f);b.delete(f);
266
+ g===c&&e()}});return d.vb()}Gd(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()+c.valueOf()),olympe.D.aa,'ONumber.plus')}vg(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()-c.valueOf()),olympe.D.aa,'ONumber.minus')}round(){return olympe.D.na(Math.round(this.valueOf()))}zi(){return olympe.D.na(-this.valueOf())}Xj(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()*c.valueOf()),olympe.D.aa,'ONumber.mul')}ei(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()/
267
+ c.valueOf()),olympe.D.aa,'ONumber.div')}yv(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(b.valueOf()%c.valueOf()),olympe.D.aa,'ONumber.div')}floor(){return olympe.D.na(Math.floor(this.valueOf()))}ceil(){return olympe.D.na(Math.ceil(this.valueOf()))}trunc(){return olympe.D.na(Math.trunc(this.valueOf()))}log(){return olympe.D.na(Math.log(this.valueOf()))}pow(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.na(Math.pow(b.valueOf(),c.valueOf())),olympe.D.aa,'ONumber.pow')}exp(){return olympe.D.na(Math.exp(this.valueOf()))}vd(a){return olympe.D.ra([this,
268
+ a],(b,c)=>olympe.D.Hb(b.Pa(c)),olympe.D.ea,'ONumber.oEquals')}Pa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Mu(){return this.valueOf()}$l(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isBiggerThan')}Uv(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.na(c),olympe.D.aa,'ONumber.returnsBiggest')}iq(a){return olympe.D.ra([this,
269
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.na(c),olympe.D.aa,'ONumber.returnsSmallest')}qv(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isSmallerThan')}sin(){return olympe.D.na(Math.sin(this.valueOf()))}cos(){return olympe.D.na(Math.cos(this.valueOf()))}atan2(a){return olympe.D.Ya(a)?olympe.D.Vd([a],b=>olympe.D.na(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.aa):olympe.D.na(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.na(Math.abs(this.valueOf()))}ri(a,
270
+ b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.aa):olympe.D.na(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static rt(a,b,c,d){'number'===typeof a&&(a=olympe.D.Fd(a));'number'===typeof b&&(b=olympe.D.Fd(b));'number'===typeof c&&(c=olympe.D.Fd(c));let e=0;const f=olympe.D.Fd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.aq(b.$l(c),()=>{olympe.ka.ab('df').warn('You have a min bigger than max, cap your inputs')});
271
+ const k=(m,n)=>{n=olympe.D.Fd(n);const p=olympe.D.aa.animate(n,500);sb(f,p);O(n,olympe.D.na(m));e=m};olympe.D.Vd([a],m=>{e+=m.valueOf();e>h?k(h,e):e<g?k(g,e):sb(f,olympe.D.Fd(e))},olympe.D.aa);void 0!==b&&olympe.D.im(b.valueOf(),m=>{if(g!==m&&(g=m,g>e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.na(g);L(n.Aa,m);e=g;sb(f,p)}});void 0!==c&&olympe.D.im(c.valueOf(),m=>{if(h!==m&&(h=m,h<e)){const n=olympe.D.Fd(e),p=olympe.D.aa.animate(n,400,d);m=olympe.D.na(h);L(n.Aa,m);e=h;sb(f,
272
+ p)}});return f}static offset(a){let b;return olympe.D.Vd([a],c=>{void 0===b&&(b=c);return olympe.D.na(c-b)},olympe.D.aa,'offset')}static Np(a){let b,c,d;return olympe.D.ra([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.na(0);d=window.performance.now();const f=olympe.D.na((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.aa,'derivative')}static lv(a){let b=olympe.D.na(0),c,d,e;return olympe.D.ra([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.na(0);
273
+ e=window.performance.now();b=b.Gd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.aa,'integrate')}static Ot(a){let b;return olympe.D.ra([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.na(c.valueOf()-b.valueOf());b=c;return d},olympe.D.aa,'diff')}static Gt(a,b,c){return olympe.D.Vd([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.na(d>=e?d<=f?d:f:e)},olympe.D.aa)}static animate(a,b,c,d){let e;
274
+ return e=olympe.D.ra([a],f=>{const g=olympe.D.Qa(b,1E3),h=olympe.D.Qa(e);return void 0===h?olympe.D.na(f):vb(h,f,g,c,k=>{d&&d(k)})},olympe.D.aa)}static Ct(a,b,c){let d,e,f,g,h,k,m=olympe.D.Fd(),n;olympe.D.oc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);O(m,olympe.D.na(g));1===h&&(clearTimeout(n),n=void 0)},0))});return m}static xc(a){return olympe.D.Ya(a)?
275
+ olympe.D.ra([a],b=>olympe.D.rb(b.valueOf().toString()),olympe.D.Ja):olympe.D.rb(a)}static zi(a){return olympe.D.Ya(a)?olympe.D.ra([a],b=>olympe.D.na(-b.valueOf()),olympe.D.aa):olympe.D.na(-a.valueOf())}static Gd(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.ra([a,b],(c,d)=>olympe.D.na(c.valueOf()+d.valueOf()),olympe.D.aa,'plus'):olympe.D.na(a.valueOf()+b.valueOf())}static vg(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(c.valueOf()-d.valueOf()),olympe.D.aa,
276
+ 'minus'):olympe.D.na(a.valueOf()-b.valueOf())}static ei(a,b){return olympe.D.Ya(a)||olympe.D.Ya(b)?olympe.D.Vd([a,b],(c,d)=>olympe.D.na(c.valueOf()/d.valueOf()),olympe.D.aa,'div'):olympe.D.na(a.valueOf()/b.valueOf())}static Rv(a,b){if(void 0===b)return a;olympe.D.oc([b],c=>{c=olympe.D.na(a.Aa.xb.valueOf()+c.valueOf());L(a.Aa,c)},'plusEqual');return a}};olympe.D.aa.ZERO=new olympe.D.aa(0);olympe.D.aa.ONE=new olympe.D.aa(1);olympe.D.aa.et=new olympe.D.aa(2);olympe.D.aa.PI=new olympe.D.aa(Math.PI);
277
+ olympe.D.aa.rr=new olympe.D.aa(Infinity);olympe.D.aa.ms=new olympe.D.aa(-Infinity);olympe.D.aa.jo=new olympe.D.aa(NaN);olympe.D.aa.Gy=olympe.D.aa.Rv;olympe.D.aa.ow=olympe.D.aa.rt;olympe.D.aa.vy=olympe.D.aa.offset;olympe.D.aa.Vw=olympe.D.aa.Np;olympe.D.aa.KA=olympe.D.aa.Np;olympe.D.aa.Sx=olympe.D.aa.lv;olympe.D.aa.Ww=olympe.D.aa.Ot;olympe.D.aa.Dw=olympe.D.aa.Gt;olympe.D.aa.pw=olympe.D.aa.animate;olympe.D.aa.qw=olympe.D.aa.Ct;olympe.D.aa.Wz=olympe.D.aa.xc;olympe.D.aa.Xz=olympe.D.aa.zi;
278
+ olympe.D.aa.Fy=olympe.D.aa.Gd;olympe.D.aa.iy=olympe.D.aa.vg;olympe.D.aa.Xw=olympe.D.aa.ei;
279
+ olympe.D.aa.nn={$n:function(a,b,c,d){return c*a/d+b},ux:function(a,b,c,d){a/=d;return c*a*a+b},Ex:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},px:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},ix:function(a,b,c,d){a/=d;return c*a*a*a+b},Ax:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},nx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},vx:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Fx:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
+ qx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},wx:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Gx:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},sx:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},xx:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Hx:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},tx:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},lx:function(a,b,c,d){return c*Math.pow(2,
281
+ 10*(a/d-1))+b},Dx:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},ox:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},hx:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},zx:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},mx:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},$w:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},ax:function(a,b,c,d){d=(a/=d)*a;return b+
282
+ c*(2*d*d+2*d*a+-3*d)},bx:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},ex:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Cx:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Bx:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},kx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},jx:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},yx:function(a,
283
+ b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},gx:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};l=olympe.D.aa.prototype;l.toJSON.J=olympe.D.H.C;l.tm.J=olympe.D.H.C;l.isNaN.J=olympe.D.H.P;l.xc.J=olympe.D.H.F;
284
+ l.toString.J=new olympe.D.H(()=>String,[]);l.toFixed.J=new olympe.D.H(()=>String,[]);l.Gd.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.vg.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.round.J=olympe.D.H.G;l.zi.J=olympe.D.H.G;l.Xj.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.ei.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.yv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.floor.J=olympe.D.H.G;l.ceil.J=olympe.D.H.G;l.trunc.J=olympe.D.H.G;l.log.J=olympe.D.H.G;l.pow.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.exp.J=olympe.D.H.G;
285
+ l.vd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Pa.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Mu.J=olympe.D.H.C;l.$l.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Uv.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.iq.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.qv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.sin.J=olympe.D.H.G;l.cos.J=olympe.D.H.G;l.atan2.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.abs.J=olympe.D.H.G;l.ri.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);olympe.D.Ja=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.rb(b.value)}Jp(a){return olympe.D.Ja.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.ra([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.rb(d)},olympe.D.Ja,'OString.concat')}xc(){return this}hw(a){return olympe.D.na(parseInt(this.value,
286
+ a))}mq(){return olympe.D.na(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Pa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}vd(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.Hb(c&&b.valueOf()===c.valueOf()),olympe.D.ea,'OString.oEquals')}kh(){return olympe.D.Hb(!this.value||0===this.value.length)}contains(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.Hb((c instanceof olympe.D.Ja||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
287
  olympe.D.ea,'OString.contains')}startsWith(a,b){return olympe.D.ra([this,a,b||0],(c,d,e)=>olympe.D.Hb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.startsWith')}endsWith(a,b){return olympe.D.ra([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Sl().valueOf()+e.valueOf()+1;return olympe.D.Hb(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ea,'OString.endsWith')}indexOf(a,b){return olympe.D.ra([this,a,b||0],(c,d,e)=>olympe.D.na(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
288
  olympe.D.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.ra([this,a,b||Infinity],(c,d,e)=>olympe.D.na(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.aa,'OString.lastIndexOf')}slice(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Ja,'OString.slice')}Sl(){return olympe.D.na(this.value.length)}threshold(a){return olympe.D.ra([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Ja.EMPTY,olympe.D.Ja,'OString.threshold')}toLowerCase(){return olympe.D.rb(this.value.toLowerCase())}toUpperCase(){return olympe.D.rb(this.value.toUpperCase())}trim(){return olympe.D.rb(this.value.trim())}padStart(a,
289
- b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.padStart')}padEnd(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.padEnd')}replace(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.replace')}ew(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Ja,'OString.subOStr')}static concat(...a){return olympe.D.rb('').concat(...a)}};olympe.D.Ja.EMPTY=new olympe.D.Ja('');olympe.D.Ja.Vs=new olympe.D.Ja(' ');l=olympe.D.Ja.prototype;l.toJSON.J=olympe.D.H.C;l.Jp.J=new olympe.D.H(()=>olympe.D.Ja,[0,1]);l.concat.J=olympe.D.H.F;l.wc.J=olympe.D.H.F;l.iw.J=olympe.D.H.G;l.mq.J=olympe.D.H.G;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Qa.J=olympe.D.H.C;l.ud.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.hh.J=olympe.D.H.O;
289
+ b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.padStart')}padEnd(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.padEnd')}replace(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Ja,'OString.replace')}dw(a,b){return olympe.D.ra([this,a,b],(c,d,e)=>olympe.D.rb(c.valueOf().substr(d.valueOf(),
290
+ e.valueOf())),olympe.D.Ja,'OString.subOStr')}static concat(...a){return olympe.D.rb('').concat(...a)}};olympe.D.Ja.EMPTY=new olympe.D.Ja('');olympe.D.Ja.Us=new olympe.D.Ja(' ');l=olympe.D.Ja.prototype;l.toJSON.J=olympe.D.H.C;l.Jp.J=new olympe.D.H(()=>olympe.D.Ja,[0,1]);l.concat.J=olympe.D.H.F;l.xc.J=olympe.D.H.F;l.hw.J=olympe.D.H.G;l.mq.J=olympe.D.H.G;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;l.Pa.J=olympe.D.H.C;l.vd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.kh.J=olympe.D.H.P;
291
291
  l.contains.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.startsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.endsWith.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.indexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.lastIndexOf.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.slice.J=new olympe.D.H(()=>olympe.D.Ja,[0,1]);l.Sl.J=olympe.D.H.G;l.threshold.J=new olympe.D.H(()=>olympe.D.Ja,[0]);l.toLowerCase.J=olympe.D.H.F;l.toUpperCase.J=olympe.D.H.F;l.trim.J=olympe.D.H.F;l.padStart.J=olympe.D.H.F;l.padEnd.J=olympe.D.H.F;
292
- l.replace.J=olympe.D.H.F;l.ew.J=olympe.D.H.F;olympe.D.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ea.F:olympe.D.ea.C}and(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()&&b.valueOf()),olympe.D.ea,'and'):this.value&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}Qa(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}ud(a){if(void 0!==a)return olympe.D.Ya(a)?
293
- olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()===b.valueOf()),olympe.D.ea,'oEquals'):this.Qa(a)?olympe.D.ea.F:olympe.D.ea.C}Wc(){return this.value?olympe.D.ea.C:olympe.D.ea.F}Ct(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(!(this.valueOf()&&b.valueOf())),olympe.D.ea,'andNot'):this.value&&!a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}or(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()||b.valueOf()),olympe.D.ea,'or'):this.value||a.valueOf()?
294
- olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.ra([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Hb(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}cu(){return this.value}Wp(){return!0===this.value?olympe.D.aa.ONE:olympe.D.aa.ZERO}wc(){return olympe.D.rb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ea.F=new olympe.D.ea(!0);olympe.D.ea.C=new olympe.D.ea(!1);l=olympe.D.ea.prototype;l.toJSON.J=olympe.D.H.C;
295
- l.and.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Qa.J=olympe.D.H.C;l.ud.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Wc.J=olympe.D.H.O;l.Ct.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.or.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.xor.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.cu.J=new olympe.D.H(()=>Boolean,[]);l.Wp.J=olympe.D.H.G;l.wc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;function wb(a){return new olympe.D.Za(new Date(a))}
296
- olympe.D.Za=class{constructor(a){this.hb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.hb.toJSON()+'" }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Za(new Date(b.value.valueOf()))}static now(){return new olympe.D.Za(new Date)}li(){return this.hb&&!isNaN(this.hb.getTime())?olympe.D.ea.F:olympe.D.ea.C}zr(){return olympe.D.na(this.hb.getMilliseconds())}Br(){return olympe.D.na(this.hb.getSeconds())}Ar(){return olympe.D.na(this.hb.getMinutes())}yr(){return olympe.D.na(this.hb.getHours())}pu(){return olympe.D.na(this.hb.getDate())}getMonth(){return olympe.D.na(this.hb.getMonth()+1)}Cr(){return olympe.D.na(this.hb.getFullYear())}getTime(){return this.hb.getTime()}bw(){var a=
297
- olympe.D,b=a.rb;var c=this.hb.getDate();c=10>c?'0'+c:c;var d=this.hb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.hb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.hb.toLocaleString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.hb.toLocaleString(c.valueOf())),olympe.D.Ja)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.hb.toLocaleDateString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.hb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Ja)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.hb.toLocaleTimeString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.hb.toLocaleTimeString(c.valueOf())),olympe.D.Ja)}wc(){return olympe.D.rb(this.hb.toISOString())}fw(){return new Date(this.getTime())}hw(){return this}jw(){return this}Ef(a,b){return olympe.D.ra([b],c=>{const d=new olympe.D.Za(new Date(this.hb.getTime()));d.hb['set'+a](this.hb['get'+a]()+c.valueOf());return d},olympe.D.Za)}ut(a){return this.Ef('Milliseconds',
299
- a)}zt(a){return this.Ef('Seconds',a)}vt(a){return this.Ef('Minutes',a)}tt(a){return this.Ef('Hours',a)}Al(a){return this.Ef('Date',a)}At(a){return'number'===typeof a?this.Al(7*a):this.Al(a.Vj(7))}wt(a){return this.Ef('Month',a)}Bt(a){return this.Ef('FullYear',a)}cw(){let a=this.hb.getDay();a=0===a?6:a-1;return new olympe.D.Za(new Date(this.hb.getFullYear(),this.hb.getMonth(),this.hb.getDate()-a))}dw(){return new olympe.D.Za(new Date(this.hb.getFullYear(),this.hb.getMonth()))}ud(a){return olympe.D.ra([a],
300
- b=>olympe.D.Hb(this.Qa(b)),olympe.D.ea)}Qa(a){return a instanceof olympe.D.Za?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Eu(){let a=this.hb.getDay();0===a&&(a=7);return olympe.D.na(a)}tu(a,b){return olympe.D.ra([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.hb.getFullYear()-c.hb.getFullYear():'months'===d?c=12*(this.hb.getFullYear()-c.hb.getFullYear())+(this.hb.getMonth()-c.hb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.ka.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.hb.getTime()-c.hb.getTime())/d));return olympe.D.na(c)},olympe.D.aa)}pv(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.getTime()<b.getTime()),olympe.D.ea)}nv(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.getTime()>b.getTime()),olympe.D.ea)}qv(a,b){return olympe.D.ra([a,b],(c,d)=>olympe.D.Hb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ea)}valueOf(){return this.li().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.Za.C=wb(0);olympe.D.Za.F=wb(Number.NaN);l=olympe.D.Za.prototype;l.li.J=olympe.D.H.O;l.zr.J=olympe.D.H.G;l.Br.J=olympe.D.H.G;l.Ar.J=olympe.D.H.G;l.yr.J=olympe.D.H.G;l.pu.J=olympe.D.H.G;l.getMonth.J=olympe.D.H.G;l.Cr.J=olympe.D.H.G;l.getTime.J=olympe.D.H.C;l.bw.J=new olympe.D.H(()=>olympe.D.Ja,[0]);l.toLocaleString.J=olympe.D.H.F;l.toLocaleDateString.J=olympe.D.H.F;l.toLocaleTimeString.J=olympe.D.H.F;l.wc.J=olympe.D.H.F;l.fw.J=olympe.D.H.C;
303
- l.hw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.jw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ef.J=new olympe.D.H(()=>olympe.D.Za,[]);l.ut.J=new olympe.D.H(()=>olympe.D.Za,[]);l.zt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.vt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.tt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Al.J=new olympe.D.H(()=>olympe.D.Za,[0]);l.At.J=new olympe.D.H(()=>olympe.D.Za,[]);l.wt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Bt.J=new olympe.D.H(()=>olympe.D.Za,[0]);
304
- l.cw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.dw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.ud.J=olympe.D.H.O;l.Qa.J=olympe.D.H.C;l.Eu.J=olympe.D.H.G;l.tu.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.pv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.nv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.qv.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.valueOf.J=olympe.D.H.C;const xb=new Map,yb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,zb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function Ab(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=zb.exec(c)):(d=1,c=yb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.jf(a)?olympe.D.Vd([a],b,olympe.D.Color):b(a)}
292
+ l.replace.J=olympe.D.H.F;l.dw.J=olympe.D.H.F;olympe.D.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ea.F:olympe.D.ea.C}and(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()&&b.valueOf()),olympe.D.ea,'and'):this.value&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}Pa(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}vd(a){if(void 0!==a)return olympe.D.Ya(a)?
293
+ olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()===b.valueOf()),olympe.D.ea,'oEquals'):this.Pa(a)?olympe.D.ea.F:olympe.D.ea.C}$c(){return this.value?olympe.D.ea.C:olympe.D.ea.F}Bt(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(!(this.valueOf()&&b.valueOf())),olympe.D.ea,'andNot'):this.value&&!a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}or(a){if(void 0!==a)return olympe.D.Ya(a)?olympe.D.Vd([a],b=>new olympe.D.ea(this.valueOf()||b.valueOf()),olympe.D.ea,'or'):this.value||a.valueOf()?
294
+ olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.ra([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Hb(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}bu(){return this.value}Wp(){return!0===this.value?olympe.D.aa.ONE:olympe.D.aa.ZERO}xc(){return olympe.D.rb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ea.F=new olympe.D.ea(!0);olympe.D.ea.C=new olympe.D.ea(!1);l=olympe.D.ea.prototype;l.toJSON.J=olympe.D.H.C;
295
+ l.and.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.Pa.J=olympe.D.H.C;l.vd.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.$c.J=olympe.D.H.P;l.Bt.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.or.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.xor.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.bu.J=new olympe.D.H(()=>Boolean,[]);l.Wp.J=olympe.D.H.G;l.xc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.valueOf.J=olympe.D.H.C;function wb(a){return new olympe.D.Za(new Date(a))}
296
+ olympe.D.Za=class{constructor(a){this.ib=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.ib.toJSON()+'" }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Za(new Date(b.value.valueOf()))}static now(){return new olympe.D.Za(new Date)}pi(){return this.ib&&!isNaN(this.ib.getTime())?olympe.D.ea.F:olympe.D.ea.C}zr(){return olympe.D.na(this.ib.getMilliseconds())}Br(){return olympe.D.na(this.ib.getSeconds())}Ar(){return olympe.D.na(this.ib.getMinutes())}yr(){return olympe.D.na(this.ib.getHours())}ou(){return olympe.D.na(this.ib.getDate())}getMonth(){return olympe.D.na(this.ib.getMonth()+1)}Cr(){return olympe.D.na(this.ib.getFullYear())}getTime(){return this.ib.getTime()}aw(){var a=
297
+ olympe.D,b=a.rb;var c=this.ib.getDate();c=10>c?'0'+c:c;var d=this.ib.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.ib.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.ib.toLocaleString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.ib.toLocaleString(c.valueOf())),olympe.D.Ja)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.ib.toLocaleDateString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.ib.toLocaleDateString(c.valueOf())),
298
+ olympe.D.Ja)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.rb(this.ib.toLocaleTimeString(a)):olympe.D.ra([this,a],(b,c)=>olympe.D.rb(b.ib.toLocaleTimeString(c.valueOf())),olympe.D.Ja)}xc(){return olympe.D.rb(this.ib.toISOString())}ew(){return new Date(this.getTime())}gw(){return this}iw(){return this}Ff(a,b){return olympe.D.ra([b],c=>{const d=new olympe.D.Za(new Date(this.ib.getTime()));d.ib['set'+a](this.ib['get'+a]()+c.valueOf());return d},olympe.D.Za)}tt(a){return this.Ff('Milliseconds',
299
+ a)}yt(a){return this.Ff('Seconds',a)}ut(a){return this.Ff('Minutes',a)}st(a){return this.Ff('Hours',a)}Al(a){return this.Ff('Date',a)}zt(a){return'number'===typeof a?this.Al(7*a):this.Al(a.Xj(7))}vt(a){return this.Ff('Month',a)}At(a){return this.Ff('FullYear',a)}bw(){let a=this.ib.getDay();a=0===a?6:a-1;return new olympe.D.Za(new Date(this.ib.getFullYear(),this.ib.getMonth(),this.ib.getDate()-a))}cw(){return new olympe.D.Za(new Date(this.ib.getFullYear(),this.ib.getMonth()))}vd(a){return olympe.D.ra([a],
300
+ b=>olympe.D.Hb(this.Pa(b)),olympe.D.ea)}Pa(a){return a instanceof olympe.D.Za?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Du(){let a=this.ib.getDay();0===a&&(a=7);return olympe.D.na(a)}su(a,b){return olympe.D.ra([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.ib.getFullYear()-c.ib.getFullYear():'months'===d?c=12*(this.ib.getFullYear()-c.ib.getFullYear())+(this.ib.getMonth()-c.ib.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
+ void 0===d&&(olympe.ka.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.ib.getTime()-c.ib.getTime())/d));return olympe.D.na(c)},olympe.D.aa)}ov(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.getTime()<b.getTime()),olympe.D.ea)}mv(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.getTime()>b.getTime()),olympe.D.ea)}pv(a,b){return olympe.D.ra([a,b],(c,d)=>olympe.D.Hb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ea)}valueOf(){return this.pi().valueOf()?
302
+ new Date(this.getTime()):new Date(0)}};olympe.D.Za.C=wb(0);olympe.D.Za.F=wb(Number.NaN);l=olympe.D.Za.prototype;l.pi.J=olympe.D.H.P;l.zr.J=olympe.D.H.G;l.Br.J=olympe.D.H.G;l.Ar.J=olympe.D.H.G;l.yr.J=olympe.D.H.G;l.ou.J=olympe.D.H.G;l.getMonth.J=olympe.D.H.G;l.Cr.J=olympe.D.H.G;l.getTime.J=olympe.D.H.C;l.aw.J=new olympe.D.H(()=>olympe.D.Ja,[0]);l.toLocaleString.J=olympe.D.H.F;l.toLocaleDateString.J=olympe.D.H.F;l.toLocaleTimeString.J=olympe.D.H.F;l.xc.J=olympe.D.H.F;l.ew.J=olympe.D.H.C;
303
+ l.gw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.iw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ff.J=new olympe.D.H(()=>olympe.D.Za,[]);l.tt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.yt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.ut.J=new olympe.D.H(()=>olympe.D.Za,[]);l.st.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Al.J=new olympe.D.H(()=>olympe.D.Za,[0]);l.zt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.vt.J=new olympe.D.H(()=>olympe.D.Za,[]);l.At.J=new olympe.D.H(()=>olympe.D.Za,[0]);
304
+ l.bw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.cw.J=new olympe.D.H(()=>olympe.D.Za,[]);l.vd.J=olympe.D.H.P;l.Pa.J=olympe.D.H.C;l.Du.J=olympe.D.H.G;l.su.J=new olympe.D.H(()=>olympe.D.aa,[0,1]);l.ov.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.mv.J=new olympe.D.H(()=>olympe.D.ea,[0]);l.pv.J=new olympe.D.H(()=>olympe.D.ea,[0,1]);l.valueOf.J=olympe.D.H.C;const xb=new Map,yb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,zb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function Ab(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=zb.exec(c)):(d=1,c=yb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.kf(a)?olympe.D.Vd([a],b,olympe.D.Color):b(a)}
305
305
  olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.na(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.na(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.na(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.na(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static tc(a){let b;'string'===typeof a?b=
306
- JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.ra([a,b,c,d],(e,f,g,h)=>{e=olympe.D.na(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.na(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.na(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.na(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of xb.values())if(k&&k.C.Qa(e)&&k.F.Qa(f)&&k.b.Qa(g)&&k.a.Qa(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}pg(){return this.C}lg(){return this.b}ng(){return this.F}kg(){return this.a}Gt(a,b){return olympe.D.Color.create(this.C.mi(a.pg(),b),this.F.mi(a.ng(),b),this.b.mi(a.lg(),b),this.a.mi(a.kg(),b))}Wt(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}nq(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}qm(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
- return'#'+(a+b).toUpperCase()}toString(){return this.qm()}Qa(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Qa;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.qm;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.nq;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.kg;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.ng;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.lg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.pg;olympe.D.Color.create=olympe.D.Color.create;l=olympe.D.Color.prototype;l.toJSON.J=olympe.D.H.C;l.pg.J=olympe.D.H.G;l.lg.J=olympe.D.H.G;l.ng.J=olympe.D.H.G;l.kg.J=olympe.D.H.G;l.Gt.J=new olympe.D.H(()=>olympe.D.Color,[]);l.Wt.J=new olympe.D.H(()=>olympe.D.Color,[]);l.nq.J=new olympe.D.H(()=>String,[]);
310
- l.qm.J=new olympe.D.H(()=>String,[]);l.Qa.J=olympe.D.H.C;olympe.D.File=class{fa(){}Un(){}Nk(){}Ul(){}Gj(){}Ol(){}Hj(){}rename(){}};olympe.D.Ib=class{constructor(a,b){this.x=olympe.D.Fd(a);this.y=olympe.D.Fd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Sa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Sa(this.y).valueOf())+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Ib(b.x,b.y)}Vn(){return this.x}$v(a){tb(this.x,a)}Wn(){return this.y}aw(a){tb(this.y,a)}Yu(){return this.x.iq(this.y)}Gd(a){return olympe.D.ra([this,a],(b,c)=>new olympe.D.Ib(b.x.Gd(c.x),b.y.Gd(c.y)),
311
- olympe.D.Ib,'Vector2.plus')}vg(a){return olympe.D.ra([this,a],(b,c)=>new olympe.D.Ib(b.x.vg(c.x),b.y.vg(c.y)),olympe.D.Ib,'Vector2.minus')}Bv(a){return new olympe.D.Ib(this.x.Vj(a),this.y.Vj(a))}Rt(a){return new olympe.D.Ib(this.x.bi(a),this.y.bi(a))}Dv(){return new olympe.D.Ib(this.x.vi(),this.y.vi())}St(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.ra([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.na(d*f+e*g),olympe.D.aa),olympe.D.aa)}length(){return olympe.D.ra([this.x,this.y],(a,b)=>olympe.D.na(Math.sqrt(a*
312
- a+b*b)),olympe.D.aa)}normalize(){return olympe.D.ra([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Ib(a/c,b/c)},olympe.D.Ib)}floor(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.floor(a),Math.floor(b)),olympe.D.Ib)}ceil(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.ceil(a),Math.ceil(b)),olympe.D.Ib)}round(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.round(a),Math.round(b)),olympe.D.Ib)}xt(a){return new olympe.D.Ib(this.x.Gd(a),
313
- this.y.Gd(a))}yt(a,b){return new olympe.D.Ib(this.x.Gd(a),this.y.Gd(b))}wc(){return olympe.D.ra([this.x,this.y],(a,b)=>olympe.D.rb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Ja)}toString(){return`Vector2[${this.x.za.xb}, ${this.y.za.xb}]`}Qa(a){return this===a?!0:!1}};l=olympe.D.Ib.prototype;l.toJSON.J=olympe.D.H.C;l.Vn.J=olympe.D.H.G;l.$v.J=olympe.D.H.C;l.Wn.J=olympe.D.H.G;l.aw.J=olympe.D.H.C;l.Yu.J=olympe.D.H.G;l.Gd.J=new olympe.D.H(()=>olympe.D.Ib,[0]);
314
- l.vg.J=new olympe.D.H(()=>olympe.D.Ib,[0]);l.Bv.J=olympe.D.H.T;l.Rt.J=olympe.D.H.T;l.Dv.J=olympe.D.H.T;l.St.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.length.J=olympe.D.H.G;l.normalize.J=olympe.D.H.T;l.floor.J=olympe.D.H.T;l.ceil.J=olympe.D.H.T;l.round.J=olympe.D.H.T;l.xt.J=olympe.D.H.T;l.yt.J=olympe.D.H.T;l.wc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Qa.J=olympe.D.H.C;olympe.D.Qf=class{constructor(){}Gb(){}gd(){}get(){}bh(){}has(){}tg(){}vc(){}cf(){}Ne(){}If(){}forEach(){}Nd(){}};olympe.D.Qf.prototype.forEachCurrentValue=olympe.D.Qf.prototype.Nd;olympe.D.Qf.prototype.forEach=olympe.D.Qf.prototype.forEach;l=olympe.D.Qf.prototype;l.has.J=olympe.D.H.O;l.tg.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.cf.J=new olympe.D.H(()=>String,[]);l.Ne.J=olympe.D.H.G;l.If.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Nd.J=olympe.D.H.C;olympe.D.Oc=class extends olympe.D.Qf{Ed(){}bf(){}Be(){}af(){}Od(){}ze(){}ci(){}eh(){}};olympe.D.Oc.prototype.getCurrentAt=olympe.D.Oc.prototype.ze;olympe.D.Oc.prototype.getAt=olympe.D.Oc.prototype.Od;olympe.D.Oc.prototype.getCurrentKeyAt=olympe.D.Oc.prototype.af;olympe.D.Oc.prototype.getKeyAt=olympe.D.Oc.prototype.Be;olympe.D.Oc.prototype.getCurrentRank=olympe.D.Oc.prototype.bf;olympe.D.Oc.prototype.getRank=olympe.D.Oc.prototype.Ed;l=olympe.D.Oc.prototype;l.Ed.J=olympe.D.H.G;l.bf.J=olympe.D.H.C;
315
- l.Be.J=new olympe.D.H(()=>String,[]);l.af.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>Object,[]);l.ze.J=olympe.D.H.C;l.ci.J=olympe.D.H.C;l.eh.J=new olympe.D.H(()=>Array,[]);olympe.D.mh=class{constructor(a,b){this.O=b||olympe.D.Oa();this.valueType=a||Object;this.values={};this.ub=this.Ba=null;this.we=0;this.Z=Object.create(null);this.Cb=Object.create(null);this.size=0;this.K=null;this.O.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,m=0;m<k;m++)g[h[m]].destroy()}}})}getContext(){return this.O}Gb(){return this.valueType}gd(a){this.valueType=a;const b=this.Ba;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
- c)&&qb(b[c],a)}get(a){const b=c=>{null===this.Ba&&(this.Ba={});return this.fi(this.Ba,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.ra([a],c=>b(c),this.valueType)}bh(a){a=this.values[a];return olympe.D.Ya(a)?bb(a.za)?a.za.xb:void 0:a}has(a){const b=c=>{null===this.ub&&(this.ub={});return this.fi(this.ub,c,c in this.values?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'Map.has('+c+')')};return olympe.D.ra([a],c=>b(c),olympe.D.ea)}tg(a){return a in this.values}fi(a,b,c,d,e){let f=a[b];
317
- f||this.O.run(()=>{f=olympe.D.md(d,void 0,e);a[b]=f;f.za.onDestroy(()=>delete a[b]);olympe.D.Ya(c)?sb(f,c):O(f,c)});return f}vc(){throw Error('Abstract method getFirstKey needs to be overridden');}cf(){throw Error('Abstract method getFirstKey needs to be overridden');}Ne(){null===this.K&&this.O.run(()=>{this.K=olympe.D.md(olympe.D.aa,olympe.D.na(this.size));this.K.za.onDestroy(()=>{this.K=null})});return this.K}If(){return this.size}forEach(a,b){const c=this.wl();a=this.Dp(c,a,b);this.vl(c,a)}wl(){return String(++this.we)}vl(a,
306
+ JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.ra([a,b,c,d],(e,f,g,h)=>{e=olympe.D.na(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.na(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.na(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.na(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of xb.values())if(k&&k.C.Pa(e)&&k.F.Pa(f)&&k.b.Pa(g)&&k.a.Pa(h))return k;
307
+ return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}pg(){return this.C}kg(){return this.b}mg(){return this.F}jg(){return this.a}Ft(a,b){return olympe.D.Color.create(this.C.ri(a.pg(),b),this.F.ri(a.mg(),b),this.b.ri(a.kg(),b),this.a.ri(a.jg(),b))}Vt(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}nq(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}qm(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
+ return'#'+(a+b).toUpperCase()}toString(){return this.qm()}Pa(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Pa;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.qm;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.nq;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.jg;
309
+ olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.mg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.kg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.pg;olympe.D.Color.create=olympe.D.Color.create;l=olympe.D.Color.prototype;l.toJSON.J=olympe.D.H.C;l.pg.J=olympe.D.H.G;l.kg.J=olympe.D.H.G;l.mg.J=olympe.D.H.G;l.jg.J=olympe.D.H.G;l.Ft.J=new olympe.D.H(()=>olympe.D.Color,[]);l.Vt.J=new olympe.D.H(()=>olympe.D.Color,[]);l.nq.J=new olympe.D.H(()=>String,[]);
310
+ l.qm.J=new olympe.D.H(()=>String,[]);l.Pa.J=olympe.D.H.C;olympe.D.File=class{fa(){}Un(){}Pk(){}Ul(){}Kj(){}Ol(){}Lj(){}rename(){}};olympe.D.Ib=class{constructor(a,b){this.x=olympe.D.Fd(a);this.y=olympe.D.Fd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Qa(this.y).valueOf())+' }'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Ib(b.x,b.y)}Vn(){return this.x}Zv(a){tb(this.x,a)}Wn(){return this.y}$v(a){tb(this.y,a)}Xu(){return this.x.iq(this.y)}Gd(a){return olympe.D.ra([this,a],(b,c)=>new olympe.D.Ib(b.x.Gd(c.x),b.y.Gd(c.y)),
311
+ olympe.D.Ib,'Vector2.plus')}vg(a){return olympe.D.ra([this,a],(b,c)=>new olympe.D.Ib(b.x.vg(c.x),b.y.vg(c.y)),olympe.D.Ib,'Vector2.minus')}Av(a){return new olympe.D.Ib(this.x.Xj(a),this.y.Xj(a))}Qt(a){return new olympe.D.Ib(this.x.ei(a),this.y.ei(a))}Cv(){return new olympe.D.Ib(this.x.zi(),this.y.zi())}Rt(a){return olympe.D.ra([this,a],(b,c)=>olympe.D.ra([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.na(d*f+e*g),olympe.D.aa),olympe.D.aa)}length(){return olympe.D.ra([this.x,this.y],(a,b)=>olympe.D.na(Math.sqrt(a*
312
+ a+b*b)),olympe.D.aa)}normalize(){return olympe.D.ra([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Ib(a/c,b/c)},olympe.D.Ib)}floor(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.floor(a),Math.floor(b)),olympe.D.Ib)}ceil(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.ceil(a),Math.ceil(b)),olympe.D.Ib)}round(){return olympe.D.ra([this.x,this.y],(a,b)=>new olympe.D.Ib(Math.round(a),Math.round(b)),olympe.D.Ib)}wt(a){return new olympe.D.Ib(this.x.Gd(a),
313
+ this.y.Gd(a))}xt(a,b){return new olympe.D.Ib(this.x.Gd(a),this.y.Gd(b))}xc(){return olympe.D.ra([this.x,this.y],(a,b)=>olympe.D.rb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Ja)}toString(){return`Vector2[${this.x.Aa.xb}, ${this.y.Aa.xb}]`}Pa(a){return this===a?!0:!1}};l=olympe.D.Ib.prototype;l.toJSON.J=olympe.D.H.C;l.Vn.J=olympe.D.H.G;l.Zv.J=olympe.D.H.C;l.Wn.J=olympe.D.H.G;l.$v.J=olympe.D.H.C;l.Xu.J=olympe.D.H.G;l.Gd.J=new olympe.D.H(()=>olympe.D.Ib,[0]);
314
+ l.vg.J=new olympe.D.H(()=>olympe.D.Ib,[0]);l.Av.J=olympe.D.H.T;l.Qt.J=olympe.D.H.T;l.Cv.J=olympe.D.H.T;l.Rt.J=new olympe.D.H(()=>olympe.D.aa,[0]);l.length.J=olympe.D.H.G;l.normalize.J=olympe.D.H.T;l.floor.J=olympe.D.H.T;l.ceil.J=olympe.D.H.T;l.round.J=olympe.D.H.T;l.wt.J=olympe.D.H.T;l.xt.J=olympe.D.H.T;l.xc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Pa.J=olympe.D.H.C;olympe.D.Rf=class{constructor(){}Gb(){}ld(){}get(){}fh(){}has(){}tg(){}vc(){}df(){}Oe(){}Jf(){}forEach(){}Nd(){}};olympe.D.Rf.prototype.forEachCurrentValue=olympe.D.Rf.prototype.Nd;olympe.D.Rf.prototype.forEach=olympe.D.Rf.prototype.forEach;l=olympe.D.Rf.prototype;l.has.J=olympe.D.H.P;l.tg.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.df.J=new olympe.D.H(()=>String,[]);l.Oe.J=olympe.D.H.G;l.Jf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Nd.J=olympe.D.H.C;olympe.D.Qc=class extends olympe.D.Rf{Ed(){}cf(){}Ce(){}bf(){}Od(){}Ae(){}fi(){}hh(){}};olympe.D.Qc.prototype.getCurrentAt=olympe.D.Qc.prototype.Ae;olympe.D.Qc.prototype.getAt=olympe.D.Qc.prototype.Od;olympe.D.Qc.prototype.getCurrentKeyAt=olympe.D.Qc.prototype.bf;olympe.D.Qc.prototype.getKeyAt=olympe.D.Qc.prototype.Ce;olympe.D.Qc.prototype.getCurrentRank=olympe.D.Qc.prototype.cf;olympe.D.Qc.prototype.getRank=olympe.D.Qc.prototype.Ed;l=olympe.D.Qc.prototype;l.Ed.J=olympe.D.H.G;l.cf.J=olympe.D.H.C;
315
+ l.Ce.J=new olympe.D.H(()=>String,[]);l.bf.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>Object,[]);l.Ae.J=olympe.D.H.C;l.fi.J=olympe.D.H.C;l.hh.J=new olympe.D.H(()=>Array,[]);olympe.D.rh=class{constructor(a,b){this.P=b||olympe.D.Oa();this.valueType=a||Object;this.values={};this.ub=this.Ba=null;this.xe=0;this.Z=Object.create(null);this.Cb=Object.create(null);this.size=0;this.L=null;this.P.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,m=0;m<k;m++)g[h[m]].destroy()}}})}getContext(){return this.P}Gb(){return this.valueType}ld(a){this.valueType=a;const b=this.Ba;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
+ c)&&qb(b[c],a)}get(a){const b=c=>{null===this.Ba&&(this.Ba={});return this.ii(this.Ba,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.ra([a],c=>b(c),this.valueType)}fh(a){a=this.values[a];return olympe.D.Ya(a)?bb(a.Aa)?a.Aa.xb:void 0:a}has(a){const b=c=>{null===this.ub&&(this.ub={});return this.ii(this.ub,c,c in this.values?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'Map.has('+c+')')};return olympe.D.ra([a],c=>b(c),olympe.D.ea)}tg(a){return a in this.values}ii(a,b,c,d,e){let f=a[b];
317
+ f||this.P.run(()=>{f=olympe.D.qd(d,void 0,e);a[b]=f;f.Aa.onDestroy(()=>delete a[b]);olympe.D.Ya(c)?sb(f,c):O(f,c)});return f}vc(){throw Error('Abstract method getFirstKey needs to be overridden');}df(){throw Error('Abstract method getFirstKey needs to be overridden');}Oe(){null===this.L&&this.P.run(()=>{this.L=olympe.D.qd(olympe.D.aa,olympe.D.na(this.size));this.L.Aa.onDestroy(()=>{this.L=null})});return this.L}Jf(){return this.size}forEach(a,b){const c=this.wl();a=this.Dp(c,a,b);this.vl(c,a)}wl(){return String(++this.xe)}vl(a,
318
318
  b){this.Cb[a]=b;olympe.D.Oa().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Cb[a]});this.Nd(b)}Dp(a,b,c){const d=olympe.D.Oa();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.zl(a,f,g)})}}zl(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}Nd(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
319
- a(b[c],c,this))break}Cj(a,b){void 0!==this.values[a]&&this.Zh(a,!0);this.values[a]=b;var c=this.Ba;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?sb(c[a],b):O(c[a],b));c=this.ub;null!==c&&void 0!==c[a]&&tb(c[a],!0);this.size++;c=this.Cb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Zh(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Ug?d.za.xb:d;var e=this.Ba;null!==e&&void 0!==e[a]&&rb(e[a]);e=this.ub;null!==e&&void 0!==
320
- e[a]&&tb(e[a],!1);delete c[a];this.size--;b||this.Ye()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Ye(){null!==this.K&&tb(this.K,this.size)}Vg(){var a=this.Ba;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&rb(a[c]);a=this.ub;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&tb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
321
- c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.K&&tb(this.K,this.size)}Uf(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.mh.sa=[olympe.D.Qf];l=olympe.D.mh.prototype;l.getContext.J=olympe.D.H.C;l.Gb.J=olympe.D.H.C;l.gd.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>Object,[],'valueType');l.bh.J=olympe.D.H.C;l.has.J=olympe.D.H.O;l.tg.J=olympe.D.H.C;l.fi.J=olympe.D.H.C;
322
- l.Ne.J=olympe.D.H.G;l.If.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.wl.J=olympe.D.H.C;l.vl.J=olympe.D.H.C;l.Dp.J=olympe.D.H.C;l.zl.J=olympe.D.H.C;l.Nd.J=olympe.D.H.C;l.Cj.J=olympe.D.H.C;l.Zh.J=olympe.D.H.C;l.Ye.J=olympe.D.H.C;l.Vg.J=olympe.D.H.C;l.Uf.J=olympe.D.H.C;olympe.D.zi=class extends olympe.D.mh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.qa=this.Va=this.nb=this.ga=null}gd(a){super.gd(a);if(null!==this.qa)for(let b of this.qa.values())qb(b,a)}vc(){return this.Od(0)}cf(){return this.Be(0)}Ed(a){const b=c=>{null===this.nb&&(this.nb=Object.create(null));let d=this.bf(a);d=void 0!==d?olympe.D.na(d):void 0;return this.fi(this.nb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.Ya(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
323
- [a.za],[0],'onResolved('+(b.name||'')+')')):b(a)}bf(a){return this.F[a]}Be(a){const b=c=>{const d=c.valueOf(),e=this.af(d);null===this.Va&&(this.Va=Object.create(null));return this.fi(this.Va,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.ra([a],c=>b(c),String)}af(a){return this.C[a.valueOf()]}Od(a){if(olympe.D.Ya(a))return this.get(olympe.D.ra([a],c=>{c=this.Be(c);if(!bb(c.za)){const d=olympe.D.Oa();olympe.D.hf(d)&&lb(d)}return c},String));null===this.qa&&(this.qa=new Map);let b=this.qa.get(a);
324
- b||this.O.run(()=>{b=this.get(this.Be(a));this.qa.set(a,b);b.za.onDestroy(()=>this.qa.delete(a))});return b}ze(a){return this.bh(this.af(a))}ci(a,b,c,d){let e=this.wl();a=this.eq(e,a,b,c,d);this.vl(e,a)}eq(a,b,c,d,e){return olympe.D.Oa().G((f,g)=>{let h=!1,k=olympe.D.kh([b,c,this.Ed(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.zl(a,g,k)})}eh(){null===this.ga&&this.O.run(()=>{this.ga=olympe.D.md(Array,this.C.filter(a=>void 0!==a));
325
- this.ga.za.onDestroy(()=>{this.K=null})});return this.ga}Nd(a){if(this.C.length!==this.size)super.Nd(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}yl(a,b){const c=this.nb,d=this.Va,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&rb(c[g]),void 0!==
326
- c[a]&&O(c[a],olympe.D.na(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&rb(d[e]),void 0!==d[b]&&O(d[b],a))}}xl(a){var b=this.Va,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.za.xb===a&&rb(b));delete this.F[a];this.C.splice(c,1);c=this.nb;null!==c&&void 0!==c[a]&&rb(c[a])}Ep(){if(null!==this.ga){const a=this.C,b=this.ga.za.xb;b&&a.join(',')!==b.join(',')&&O(this.ga,a)}}Ye(){this.Ep();super.Ye()}Vg(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.nb;if(null!==a)for(b in a)rb(a[b]);
327
- a=this.Va;if(null!==a)for(b in a)rb(a[parseInt(b,10)]);var b=this.ga;null!==b&&(jb(b.za),O(b,this.C));return olympe.D.mh.prototype.Vg.call(this)}Uf(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.zi.sa=[olympe.D.Oc];l=olympe.D.zi.prototype;l.gd.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.cf.J=new olympe.D.H(()=>String,[]);l.Ed.J=olympe.D.H.G;l.bf.J=olympe.D.H.C;
328
- l.Be.J=new olympe.D.H(()=>String,[]);l.af.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>Object,[]);l.ze.J=olympe.D.H.C;l.ci.J=new olympe.D.H(()=>{},[]);l.eq.J=olympe.D.H.C;l.eh.J=new olympe.D.H(()=>Array,[]);l.Nd.J=olympe.D.H.C;l.yl.J=olympe.D.H.C;l.xl.J=olympe.D.H.C;l.Ep.J=olympe.D.H.C;l.Ye.J=olympe.D.H.C;l.Vg.J=olympe.D.H.C;l.Uf.J=olympe.D.H.C;olympe.D.Map=class extends olympe.D.mh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}gd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&qb(this.F,a);super.gd(a)}vc(){null===this.F&&this.Il();return this.F}cf(){null===this.C&&this.Il();return this.C}Il(){this.getContext().run(()=>{this.F=olympe.D.md(this.Gb());this.C=olympe.D.md(String);this.si(this.Ll())})}Ll(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}si(a){if(void 0!==
329
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?sb(this.F,b):O(this.F,b);O(this.C,a)}else void 0!==this.F.za.xb&&(rb(this.F),rb(this.C))}set(a,b){this.Cj(a,b);1===this.size&&null!==this.C&&this.si(a);this.Ye()}remove(a){const b=this.Zh(a);null!==this.C&&this.C.za.xb===a&&this.si(this.Ll());return b}clear(){this.Vg();null!==this.C&&this.si()}};l=olympe.D.Map.prototype;l.gd.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.cf.J=new olympe.D.H(()=>String,[]);l.Il.J=olympe.D.H.C;l.Ll.J=olympe.D.H.C;
330
- l.si.J=olympe.D.H.C;l.set.J=olympe.D.H.C;l.remove.J=new olympe.D.H(()=>Object,[]);l.clear.J=olympe.D.H.C;olympe.D.Xf=class extends olympe.D.zi{constructor(a){super(a)}set(a,b,c){this.Cj(a,b);void 0!==c&&olympe.D.nc([c],d=>{this.yl(a,d)});this.Ye()}remove(a){this.xl(a);return this.Zh(a)}clear(){this.Vg()}};olympe.D.Xf.prototype.remove.J=olympe.D.H.C;olympe.D.Xf.prototype.clear.J=olympe.D.H.C;olympe.D.wq=class extends olympe.D.Mi{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.nn.$n}vb(){return olympe.D.Ev(this.node,this.duration,this.C,void 0)}};let Bb=null;olympe.D.L=void 0;olympe.D.mm=void 0;olympe.D.Zg=void 0;olympe.D.Tg=new Map;olympe.D.Tg.set(0,olympe.D.aa.ZERO);olympe.D.Tg.set(1,olympe.D.aa.ONE);olympe.D.Tg.set(2,olympe.D.aa.ft);olympe.D.Bj=new Map;olympe.D.Bj.set('',olympe.D.Ja.EMPTY);olympe.D.Bj.set(' ',olympe.D.Ja.Vs);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Yc:b,lf:c,Xl:d,debug:g,Ff:e,Uc:f,$h:h})};olympe.D.hf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.md=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.hf(b)?mb(a,b):olympe.D.Ya(b)?mb(a,b.za):L(a,b);return N(a)};olympe.D.Ya=function(a){return!(!a||!a.Ug)};olympe.D.jf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Ug))};olympe.D.am=function(a){return olympe.D.hf(a)||a instanceof olympe.D.Mb||a instanceof olympe.D.Vo};olympe.D.ih=function(a){return a instanceof olympe.D.Mi};
332
- olympe.D.im=function(a,b){if(void 0!==a){olympe.D.ih(a)&&(a=a.vb().za);if(!olympe.D.jf(a))return b(a);var c=[];olympe.D.Ya(a)?c.push(a.za):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Sa=function(a,b){let c=a;olympe.D.Ya(a)?c=a.za.xb:olympe.D.hf(a)?c=a.xb:olympe.D.ih(a)&&(c=a.vb().za.xb);return void 0===c?b:c};
333
- olympe.D.yg=function(a,b){let c;olympe.D.Ya(a)?c=a.za:olympe.D.hf(a)?c=a:olympe.D.ih(a)&&(c=a.vb().za);c&&olympe.D.nc([b],d=>{c.yg(d)},'setDefaultValue');return a};olympe.D.kh=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.Bp?(h=h.za,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.ih(h)&&(h=h.vb().za,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
- olympe.D.Vd=function(a,b,c,d){return N(olympe.D.kh(a,b,c,d||'syncProxies'))};const Cb=a=>{for(const b of a)if(olympe.D.jf(b)||olympe.D.ih(b))return!1;return!0};olympe.D.ra=function(a,b,c,d,e){if(Cb(a))return b(...a);const f=olympe.D.kh(a,b,c,d||'TransformFlows');e&&olympe.D.nc([e],g=>{f.yg(g)},'setDefaultValue');return N(f)};olympe.D.nc=function(a,b,c){Cb(a)?b(...a):olympe.D.kh(a,b,void 0,c||'processFlows')};
335
- olympe.D.gq=function(a,b){if(Cb(a))b(...a);else{const c=olympe.D.Oa();olympe.D.kh(a,(...d)=>{olympe.D.Oa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.jm=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.Ya(g)?(g=g.za,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.ih(g)&&(g=g.vb().za,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Yc:b,Xl:e,Ff:f,Tv:!1,Uc:c})};
336
- olympe.D.oB=function(a,b,c){const d=olympe.D.Oa();olympe.D.jm(a,(...e)=>{olympe.D.Oa().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.IA=function(a,b,c){a=new olympe.D.Mi(a,c);b(a);return a.vb()};olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Mi(a,b)};olympe.D.rB=function(a,b,c,d){const e=olympe.D.Oa();olympe.D.kh(a,(...f)=>{olympe.D.Oa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.aq=function(a,b,c){olympe.D.ra([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.UA=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.vb()};olympe.D.RA=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.uB=function(a){return olympe.D.Oa().G(a)};olympe.D.OA=function(a,b,c){olympe.D.Tt(a?a.za:a,b,c)};
338
- olympe.D.Tt=function(a,b,c){if(a){var d=a.W();null===Bb&&(Bb={});if(Bb[d])olympe.D.L.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{Bb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.L.warn(e):olympe.D.L.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.L.log(f,'undefined'):null===g?olympe.D.L.log(f,'null'):olympe.D.L.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.L.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete Bb[d]})}}else olympe.D.L.log('NOT starting node dump, node is '+String(a))};olympe.D.NA=function(){let a='',b=olympe.D.Oa();for(;null!==b;)a+=b.Ad()+' --\x3e ',b=b.getParent();olympe.D.L.log(a)};
340
- olympe.D.na=function(a){if(void 0===a)return olympe.D.aa.ZERO;if(a instanceof olympe.D.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.aa.jo;if(a===Math.PI)return olympe.D.aa.PI;if(Infinity===a)return olympe.D.aa.rr;if(-Infinity===a)return olympe.D.aa.ms;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Tg.has(a)||olympe.D.Tg.set(a,new olympe.D.aa(a)),olympe.D.Tg.get(a)):new olympe.D.aa(a)}return null};
341
- olympe.D.Fd=function(a){return void 0===a?olympe.D.md(olympe.D.aa):olympe.D.md(olympe.D.aa,olympe.D.jf(a)?a:olympe.D.na(a))};olympe.D.Ev=olympe.D.aa.animate;olympe.D.fB=function(a,b){return new olympe.D.wq(a,b)};olympe.D.rb=function(a){if(a instanceof olympe.D.Ja)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Bj.has(a)?olympe.D.Bj.get(a):new olympe.D.Ja(a)};
342
- olympe.D.jB=function(a){return void 0===a?olympe.D.md(olympe.D.Ja):olympe.D.md(olympe.D.Ja,olympe.D.jf(a)?a:olympe.D.rb(a))};olympe.D.Hb=function(a){return a instanceof olympe.D.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C};olympe.D.gB=function(a){return void 0===a?olympe.D.md(olympe.D.ea):olympe.D.md(olympe.D.ea,olympe.D.jf(a)?a:olympe.D.Hb(a))};olympe.D.Fv=function(a){if(a instanceof Date)return new olympe.D.Za(a)};
343
- olympe.D.iB=function(a){return olympe.D.md(olympe.D.Za,void 0!==a?new olympe.D.Za(a):null)};olympe.D.cq=a=>a instanceof olympe.D.ea||a instanceof olympe.D.aa||a instanceof olympe.D.Ja||a instanceof olympe.D.Za;olympe.D.kB=function(a,b){return olympe.D.md(olympe.D.Ib,void 0===a&&void 0===b?void 0:new olympe.D.Ib(a,b))};olympe.D.Qv=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.md(olympe.D.Color,e)};olympe.D.hB=olympe.D.Qv;
344
- olympe.D.Lt=function(a){olympe.D.L=a;olympe.D.Zg=olympe.D.ef()};olympe.D.ef=function(){olympe.D.mm||(olympe.D.mm=new olympe.D.Vo);return olympe.D.mm};olympe.D.Oa=function(){olympe.D.Zg||(olympe.D.Zg=olympe.D.ef());return olympe.D.Zg};olympe.D.kq=function(a){const b=olympe.D.Zg;olympe.D.am(a)&&(olympe.D.Zg=a);return b||null};
345
- olympe.D.tc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.Za.tc(a);break;case 'number':b=olympe.D.aa.tc(a);break;case 'string':b=olympe.D.Ja.tc(a);break;case 'vector2':b=olympe.D.Ib.tc(a);break;case 'color':b=olympe.D.Color.tc(a);break;case 'boolean':b=olympe.D.ea.tc(a)}return b}return null};function Db(a){a.C.mb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.K.length=0)}
346
- olympe.D.iz=class{constructor(){this.C=new olympe.D.Mb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(Eb,'Last slot manager entry');this.size=ub(olympe.D.ec(olympe.D.aa,'SlotManager size').repeat(this.F.vb().Rl()),olympe.D.aa.ZERO);this.O=ub(olympe.D.ec(olympe.D.aa,'last valid slots'),olympe.D.na(-1))});this.T=[];this.K=[];this.C.onDestroy(()=>{Db(this)})}};
347
- class Eb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Mb('Slot manager entry');this.K=c;this.O=d;this.F.run(()=>{const e=ub(olympe.D.ec(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.Ya(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.aa);this.G=this.C.vb().Gd(e.vb())});this.next=null}W(){return this.id}bv(){return this.C.vb()}Rl(){return this.G}Ed(){return this.K}ov(){return this.O}lw(a){this.K=a}Zv(a){null===a?this.C.update(olympe.D.aa.ZERO):(this.C.repeat(a.Rl()),a.next=this)}Dr(){this.C.clear();
348
- this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}l=Eb.prototype;l.W.J=olympe.D.H.C;l.bv.J=new olympe.D.H(()=>olympe.D.aa);l.Rl.J=new olympe.D.H(()=>olympe.D.aa);l.Ed.J=olympe.D.H.C;l.ov.J=olympe.D.H.C;l.lw.J=olympe.D.H.C;l.Zv.J=olympe.D.H.C;l.Dr.J=olympe.D.H.C;l.destroy.J=olympe.D.H.C;olympe.D.R={ya:'df.Logger'};olympe.U.config(a=>{F(a,olympe.D.V.ko,Number.POSITIVE_INFINITY);E(a,olympe.D.R.ya,[olympe.ka.R.Fa],b=>b.Dc('df'))},'olympe.df');olympe.U.run([olympe.D.R.ya],a=>{olympe.D.Lt(a)},'olympe.df');olympe.host={};const Fb=new Map,Gb=new Map;olympe.host.no=class{static register(a,b,...c){Fb.set(a,b);0<c.length&&Gb.set(a,c)}static create(a,b,c,d){const e=Fb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Gb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ra(d,f))):new e(b,c)}};function Hb(a,b,c){a.L.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.no.create(c,b,a.L,a.K))}function Ib(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.L.T()<=olympe.ka.zb.C.qf&&a.L.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.Ya(f))b.push(a.C.get(f.rt)||null);else if('function'===typeof f){const g=f,h=olympe.D.Oa();b.push((...k)=>{h.mb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Jb(a){var b=olympe.host.ee.Tc,c=olympe.host.ee.mo.up;++a.G;const d=a.G;Hb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],m=d+'_'+k;this.F.has(m)&&this.F.get(m).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.Ya(p)?(h.push(n),p=p.za):olympe.D.hf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Ib(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
- {Ib(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(m,f),f.onDestroy(()=>this.F.delete(m)));return null}.bind(a));e.Z(a.O.bind(a,d));a=N(e);a.rt=d;L(e,a);return a}olympe.host.Ca=class{constructor(a,b){this.L=a;this.K=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ab(){return this.L}O(a){this.L.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.jd=class{constructor(a){this.C=a;this.F=olympe.D.Oa()}G(){return this.C}zc(){return this.C.za.zc()||this.F.zc()}mb(){return this.C.za.mb()}};olympe.host.jd.prototype.G.J=new olympe.D.H(()=>olympe.host.ee.jd,[]);olympe.host.tj=class{};olympe.host.Dh=class{constructor(){}C(){}F(){}back(){}li(){}};function Kb(a){return(a=a.find(b=>'authToken'===b.fa()))?a.getValue():null}olympe.host.Dh.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}fa(){return this.name}getValue(){return this.value}Qa(a){return this.fa()===a.fa()&&this.getValue()===a.getValue()&&this.C===a.C}};function Lb(){const a={}.parameters;return new olympe.host.Dh.C(a?a.map(b=>new olympe.host.Dh.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Dh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.fa(),d]));a.parameters.forEach(c=>{b.has(c.fa())?this.parameters[b.get(c.fa())]=c:this.parameters.push(c)})}};function Mb(a,b){var c=olympe.host.mf;const d=olympe.Y.hc(),e=new olympe.D.Mb('onTimeout context');c.C.Z(b,d,()=>{e.mb()||e.zc()||e.run(a);c.C.G(d)});return new olympe.host.Tc.F(c.C,d,e)}function Nb(a,b){var c=olympe.host.mf;const d=olympe.Y.hc(),e=new olympe.D.Mb('onInterval context');c.C.T(b,d,()=>{e.mb()||e.zc()?c.C.F(d):e.run(a)})}olympe.host.Tc=class{constructor(a){this.C=Jb(a)}};olympe.host.Tc.C=class{constructor(a,b,c){this.mf=a;this.id=b;this.C=null!=c?c:null}W(){return this.id}cancel(){}};
352
- olympe.host.Tc.K=class extends olympe.host.Tc.C{cancel(){this.mf.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Tc.F=class extends olympe.host.Tc.C{cancel(){this.mf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Tc.G=class extends olympe.host.Tc.C{cancel(){this.mf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.gj=class{F(){return''}ba(){return''}O(){}C(){return''}G(){}};olympe.host.ee={};olympe.host.ee.jd=class{destroy(){}};olympe.host.ee.jd.prototype.destroy=olympe.host.ee.jd.prototype.destroy;olympe.host.ee.mo={tw:100,vw:101,uw:102,xw:103,ww:104,sw:105,$y:201,Yy:202,Vy:204,cz:205,Uy:206,Xy:207,az:208,dz:209,ez:210,fz:211,Wy:212,bz:218,Zy:219,gz:220,Ty:221,Sy:222,mz:300,nz:301,oz:302,sz:303,uz:304,vz:305,pz:310,qz:311,rz:312,xy:400,yy:401,zy:402,ky:450,ay:500,Zx:501,gy:502,ey:503,$x:504,by:505,Oz:600,Fz:601,Jz:602,Bz:603,Cz:604,zz:605,Ez:606,Uz:607,Mz:608,wz:609,Az:610,Dz:611,Lz:612,Qz:613,xz:614,Pz:615,Kz:616,Tz:617,Gz:618,Hz:619,Iz:620,Nz:630,yz:631,Rz:632,Sz:633,wA:700,$z:701,aA:702,
353
- bA:703,dA:704,eA:705,fA:706,cA:707,hA:708,gA:709,iA:710,mA:711,uA:712,jA:713,kA:714,nA:715,oA:716,qA:717,rA:718,tA:719,pA:720,sA:721,vA:722,lA:723,xA:724,yA:725,up:800};olympe.host.ee.Tc=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={fp:'host.System',Gk:'host.HistoryManager',Xo:'host.Scheduler',ya:'host.platform.Logger',Fa:'host.Manager',Qe:'host.ProcessManager'};olympe.host.V={zo:'host.processProbe'};olympe.host.mf=null;
354
- olympe.U.config(function(a){va(a,olympe.host.R.fp);va(a,olympe.host.R.Gk);D(a,olympe.host.R.Qe,olympe.host.gj);E(a,olympe.host.R.ya,[olympe.ka.R.Fa],function(b){return b.Dc('host')});D(a,olympe.host.R.Fa,olympe.host.Ca,olympe.host.R.ya,olympe.U.R.Of);E(a,olympe.host.R.Xo,[olympe.host.R.Fa],b=>{null===olympe.host.mf&&(olympe.host.mf=new olympe.host.Tc(b));return olympe.host.mf},!0)},'olympe.host');olympe.U.run([olympe.host.R.Xo],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.R.Fa],a=>a,'olympe.host');
355
- olympe.U.run([olympe.host.R.Qe],a=>{olympe.host.Nj=()=>a});olympe.net={};olympe.net.Ia={};olympe.net.Ia.Jd={Lg:'POST',GET:'GET',ir:'HEAD',Ao:'PUT',oc:'DELETE',ro:'OPTIONS',Ay:'PATCH'};olympe.net.Ia.ResponseType={nl:'text',ph:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.Ia.Headers={vh:'content-type',Hw:'content-length',Cm:'authorization',vq:'access-control-allow-origin',uq:'access-control-allow-headers'};olympe.net.Ia.bn={Nx:'text/html',JSON:'application/json',qt:'application/zip'};olympe.net.Ia.mc={Eq:0,Zi:200,Vm:201,wi:202,yq:400,ht:401,yn:403,ps:404,hy:405,Qh:500,Rs:503};function Ob(a){return a.host&&encodeURI(a.host)}function Pb(a){return encodeURI(a.path).replace(olympe.net.Yh.C,(b,c)=>'%'+c)}function Qb(a){return void 0===a.F?443===a.port:a.F}olympe.net.Yh=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.F=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.F=d)}C(){return`${Qb(this)?'wss':'ws'}://${Ob(this)}:${this.port}/${Pb(this)}`}toString(){return`${Ob(this)}:${this.port}/${Pb(this)}`}};
356
- olympe.net.Yh.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ga(){}ba(){}Z(){}F(){}};function Rb(a,b,c,d){a=olympe.Y.Rv(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Eh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.oq&&(c=a.oq.split(':'),2===c.length&&(c=Ga(olympe.Y.Pd(),`${c[0]}:${c[1]}`),P(b,{Authorization:`Basic ${c}`})));return b}function Sb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function P(a,b){Object.assign(a.headers,b)}
357
- olympe.net.Eh=class extends olympe.net.Yh{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Ia.Jd.GET;this.query=h;this.headers={};this.body=f;this.G=void 0!==g?g:olympe.net.Ia.ResponseType.nl;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Jj(){return this.headers}C(){let a=Sb(this);a=a?`?${a}`:'';return Ob(this)?`${Qb(this)?'https':'http'}://${Ob(this)}:${this.port}/${Pb(this)}${a}`:`${Pb(this)}${a}`}toString(){return this.C()}};
358
- olympe.net.Eh.Jd={Lg:'POST',GET:'GET',ir:'HEAD',Ao:'PUT',oc:'DELETE',ro:'OPTIONS'};olympe.net.xf=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}qd(){return this.status}Jj(){return this.headers}};function Tb(a,b,c){const d=olympe.D.Oa(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.kf(e);a.F().C.delete(b);c(f)})}function Ub(a,b){return new olympe.net.Pe(a,b)}olympe.net.Ca=class{constructor(a){this.L=a;this.K=1;a='Initializing NET layer';this.L.C()&&(a+=' (implementation: '+this.T()+')');this.L.info(a);this.L.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}T(){}};function Vb(a){let b;return!(null==(b=a.C)||!b.connected)}function Wb(a,b){const c=()=>{const d=b(),e=d.od();return{username:`${a.T.vhost}:${d.yc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
359
- function Xb(a,b,c){Vb(a)?(a.L.C()&&a.L.debug(`MQTT subscribe to topic ${b}`),a.C.subscribe(b,void 0,d=>{d?a.L.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)})):null==c||c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Yb(a,b,c){Vb(a)?(a.L.C()&&a.L.debug(`MQTT unsubscribe topic ${b}`),a.C.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Zb(a,b){a.G.push(b)}
360
- function $b(a,b){a.O.push(b)}function ac(a,b){a.K.push(b)}
361
- olympe.net.Pe=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.O=[];this.K=[];this.ba=[];this.Z=[];this.F=new Map;this.L=olympe.ka.ab('MQTT')}connect(a,b){if(Vb(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,Wb(this,a)),this.C.on(olympe.net.Pe.C.ls,(c,d)=>{this.L.C()&&this.L.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.L.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.Pe.C.Kq,
362
- ()=>{this.L.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.Pe.C.Js,()=>{this.L.info('Mqtt client is reconnecting to bus ... ');this.O.forEach(c=>c())}),this.C.on(olympe.net.Pe.C.Fb,c=>{this.L.error('Mqtt client error ',c);this.ba.forEach(d=>d(c))}),this.C.on(olympe.net.Pe.C.Lh,()=>{this.L.info('Mqtt client is offline');this.K.forEach(c=>c())}),this.C.on(olympe.net.Pe.C.Jq,()=>{this.L.info('Mqtt client is closed');this.Z.forEach(c=>c())}),this.C.on(olympe.net.Pe.C.yk,
363
- ()=>{this.L.info('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Vb(this))return null==d||d(Error('Cannot publish message because the MQTT client is disconnected')),this;const e=JSON.stringify(b);this.L.C()&&this.L.debug(`MQTT > ${e}`);this.C.publish(a,e,c,f=>{null==d||d(f);f&&this.L.error('Failed to publish a message '+b)});return this}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
364
- olympe.net.Pe.C={Kq:'connect',Js:'reconnect',ls:'message',Jq:'close',yk:'end',Fb:'error',Lh:'offline'};olympe.net.zj=class{constructor(a){this.L=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}G(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}ba(){this.L.error('Try to set cors policies on a web server with the browser implementation.')}O(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.R={Fa:'net.Manager',ya:'net.Logger',yj:'net.WebServer'};olympe.net.V={Ah:'net.httpHost',Bh:'net.httpPort',Pi:'net.httpSSL',Hg:'net.httpBasePath',In:'net.httpBodyLimit'};
365
- olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;F(a,olympe.net.V.Ah,b);F(a,olympe.net.V.Bh,c?3141:443);F(a,olympe.net.V.Pi,!c);F(a,olympe.net.V.Hg,'/runtime');F(a,olympe.net.V.In,100);va(a,olympe.net.R.Fa);E(a,olympe.net.R.ya,[olympe.ka.R.Fa],function(d){return d.Dc('net')});D(a,olympe.net.R.yj,olympe.net.zj,olympe.net.R.ya)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.jd=function(a,b){this.L=b};olympe.Na.node.host.jd.prototype.constructor=olympe.Na.node.host.jd;olympe.Na.node.host.jd.prototype.destroy=function(){};olympe.Na.node.host.jd.prototype.destroy=olympe.Na.node.host.jd.prototype.destroy;olympe.Na.node.host.jd.prototype.ab=function(){return this.L};olympe.Na.node.host.jd.sa=[olympe.host.ee.jd];function bc(a){a.L.error('No history manager implemented in Node')}olympe.Na.node.host.oo=class{constructor(a){this.L=a}li(){return!1}C(){bc(this);return Lb()}F(){bc(this)}back(){bc(this)}};olympe.Na.node.host.oo.sa=[olympe.host.Dh];olympe.Na.node.host.Tc=class{constructor(){this.C={};this.K={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.K[b]=setInterval(c,a)}F(a){clearInterval(this.K[a]);delete this.K[a]}};olympe.host.no.register(olympe.host.ee.mo.up,olympe.Na.node.host.Tc);olympe.Na.node.host.Tc.sa=[olympe.host.ee.Tc];olympe.Na.node.host.tj=class{constructor(a){this.L=a}};olympe.Na.node.host.tj.sa=[olympe.host.tj];function cc(a){const b=olympe.net.Ia.mc.Zi,c=olympe.net.Ia.mc.Qh;a.ga.O('healthcheck','/readiness',[olympe.net.Ia.Jd.GET],()=>{const d=Array.from(a.Z.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.xf('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.L.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.xf(g,
366
- f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.L.error(`Failed to add health check route ${d}`));a.F(()=>a.ga.stop())}function dc(a,b){b=Array.from(b.values()).map(c=>c.apply(a));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.L.warn(`Failed to close some resource: ${e.reason}`));return d})}
367
- function ec(a){return v(function*(){try{const b=yield dc(a,a.K),c=yield dc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.K.clear(),a.T.clear()}})}
368
- olympe.Na.node.host.gj=class extends olympe.host.gj{constructor(a,b,c=!0){super();this.L=a;this.ga=b;this.Z=new Map;this.K=new Map;this.T=new Map;c&&cc(this)}C(a){const b=olympe.Y.$e();this.Z.set(b,a);return b}G(a){this.Z.delete(a)}F(a){const b=olympe.Y.$e();this.K.set(b,a);return b}ba(a){const b=olympe.Y.$e();this.T.set(b,a);return b}O(a){this.K.has(a)?this.K.delete(a):this.T.delete(a)}};olympe.U.config(function(a){F(a,olympe.host.V.zo,!0);ta(a,olympe.host.R.Gk,olympe.Na.node.host.oo,olympe.host.R.ya);ta(a,olympe.host.R.fp,olympe.Na.node.host.tj,olympe.host.R.ya);D(a,olympe.host.R.Qe,olympe.Na.node.host.gj,olympe.host.R.ya,olympe.net.R.yj,new olympe.U.ma(olympe.host.V.zo))},'olympe.native.node.host');olympe.U.run([olympe.host.R.Qe],a=>{olympe.Na.node.host.Nj=()=>a});olympe.net.Ud={};olympe.net.Ud.Kk=class{constructor(a){this.L=a;this.C=new Map}G(){}F(){}};olympe.net.Ud.WebSocket=class{constructor(a,b){this.L=b;this.id=a;this.C=null;this.buffer=[];this.O=this.G=this.K=this.T=null}W(){return this.id}open(a){const b=`#${this.id}`,c=this.qa(a);c.binaryType='arraybuffer';c.onopen=()=>{this.L.info('Websocket OPENED');this.T?(this.L.debug('Notifying upper layer for WebSocket',b),this.T()):this.L.warn('Nothing to notify for WebSocket',b);this.L.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
369
- 0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ha(d.data);this.L.debug(b,'<',d);this.G&&this.G(d)};c.onclose=()=>{this.L.debug(`WebSocket ${b} CLOSED`);this.K&&this.K()};c.onerror=()=>{this.L.debug(`WebSocket ${b} ERROR`);this.O&&this.O()};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:this.L.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.L.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);
370
- break;default:return this.L.debug(b,'- Closed','>',a),!1}}else this.L.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.L.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.L.debug('Try to force close native websocket, but not open nor connecting')}ga(a){this.T=a||null}ba(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.K=a||null}qa(){}};
371
- olympe.net.Ud.WebSocket.sa=[olympe.net.WebSocket];olympe.Na.node.net={};olympe.Na.node.net.rs=class extends olympe.net.Ca{constructor(a,b){super(a,b);this.Z=new olympe.Na.node.net.Kk(a)}T(){return'NodeJS'}G(a){var b=this.K++;a=a.C();this.L.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Na.node.net.ss(b,this.L);b.open(a);return b}C(a,b){this.L.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.K++;b=Tb(this,c,b);this.Z.G(c,{u:a.C(),s:Qb(a),h:Ob(a),p:a.port,z:Pb(a),q:Sb(a),m:a.method,v:a.Jj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.G},b)}O(){this.L.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const fc=require('fs'),gc=require('http'),hc=require('https');
372
- olympe.Na.node.net.Kk=class extends olympe.net.Ud.Kk{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,m=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(x,y,z)=>new Promise((A,J)=>{fc.readFile(x,(M,Ka)=>{M?J(M):(z[y]=Ka,A(z))})});p=x=>{const y=A=>{A.setEncoding(w===olympe.net.Ia.ResponseType.nl?'utf-8':'binary');let J='';A.on('data',M=>{J+=M});A.on('end',()=>{if(w!==olympe.net.Ia.ResponseType.nl){var M=
373
- (new Uint8Array(Buffer.from(J,'binary'))).buffer;M=w===olympe.net.Ia.ResponseType.ph?new Blob([M]):M}else M=J;c(this.F(A.statusCode,A.statusMessage,M,A.headers))})},z=d?new hc.request(x,y):new gc.request(x,y);this.C.set(a,()=>{z.destroy()});z.on('error',A=>{c(this.F(olympe.net.Ia.mc.Qh,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+A.code+', message = '+A.message,''))});!e||'POST'!==f&&'PUT'!==f?z.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(A=>{z.write(A instanceof
374
- ArrayBuffer?Buffer.from(A):A);z.end()})};d&&(h||k||m)?h&&k&&m?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,m,'ca')).then(p).catch(x=>{this.L.log('Error loading self signed files:',x)})):this.L.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.L.debug('Received HTTP response',a,c);return new olympe.net.xf(c,a,b,d)}};olympe.Na.node.net.ss=class extends olympe.net.Ud.WebSocket{qa(a){return new (require('ws'))(a)}};olympe.Na.node.net.V={Zz:'native.html.net.useWorkers'};olympe.U.config(function(a){ta(a,olympe.net.R.Fa,olympe.Na.node.net.rs,olympe.net.R.ya,olympe.host.R.Fa)},'olympe.native.node.net');olympe.Na.node.net.http={};const ic=require('fastify'),jc=require('@fastify/cors'),kc={pj:0,oj:1,ll:2};
375
- function lc(a,b){a.F.route({bodyLimit:1048576*a.ga,url:b.path,method:b.methods,handler:(c,d)=>{a.L.debug('< HTTP:',c);var e=c.body,f='';if(e instanceof Buffer)f=new Uint8Array(e.length),e.copy(f);else if('string'===typeof e||e instanceof Object)f=e;const [g,h]=c.hostname.split(':');e=new olympe.net.Eh(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,m]of Object.entries(c.headers))e.headers[k]=m;f=new Map(Object.entries(c.params));c=new Map(Object.entries(c.query));b.kv(e,f,c).then(k=>
376
- {const m=k.qd(),n=k.getData();if(m>=olympe.net.Ia.mc.Qh)throw Error(n);m>=olympe.net.Ia.mc.yq?a.L.warn('> HTTP: client bad request: reply with error:',n):a.L.debug('> HTTP: reply with body:',n instanceof ArrayBuffer?'binary':n);d.code(m).headers(k.Jj()).send(n instanceof ArrayBuffer?Buffer.from(n):n)}).catch(k=>{a.L.error('> HTTP: reply with internal server error:',k);d.code(olympe.net.Ia.mc.Qh).header(olympe.net.Ia.Headers.vh,'text/plain').send('Internal server error')})}})}
377
- olympe.Na.node.net.http.zj=class extends olympe.net.zj{constructor(a,b,c,d){super(a);this.ga=d;this.F=this.createServer();this.host=b;this.port=c;this.K=new Map;this.T=null;this.C=kc.pj;this.Xc=new Set;this.timer=null}ba(a,b){this.T={origin:'*',methods:a,allowedHeaders:b}}O(a,b,c,d){this.K.set(a,{path:b,methods:c,kv:d});return this.G()}Z(a){const b=this;return v(function*(){b.K.delete(a);return 0<b.K.size?b.G():b.stop()})}start(){if(this.C===kc.pj)return this.G();if(this.C===kc.oj){this.F.register(jc,
378
- this.T);for(const a of this.K.values())lc(this,a);return this.F.listen(this.port,'0.0.0.0').then(a=>{this.C=kc.ll;this.L.debug('Web server listening on '+a);this.Xc.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.Xc.forEach(b=>b(a))}).finally(()=>this.Xc.clear())}return Promise.reject('Try to start a webservice already started')}G(){return this.C===kc.oj?(new Promise((a,b)=>{this.Xc.add(c=>c?b(c):a())})).then(()=>this.G()):new Promise((a,b)=>{this.Xc.add(c=>c?b(c):a());this.Lp(()=>{const c=
379
- this;return v(function*(){c.C=kc.oj;yield c.F.close();c.F=c.createServer();yield c.start()})})})}stop(){return this.C===kc.ll?this.F.close().then(()=>{this.C=kc.pj}):Promise.resolve()}createServer(){const a=ic({logger:!1,level:'error'});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}Lp(a){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,1E3)}};olympe.U.config(function(a){D(a,olympe.net.R.yj,olympe.Na.node.net.http.zj,olympe.net.R.ya,new olympe.U.ma(olympe.net.V.Ah),new olympe.U.ma(olympe.net.V.Bh),new olympe.U.ma(olympe.net.V.In))},'olympe.native.node.net.http');olympe.Na.node.Y={};const mc=new Map;olympe.Na.node.Y.lk=class extends olympe.Y.lk{G(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}K(a,b){a.arrayBuffer().then(olympe.D.Oa().G(b))}O(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;mc.set(b,a);return b}F(a,b,c){mc.has(a)?b(mc.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}T(a){mc.delete(a)}};olympe.U.config(function(a){ta(a,olympe.Y.R.Ag,olympe.Na.node.Y.lk)},'olympe.native.node.utils');olympe.async={};function nc(a,b){0<=b&&(a.timeout=b)}function oc(a,b){a.K||a.Z.push(a.G.G(b))}
380
- olympe.async.un=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Mb('Async executor context');this.qa=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.K=this.O=!1;this.L=null;this.timer=this.timeout=0;this.ba=olympe.Y.hc()}ab(){return this.L}add(a){this.K||this.F.push(this.G.G(a));return this}start(){this.O||(this.L&&this.L.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},this.ba),0<this.timeout&&(this.timer=
381
- setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.qa&&this.G.destroy()}complete(a){this.G.kf(this.ba);if(!this.K){this.K=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.L&&this.L.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
382
- function pc(a){if(0<a.F.length){const b=a.F.shift();a.L&&a.L.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{pc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.gp=class extends olympe.async.un{static create(){return new olympe.async.gp(new olympe.D.Mb('SequencedExecutor'),!0)}start(){this.O||(super.start(),pc(this))}};
383
- olympe.async.ej=class extends olympe.async.un{constructor(a,b){super(a,b);this.T=0;this.ga=!0}static create(){return new olympe.async.ej(new olympe.D.Mb('ParallelExecutor'),!0)}run(a){this.L&&this.L.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ga=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.K&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ga)}start(){if(!this.O)if(super.start(),
384
- 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.Zr=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.Yr=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}write(){}close(){}};olympe.jc.R={Ui:'localStorage.KeyValueManager',qj:'localStorage.Storage',Lw:'localStorage.DatacloudStorage',ya:'localStorage.Logger'};olympe.U.config(function(a){va(a,olympe.jc.R.Ui);E(a,olympe.jc.R.ya,[olympe.ka.R.Fa],function(b){return b.Dc('localstorage')})},'olympe.localstorage');olympe.P={};olympe.P.errors={};olympe.P.errors.vy=class extends Error{};olympe.P.errors.pp=class extends Error{};olympe.P.errors.xo=class extends Error{};olympe.P.errors.nt=class extends Error{};olympe.P.errors.Zk=class extends Error{constructor(a,b){super(a);this.id=b}W(){return this.id}};olympe.P.Nb={Li:'urls.FileSvc',Dm:'urls.BackupSvc',Oo:'urls.RestoreBackupSvc',me:'urls.GetContext',Fn:'urls.GraphDef',Qm:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',tp:'urls.UserTagFromToken',mt:'urls.UserNameFromTag',lt:'urls.UserRoles',Ns:'urls.RoleMembers',$k:'urls.OpenIDSvc'};
385
- olympe.U.config(a=>{F(a,olympe.P.Nb.Li,'rest/filesvc');F(a,olympe.P.Nb.Dm,'rest/backupsvc');F(a,olympe.P.Nb.Oo,'rest/backupsvc/restore');F(a,olympe.P.Nb.$k,'rest/openid');F(a,olympe.P.Nb.me,'rest/initialData');F(a,olympe.P.Nb.Fn,'rest/querysvc/graphDef');F(a,olympe.P.Nb.Qm,'rest/querysvc/graphDef/static');F(a,olympe.P.Nb.TRANSACTION,'rest/transaction');F(a,olympe.P.Nb.tp,'rest/token');F(a,olympe.P.Nb.mt,'rest/authorization/getUserTag');F(a,olympe.P.Nb.lt,'rest/authorization/getUserRoles');F(a,olympe.P.Nb.Ns,
386
- 'rest/authorization/roleMembers')});function qc(a){a.L.debug('Disconnected from bus');a.G=!0;let b;null==(b=a.F)||b.forEach((c,d)=>{null!==c.F&&(a.L.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),rc(c))})}function sc(a){a.L.debug('Connection to bus established. Listening to responses on topic',a.O);Xb(a.C,a.O,b=>{a.L.C()&&a.L.debug('BUS <',JSON.stringify(b));b=new olympe.P.Response(b.dest,b.src,b.seq,b.type,a.Ba.G(b.content));let c;null==(c=a.K.get(b.qg()))||c(b)})}
387
- function tc(a){a.L.debug(`Reconnected to bus: Sending ${a.ga.length} pending messages and resubscribe to ${a.ba.size} active topics.`);for(const c of a.ga){let d;try{d=c.ha(a.Ba)}catch(e){a.L.error(`An error occurred while serializing a message that was pending (seqId=${c.qg()}: ${e}`)}a.C.publish(c.uc(),d)}a.ga=[];a.ba.forEach((c,d)=>{uc(a,d,c)});a.ba.clear();let b;null==(b=a.F)||b.forEach((c,d)=>{null===c.F&&(a.L.info(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),
388
- vc(c,!0))})}function wc(a){a.ub=a.qa.C(()=>Vb(a.C)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function uc(a,b,c){a.G||a.Va?a.ba.set(b,c):a.connect().then(()=>{a.L.debug(`Bus: Subscribe to ${b}`);Xb(a.C,b,d=>{a.L.C()&&a.L.debug(`BUS < #${b}: ${JSON.stringify(d)}`);d=new olympe.P.Request(d.dest,d.src,d.auth,d.seq,d.type,a.Ba.G(d.content));c(d)})})}function xc(a,b,c,d,e){b=new olympe.P.Response(c,a.O,b,d,e);return a.publish(b)}
389
- function yc(a,b,c,d){const e=zc(a.T).od();a.Z++;return new olympe.P.Request(b,a.O,e,a.Z,c,d)}function Ac(a,b,c,d){const e=b.qg(),f=olympe.P.Response.kb.ck;let g=null;g=setTimeout(()=>Bc(a,e),a.Vb);a.K.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Bc(a,e),d):(a.K.delete(e),c(h))})}function Bc(a,b){const c=a.K.get(b);a.K.delete(b);null==c||c(new olympe.P.Response(a.O,a.O,b,olympe.P.Response.kb.Fb,{reason:'Timeout'}))}
390
- function Cc(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>Bc(a,c),a.Vb);a.K.set(c,e=>{a.K.delete(c);clearTimeout(d);b(e)});return a.Z}function Dc(a,b){a.ba.delete(b);let c;null==(c=a.F)||c.delete(b);a.L.debug(`Bus: Unsubscribe to ${b}`);return a.G||a.Va?Promise.resolve():new Promise((d,e)=>{Yb(a.C,b,f=>f?e(f):d())})}
391
- function Ec(a,b,c,d,e){null===a.F&&(a.F=new Map);let f=a.F.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(rc(a),vc(a,!1)))):(f=new olympe.P.at(a.L,a,b,d),a.F.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&vc(d,!1)}function Fc(a,b,c){let d;const e=null==(d=a.F)?void 0:d.get(b);if(null==e?0:Gc(e,c))a.publish(yc(a,b,olympe.P.Request.kb.qp,c)).catch(f=>a.L.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.F.delete(b),0===a.F.size&&(a.F=null))}
392
- function Hc(a,b){return rxjs.operators.retry({resetOnSuccess:!0,delay:c=>{if(c instanceof olympe.P.errors.Zk){const d=Math.round(5E3*Math.random());a.L.debug(`Subscription topic ${c.W()} not registered in the service, re-subscribe in ${d}ms`);return rxjs.timer(d).pipe(rxjs.operators.tap(()=>null==b?void 0:b()))}return rxjs.throwError(()=>c)}})}function Ic(a,b){return new Promise((c,d)=>{const e=b.rd(),f=a.Ob.get(e);void 0!==f?c(f):a.T.sg(b.rd(),(g,h)=>{g?d(g):(a.Ob.set(e,h),c(h))})})}
393
- olympe.P.Pm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.L=a;this.T=c;this.qa=d;this.Ba=e;this.Vb=f.get('shortTimeout');this.qc=f.get('requestTimeout');this.Wb=f.get('subscriptionsRefreshRate');this.K=new Map;this.C=Ub(f.get('url'),b);this.Ob=new olympe.Y.ql(f.get('tokenTimeout'));this.nb=f.get('allowGuest');this.Z=1;this.O=olympe.Y.hc();this.F=null;this.G=!1;this.ga=[];this.ba=new Map;this.Cb=this.ub='';this.Va=!1;ac(this.C,()=>{qc(this)});$b(this.C,()=>{qc(this)});Zb(this.C,
394
- ()=>{this.G&&(this.Va=!1,sc(this),this.G=!1,tc(this))})}connect(){const a=olympe.auth.Ca.C.INIT,b=olympe.auth.Ca.C.Fb,c=olympe.auth.Ca.C.Fe,d=olympe.auth.Ca.C.wf,e=olympe.auth.Ca.C.Ke;return new Promise((f,g)=>{Vb(this.C)||this.G?f():olympe.D.nc([this.T.getState()],h=>{const k=olympe.D.Oa();if(this.nb||h!==d)switch(h){case a:this.Va=!0;break;case b:case e:g(Error('Authentication failed.'));k.destroy();break;case c:case d:wc(this),this.nb||Jc(this.T,()=>this.disconnect().then()),this.G=!0,this.C.connect(()=>
395
- zc(this.T),()=>{k.destroy();f()}),this.Cb=this.qa.ba(()=>this.disconnect())}else wc(this),g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.L.debug('Disconnecting from bus');this.T.Ba.delete('busLogoutCallback');this.C.end(!1,()=>a());this.qa.G(this.ub);this.qa.O(this.Cb)})}publish(a){return this.G?(a.getType()!==olympe.P.Request.kb.oe&&(this.L.debug('Bus disconnected, storing message in queue'),
396
- this.ga.push(a)),Promise.resolve()):new Promise((b,c)=>{try{const d=a.ha(this.Ba),e=a.uc();this.L.C()&&this.L.debug(`BUS > #${e}: ${JSON.stringify(d)}`);this.C.publish(e,d,void 0,f=>{f?c(f):b()})}catch(d){c(`An error occurred while serializing the message (seqId=${a.qg()}: ${d}`)}})}$c(a,b,c){return xc(this,a.qg(),a.Lb(),b,c)}request(a,b,c,d){const e=yc(this,a,b,c);if(b===olympe.P.Request.kb.PUBLISH){const f=new olympe.P.Response(a,this.O,e.qg(),olympe.P.Response.kb.ck);return this.publish(e).then(()=>
397
- f)}return new Promise((f,g)=>{Ac(this,e,f,null!=d?d:this.qc);this.publish(e).catch(g)})}};olympe.P.Pm.C='Timeout';const Kc=olympe.net.Ia.Headers.Cm,Lc=olympe.net.Ia.mc.Zi,Mc=olympe.net.Ia.mc.Vm,Nc=olympe.net.Ia.mc.wi,Oc=olympe.net.Ia.mc.Rs,Pc=olympe.net.Ia.mc.Eq,Qc=olympe.net.Ia.mc.yn,Rc=olympe.net.Ia.mc.ht;function Sc(a,b){let c;return null!=(c=a.G.get(b))?c:''}
398
- function Tc(a,b,c){if(null===b)return Promise.reject('No http request to send');P(b,{[Kc]:c});return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((d,e)=>{const f=b.C();if(a.L.C()){const g=b.body;a.L.debug('HTTP >',f,`body: ${'string'===typeof g?g:typeof g}`)}a.C.C(b,g=>{switch(g.qd()){case Lc:case Mc:case Nc:const h=g.getData();a.L.C()&&a.L.debug('HTTP <',g.qd(),`content: ${'string'===typeof h?h:typeof h}`);d(h);break;case Oc:g=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;
399
- a.L.warn(g);e(new olympe.P.errors.xo(g));break;case Pc:a.L.debug(`HTTP < request canceled (${b.C()}).`);d();break;case Qc:case Rc:g=`HTTP < request authorization denied: ${b.C()}`;a.L.error(g);e(new olympe.P.errors.nt(g));break;default:g=`HTTP < Error: ${g.qd()}, ${g.statusText}`,a.L.error(g),e(Error(g))}})})).pipe(rxjs.operators.retry(a.F)))}olympe.P.jr=class{constructor(a,b,c,d){this.L=a;this.C=b;this.G=c;this.F=d}};function Uc(a,b,c){a.L.info('Initializing COMMUNICATION layer');if(a.L.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.L.debug(d.join('\n\t'))}Vc(a,olympe.P.Zd.Fb,d=>{switch(d.c){case olympe.P.kb.jt:a.L.error('Unknown message sent to the server:',olympe.P.cb.bc[d.s]);break;case olympe.P.kb.br:a.L.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.nm&&Wc(a,f,d.i)})}});b.get('autoConnect')&&
400
- (a.L.debug('Connecting automatically'),a.connect());olympe.D.aq(a.O.vb(),()=>{a.ld.forEach(d=>d());Nb(a.di.bind(a),a.ji);Nb(a.Vb.bind(a),a.qc)},()=>{a.T=null;a.cd.forEach(d=>d(a.K[2]));a.Vb()});c.C(()=>Xc(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ba(()=>{a.disconnect();return Promise.resolve()});a.L.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
401
- function Xc(a){return a.C===olympe.P.cb.C.sh}
402
- function Q(a,b){if(a.C!==b){a.L.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.we)||c.call(a,b);switch(b){case olympe.P.cb.C.CONNECTING:break;case olympe.P.cb.C.sh:a.O.update(olympe.D.ea.F);break;case olympe.P.cb.C.$f:a.K[0]=0;a.K[1]=0;a.connect();break;case olympe.P.cb.C.Fb:a.L.error('Connection to server',a.ba.C(),'aborted due to error');a.O.update(olympe.D.ea.C);break;case olympe.P.cb.C.Sg:break;case olympe.P.cb.C.zg:a.connect();break;case olympe.P.cb.C.Ke:a.O.update(olympe.D.ea.C);
403
- a.Va&&(a.L.info('Disconnected, will try to auto reconnect in',a.nb,'ms'),Mb(()=>{a.connect()},a.nb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}function Yc(a,b){const c=olympe.Y.hc();a.ld.set(c,b);olympe.D.Sa(a.O)===olympe.D.ea.F&&b()}function Zc(a,b){var c;void 0===c&&(c=olympe.Y.hc());a.cd.set(c,b);olympe.D.Sa(a.O)===olympe.D.ea.C&&b(a.K[2])}
404
- function $c(a,b,c,d){const e=a.ve;a.ve++;c={message:{seqId:e,messageFamily:b,payload:c},Dl:d?ad(a,d):null,nm:null};a.G.set(e,c);d=[olympe.P.cb.C.CONNECTING,olympe.P.cb.C.$f];(Xc(a)||b===olympe.P.Zd.Oi&&d.includes(a.C))&&bd(a,e,c)}
405
- function ad(a,b){const c=olympe.P.cb.G.Sh;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;'string'===typeof g?a.L.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`):void 0!==f&&f!==c&&(e=void 0!==olympe.P.cb.bc[f]?`Status code = ${f} [${olympe.P.cb.bc[f]}]`:`Status code = ${f}`,g=d.info,void 0!==g&&void 0!==g.error&&(f=g.error.reason,'string'===typeof f&&0<f.length&&(e+=`\nReason:\n${g.error.reason}`),f=g.error.detailedReason,'string'===
406
- typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function bd(a,b,c){var d=c.message;a.L.C()&&a.L.debug('WS >',cd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Dl?a.G.delete(b):c.nm=Date.now():Q(a,olympe.P.cb.C.$f);return d}function Vc(a,b,c,d){void 0===d&&(d=olympe.Y.hc());let e=a.ga.get(b);void 0===e&&(e=new Map,a.ga.set(b,e));e.set(d,c)}function dd(a){a=a.ga.get(olympe.P.Zd.Wf);void 0!==a&&a.delete('logoutHandler')}
407
- function Wc(a,b,c){if(a.G.has(b)){const {Dl:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function ed(a,b){a.we=b}function fd(a,b){a.L.error(b);Q(a,olympe.P.cb.C.Fb)}function gd(a,b,c){a.Ob=null!=c?c:-1;a.L.info('Connected to',a.ba.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!bd(a,d,e))return;Q(a,olympe.P.cb.C.sh)}
408
- function cd(a){a=JSON.parse(JSON.stringify(a));return`${olympe.Y.Fu(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
409
- olympe.P.cb=class{constructor(a,b,c,d,e,f){this.L=a;this.Cb=b;this.ba=d;this.F=null;this.config=f;this.nb=this.config.get('reconnectionDelay');this.Ba=e;this.we=null;this.ji=this.config.get('pingInterval');this.em=this.nb/2;this.Va=f.get('autoConnect');f.get('retryHttpOverload');this.qc=f.get('messageTimeout');this.Z=olympe.Y.Xe.parse(f.get('clientVersion'));this.qa=olympe.Y.Xe.parse(f.get('serverVersion'));this.C=olympe.P.cb.C.INIT;this.ub=f.get('getContextMode');this.ve=1;this.T=null;this.K=[0,
410
- 0,0];this.ga=new Map;this.O=olympe.D.ec(olympe.D.ea,'Server is online');this.ld=new Map;this.cd=new Map;this.G=new Map;this.Wb=new Map;this.Ob=-1;Uc(this,f,c)}connect(){const a=olympe.P.cb.C.INIT,b=olympe.P.cb.C.CONNECTING,c=olympe.P.cb.C.sh,d=olympe.P.cb.C.Ke,e=olympe.P.cb.C.$f,f=olympe.P.cb.C.Sg,g=olympe.P.cb.C.zg,h=olympe.P.cb.C.Fb;null!==this.F&&(this.F.Z(null),this.F.close());this.Va=!0;this.L.log(`Asking NET layer for a connection to ${Ob(this.ba)}:${this.ba.port}...`);this.F=this.Cb.G(this.ba);
411
- this.F.ga(this.Ad.bind(this));this.F.ba(this.Hf.bind(this));this.F.Z(()=>{this.F=null;this.C===c?Q(this,e):this.C!==h&&this.C!==f&&Q(this,d)});this.Ba&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Pb(this.Ba);this.L.info(`Trying to wakeup orchestrator with ${k}`);Q(this,f);var m=this.Cb.G(this.Ba);m.ba(n=>{const p=JSON.parse(n);this.L.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':Q(this,g);m.close();break;case 'asleep':this.L.info(`Trying to wakeup orchestrator with ${k}`);
412
- m.send('{"action": "wakeup"}');Q(this,f);break;case 'waking-up':break;default:this.L.warn(`Invalid message from ${k}: ${n}`),m.close(),Q(this,d)}});m.F(()=>{this.L.warn(`Communication with ${k} failed.`);m.close();Q(this,d)});m.ga(()=>{this.L.info(`Checking orchestrator status with ${k}`);m.send('{"action": "status"}')})}this.Ba=null});this.C!==e&&Q(this,b)}disconnect(){const a=olympe.P.cb.C.CONNECTING;if(this.C===olympe.P.cb.C.sh||this.C===a)this.Va=!1,Q(this,olympe.P.cb.C.Ke),this.F.close()}Ad(){this.L.debug('Websocket connected, sending handshake. Client version:',
413
- Ra(this.Z),'subscribeEverything:',this.ub?'NO':'YES');$c(this,olympe.P.Zd.Oi,{c:olympe.P.kb.Oi,cv:Ra(this.Z),m:this.ub?0:1,s:this.T},this.hi.bind(this))}hi(a,b){if(a)fd(this,'Error in receiving handshake response: '+a.message);else{this.L.debug('Handshake response received');var c=olympe.P.cb.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.vr:fd(this,`Framework version (${Ra(this.Z)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
414
- return;case c.ct:fd(this,`Framework version (${Ra(this.Z)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.er:fd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.qa.Qa(olympe.Y.Xe.C))this.L.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Y.Xe.parse(a);if(e.ti(this.qa)){fd(this,`Framework v${Ra(this.Z)} is expecting Orchestrator to be at least in v${Ra(this.qa)}`);
415
- return}this.L.log('Handshake successful. Orchestrator version: ',e,'required:',Ra(this.qa))}catch(f){fd(this,f);return}e=olympe.P.cb.C.Ke;if(this.C===olympe.P.cb.C.$f&&null!==this.T&&this.T!==b.sessionId)this.L.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),Q(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Wb.set(f,g);this.T=b.sessionId||null;gd(this,a,d)}}}di(){this.K[0]-this.K[1]>this.em?(this.L.debug('Ping did not get answer, try to reconnect'),
416
- Q(this,olympe.P.cb.C.$f)):(this.K[0]=Date.now(),this.F.send('ping')||(this.L.debug('Impossible to send ping, try to reconnect'),Q(this,olympe.P.cb.C.$f)))}Hf(a){this.K[2]=Date.now();if(a.startsWith('pong'))return this.K[1]=this.K[2],null;try{var b=JSON.parse(a)}catch(d){return this.L.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.L.C()&&this.L.debug('WS <',cd(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Dl:d}=
417
- this.G.get(a);this.G.delete(a);d&&d(b)}a=this.ga.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Vb(){const a=Date.now();for(const [b,{nm:c}]of this.G)null!==c&&a-c>this.qc&&(this.L.warn(`No response was received from the server for the seqId = ${b}`),Wc(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.P.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.C=a;this.source=b;this.O=c;this.F=e;this.K=f||null}uc(){return this.C}Lb(){return this.source}qg(){return this.G}getType(){return this.F}pd(){return this.K}rd(){return this.O}ha(a){return{dest:this.C,src:this.source,seq:this.G,auth:this.O,type:this.F,content:a.ha(this.K)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.G}, type: ${this.F})`}};olympe.P.Request.kb={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,oe:4,qp:5};function hd(a){const b=olympe.P.Response.kb.op;return a.F!==olympe.P.Response.kb.ol?Promise.reject('Should only call `topicAck` on TOPIC responses'):xc(olympe.P.ah(),a.C.seq,a.source,b)}olympe.P.Response=class{constructor(a,b,c,d,e){this.K=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}uc(){return this.G}Lb(){return this.source}qg(){return this.K}getType(){return this.F}pd(){return this.C}ha(a){return{dest:this.G,src:this.source,seq:this.K,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
418
- olympe.P.Response.kb={ck:0,Yo:1,wp:2,ol:3,op:4,Fb:5};const id=olympe.P.Response.kb.Yo,jd=olympe.P.Response.kb.Fb,kd=olympe.P.Response.kb.wp,ld=olympe.P.Response.kb.ol,md=olympe.P.Response.kb.op,nd=olympe.P.Request.kb.SEND,od=olympe.P.Request.kb.GET,pd=olympe.P.Request.kb.SUBSCRIBE,qd=olympe.P.Request.kb.oe;
419
- olympe.P.Jc=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}lh(){return null!==this.F?Promise.resolve(this.F):Ic(this.C,this.request).then(a=>this.F=a)}source(){return this.request.Lb()}body(){return this.request.pd()}Fp(){return this.request.getType()===nd?this.C.$c(this.request,id):Promise.reject('Should only call `ack` on SEND requests')}$c(a){const b=this.request.getType();return b===od||b===qd?this.C.$c(this.request,kd,a):Promise.reject('Should only call `reply` on GET requests')}hm(a){if(this.request.getType()!==
420
- pd)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.hc();return new Promise((c,d)=>{const e={seq:Cc(this.C,f=>{switch(f.getType()){case md:rd(this.G,b);c(b);break;case jd:d(f.pd().reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.C.Wb};this.C.$c(this.request,ld,e).catch(d)})}$g(a){return this.C.$c(this.request,jd,{reason:a.message})}};olympe.P.Jc.prototype.fail=olympe.P.Jc.prototype.$g;
421
- olympe.P.Jc.prototype.notifyOn=olympe.P.Jc.prototype.hm;olympe.P.Jc.prototype.reply=olympe.P.Jc.prototype.$c;olympe.P.Jc.prototype.ack=olympe.P.Jc.prototype.Fp;olympe.P.Jc.prototype.body=olympe.P.Jc.prototype.body;olympe.P.Jc.prototype.source=olympe.P.Jc.prototype.source;olympe.P.Jc.prototype.userTag=olympe.P.Jc.prototype.lh;function rc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function vc(a,b){b&&a.nf();null===a.F&&(a.F=setInterval(a.nf.bind(a),a.G))}function Gc(a,b){b=a.C.delete(b);0===a.C.size&&rc(a);return b}function sd(a,b){a.C.forEach((c,d)=>{Gc(a,d);c(b)})}
422
- olympe.P.at=class{constructor(a,b,c,d){this.L=a;this.K=b;this.O=c;this.G=d;this.C=new Map;this.F=null}nf(){const a=olympe.P.errors.Zk;Vb(this.K.C)?this.K.request(this.O,olympe.P.Request.kb.oe,Array.from(this.C.keys())).then(b=>{b=b.pd();0<b.length&&b.forEach(c=>{const d=this.C.get(c);Gc(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.L.error(b);sd(this,Error(b))}):rc(this)}};olympe.P.dg=class{ha(a){return this.C(a)}G(a){return this.F(a)}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.Za:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,r:a.pg().valueOf(),g:a.ng().valueOf(),b:a.lg().valueOf(),a:a.kg().valueOf()};case a instanceof Map:const b=Object.create(null);for(const [c,
319
+ a(b[c],c,this))break}Gj(a,b){void 0!==this.values[a]&&this.bi(a,!0);this.values[a]=b;var c=this.Ba;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?sb(c[a],b):O(c[a],b));c=this.ub;null!==c&&void 0!==c[a]&&tb(c[a],!0);this.size++;c=this.Cb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}bi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Xg?d.Aa.xb:d;var e=this.Ba;null!==e&&void 0!==e[a]&&rb(e[a]);e=this.ub;null!==e&&void 0!==
320
+ e[a]&&tb(e[a],!1);delete c[a];this.size--;b||this.Ze()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Ze(){null!==this.L&&tb(this.L,this.size)}Yg(){var a=this.Ba;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&rb(a[c]);a=this.ub;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&tb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
321
+ c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&tb(this.L,this.size)}Vf(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.rh.sa=[olympe.D.Rf];l=olympe.D.rh.prototype;l.getContext.J=olympe.D.H.C;l.Gb.J=olympe.D.H.C;l.ld.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>Object,[],'valueType');l.fh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.tg.J=olympe.D.H.C;l.ii.J=olympe.D.H.C;
322
+ l.Oe.J=olympe.D.H.G;l.Jf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.wl.J=olympe.D.H.C;l.vl.J=olympe.D.H.C;l.Dp.J=olympe.D.H.C;l.zl.J=olympe.D.H.C;l.Nd.J=olympe.D.H.C;l.Gj.J=olympe.D.H.C;l.bi.J=olympe.D.H.C;l.Ze.J=olympe.D.H.C;l.Yg.J=olympe.D.H.C;l.Vf.J=olympe.D.H.C;olympe.D.Di=class extends olympe.D.rh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.qa=this.Wa=this.nb=this.ga=null}ld(a){super.ld(a);if(null!==this.qa)for(let b of this.qa.values())qb(b,a)}vc(){return this.Od(0)}df(){return this.Ce(0)}Ed(a){const b=c=>{null===this.nb&&(this.nb=Object.create(null));let d=this.cf(a);d=void 0!==d?olympe.D.na(d):void 0;return this.ii(this.nb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.Ya(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
323
+ [a.Aa],[0],'onResolved('+(b.name||'')+')')):b(a)}cf(a){return this.F[a]}Ce(a){const b=c=>{const d=c.valueOf(),e=this.bf(d);null===this.Wa&&(this.Wa=Object.create(null));return this.ii(this.Wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.ra([a],c=>b(c),String)}bf(a){return this.C[a.valueOf()]}Od(a){if(olympe.D.Ya(a))return this.get(olympe.D.ra([a],c=>{c=this.Ce(c);if(!bb(c.Aa)){const d=olympe.D.Oa();olympe.D.jf(d)&&lb(d)}return c},String));null===this.qa&&(this.qa=new Map);let b=this.qa.get(a);
324
+ b||this.P.run(()=>{b=this.get(this.Ce(a));this.qa.set(a,b);b.Aa.onDestroy(()=>this.qa.delete(a))});return b}Ae(a){return this.fh(this.bf(a))}fi(a,b,c,d){let e=this.wl();a=this.eq(e,a,b,c,d);this.vl(e,a)}eq(a,b,c,d,e){return olympe.D.Oa().G((f,g)=>{let h=!1,k=olympe.D.ph([b,c,this.Ed(g)],(m,n,p)=>{p>=m&&p<m+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.zl(a,g,k)})}hh(){null===this.ga&&this.P.run(()=>{this.ga=olympe.D.qd(Array,this.C.filter(a=>void 0!==a));
325
+ this.ga.Aa.onDestroy(()=>{this.L=null})});return this.ga}Nd(a){if(this.C.length!==this.size)super.Nd(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}yl(a,b){const c=this.nb,d=this.Wa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&rb(c[g]),void 0!==
326
+ c[a]&&O(c[a],olympe.D.na(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&rb(d[e]),void 0!==d[b]&&O(d[b],a))}}xl(a){var b=this.Wa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Aa.xb===a&&rb(b));delete this.F[a];this.C.splice(c,1);c=this.nb;null!==c&&void 0!==c[a]&&rb(c[a])}Ep(){if(null!==this.ga){const a=this.C,b=this.ga.Aa.xb;b&&a.join(',')!==b.join(',')&&O(this.ga,a)}}Ze(){this.Ep();super.Ze()}Yg(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.nb;if(null!==a)for(b in a)rb(a[b]);
327
+ a=this.Wa;if(null!==a)for(b in a)rb(a[parseInt(b,10)]);var b=this.ga;null!==b&&(jb(b.Aa),O(b,this.C));return olympe.D.rh.prototype.Yg.call(this)}Vf(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Di.sa=[olympe.D.Qc];l=olympe.D.Di.prototype;l.ld.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.df.J=new olympe.D.H(()=>String,[]);l.Ed.J=olympe.D.H.G;l.cf.J=olympe.D.H.C;
328
+ l.Ce.J=new olympe.D.H(()=>String,[]);l.bf.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>Object,[]);l.Ae.J=olympe.D.H.C;l.fi.J=new olympe.D.H(()=>{},[]);l.eq.J=olympe.D.H.C;l.hh.J=new olympe.D.H(()=>Array,[]);l.Nd.J=olympe.D.H.C;l.yl.J=olympe.D.H.C;l.xl.J=olympe.D.H.C;l.Ep.J=olympe.D.H.C;l.Ze.J=olympe.D.H.C;l.Yg.J=olympe.D.H.C;l.Vf.J=olympe.D.H.C;olympe.D.Map=class extends olympe.D.rh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}ld(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&qb(this.F,a);super.ld(a)}vc(){null===this.F&&this.Il();return this.F}df(){null===this.C&&this.Il();return this.C}Il(){this.getContext().run(()=>{this.F=olympe.D.qd(this.Gb());this.C=olympe.D.qd(String);this.xi(this.Ll())})}Ll(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}xi(a){if(void 0!==
329
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?sb(this.F,b):O(this.F,b);O(this.C,a)}else void 0!==this.F.Aa.xb&&(rb(this.F),rb(this.C))}set(a,b){this.Gj(a,b);1===this.size&&null!==this.C&&this.xi(a);this.Ze()}remove(a){const b=this.bi(a);null!==this.C&&this.C.Aa.xb===a&&this.xi(this.Ll());return b}clear(){this.Yg();null!==this.C&&this.xi()}};l=olympe.D.Map.prototype;l.ld.J=olympe.D.H.C;l.vc.J=new olympe.D.H(()=>Object,[]);l.df.J=new olympe.D.H(()=>String,[]);l.Il.J=olympe.D.H.C;l.Ll.J=olympe.D.H.C;
330
+ l.xi.J=olympe.D.H.C;l.set.J=olympe.D.H.C;l.remove.J=new olympe.D.H(()=>Object,[]);l.clear.J=olympe.D.H.C;olympe.D.Xf=class extends olympe.D.Di{constructor(a){super(a)}set(a,b,c){this.Gj(a,b);void 0!==c&&olympe.D.oc([c],d=>{this.yl(a,d)});this.Ze()}remove(a){this.xl(a);return this.bi(a)}clear(){this.Yg()}};olympe.D.Xf.prototype.remove.J=olympe.D.H.C;olympe.D.Xf.prototype.clear.J=olympe.D.H.C;olympe.D.wq=class extends olympe.D.Qi{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.nn.$n}vb(){return olympe.D.Dv(this.node,this.duration,this.C,void 0)}};let Bb=null;olympe.D.K=void 0;olympe.D.mm=void 0;olympe.D.bh=void 0;olympe.D.Wg=new Map;olympe.D.Wg.set(0,olympe.D.aa.ZERO);olympe.D.Wg.set(1,olympe.D.aa.ONE);olympe.D.Wg.set(2,olympe.D.aa.et);olympe.D.Fj=new Map;olympe.D.Fj.set('',olympe.D.Ja.EMPTY);olympe.D.Fj.set(' ',olympe.D.Ja.Us);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,bd:b,mf:c,Xl:d,debug:g,Gf:e,Wc:f,ci:h})};olympe.D.jf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
+ olympe.D.qd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.jf(b)?mb(a,b):olympe.D.Ya(b)?mb(a,b.Aa):L(a,b);return N(a)};olympe.D.Ya=function(a){return!(!a||!a.Xg)};olympe.D.kf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Xg))};olympe.D.am=function(a){return olympe.D.jf(a)||a instanceof olympe.D.Nb||a instanceof olympe.D.Vo};olympe.D.lh=function(a){return a instanceof olympe.D.Qi};
332
+ olympe.D.im=function(a,b){if(void 0!==a){olympe.D.lh(a)&&(a=a.vb().Aa);if(!olympe.D.kf(a))return b(a);var c=[];olympe.D.Ya(a)?c.push(a.Aa):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Qa=function(a,b){let c=a;olympe.D.Ya(a)?c=a.Aa.xb:olympe.D.jf(a)?c=a.xb:olympe.D.lh(a)&&(c=a.vb().Aa.xb);return void 0===c?b:c};
333
+ olympe.D.yg=function(a,b){let c;olympe.D.Ya(a)?c=a.Aa:olympe.D.jf(a)?c=a:olympe.D.lh(a)&&(c=a.vb().Aa);c&&olympe.D.oc([b],d=>{c.yg(d)},'setDefaultValue');return a};olympe.D.ph=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.Bp?(h=h.Aa,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.lh(h)&&(h=h.vb().Aa,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
+ olympe.D.Vd=function(a,b,c,d){return N(olympe.D.ph(a,b,c,d||'syncProxies'))};const Cb=a=>{for(const b of a)if(olympe.D.kf(b)||olympe.D.lh(b))return!1;return!0};olympe.D.ra=function(a,b,c,d,e){if(Cb(a))return b(...a);const f=olympe.D.ph(a,b,c,d||'TransformFlows');e&&olympe.D.oc([e],g=>{f.yg(g)},'setDefaultValue');return N(f)};olympe.D.oc=function(a,b,c){Cb(a)?b(...a):olympe.D.ph(a,b,void 0,c||'processFlows')};
335
+ olympe.D.gq=function(a,b){if(Cb(a))b(...a);else{const c=olympe.D.Oa();olympe.D.ph(a,(...d)=>{olympe.D.Oa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.jm=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.Ya(g)?(g=g.Aa,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.lh(g)&&(g=g.vb().Aa,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({bd:b,Xl:e,Gf:f,Sv:!1,Wc:c})};
336
+ olympe.D.nB=function(a,b,c){const d=olympe.D.Oa();olympe.D.jm(a,(...e)=>{olympe.D.Oa().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.HA=function(a,b,c){a=new olympe.D.Qi(a,c);b(a);return a.vb()};olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Qi(a,b)};olympe.D.qB=function(a,b,c,d){const e=olympe.D.Oa();olympe.D.ph(a,(...f)=>{olympe.D.Oa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
+ olympe.D.aq=function(a,b,c){olympe.D.ra([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.TA=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.vb()};olympe.D.QA=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.tB=function(a){return olympe.D.Oa().G(a)};olympe.D.NA=function(a,b,c){olympe.D.St(a?a.Aa:a,b,c)};
338
+ olympe.D.St=function(a,b,c){if(a){var d=a.W();null===Bb&&(Bb={});if(Bb[d])olympe.D.K.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{Bb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.K.warn(e):olympe.D.K.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.K.log(f,'undefined'):null===g?olympe.D.K.log(f,'null'):olympe.D.K.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.K.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
+ ''))});c.onDestroy(()=>{delete Bb[d]})}}else olympe.D.K.log('NOT starting node dump, node is '+String(a))};olympe.D.MA=function(){let a='',b=olympe.D.Oa();for(;null!==b;)a+=b.Ad()+' --\x3e ',b=b.getParent();olympe.D.K.log(a)};
340
+ olympe.D.na=function(a){if(void 0===a)return olympe.D.aa.ZERO;if(a instanceof olympe.D.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.aa.jo;if(a===Math.PI)return olympe.D.aa.PI;if(Infinity===a)return olympe.D.aa.rr;if(-Infinity===a)return olympe.D.aa.ms;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Wg.has(a)||olympe.D.Wg.set(a,new olympe.D.aa(a)),olympe.D.Wg.get(a)):new olympe.D.aa(a)}return null};
341
+ olympe.D.Fd=function(a){return void 0===a?olympe.D.qd(olympe.D.aa):olympe.D.qd(olympe.D.aa,olympe.D.kf(a)?a:olympe.D.na(a))};olympe.D.Dv=olympe.D.aa.animate;olympe.D.eB=function(a,b){return new olympe.D.wq(a,b)};olympe.D.rb=function(a){if(a instanceof olympe.D.Ja)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Fj.has(a)?olympe.D.Fj.get(a):new olympe.D.Ja(a)};
342
+ olympe.D.iB=function(a){return void 0===a?olympe.D.qd(olympe.D.Ja):olympe.D.qd(olympe.D.Ja,olympe.D.kf(a)?a:olympe.D.rb(a))};olympe.D.Hb=function(a){return a instanceof olympe.D.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C};olympe.D.fB=function(a){return void 0===a?olympe.D.qd(olympe.D.ea):olympe.D.qd(olympe.D.ea,olympe.D.kf(a)?a:olympe.D.Hb(a))};olympe.D.Ev=function(a){if(a instanceof Date)return new olympe.D.Za(a)};
343
+ olympe.D.hB=function(a){return olympe.D.qd(olympe.D.Za,void 0!==a?new olympe.D.Za(a):null)};olympe.D.cq=a=>a instanceof olympe.D.ea||a instanceof olympe.D.aa||a instanceof olympe.D.Ja||a instanceof olympe.D.Za;olympe.D.jB=function(a,b){return olympe.D.qd(olympe.D.Ib,void 0===a&&void 0===b?void 0:new olympe.D.Ib(a,b))};olympe.D.Pv=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.qd(olympe.D.Color,e)};olympe.D.gB=olympe.D.Pv;
344
+ olympe.D.Kt=function(a){olympe.D.K=a;olympe.D.bh=olympe.D.ff()};olympe.D.ff=function(){olympe.D.mm||(olympe.D.mm=new olympe.D.Vo);return olympe.D.mm};olympe.D.Oa=function(){olympe.D.bh||(olympe.D.bh=olympe.D.ff());return olympe.D.bh};olympe.D.kq=function(a){const b=olympe.D.bh;olympe.D.am(a)&&(olympe.D.bh=a);return b||null};
345
+ olympe.D.tc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.Za.tc(a);break;case 'number':b=olympe.D.aa.tc(a);break;case 'string':b=olympe.D.Ja.tc(a);break;case 'vector2':b=olympe.D.Ib.tc(a);break;case 'color':b=olympe.D.Color.tc(a);break;case 'boolean':b=olympe.D.ea.tc(a)}return b}return null};function Db(a){a.C.mb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.P.clear(),a.T.length=0,a.L.length=0)}
346
+ olympe.D.hz=class{constructor(){this.C=new olympe.D.Nb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(Eb,'Last slot manager entry');this.size=ub(olympe.D.ec(olympe.D.aa,'SlotManager size').repeat(this.F.vb().Rl()),olympe.D.aa.ZERO);this.P=ub(olympe.D.ec(olympe.D.aa,'last valid slots'),olympe.D.na(-1))});this.T=[];this.L=[];this.C.onDestroy(()=>{Db(this)})}};
347
+ class Eb{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Nb('Slot manager entry');this.L=c;this.P=d;this.F.run(()=>{const e=ub(olympe.D.ec(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.Ya(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.aa);this.G=this.C.vb().Gd(e.vb())});this.next=null}W(){return this.id}av(){return this.C.vb()}Rl(){return this.G}Ed(){return this.L}nv(){return this.P}kw(a){this.L=a}Yv(a){null===a?this.C.update(olympe.D.aa.ZERO):(this.C.repeat(a.Rl()),a.next=this)}Dr(){this.C.clear();
348
+ this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}l=Eb.prototype;l.W.J=olympe.D.H.C;l.av.J=new olympe.D.H(()=>olympe.D.aa);l.Rl.J=new olympe.D.H(()=>olympe.D.aa);l.Ed.J=olympe.D.H.C;l.nv.J=olympe.D.H.C;l.kw.J=olympe.D.H.C;l.Yv.J=olympe.D.H.C;l.Dr.J=olympe.D.H.C;l.destroy.J=olympe.D.H.C;olympe.D.R={za:'df.Logger'};olympe.U.config(a=>{F(a,olympe.D.V.ko,Number.POSITIVE_INFINITY);E(a,olympe.D.R.za,[olympe.ka.R.Fa],b=>b.Gc('df'))},'olympe.df');olympe.U.run([olympe.D.R.za],a=>{olympe.D.Kt(a)},'olympe.df');olympe.host={};const Fb=new Map,Gb=new Map;olympe.host.no=class{static register(a,b,...c){Fb.set(a,b);0<c.length&&Gb.set(a,c)}static create(a,b,c,d){const e=Fb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Gb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ra(d,f))):new e(b,c)}};function Hb(a,b,c){a.K.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.no.create(c,b,a.K,a.L))}function Ib(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.K.T()<=olympe.ka.zb.C.qf&&a.K.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.Ya(f))b.push(a.C.get(f.qt)||null);else if('function'===typeof f){const g=f,h=olympe.D.Oa();b.push((...k)=>{h.mb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
+ function Jb(a){var b=olympe.host.ee.Vc,c=olympe.host.ee.mo.up;++a.G;const d=a.G;Hb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],m=d+'_'+k;this.F.has(m)&&this.F.get(m).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.Ya(p)?(h.push(n),p=p.Aa):olympe.D.jf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Ib(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
+ {Ib(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(m,f),f.onDestroy(()=>this.F.delete(m)));return null}.bind(a));e.Z(a.P.bind(a,d));a=N(e);a.qt=d;L(e,a);return a}olympe.host.Ca=class{constructor(a,b){this.K=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ab(){return this.K}P(a){this.K.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.nd=class{constructor(a){this.C=a;this.F=olympe.D.Oa()}G(){return this.C}Ac(){return this.C.Aa.Ac()||this.F.Ac()}mb(){return this.C.Aa.mb()}};olympe.host.nd.prototype.G.J=new olympe.D.H(()=>olympe.host.ee.nd,[]);olympe.host.xj=class{};olympe.host.Gh=class{constructor(){}C(){}F(){}back(){}pi(){}};function Kb(a){return(a=a.find(b=>'authToken'===b.fa()))?a.getValue():null}olympe.host.Gh.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}fa(){return this.name}getValue(){return this.value}Pa(a){return this.fa()===a.fa()&&this.getValue()===a.getValue()&&this.C===a.C}};function Lb(){const a={}.parameters;return new olympe.host.Gh.C(a?a.map(b=>new olympe.host.Gh.F(b.name,b.value,b.hidden)):[])}
351
+ olympe.host.Gh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.fa(),d]));a.parameters.forEach(c=>{b.has(c.fa())?this.parameters[b.get(c.fa())]=c:this.parameters.push(c)})}};function Mb(a,b){var c=olympe.host.nf;const d=olympe.Y.ic(),e=new olympe.D.Nb('onTimeout context');c.C.Z(b,d,()=>{e.mb()||e.Ac()||e.run(a);c.C.G(d)});return new olympe.host.Vc.F(c.C,d,e)}function Nb(a,b){var c=olympe.host.nf;const d=olympe.Y.ic(),e=new olympe.D.Nb('onInterval context');c.C.T(b,d,()=>{e.mb()||e.Ac()?c.C.F(d):e.run(a)})}olympe.host.Vc=class{constructor(a){this.C=Jb(a)}};olympe.host.Vc.C=class{constructor(a,b,c){this.nf=a;this.id=b;this.C=null!=c?c:null}W(){return this.id}cancel(){}};
352
+ olympe.host.Vc.L=class extends olympe.host.Vc.C{cancel(){this.nf.P(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Vc.F=class extends olympe.host.Vc.C{cancel(){this.nf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Vc.G=class extends olympe.host.Vc.C{cancel(){this.nf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.kj=class{F(){return''}ba(){return''}P(){}C(){return''}G(){}};olympe.host.ee={};olympe.host.ee.nd=class{destroy(){}};olympe.host.ee.nd.prototype.destroy=olympe.host.ee.nd.prototype.destroy;olympe.host.ee.mo={sw:100,uw:101,tw:102,ww:103,vw:104,rw:105,Zy:201,Xy:202,Uy:204,bz:205,Ty:206,Wy:207,$y:208,cz:209,dz:210,ez:211,Vy:212,az:218,Yy:219,fz:220,Sy:221,Ry:222,lz:300,mz:301,nz:302,rz:303,sz:304,uz:305,oz:310,pz:311,qz:312,wy:400,xy:401,yy:402,jy:450,$x:500,Yx:501,ey:502,by:503,Zx:504,ay:505,Nz:600,Ez:601,Iz:602,Az:603,Bz:604,yz:605,Dz:606,Tz:607,Lz:608,vz:609,zz:610,Cz:611,Kz:612,Pz:613,wz:614,Oz:615,Jz:616,Sz:617,Fz:618,Gz:619,Hz:620,Mz:630,xz:631,Qz:632,Rz:633,vA:700,Zz:701,$z:702,
353
+ aA:703,cA:704,dA:705,eA:706,bA:707,gA:708,fA:709,hA:710,lA:711,tA:712,iA:713,jA:714,mA:715,nA:716,pA:717,qA:718,sA:719,oA:720,rA:721,uA:722,kA:723,wA:724,xA:725,up:800};olympe.host.ee.Vc=class{P(){}Z(){}G(){}T(){}F(){}};olympe.host.R={fp:'host.System',Ik:'host.HistoryManager',Xo:'host.Scheduler',za:'host.platform.Logger',Fa:'host.Manager',Se:'host.ProcessManager'};olympe.host.V={zo:'host.processProbe'};olympe.host.nf=null;
354
+ olympe.U.config(function(a){va(a,olympe.host.R.fp);va(a,olympe.host.R.Ik);D(a,olympe.host.R.Se,olympe.host.kj);E(a,olympe.host.R.za,[olympe.ka.R.Fa],function(b){return b.Gc('host')});D(a,olympe.host.R.Fa,olympe.host.Ca,olympe.host.R.za,olympe.U.R.Pf);E(a,olympe.host.R.Xo,[olympe.host.R.Fa],b=>{null===olympe.host.nf&&(olympe.host.nf=new olympe.host.Vc(b));return olympe.host.nf},!0)},'olympe.host');olympe.U.run([olympe.host.R.Xo],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.R.Fa],a=>a,'olympe.host');
355
+ olympe.U.run([olympe.host.R.Se],a=>{olympe.host.Rj=()=>a});olympe.net={};olympe.net.Ia={};olympe.net.Ia.Jd={Og:'POST',GET:'GET',ir:'HEAD',Ao:'PUT',pc:'DELETE',ro:'OPTIONS',zy:'PATCH'};olympe.net.Ia.ResponseType={nl:'text',uh:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.Ia.Headers={yh:'content-type',Gw:'content-length',Cm:'authorization',vq:'access-control-allow-origin',uq:'access-control-allow-headers'};olympe.net.Ia.bn={Mx:'text/html',JSON:'application/json',pt:'application/zip'};olympe.net.Ia.nc={Eq:0,bj:200,Vm:201,Ai:202,yq:400,gt:401,yn:403,ps:404,gy:405,Uh:500,Qs:503};function Ob(a){return a.host&&encodeURI(a.host)}function Pb(a){return encodeURI(a.path).replace(olympe.net.ai.C,(b,c)=>'%'+c)}function Qb(a){return void 0===a.F?443===a.port:a.F}olympe.net.ai=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.F=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.F=d)}C(){return`${Qb(this)?'wss':'ws'}://${Ob(this)}:${this.port}/${Pb(this)}`}toString(){return`${Ob(this)}:${this.port}/${Pb(this)}`}};
356
+ olympe.net.ai.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ga(){}ba(){}Z(){}F(){}};function P(a,b,c,d){a=olympe.Y.Qv(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Hh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.oq&&(c=a.oq.split(':'),2===c.length&&(c=Ga(olympe.Y.Pd(),`${c[0]}:${c[1]}`),Q(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Q(a,b){Object.assign(a.headers,b)}
357
+ olympe.net.Hh=class extends olympe.net.ai{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Ia.Jd.GET;this.query=h;this.headers={};this.body=f;this.G=void 0!==g?g:olympe.net.Ia.ResponseType.nl;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Nj(){return this.headers}C(){let a=Rb(this);a=a?`?${a}`:'';return Ob(this)?`${Qb(this)?'https':'http'}://${Ob(this)}:${this.port}/${Pb(this)}${a}`:`${Pb(this)}${a}`}toString(){return this.C()}};
358
+ olympe.net.Hh.Jd={Og:'POST',GET:'GET',ir:'HEAD',Ao:'PUT',pc:'DELETE',ro:'OPTIONS'};olympe.net.xf=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}sd(){return this.status}Nj(){return this.headers}};function Sb(a,b,c){const d=olympe.D.Oa(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.lf(e);a.F().C.delete(b);c(f)})}function Tb(a,b){return new olympe.net.Re(a,b)}olympe.net.Ca=class{constructor(a){this.K=a;this.L=1;a='Initializing NET layer';this.K.C()&&(a+=' (implementation: '+this.T()+')');this.K.info(a);this.K.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}P(){}T(){}};function Ub(a){let b;return!(null==(b=a.C)||!b.connected)}function Vb(a,b){const c=()=>{const d=b(),e=d.Rc();return{username:`${a.T.vhost}:${d.wc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
359
+ function Wb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT subscribe to topic ${b}`),a.C.subscribe(b,void 0,d=>{d?a.K.error(`Failed to subscribe to topic ${b}: ${d}`):a.F.set(b,c)})):null==c||c(Error('Cannot subscribe because the MQTT client is disconnected'))}function Xb(a,b,c){Ub(a)?(a.K.C()&&a.K.debug(`MQTT unsubscribe topic ${b}`),a.C.unsubscribe(b,void 0,c),a.F.delete(b)):c&&c(Error('Cannot unsubscribe because the MQTT client is disconnected'))}function Yb(a,b){a.G.push(b)}
360
+ function Zb(a,b){a.P.push(b)}function $b(a,b){a.L.push(b)}
361
+ olympe.net.Re=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.P=[];this.L=[];this.ba=[];this.Z=[];this.F=new Map;this.K=olympe.ka.ab('MQTT')}connect(a,b){if(Ub(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,Vb(this,a)),this.C.on(olympe.net.Re.C.ls,(c,d)=>{this.K.C()&&this.K.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.K.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.Re.C.Kq,
362
+ ()=>{this.K.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.Re.C.Is,()=>{this.K.info('Mqtt client is reconnecting to bus ... ');this.P.forEach(c=>c())}),this.C.on(olympe.net.Re.C.Fb,c=>{this.K.error('Mqtt client error ',c);this.ba.forEach(d=>d(c))}),this.C.on(olympe.net.Re.C.Oh,()=>{this.K.info('Mqtt client is offline');this.L.forEach(c=>c())}),this.C.on(olympe.net.Re.C.Jq,()=>{this.K.info('Mqtt client is closed');this.Z.forEach(c=>c())}),this.C.on(olympe.net.Re.C.Ak,
363
+ ()=>{this.K.info('Mqtt client has ended')}));return this}publish(a,b,c,d){if(!Ub(this))return null==d||d(Error('Cannot publish message because the MQTT client is disconnected')),this;const e=JSON.stringify(b);this.K.C()&&this.K.debug(`MQTT > ${e}`);this.C.publish(a,e,c,f=>{null==d||d(f);f&&this.K.error('Failed to publish a message '+b)});return this}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
364
+ olympe.net.Re.C={Kq:'connect',Is:'reconnect',ls:'message',Jq:'close',Ak:'end',Fb:'error',Oh:'offline'};olympe.net.Dj=class{constructor(a){this.K=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}G(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}ba(){this.K.error('Try to set cors policies on a web server with the browser implementation.')}P(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.R={Fa:'net.Manager',za:'net.Logger',Cj:'net.WebServer'};olympe.net.V={Dh:'net.httpHost',Eh:'net.httpPort',Ti:'net.httpSSL',Jg:'net.httpBasePath',In:'net.httpBodyLimit'};
365
+ olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;F(a,olympe.net.V.Dh,b);F(a,olympe.net.V.Eh,c?3141:443);F(a,olympe.net.V.Ti,!c);F(a,olympe.net.V.Jg,'/runtime');F(a,olympe.net.V.In,100);va(a,olympe.net.R.Fa);E(a,olympe.net.R.za,[olympe.ka.R.Fa],function(d){return d.Gc('net')});D(a,olympe.net.R.Cj,olympe.net.Dj,olympe.net.R.za)},'olympe.net');olympe.Na.node.host={};olympe.Na.node.host.nd=function(a,b){this.K=b};olympe.Na.node.host.nd.prototype.constructor=olympe.Na.node.host.nd;olympe.Na.node.host.nd.prototype.destroy=function(){};olympe.Na.node.host.nd.prototype.destroy=olympe.Na.node.host.nd.prototype.destroy;olympe.Na.node.host.nd.prototype.ab=function(){return this.K};olympe.Na.node.host.nd.sa=[olympe.host.ee.nd];function ac(a){a.K.error('No history manager implemented in Node')}olympe.Na.node.host.oo=class{constructor(a){this.K=a}pi(){return!1}C(){ac(this);return Lb()}F(){ac(this)}back(){ac(this)}};olympe.Na.node.host.oo.sa=[olympe.host.Gh];olympe.Na.node.host.Vc=class{constructor(){this.C={};this.L={}}destroy(){}P(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.no.register(olympe.host.ee.mo.up,olympe.Na.node.host.Vc);olympe.Na.node.host.Vc.sa=[olympe.host.ee.Vc];olympe.Na.node.host.xj=class{constructor(a){this.K=a}};olympe.Na.node.host.xj.sa=[olympe.host.xj];function bc(a){const b=olympe.net.Ia.nc.bj,c=olympe.net.Ia.nc.Uh;a.ga.P('healthcheck','/readiness',[olympe.net.Ia.Jd.GET],()=>{const d=Array.from(a.Z.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.xf('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.K.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.xf(g,
366
+ f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.K.error(`Failed to add health check route ${d}`));a.F(()=>a.ga.stop())}function cc(a,b){b=Array.from(b.values()).map(c=>c.apply(a));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.K.warn(`Failed to close some resource: ${e.reason}`));return d})}
367
+ function dc(a){return v(function*(){try{const b=yield cc(a,a.L),c=yield cc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.L.clear(),a.T.clear()}})}
368
+ olympe.Na.node.host.kj=class extends olympe.host.kj{constructor(a,b,c=!0){super();this.K=a;this.ga=b;this.Z=new Map;this.L=new Map;this.T=new Map;c&&bc(this)}C(a){const b=olympe.Y.af();this.Z.set(b,a);return b}G(a){this.Z.delete(a)}F(a){const b=olympe.Y.af();this.L.set(b,a);return b}ba(a){const b=olympe.Y.af();this.T.set(b,a);return b}P(a){this.L.has(a)?this.L.delete(a):this.T.delete(a)}};olympe.U.config(function(a){F(a,olympe.host.V.zo,!0);ta(a,olympe.host.R.Ik,olympe.Na.node.host.oo,olympe.host.R.za);ta(a,olympe.host.R.fp,olympe.Na.node.host.xj,olympe.host.R.za);D(a,olympe.host.R.Se,olympe.Na.node.host.kj,olympe.host.R.za,olympe.net.R.Cj,new olympe.U.ma(olympe.host.V.zo))},'olympe.native.node.host');olympe.U.run([olympe.host.R.Se],a=>{olympe.Na.node.host.Rj=()=>a});olympe.net.Ud={};olympe.net.Ud.Mk=class{constructor(a){this.K=a;this.C=new Map}G(){}F(){}};olympe.net.Ud.WebSocket=class{constructor(a,b){this.K=b;this.id=a;this.C=null;this.buffer=[];this.P=this.G=this.L=this.T=null}W(){return this.id}open(a){const b=`#${this.id}`,c=this.qa(a);c.binaryType='arraybuffer';c.onopen=()=>{this.K.info('Websocket OPENED');this.T?(this.K.debug('Notifying upper layer for WebSocket',b),this.T()):this.K.warn('Nothing to notify for WebSocket',b);this.K.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
369
+ 0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Ha(d.data);this.K.debug(b,'<',d);this.G&&this.G(d)};c.onclose=()=>{this.K.debug(`WebSocket ${b} CLOSED`);this.L&&this.L()};c.onerror=()=>{this.K.debug(`WebSocket ${b} ERROR`);this.P&&this.P()};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:this.K.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.K.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);
370
+ break;default:return this.K.debug(b,'- Closed','>',a),!1}}else this.K.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.K.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.K.debug('Try to force close native websocket, but not open nor connecting')}ga(a){this.T=a||null}ba(a){this.G=a||null}F(a){this.P=a||null}Z(a){this.L=a||null}qa(){}};
371
+ olympe.net.Ud.WebSocket.sa=[olympe.net.WebSocket];olympe.Na.node.net={};olympe.Na.node.net.rs=class extends olympe.net.Ca{constructor(a,b){super(a,b);this.Z=new olympe.Na.node.net.Mk(a)}T(){return'NodeJS'}G(a){var b=this.L++;a=a.C();this.K.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Na.node.net.ss(b,this.K);b.open(a);return b}C(a,b){this.K.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.L++;b=Sb(this,c,b);this.Z.G(c,{u:a.C(),s:Qb(a),h:Ob(a),p:a.port,z:Pb(a),q:Rb(a),m:a.method,v:a.Nj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.G},b)}P(){this.K.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const ec=require('fs'),fc=require('http'),gc=require('https');
372
+ olympe.Na.node.net.Mk=class extends olympe.net.Ud.Mk{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,m=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(x,y,z)=>new Promise((A,J)=>{ec.readFile(x,(M,La)=>{M?J(M):(z[y]=La,A(z))})});p=x=>{const y=A=>{A.setEncoding(w===olympe.net.Ia.ResponseType.nl?'utf-8':'binary');let J='';A.on('data',M=>{J+=M});A.on('end',()=>{if(w!==olympe.net.Ia.ResponseType.nl){var M=
373
+ (new Uint8Array(Buffer.from(J,'binary'))).buffer;M=w===olympe.net.Ia.ResponseType.uh?new Blob([M]):M}else M=J;c(this.F(A.statusCode,A.statusMessage,M,A.headers))})},z=d?new gc.request(x,y):new fc.request(x,y);this.C.set(a,()=>{z.destroy()});z.on('error',A=>{c(this.F(olympe.net.Ia.nc.Uh,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+A.code+', message = '+A.message,''))});!e||'POST'!==f&&'PUT'!==f?z.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(A=>{z.write(A instanceof
374
+ ArrayBuffer?Buffer.from(A):A);z.end()})};d&&(h||k||m)?h&&k&&m?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,m,'ca')).then(p).catch(x=>{this.K.log('Error loading self signed files:',x)})):this.K.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.K.debug('Received HTTP response',a,c);return new olympe.net.xf(c,a,b,d)}};olympe.Na.node.net.ss=class extends olympe.net.Ud.WebSocket{qa(a){return new (require('ws'))(a)}};olympe.Na.node.net.V={Yz:'native.html.net.useWorkers'};olympe.U.config(function(a){ta(a,olympe.net.R.Fa,olympe.Na.node.net.rs,olympe.net.R.za,olympe.host.R.Fa)},'olympe.native.node.net');olympe.Na.node.net.http={};const hc=require('fastify'),ic=require('@fastify/cors'),jc={tj:0,sj:1,ll:2};
375
+ function kc(a,b){a.F.route({bodyLimit:1048576*a.ga,url:b.path,method:b.methods,handler:(c,d)=>{a.K.debug('< HTTP:',c);var e=c.body,f='';if(e instanceof Buffer)f=new Uint8Array(e.length),e.copy(f);else if('string'===typeof e||e instanceof Object)f=e;const [g,h]=c.hostname.split(':');e=new olympe.net.Hh(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,m]of Object.entries(c.headers))e.headers[k]=m;f=new Map(Object.entries(c.params));c=new Map(Object.entries(c.query));b.jv(e,f,c).then(k=>
376
+ {const m=k.sd(),n=k.getData();if(m>=olympe.net.Ia.nc.Uh)throw Error(n);m>=olympe.net.Ia.nc.yq?a.K.warn('> HTTP: client bad request: reply with error:',n):a.K.debug('> HTTP: reply with body:',n instanceof ArrayBuffer?'binary':n);d.code(m).headers(k.Nj()).send(n instanceof ArrayBuffer?Buffer.from(n):n)}).catch(k=>{a.K.error('> HTTP: reply with internal server error:',k);d.code(olympe.net.Ia.nc.Uh).header(olympe.net.Ia.Headers.yh,'text/plain').send('Internal server error')})}})}
377
+ olympe.Na.node.net.http.Dj=class extends olympe.net.Dj{constructor(a,b,c,d){super(a);this.ga=d;this.F=this.createServer();this.host=b;this.port=c;this.L=new Map;this.T=null;this.C=jc.tj;this.ad=new Set;this.timer=null}ba(a,b){this.T={origin:'*',methods:a,allowedHeaders:b}}P(a,b,c,d){this.L.set(a,{path:b,methods:c,jv:d});return this.G()}Z(a){const b=this;return v(function*(){b.L.delete(a);return 0<b.L.size?b.G():b.stop()})}start(){if(this.C===jc.tj)return this.G();if(this.C===jc.sj){this.F.register(ic,
378
+ this.T);for(const a of this.L.values())kc(this,a);return this.F.listen(this.port,'0.0.0.0').then(a=>{this.C=jc.ll;this.K.debug('Web server listening on '+a);this.ad.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.ad.forEach(b=>b(a))}).finally(()=>this.ad.clear())}return Promise.reject('Try to start a webservice already started')}G(){return this.C===jc.sj?(new Promise((a,b)=>{this.ad.add(c=>c?b(c):a())})).then(()=>this.G()):new Promise((a,b)=>{this.ad.add(c=>c?b(c):a());this.Lp(()=>{const c=
379
+ this;return v(function*(){c.C=jc.sj;yield c.F.close();c.F=c.createServer();yield c.start()})})})}stop(){return this.C===jc.ll?this.F.close().then(()=>{this.C=jc.tj}):Promise.resolve()}createServer(){const a=hc({logger:!1,level:'error'});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}Lp(a){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,1E3)}};olympe.U.config(function(a){D(a,olympe.net.R.Cj,olympe.Na.node.net.http.Dj,olympe.net.R.za,new olympe.U.ma(olympe.net.V.Dh),new olympe.U.ma(olympe.net.V.Eh),new olympe.U.ma(olympe.net.V.In))},'olympe.native.node.net.http');olympe.Na.node.Y={};const lc=new Map;olympe.Na.node.Y.nk=class extends olympe.Y.nk{G(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}L(a,b){a.arrayBuffer().then(olympe.D.Oa().G(b))}P(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;lc.set(b,a);return b}F(a,b,c){lc.has(a)?b(lc.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}T(a){lc.delete(a)}};olympe.U.config(function(a){ta(a,olympe.Y.R.Ag,olympe.Na.node.Y.nk)},'olympe.native.node.utils');olympe.async={};function mc(a,b){0<=b&&(a.timeout=b)}function nc(a,b){a.L||a.Z.push(a.G.G(b))}
380
+ olympe.async.un=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Nb('Async executor context');this.qa=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.L=this.P=!1;this.K=null;this.timer=this.timeout=0;this.ba=olympe.Y.ic()}ab(){return this.K}add(a){this.L||this.F.push(this.G.G(a));return this}start(){this.P||(this.K&&this.K.log('Executor started.'),this.P=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},this.ba),0<this.timeout&&(this.timer=
381
+ setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.qa&&this.G.destroy()}complete(a){this.G.lf(this.ba);if(!this.L){this.L=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.K&&this.K.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
382
+ function oc(a){if(0<a.F.length){const b=a.F.shift();a.K&&a.K.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{oc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.gp=class extends olympe.async.un{static create(){return new olympe.async.gp(new olympe.D.Nb('SequencedExecutor'),!0)}start(){this.P||(super.start(),oc(this))}};
383
+ olympe.async.ij=class extends olympe.async.un{constructor(a,b){super(a,b);this.T=0;this.ga=!0}static create(){return new olympe.async.ij(new olympe.D.Nb('ParallelExecutor'),!0)}run(a){this.K&&this.K.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ga=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.P&&!this.L&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ga)}start(){if(!this.P)if(super.start(),
384
+ 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.kc={};olympe.kc.Zr=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.kc.Yr=class{constructor(){}C(){}};olympe.kc.Storage=class{open(){}write(){}close(){}};olympe.kc.R={Xi:'localStorage.KeyValueManager',uj:'localStorage.Storage',Kw:'localStorage.DatacloudStorage',za:'localStorage.Logger'};olympe.U.config(function(a){va(a,olympe.kc.R.Xi);E(a,olympe.kc.R.za,[olympe.ka.R.Fa],function(b){return b.Gc('localstorage')})},'olympe.localstorage');olympe.O={};olympe.O.errors={};olympe.O.errors.uy=class extends Error{};olympe.O.errors.pp=class extends Error{};olympe.O.errors.xo=class extends Error{};olympe.O.errors.mt=class extends Error{};olympe.O.errors.al=class extends Error{constructor(a,b){super(a);this.id=b}W(){return this.id}};olympe.O.Kb={Pi:'urls.FileSvc',Dm:'urls.BackupSvc',Oo:'urls.RestoreBackupSvc',ne:'urls.GetContext',Fn:'urls.GraphDef',Qm:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',tp:'urls.UserTagFromToken',lt:'urls.UserNameFromTag',kt:'urls.UserRoles',Ms:'urls.RoleMembers',cj:'urls.OpenIDSvc'};
385
+ olympe.U.config(a=>{F(a,olympe.O.Kb.Pi,'rest/filesvc');F(a,olympe.O.Kb.Dm,'rest/backupsvc');F(a,olympe.O.Kb.Oo,'rest/backupsvc/restore');F(a,olympe.O.Kb.cj,'rest/openid');F(a,olympe.O.Kb.ne,'rest/initialData');F(a,olympe.O.Kb.Fn,'rest/querysvc/graphDef');F(a,olympe.O.Kb.Qm,'rest/querysvc/graphDef/static');F(a,olympe.O.Kb.TRANSACTION,'rest/transaction');F(a,olympe.O.Kb.tp,'rest/token');F(a,olympe.O.Kb.lt,'rest/authorization/getUserTag');F(a,olympe.O.Kb.kt,'rest/authorization/getUserRoles');F(a,olympe.O.Kb.Ms,
386
+ 'rest/authorization/roleMembers')});function pc(a){a.K.debug('Disconnected from bus');a.G=!0;let b;null==(b=a.F)||b.forEach((c,d)=>{null!==c.F&&(a.K.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),qc(c))})}function rc(a){a.K.debug('Connection to bus established. Listening to responses on topic',a.P);Wb(a.C,a.P,b=>{a.K.C()&&a.K.debug('BUS <',JSON.stringify(b));b=new olympe.O.Response(b.dest,b.src,b.seq,b.type,a.Ba.G(b.content));let c;null==(c=a.L.get(b.qg()))||c(b)})}
387
+ function sc(a){a.K.debug(`Reconnected to bus: Sending ${a.ga.length} pending messages and resubscribe to ${a.ba.size} active topics.`);for(const c of a.ga){let d;try{d=c.ha(a.Ba)}catch(e){a.K.error(`An error occurred while serializing a message that was pending (seqId=${c.qg()}: ${e}`)}a.C.publish(c.uc(),d)}a.ga=[];a.ba.forEach((c,d)=>{tc(a,d,c)});a.ba.clear();let b;null==(b=a.F)||b.forEach((c,d)=>{null===c.F&&(a.K.info(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),
388
+ uc(c,!0))})}function vc(a){a.ub=a.qa.C(()=>Ub(a.C)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function tc(a,b,c){a.G||a.Wa?a.ba.set(b,c):a.connect().then(()=>{a.K.debug(`Bus: Subscribe to ${b}`);Wb(a.C,b,d=>{a.K.C()&&a.K.debug(`BUS < #${b}: ${JSON.stringify(d)}`);d=new olympe.O.Request(d.dest,d.src,d.auth,d.seq,d.type,a.Ba.G(d.content));c(d)})})}function wc(a,b,c,d,e){b=new olympe.O.Response(c,a.P,b,d,e);return a.publish(b)}
389
+ function xc(a,b,c,d){const e=yc(a.T).Rc();a.Z++;return new olympe.O.Request(b,a.P,e,a.Z,c,d)}function zc(a,b,c,d){const e=b.qg(),f=olympe.O.Response.hb.ek;let g=null;g=setTimeout(()=>Ac(a,e),a.Wb);a.L.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Ac(a,e),d):(a.L.delete(e),c(h))})}function Ac(a,b){const c=a.L.get(b);a.L.delete(b);null==c||c(new olympe.O.Response(a.P,a.P,b,olympe.O.Response.hb.Fb,{reason:'Timeout'}))}
390
+ function Bc(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>Ac(a,c),a.Wb);a.L.set(c,e=>{a.L.delete(c);clearTimeout(d);b(e)});return a.Z}function Cc(a,b){a.ba.delete(b);let c;null==(c=a.F)||c.delete(b);a.K.debug(`Bus: Unsubscribe to ${b}`);return a.G||a.Wa?Promise.resolve():new Promise((d,e)=>{Xb(a.C,b,f=>f?e(f):d())})}
391
+ function Dc(a,b,c,d,e){null===a.F&&(a.F=new Map);let f=a.F.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(qc(a),uc(a,!1)))):(f=new olympe.O.$s(a.K,a,b,d),a.F.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&uc(d,!1)}function Ec(a,b,c){let d;const e=null==(d=a.F)?void 0:d.get(b);if(null==e?0:Fc(e,c))a.publish(xc(a,b,olympe.O.Request.hb.qp,c)).catch(f=>a.K.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.F.delete(b),0===a.F.size&&(a.F=null))}
392
+ function Gc(a,b){return rxjs.operators.retry({resetOnSuccess:!0,delay:c=>{if(c instanceof olympe.O.errors.al){const d=Math.round(5E3*Math.random());a.K.debug(`Subscription topic ${c.W()} not registered in the service, re-subscribe in ${d}ms`);return rxjs.timer(d).pipe(rxjs.operators.tap(()=>null==b?void 0:b()))}return rxjs.throwError(()=>c)}})}function Hc(a,b){return new Promise((c,d)=>{const e=b.td(),f=a.Ob.get(e);void 0!==f?c(f):a.T.sg(b.td(),(g,h)=>{g?d(g):(a.Ob.set(e,h),c(h))})})}
393
+ olympe.O.Pm=class{constructor(a,b,c,d,e,f){b=f.get('connectionOptions');this.K=a;this.T=c;this.qa=d;this.Ba=e;this.Wb=f.get('shortTimeout');this.hc=f.get('requestTimeout');this.Xb=f.get('subscriptionsRefreshRate');this.L=new Map;this.C=Tb(f.get('url'),b);this.Ob=new olympe.Y.ql(f.get('tokenTimeout'));this.nb=f.get('allowGuest');this.Z=1;this.P=olympe.Y.ic();this.F=null;this.G=!1;this.ga=[];this.ba=new Map;this.Cb=this.ub='';this.Wa=!1;$b(this.C,()=>{pc(this)});Zb(this.C,()=>{pc(this)});Yb(this.C,
394
+ ()=>{this.G&&(this.Wa=!1,rc(this),this.G=!1,sc(this))})}connect(){const a=olympe.auth.Ca.C.INIT,b=olympe.auth.Ca.C.Fb,c=olympe.auth.Ca.C.Ge,d=olympe.auth.Ca.C.wf,e=olympe.auth.Ca.C.Le;return new Promise((f,g)=>{Ub(this.C)||this.G?f():olympe.D.oc([this.T.getState()],h=>{const k=olympe.D.Oa();if(this.nb||h!==d)switch(h){case a:this.Wa=!0;break;case b:case e:g(Error('Authentication failed.'));k.destroy();break;case c:case d:vc(this),this.nb||Ic(this.T,()=>this.disconnect().then()),this.G=!0,this.C.connect(()=>
395
+ yc(this.T),()=>{k.destroy();f()}),this.Cb=this.qa.ba(()=>this.disconnect())}else vc(this),g(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter !!!')),k.destroy()})})}disconnect(){return new Promise(a=>{this.K.debug('Disconnecting from bus');this.T.Ba.delete('busLogoutCallback');this.C.end(!1,()=>a());this.qa.G(this.ub);this.qa.P(this.Cb)})}publish(a){return this.G?(a.getType()!==olympe.O.Request.hb.pe&&(this.K.debug('Bus disconnected, storing message in queue'),
396
+ this.ga.push(a)),Promise.resolve()):new Promise((b,c)=>{try{const d=a.ha(this.Ba),e=a.uc();this.K.C()&&this.K.debug(`BUS > #${e}: ${JSON.stringify(d)}`);this.C.publish(e,d,void 0,f=>{f?c(f):b()})}catch(d){c(`An error occurred while serializing the message (seqId=${a.qg()}: ${d}`)}})}dd(a,b,c){return wc(this,a.qg(),a.Lb(),b,c)}request(a,b,c,d){const e=xc(this,a,b,c);if(b===olympe.O.Request.hb.PUBLISH){const f=new olympe.O.Response(a,this.P,e.qg(),olympe.O.Response.hb.ek);return this.publish(e).then(()=>
397
+ f)}return new Promise((f,g)=>{zc(this,e,f,null!=d?d:this.hc);this.publish(e).catch(g)})}};olympe.O.Pm.C='Timeout';const Jc=olympe.net.Ia.Headers.Cm,Kc=olympe.net.Ia.nc.bj,Lc=olympe.net.Ia.nc.Vm,Mc=olympe.net.Ia.nc.Ai,Nc=olympe.net.Ia.nc.Qs,Oc=olympe.net.Ia.nc.Eq,Pc=olympe.net.Ia.nc.yn,Qc=olympe.net.Ia.nc.gt;function Rc(a,b){let c;return null!=(c=a.G.get(b))?c:''}
398
+ function Sc(a,b,c){if(null===b)return Promise.reject('No http request to send');Q(b,{[Jc]:c});return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((d,e)=>{const f=b.C();if(a.K.C()){const g=b.body;a.K.debug('HTTP >',f,`body: ${'string'===typeof g?g:typeof g}`)}a.C.C(b,g=>{switch(g.sd()){case Kc:case Lc:case Mc:const h=g.getData();a.K.C()&&a.K.debug('HTTP <',g.sd(),`content: ${'string'===typeof h?h:typeof h}`);d(h);break;case Nc:g=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;
399
+ a.K.warn(g);e(new olympe.O.errors.xo(g));break;case Oc:a.K.debug(`HTTP < request canceled (${b.C()}).`);d();break;case Pc:case Qc:g=`HTTP < request authorization denied: ${b.C()}`;a.K.error(g);e(new olympe.O.errors.mt(g));break;default:g=`HTTP < Error: ${g.sd()}, ${g.statusText}`,a.K.error(g),e(Error(g))}})})).pipe(rxjs.operators.retry(a.F)))}olympe.O.jr=class{constructor(a,b,c,d){this.K=a;this.C=b;this.G=c;this.F=d}};function Tc(a,b,c){a.K.info('Initializing COMMUNICATION layer');if(a.K.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.K.debug(d.join('\n\t'))}Uc(a,olympe.O.Zd.Fb,d=>{switch(d.c){case olympe.O.hb.it:a.K.error('Unknown message sent to the server:',olympe.O.cb.ac[d.s]);break;case olympe.O.hb.br:a.K.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.nm&&Vc(a,f,d.i)})}});b.get('autoConnect')&&
400
+ (a.K.debug('Connecting automatically'),a.connect());olympe.D.aq(a.P.vb(),()=>{a.pd.forEach(d=>d());Nb(a.gi.bind(a),a.mi);Nb(a.Wb.bind(a),a.hc)},()=>{a.T=null;a.hd.forEach(d=>d(a.L[2]));a.Wb()});c.C(()=>Wc(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ba(()=>{a.disconnect();return Promise.resolve()});a.K.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
401
+ function Wc(a){return a.C===olympe.O.cb.C.xh}
402
+ function R(a,b){if(a.C!==b){a.K.debug('State change '+a.C+' --\x3e '+b);a.C=b;var c;null==(c=a.xe)||c.call(a,b);switch(b){case olympe.O.cb.C.CONNECTING:break;case olympe.O.cb.C.xh:a.P.update(olympe.D.ea.F);break;case olympe.O.cb.C.$f:a.L[0]=0;a.L[1]=0;a.connect();break;case olympe.O.cb.C.Fb:a.K.error('Connection to server',a.ba.C(),'aborted due to error');a.P.update(olympe.D.ea.C);break;case olympe.O.cb.C.Vg:break;case olympe.O.cb.C.zg:a.connect();break;case olympe.O.cb.C.Le:a.P.update(olympe.D.ea.C);
403
+ a.Wa&&(a.K.info('Disconnected, will try to auto reconnect in',a.nb,'ms'),Mb(()=>{a.connect()},a.nb));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}}function Xc(a,b){const c=olympe.Y.ic();a.pd.set(c,b);olympe.D.Qa(a.P)===olympe.D.ea.F&&b()}function Yc(a,b){var c;void 0===c&&(c=olympe.Y.ic());a.hd.set(c,b);olympe.D.Qa(a.P)===olympe.D.ea.C&&b(a.L[2])}
404
+ function Zc(a,b,c,d){const e=a.we;a.we++;c={message:{seqId:e,messageFamily:b,payload:c},Dl:d?$c(a,d):null,nm:null};a.G.set(e,c);d=[olympe.O.cb.C.CONNECTING,olympe.O.cb.C.$f];(Wc(a)||b===olympe.O.Zd.Si&&d.includes(a.C))&&ad(a,e,c)}
405
+ function $c(a,b){const c=olympe.O.cb.G.Vh;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;'string'===typeof g?a.K.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`):void 0!==f&&f!==c&&(e=void 0!==olympe.O.cb.ac[f]?`Status code = ${f} [${olympe.O.cb.ac[f]}]`:`Status code = ${f}`,g=d.info,void 0!==g&&void 0!==g.error&&(f=g.error.reason,'string'===typeof f&&0<f.length&&(e+=`\nReason:\n${g.error.reason}`),f=g.error.detailedReason,'string'===
406
+ typeof f&&0<f.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)),e=Error('Rejected by orchestrator:\n'+e));b(e,d)}}}function ad(a,b,c){var d=c.message;a.K.C()&&a.K.debug('WS >',bd(d));(d=a.F.send(JSON.stringify(d)))?null===c.Dl?a.G.delete(b):c.nm=Date.now():R(a,olympe.O.cb.C.$f);return d}function Uc(a,b,c,d){void 0===d&&(d=olympe.Y.ic());let e=a.ga.get(b);void 0===e&&(e=new Map,a.ga.set(b,e));e.set(d,c)}function cd(a){a=a.ga.get(olympe.O.Zd.Wf);void 0!==a&&a.delete('logoutHandler')}
407
+ function Vc(a,b,c){if(a.G.has(b)){const {Dl:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function dd(a,b){a.xe=b}function ed(a,b){a.K.error(b);R(a,olympe.O.cb.C.Fb)}function fd(a,b,c){a.Ob=null!=c?c:-1;a.K.info('Connected to',a.ba.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!ad(a,d,e))return;R(a,olympe.O.cb.C.xh)}
408
+ function bd(a){a=JSON.parse(JSON.stringify(a));return`${olympe.Y.Eu(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
409
+ olympe.O.cb=class{constructor(a,b,c,d,e,f){this.K=a;this.Cb=b;this.ba=d;this.F=null;this.config=f;this.nb=this.config.get('reconnectionDelay');this.Ba=e;this.xe=null;this.mi=this.config.get('pingInterval');this.em=this.nb/2;this.Wa=f.get('autoConnect');f.get('retryHttpOverload');this.hc=f.get('messageTimeout');this.Z=olympe.Y.Ye.parse(f.get('clientVersion'));this.qa=olympe.Y.Ye.parse(f.get('serverVersion'));this.C=olympe.O.cb.C.INIT;this.ub=f.get('getContextMode');this.we=1;this.T=null;this.L=[0,
410
+ 0,0];this.ga=new Map;this.P=olympe.D.ec(olympe.D.ea,'Server is online');this.pd=new Map;this.hd=new Map;this.G=new Map;this.Xb=new Map;this.Ob=-1;Tc(this,f,c)}connect(){const a=olympe.O.cb.C.INIT,b=olympe.O.cb.C.CONNECTING,c=olympe.O.cb.C.xh,d=olympe.O.cb.C.Le,e=olympe.O.cb.C.$f,f=olympe.O.cb.C.Vg,g=olympe.O.cb.C.zg,h=olympe.O.cb.C.Fb;null!==this.F&&(this.F.Z(null),this.F.close());this.Wa=!0;this.K.log(`Asking NET layer for a connection to ${Ob(this.ba)}:${this.ba.port}...`);this.F=this.Cb.G(this.ba);
411
+ this.F.ga(this.Ad.bind(this));this.F.ba(this.If.bind(this));this.F.Z(()=>{this.F=null;this.C===c?R(this,e):this.C!==h&&this.C!==f&&R(this,d)});this.Ba&&this.C===a&&this.F.F(()=>{this.F.F(null);if(this.C===b){var k=Pb(this.Ba);this.K.info(`Trying to wakeup orchestrator with ${k}`);R(this,f);var m=this.Cb.G(this.Ba);m.ba(n=>{const p=JSON.parse(n);this.K.info(`${k}: ${null==p?void 0:p.status}`);switch(null==p?void 0:p.status){case 'ready':R(this,g);m.close();break;case 'asleep':this.K.info(`Trying to wakeup orchestrator with ${k}`);
412
+ m.send('{"action": "wakeup"}');R(this,f);break;case 'waking-up':break;default:this.K.warn(`Invalid message from ${k}: ${n}`),m.close(),R(this,d)}});m.F(()=>{this.K.warn(`Communication with ${k} failed.`);m.close();R(this,d)});m.ga(()=>{this.K.info(`Checking orchestrator status with ${k}`);m.send('{"action": "status"}')})}this.Ba=null});this.C!==e&&R(this,b)}disconnect(){const a=olympe.O.cb.C.CONNECTING;if(this.C===olympe.O.cb.C.xh||this.C===a)this.Wa=!1,R(this,olympe.O.cb.C.Le),this.F.close()}Ad(){this.K.debug('Websocket connected, sending handshake. Client version:',
413
+ Ra(this.Z),'subscribeEverything:',this.ub?'NO':'YES');Zc(this,olympe.O.Zd.Si,{c:olympe.O.hb.Si,cv:Ra(this.Z),m:this.ub?0:1,s:this.T},this.ki.bind(this))}ki(a,b){if(a)ed(this,'Error in receiving handshake response: '+a.message);else{this.K.debug('Handshake response received');var c=olympe.O.cb.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.vr:ed(this,`Framework version (${Ra(this.Z)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
414
+ return;case c.bt:ed(this,`Framework version (${Ra(this.Z)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.er:ed(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.qa.Pa(olympe.Y.Ye.C))this.K.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Y.Ye.parse(a);if(e.yi(this.qa)){ed(this,`Framework v${Ra(this.Z)} is expecting Orchestrator to be at least in v${Ra(this.qa)}`);
415
+ return}this.K.log('Handshake successful. Orchestrator version: ',e,'required:',Ra(this.qa))}catch(f){ed(this,f);return}e=olympe.O.cb.C.Le;if(this.C===olympe.O.cb.C.$f&&null!==this.T&&this.T!==b.sessionId)this.K.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),R(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Xb.set(f,g);this.T=b.sessionId||null;fd(this,a,d)}}}gi(){this.L[0]-this.L[1]>this.em?(this.K.debug('Ping did not get answer, try to reconnect'),
416
+ R(this,olympe.O.cb.C.$f)):(this.L[0]=Date.now(),this.F.send('ping')||(this.K.debug('Impossible to send ping, try to reconnect'),R(this,olympe.O.cb.C.$f)))}If(a){this.L[2]=Date.now();if(a.startsWith('pong'))return this.L[1]=this.L[2],null;try{var b=JSON.parse(a)}catch(d){return this.K.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.K.C()&&this.K.debug('WS <',bd(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.G.has(a)){const {Dl:d}=
417
+ this.G.get(a);this.G.delete(a);d&&d(b)}a=this.ga.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Wb(){const a=Date.now();for(const [b,{nm:c}]of this.G)null!==c&&a-c>this.hc&&(this.K.warn(`No response was received from the server for the seqId = ${b}`),Vc(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.O.Request=class{constructor(a,b,c,d,e,f){this.F=d;this.C=a;this.source=b;this.L=c;this.nh=e;this.G=f||null}uc(){return this.C}Lb(){return this.source}qg(){return this.F}getType(){return this.nh}Yc(){return this.G}td(){return this.L}ha(a){return{dest:this.C,src:this.source,seq:this.F,auth:this.L,type:this.nh,content:a.ha(this.G)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.F}, type: ${this.nh})`}};
418
+ olympe.O.Request.hb={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,pe:4,qp:5};function gd(a){const b=olympe.O.Response.hb.op;return a.F!==olympe.O.Response.hb.ol?Promise.reject('Should only call `topicAck` on TOPIC responses'):wc(olympe.O.eh(),a.C.seq,a.source,b)}olympe.O.Response=class{constructor(a,b,c,d,e){this.L=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}uc(){return this.G}Lb(){return this.source}qg(){return this.L}getType(){return this.F}Yc(){return this.C}ha(a){return{dest:this.G,src:this.source,seq:this.L,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
419
+ olympe.O.Response.hb={ek:0,Yo:1,wp:2,ol:3,op:4,Fb:5};const hd=olympe.O.Response.hb.Yo,id=olympe.O.Response.hb.Fb,jd=olympe.O.Response.hb.wp,kd=olympe.O.Response.hb.ol,ld=olympe.O.Response.hb.op,md=olympe.O.Request.hb.SEND,nd=olympe.O.Request.hb.GET,od=olympe.O.Request.hb.SUBSCRIBE,pd=olympe.O.Request.hb.pe;
420
+ olympe.O.yc=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}qh(){return null!==this.F?Promise.resolve(this.F):Hc(this.C,this.request).then(a=>this.F=a)}nh(){return this.request.getType()}source(){return this.request.Lb()}body(){return this.request.Yc()}Fp(){return this.request.getType()===md?this.C.dd(this.request,hd):Promise.reject('Should only call `ack` on SEND requests')}dd(a){const b=this.request.getType();return b===nd||b===pd?this.C.dd(this.request,jd,a):Promise.reject('Should only call `reply` on GET requests')}hm(a){if(this.request.getType()!==
421
+ od)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.ic();return new Promise((c,d)=>{const e={seq:Bc(this.C,f=>{switch(f.getType()){case ld:qd(this.G,b);c(b);break;case id:d(f.Yc().reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.C.Xb};this.C.dd(this.request,kd,e).catch(d)})}dh(a){return this.C.dd(this.request,id,{reason:a.message})}};olympe.O.yc.prototype.fail=olympe.O.yc.prototype.dh;
422
+ olympe.O.yc.prototype.notifyOn=olympe.O.yc.prototype.hm;olympe.O.yc.prototype.reply=olympe.O.yc.prototype.dd;olympe.O.yc.prototype.ack=olympe.O.yc.prototype.Fp;olympe.O.yc.prototype.body=olympe.O.yc.prototype.body;olympe.O.yc.prototype.source=olympe.O.yc.prototype.source;olympe.O.yc.prototype.requestType=olympe.O.yc.prototype.nh;olympe.O.yc.prototype.userTag=olympe.O.yc.prototype.qh;function qc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function uc(a,b){b&&a.De();null===a.F&&(a.F=setInterval(a.De.bind(a),a.G))}function Fc(a,b){b=a.C.delete(b);0===a.C.size&&qc(a);return b}function rd(a,b){a.C.forEach((c,d)=>{Fc(a,d);c(b)})}
423
+ olympe.O.$s=class{constructor(a,b,c,d){this.K=a;this.L=b;this.P=c;this.G=d;this.C=new Map;this.F=null}De(){const a=olympe.O.errors.al;Ub(this.L.C)?this.L.request(this.P,olympe.O.Request.hb.pe,Array.from(this.C.keys())).then(b=>{b=b.Yc();0<b.length&&b.forEach(c=>{const d=this.C.get(c);Fc(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.K.error(b);rd(this,Error(b))}):qc(this)}};olympe.O.cg=class{ha(a){return this.C(a)}G(a){return this.F(a)}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.Za:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,r:a.pg().valueOf(),g:a.mg().valueOf(),b:a.kg().valueOf(),a:a.jg().valueOf()};case a instanceof Map:const b=Object.create(null);for(const [c,
423
424
  d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:3,m:b};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof ArrayBuffer:return{t:4,v:olympe.Y.Pd().C(a)};case a instanceof Uint8Array:return{t:5,v:olympe.Y.Pd().C(a.buffer)};case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:throw Error(`Impossible to serialize the following value: ${a}`);}}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===
424
- typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(b=>this.G(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.create(a.r,a.g,a.b,a.a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.G(c)]));case 4:return olympe.Y.Pd().G(a.v);case 5:return new Uint8Array(olympe.Y.Pd().G(a.v));default:return Object.entries(a).reduce((b,[c,d])=>{b[c]=this.G(d);return b},{})}}};const td=olympe.P.Response.kb.Yo,ud=olympe.P.Response.kb.ck,vd=olympe.P.Response.kb.Fb,wd=olympe.P.Response.kb.wp,xd=olympe.P.Response.kb.ol,yd=olympe.P.Request.kb.SEND,zd=olympe.P.Request.kb.GET,Ad=olympe.P.Request.kb.PUBLISH,Bd=olympe.P.Request.kb.SUBSCRIBE,Cd=olympe.P.Request.kb.oe,Dd=olympe.P.Request.kb.qp;function rd(a,b){a.C||(a.C=La(new olympe.Y.rl(a.F.Wb+6E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
425
- function Ed(a){let b,c;a=null!=(c=null==(b=a.pd())?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.P.errors.pp(a):Error(a)}
426
- olympe.P.pb=class{constructor(a,b){this.F=olympe.P.ah();this.K=a;this.G=this.C=null;this.O=new olympe.D.Mb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.L=olympe.ka.ab(`Service ${this.K}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);this.F.connect().then(()=>{uc(this.F,this.K,c=>{const d=new olympe.P.Jc(c,this.F,this);switch(c.getType()){case Cd:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Ja(h,g))});d.$c(e).catch(g=>this.L.error('Not able to validate subscription keep alive',
427
- g));break;case Dd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case Ad:a.next(d);break;default:this.F.$c(c,ud).then(()=>a.next(d))}})}).catch(c=>this.L.error('Failed to connect to the bus: '+c));return b})}lq(a){this.G=a;return this}stop(){this.clear();this.O.destroy()}clear(){Dc(this.F,this.K).catch(b=>this.L.error('Failed to unsubscribe from '+this.K+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,
428
- c)})}let a;null==(a=this.C)||a.clear()}static publish(a,b){const c=olympe.P.ah();return c.connect().then(()=>c.request(a,Ad,b)).then()}static send(a,b,c={}){const d=olympe.P.ah();return d.connect().then(()=>d.request(a,yd,b,c.timeout)).then(e=>{switch(e.getType()){case td:break;case vd:throw Ed(e);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){const d=olympe.P.ah();return d.connect().then(()=>d.request(a,zd,b,c.timeout)).then(e=>{switch(e.getType()){case wd:e=
429
- e.pd();if(null!==e)return e;throw Error('No payload after request to service: '+a);case vd:throw Ed(e);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.P.ah();return(new rxjs.Observable(g=>{let h=null,k=null;const m=()=>{g.complete();k&&Fc(f,a,k);h&&Dc(f,h).catch(n=>olympe.ka.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(m);f.connect().then(()=>f.request(a,Bd,c,d.timeout)).then(n=>
430
- {switch(n.getType()){case xd:const p=n.pd();h=p.topic;uc(f,h,q=>{q.getType()===Ad?g.next(q.pd()):(g.error('Unsupported notification message. It should be a publish'),m())});k=p.id;Ec(f,a,k,p.refresh,q=>g.error(q));hd(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);m()});break;case vd:g.error(Ed(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return m})).pipe(Hc(f,d.onRetry))}};olympe.P.pb.observe=olympe.P.pb.observe;
431
- olympe.P.pb.get=olympe.P.pb.get;olympe.P.pb.send=olympe.P.pb.send;olympe.P.pb.publish=olympe.P.pb.publish;olympe.P.pb.prototype.stop=olympe.P.pb.prototype.stop;olympe.P.pb.prototype.setUnsubscriptionHandler=olympe.P.pb.prototype.lq;olympe.P.pb.prototype.listen=olympe.P.pb.prototype.listen;olympe.P.Zd={en:1,qf:2,Fb:3,Wf:4,Dw:5,Oi:6};olympe.P.kb={Oi:1,jt:2,br:3,oe:5};olympe.P.cb.C={INIT:'initialize',CONNECTING:'connecting',Ke:'disconnected',sh:'connected',$f:'reconnecting',Sg:'waking',zg:'awake',Fb:'error'};olympe.P.cb.F={Zi:1,er:-1,vr:-2,ct:-3};olympe.P.cb.G={Sh:0,Rx:23};
432
- olympe.P.cb.bc={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',
433
- 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.P.R={mj:'com.ServerManager',kk:'com.BusManager',Hk:'com.HttpManager',de:'com.Serializer',ya:'com.Logger',cp:'com.Source',rp:'com.Urls',By:'com.peerFileSvcUrl',uo:'com.overloadRetryPolicy'};
434
- olympe.P.V={Sf:'server.host',cj:'server.port',nj:'server.ssl',jk:'server.basePath',zp:'server.wsPath',xm:'server.autoConnect',fl:'server.reconnectionDelay',yo:'server.pingInterval',yp:'server.messageTimeout',Qo:'server.retryHttpOnOverload',Um:'server.clientVersion',ap:'server.serverVersion',Ss:'server.wakeUpService',Hm:'bus.host',Im:'bus.path',Jm:'bus.port',Om:'bus.vhost',Mm:'bus.ssl',oe:'bus.keepalive',Ls:'bus.reschedulePings',Iq:'bus.clientId',Gq:'bus.clean',Lq:'bus.connectTimeout',np:'bus.tokenTimeout',
435
- Lm:'bus.shortTimeout',Km:'bus.requestTimeout',Nm:'bus.subscriptionRefreshRate',Hs:'bus.queueQoSZero',Ci:'bus.allowGuest'};
436
- olympe.U.config(function(a){F(a,olympe.P.V.Sf,'object'===typeof window&&window.location&&window.location.hostname||'localhost');var b=a.getParameter(olympe.P.V.Sf);const c='localhost'===b;F(a,olympe.P.V.cj,c?8080:443);F(a,olympe.P.V.nj,'localhost'!==b);F(a,olympe.P.V.jk,'OlympeServer');F(a,olympe.P.V.zp,'websocket');F(a,olympe.P.V.xm,!0);F(a,olympe.P.V.fl,5E3);F(a,olympe.P.V.yo,5E3);F(a,olympe.P.V.yp,15E3);F(a,olympe.P.V.Qo,5E3);F(a,olympe.P.V.ap,'7.1.0');F(a,olympe.P.V.Hm,b);F(a,olympe.P.V.Im,c?
437
- '':'/mqtt');F(a,olympe.P.V.Jm,c?15675:443);F(a,olympe.P.V.Mm,'localhost'!==b);F(a,olympe.P.V.Om,c?'/':'');F(a,olympe.P.V.oe,30);F(a,olympe.P.V.Lm,5E3);F(a,olympe.P.V.Km,3E4);F(a,olympe.P.V.Nm,3E5);F(a,olympe.P.V.np,3E5);F(a,olympe.P.V.Ci,!1);b=a.getParameter(olympe.Kf.V.zn);if(void 0!==b)wa(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.P.R.ya,[olympe.ka.R.Fa],e=>e.Dc('communication'));E(a,'server.WebSocketRequest',[new olympe.U.ma(olympe.P.V.Sf),
438
- new olympe.U.ma(olympe.P.V.cj),new olympe.U.ma(olympe.P.V.nj),new olympe.U.ma(olympe.P.V.jk),new olympe.U.ma(olympe.P.V.zp)],(e,f,g,h,k)=>new olympe.net.Yh(e,f,(h+'/'+k).replace(/\/+/g,'/').replace(/\/$/,''),g));E(a,'server.wakeUpRequest',[new olympe.U.ma(olympe.P.V.Sf),new olympe.U.ma(olympe.P.V.cj),new olympe.U.ma(olympe.P.V.nj),new olympe.U.ma(olympe.P.V.Ss)],(e,f,g,h)=>{if(null===h||void 0===h)return null;h=h.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Yh(e,f,h,g)});const d=Array.from(Object.values(olympe.P.Nb));
439
- E(a,olympe.P.R.rp,[new olympe.U.ma(olympe.P.V.Sf),new olympe.U.ma(olympe.P.V.cj),new olympe.U.ma(olympe.P.V.nj),new olympe.U.ma(olympe.P.V.jk),...d.map(e=>new olympe.U.ma(e))],(e,f,g,h,...k)=>{const m=d.map((n,p)=>{p=k[p];p=(new olympe.net.Eh(e,f,`${h}${p?'/'+p:''}`.replace(/\/+/g,'/').replace(/\/$/,''),g)).C();return[n,p]});return new Map(m)});E(a,olympe.P.R.uo,[olympe.P.R.ya],e=>({resetOnSuccess:!0,delay:(f,g)=>f instanceof olympe.P.errors.xo?(g=Math.round(Math.random()*(g+1)*4E3),e.warn(`Service overloaded, re-send request in ${g}ms`),
440
- rxjs.timer(g)):rxjs.throwError(()=>f)}));D(a,olympe.P.R.de,olympe.P.dg);D(a,olympe.P.R.Hk,olympe.P.jr,olympe.P.R.ya,olympe.net.R.Fa,olympe.P.R.rp,olympe.P.R.uo);E(a,'server.ManagerConfig',[new olympe.U.ma(olympe.P.V.xm),new olympe.U.ma(olympe.P.V.fl),new olympe.U.ma(olympe.P.V.yo),new olympe.U.ma(olympe.P.V.yp),new olympe.U.ma(olympe.P.V.Um),new olympe.U.ma(olympe.P.V.ap),new olympe.U.ma(olympe.dc.V.Pg),new olympe.U.ma(olympe.P.V.Qo)],(...e)=>{const f='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),
441
- g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.P.R.mj,olympe.P.cb,olympe.P.R.ya,olympe.net.R.Fa,olympe.host.R.Qe,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');E(a,'server.bus.ManagerConfig',[new olympe.U.ma(olympe.P.V.Sf),new olympe.U.ma(olympe.P.V.Hm),new olympe.U.ma(olympe.P.V.Im),new olympe.U.ma(olympe.P.V.Jm),new olympe.U.ma(olympe.P.V.Om),new olympe.U.ma(olympe.P.V.Mm),new olympe.U.ma(olympe.P.V.Ci),new olympe.U.ma(olympe.P.V.Lm),new olympe.U.ma(olympe.P.V.Km),
442
- new olympe.U.ma(olympe.P.V.Nm),new olympe.U.ma(olympe.P.V.np),new olympe.U.ma(olympe.P.V.oe),new olympe.U.ma(olympe.P.V.Ls),new olympe.U.ma(olympe.P.V.Iq),new olympe.U.ma(olympe.P.V.Gq),new olympe.U.ma(olympe.P.V.fl),new olympe.U.ma(olympe.P.V.Lq),new olympe.U.ma(olympe.P.V.Hs)],(e,f,g,h,k,m,n,p,q,r,t,...u)=>{f=`${m?'wss://':'ws://'}${f}:${h}${g}/ws`;const w='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');u=u.reduce((x,
443
- y,z)=>{x[w[z]]=y;return x},{});u.vhost=`${k||e.split('.')[0]}`;return new Map([['url',f],['connectionOptions',u],['allowGuest',n],['shortTimeout',p],['requestTimeout',q],['subscriptionsRefreshRate',r],['tokenTimeout',t]])});D(a,olympe.P.R.kk,olympe.P.Pm,olympe.P.R.ya,olympe.net.R.Fa,olympe.auth.R.Fa,olympe.host.R.Qe,olympe.P.R.de,'server.bus.ManagerConfig')},'olympe.communication');olympe.U.run([olympe.P.R.kk],a=>{olympe.P.ah=()=>a});olympe.auth={};function Fd(a,b){dd(a.C);Vc(a.C,olympe.P.Zd.Wf,c=>{const d=c.c;d===olympe.auth.Nc.C.ds?(a.C.Ad(),b(olympe.auth.Ca.F.wi,c)):d===olympe.auth.Nc.C.Ps&&b(olympe.auth.Ca.F.Kn,c)},'logoutHandler')}
444
- function Gd(a,b,c){const d=null==b?void 0:b.Vf();if(b instanceof olympe.auth.cl){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.od();h.access_token=b.pd().access_token||null;g=`${Sc(a.Si,olympe.P.Nb.$k)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);if(0!==f.hash.length||0!==f.search.length){const g=a.storage.C('AUTH');f.hash='';f.search='';g&&g.set('redirectTo',c,()=>{g.close();e(f.toString())})}else e(c)}else $c(a.C,olympe.P.Zd.Wf,Object.assign({},
445
- {c:olympe.auth.Nc.C.es},d&&{idpName:d}),c)}function Hd(a,b,c,d){c.c=b;$c(a.C,olympe.P.Zd.Wf,c,d)}
446
- olympe.auth.Nc=class{constructor(a,b,c,d,e){this.L=a;this.C=b;this.Si=c;this.F=d;this.storage=e;const f=this.storage.C('AUTH');f&&(f.get('redirectTo',g=>{g&&(f.remove('redirectTo'),f.close(),this.F.redirect(g,null,olympe.auth.lj.C.GET))}),f.close())}nf(a){$c(this.C,olympe.P.Zd.Wf,{c:olympe.auth.Nc.C.oe},a)}sg(a,b,c){const d=Sc(this.Si,olympe.P.Nb.tp);a=Rb(`${d}/${a}`);Tc(this.Si,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};
447
- olympe.auth.Nc.C={Wf:1,es:2,Fb:3,oe:5,Sh:6,lr:10,Ys:11,tq:12,bg:13,Ps:14,ds:20};function Jc(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.jg());a.Ba.set(c,b)}function zc(a){return olympe.D.Sa(a.C.vb())}
448
- function Id(a){a.L.info('Initializing AUTH layer');let b=a.Wb;if(a.qa){const c=a.qa.C(),d=Kb(c.parameters);b=d||b;d&&a.qa.F(c.parameters.filter(e=>'authToken'!==e.fa()))}b&&a.storage&&Jd(a.storage,b,c=>{!c&&a.L.error('Could not store authToken')});a.L.debug('Asking to be notified when auth connector gets online');Yc(a.G,()=>{if(a.nb)if(a.F=olympe.auth.Ca.G.qq,a.L.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.ba){const c=new olympe.auth.Request;c.set('username',
449
- a.ba);c.set('password',a.Cb);a.L.log('Autologin with user "'+a.ba+'"');Kd(a,c)}else Ld(a,'No user specified for auto login',!0);else a.F=olympe.auth.Ca.G.uj,a.L.log('Connector online, attempting to log with token'),Md(a)});Zc(a.G,()=>{switch(olympe.D.Sa(a.O)){case olympe.auth.Ca.C.Fe:const c=olympe.D.Sa(a.C.vb()).yc();a.L.warn(`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ca.C.wf:a.L.warn('Disconnected from server - guest session lost');break;case olympe.auth.Ca.C.yi:a.L.warn('Disconnected from server - authentication aborted');
450
- break;case olympe.auth.Ca.C.INIT:a.L.warn('Cannot open auth session - no server connection');break;default:a.L.error('Should not get there, investigate')}Nd(a,olympe.auth.Ca.C.Ke)});ed(a.G,c=>{switch(c){case olympe.P.cb.C.Sg:Nd(a,olympe.auth.Ca.C.Sg);break;case olympe.P.cb.C.zg:Nd(a,olympe.auth.Ca.C.zg)}});Fd(a.K,(c,d)=>{if(c===olympe.auth.Ca.F.wi)Ld(a,'authentication revoked'),a.storage&&Od(a.storage),a.Ba.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ca.F.Kn)a.L.info('Redirection to IDP to invalidate token (SAML)'),
451
- zc(a),a.storage&&Od(a.storage),a.ub.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Va=Pd(a);a.Z.F(()=>a.Uj());a.L.log('DONE initializing AUTH layer (waiting for connector to be online)')}
452
- function Md(a){null!==a.storage?(a.L.debug('Retrieving token from local storage'),a.storage.rd(b=>{if(b){const d=new olympe.auth.Request;var c=b.yc();d.set('username',c);c=d;b=b.od();c.set('nonce',b);a.L.debug('Token found, trying login with',d);Kd(a,d,'localToken')}else Ld(a,'No token found, cannot perform auto login')})):Ld(a,'Cannot retrieve token: no storage configured, cannot perform auto login',!0)}function Nd(a,b){a.L.log('State change: ',Qd(a),'--\x3e',b);a.O.update(b)}
453
- function Ld(a,b,c=!1){a.C.update(a.ga);Nd(a,olympe.auth.Ca.C.wf);b=`Authenticated as guest (${b})`;c?a.L.error(b):a.L.info(b)}function Pd(a){const b=[olympe.auth.Ca.C.Fe];a.nb||b.push(olympe.auth.Ca.C.wf);return a.Z.C(()=>{const c=Qd(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function Qd(a){return olympe.D.Sa(a.O.vb())}function Rd(){var a=olympe.public.Xa.get();return new Map(a.G.Wb)}
454
- function Sd(a,b,c,d=!1){b=b+c?':'+c.message:'';a.L.error(b);a.error.update(olympe.D.rb(b));Nd(a,olympe.auth.Ca.C.Fb);if(d)throw Error(b);}function Kd(a,b,c,d){void 0===c&&(c=a.Ob);void 0===c&&Sd(a,'No authentication provider specified',null,!0);const e=a.ac.get(c);e||Sd(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.T.set('login',d);a.L.log('Sending authentication request using "'+c+'" for '+b);e.rd(b,a.Vb.bind(a));Nd(a,olympe.auth.Ca.C.yi)}
455
- function Td(a,b,c){a.T.forEach(d=>{d(b,c)})}
456
- olympe.auth.Ca=class{constructor(a,b,c,d,e,f,g,h,k){this.L=a;this.G=b;this.K=c;this.storage=d;this.ub=e;this.qa=f;this.Ob=k.get('defaultProvider');this.nb=!!k.get('autoLogin');this.ba=k.get('autoUser');this.Cb=k.get('autoPassword');this.Wb=k.get('autoToken');this.ac=new Map;this.Z=g;this.Va='';this.O=olympe.D.ec(String).update(olympe.auth.Ca.C.INIT);this.error=olympe.D.ec(olympe.D.Ja);this.F=null;this.ga=new olympe.auth.zd('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
457
- olympe.D.ec(olympe.auth.zd).update(this.ga);this.T=new Map;this.Ba=new Map;h.forEach(m=>{const n=m.fa();if(this.ac.has(n))throw Error('Provider "'+n+'" has already been registered !');this.ac.set(n,m)});Id(this)}getState(){return this.O.vb()}yc(){return this.C.vb().yc()}Ce(){return this.C.vb().Ce()}dh(){return this.C.vb().dh()}sg(a,b){let c;const d=null==(c=olympe.D.Sa(this.C.vb()))?void 0:c.od();this.K.sg(a,d,b)}Uj(){return olympe.D.Sa(this.C)===this.ga?(this.L.warn('Logout called for Guest user so it will be ignored'),
458
- Promise.resolve()):new Promise((a,b)=>{this.L.debug('Sending logout');Od(this.storage);Gd(this.K,zc(this),c=>{c?(Sd(this,'Logout request rejected:',c),b(c)):(this.L.debug('Logout request acknowledged'),a())});this.Z.G(this.Va)})}nf(){Qd(this)===olympe.auth.Ca.C.Fe&&this.K.nf(a=>{a&&this.L.error('Was not able to send the auth keep alive message:',a.message)})}Vb(a,b){const c=null===this.F?olympe.auth.Ca.G.ks:this.F;this.F=null;a?(Od(this.storage),this.error.update(olympe.D.rb(a.message)),Ld(this,'authentication rejected: '+
459
- a.message),Td(this,a,c)):(this.L.info('User '+b.yc()+' (#'+b.Ce()+') successfully authenticated'),this.C.update(b),Nd(this,olympe.auth.Ca.C.Fe),Td(this,a,c),this.storage&&Jd(this.storage,b));this.T.has('login')&&this.T.delete('login')}};olympe.auth.Ca.C={INIT:'init',Sg:'waking',zg:'awake',Ke:'disconnected',wf:'guest',yi:'authenticating',Fb:'error',Fe:'authenticated'};olympe.auth.Ca.G={ks:'manual',qq:'auto',uj:'tokenOnFirstConnection'};olympe.auth.Ca.F={wi:'accepted',Kn:'redirect'};olympe.auth.Nh=class{fa(){}rd(){}};function Ud(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Ug&&(a=a.za.xb);return a?a.valueOf():a}yc(){return this.get('username')}od(){return this.get('nonce')}toString(){return this.yc()+(this.od()?' with nonce':'')+(this.get('password')?' with password':'')+(Ud(this)?` with idp name ${Ud(this)}`:'')}};olympe.auth.zd=class{constructor(a,b,c,d={}){this.O=a;this.lh=b;this.G=c;this.C=null;this.K=d}yc(){return this.O}Ce(){return this.lh}od(){return this.G}pd(){return this.K}dh(){return null}Vf(){return this.C}ha(){const a=olympe.Y.Pd(),b=Object.assign({},{user:this.O,userTag:this.lh,nonce:this.G},this.C&&{idpName:this.C},{payload:this.K});return olympe.Y.Gp(Ga(a,JSON.stringify(b)))}Oj(){return olympe.auth.zd.C.Rh}};olympe.auth.zd.C={bg:'saml',vs:'oauth2',Rh:'srp'};l=olympe.auth.zd.prototype;
460
- l.yc.J=new olympe.D.H(()=>String,[]);l.Ce.J=new olympe.D.H(()=>String,[]);l.od.J=new olympe.D.H(()=>String,[]);l.pd.J=new olympe.D.H(()=>Object,[]);l.dh.J=new olympe.D.H(()=>String,[]);l.Vf.J=new olympe.D.H(()=>String,[]);l.ha.J=new olympe.D.H(()=>String,[]);l.Oj.J=new olympe.D.H(()=>String,[]);olympe.auth.cl=class extends olympe.auth.zd{constructor(a,b,c,d){super(a,b,c,d)}dh(){return this.pd().access_token||null}Oj(){return olympe.auth.zd.C.vs}};olympe.auth.Wo=class extends olympe.auth.zd{constructor(a,b,c,d){super(a,b,c,d);this.F=null}dh(){return this.F}Oj(){return olympe.auth.zd.C.bg}ha(){const a=olympe.Y.Pd(),b=Object.assign({},{user:this.yc(),userTag:this.Ce(),nonce:this.od()},this.Vf()&&{idpName:this.Vf()},{payload:this.pd(),fullToken:this.F});return olympe.Y.Gp(Ga(a,JSON.stringify(b)))}};function Jd(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ha(),e=>{d.close();c&&c(e)})}function Od(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
461
- olympe.auth.sl=class{constructor(a,b,c){this.C=a;this.L=b;this.key='OlympeToken-'+c.C}rd(a){const b=this.C.C('AUTH');this.L.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.L.debug('olympe.auth.TokenStorage: Token retrieved successfully');var e=JSON,f=e.parse;var g=Ha(olympe.Y.Pd().G(olympe.Y.Ft(c)));const h=f.call(e,g);let k;h.fullToken?(k=new olympe.auth.Wo(h.user,h.userTag,h.nonce,h.payload),k.F=h.fullToken):h.payload&&h.payload.id_token?
462
- k=new olympe.auth.cl(h.user,h.userTag,h.nonce,h.payload):k=new olympe.auth.zd(h.user,h.userTag,h.nonce,h.payload);h.idpName&&(k.C=h.idpName);d=k}catch(h){this.L.error('Error while unserializing token: ',h.message)}else this.L.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.sl.F='OlympeToken';olympe.auth.sl.C='AUTH';olympe.auth.lj=class{redirect(){}F(){}C(){}};olympe.auth.lj.C={GET:'GET',Lg:'POST'};olympe.auth.hk=class{constructor(a){this.C=a||'default'}};olympe.auth.ac={};function Vd(a,b){return olympe.Y.jb(b+'-olympe-'+a.C[b])}olympe.auth.ac.ao=class{constructor(a){this.C=a}fa(){return'local'}rd(a,b){const c=a.yc();if(c){const d=a.get('password'),e=a.od();a.C.delete('password');if(void 0!==e&&Vd(this,c)===e){b(null,new olympe.auth.zd(c,'',Vd(this,c)));return}a=olympe.Y.jb(d||'');if(this.C[c]===a){b(null,new olympe.auth.zd(c,'',Vd(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.ac.ao.C='local';olympe.auth.ac.ao.sa=[olympe.auth.Nh];function Wd(a,b,c){Hd(a.C,olympe.auth.Nc.C.Wf,{token:b.od()},(d,e)=>{if(null!==d)c(d);else switch(e.c){case olympe.auth.Nc.C.Fb:c(Error('Invalid token'));break;case olympe.auth.Nc.C.Sh:d=null;var f=e.payload;if(f){e=f.userName;const g=f.userTag,h=f.rndCook,k=f.payload,m=f.protocol;'SAML'===m?(f=f.samlToken,d=new olympe.auth.Wo(e,g,h,k),d.F=f):'openid'===m&&(d=new olympe.auth.cl(e,g,h,k))}c(null,d);break;default:c(Error('Unknown response from server'))}})}
463
- olympe.auth.ac.Tk=class{constructor(a,b){this.C=a;this.storage=b}fa(){return'localToken'}rd(a,b){this.storage.rd(c=>{Wd(this,a,(d,e)=>{c&&e&&c.Vf()&&(e.C=c.Vf());b(d,e||c)})})}};olympe.auth.ac.Tk.C='localToken';olympe.auth.ac.Tk.sa=[olympe.auth.Nh];olympe.auth.ac.bl=class{constructor(a,b){this.C=a;this.F=b}fa(){return'openID'}rd(a){const b=encodeURIComponent(this.C.C());a=Ud(a)?`idpName=${Ud(a)}&`:'';this.C.redirect(`${this.F}/auth?${a}url=${b}`,null,olympe.auth.lj.C.GET)}};olympe.auth.ac.bl.C='openID';olympe.auth.ac.bl.sa=[olympe.auth.Nh];function Xd(a,b){Hd(a.C,olympe.auth.Nc.C.bg,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.ac.bg=class{constructor(a,b){this.C=a;this.F=b}fa(){return'saml'}rd(a,b){Xd(this,c=>{c?b(c):this.F.F(Ud(a))})}};olympe.auth.ac.bg.C='saml';olympe.auth.ac.bg.sa=[olympe.auth.Nh];function Yd(a,b,c){const d=olympe.auth.Nc.C.lr,e=olympe.auth.Nc.C.Fb,f=olympe.auth.Nc.C.Ys,g={I:b.yc()};Hd(a.C,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.yc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
464
- function Zd(a,b,c){const d=olympe.auth.Nc.C.tq,e=olympe.auth.Nc.C.Fb,f=olympe.auth.Nc.C.Sh;b={A:b.get('a'),M:b.get('m1'),I:b.yc()};Hd(a.C,d,b,(g,h)=>{if(null!==g)c(g);else switch(h.c){case e:a.L.debug('Login failed, invalid username or password');c(Error('Invalid username or password'));break;case f:g=h.payload;a.L.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.zd(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`))}})}
465
- olympe.auth.ac.Rh=class{constructor(a){this.C=a;this.L=olympe.ka.ab('auth')}fa(){return'srp'}rd(a,b){const c=a.get('password');a.C.delete('password');this.L.debug('Sending SRP request');Yd(this,a,(d,e,f)=>{this.L.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.yc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);return}this.L.debug('Sending SRP A+M (proof) message');Zd(this,a,b)}})}};olympe.auth.ac.Rh.C='srp';olympe.auth.ac.Rh.sa=[olympe.auth.Nh];olympe.auth.R={Fa:'auth.Manager',ya:'auth.Logger',qj:'auth.Storage',xi:'auth.appNameToken',jj:'auth.Redirector',Zo:'auth.ServerConnector'};olympe.auth.V={tk:'auth.defaultProvider',fk:'auth.autoLogin',zm:'auth.autoUser',ym:'auth.autoPassword',uj:'auth.token',vm:'auth.appToken',Ci:'bus.allowGuest'};
466
- olympe.U.config(function(a){F(a,olympe.auth.V.tk,'srp');F(a,olympe.auth.V.fk,!1);F(a,olympe.auth.V.zm,'');F(a,olympe.auth.V.ym,'');F(a,olympe.auth.V.uj,'');F(a,olympe.auth.V.vm,'default');E(a,olympe.auth.R.ya,[olympe.ka.R.Fa],b=>b.Dc('auth'));D(a,olympe.auth.R.xi,olympe.auth.hk,new olympe.U.ma(olympe.auth.V.vm));D(a,olympe.auth.R.qj,olympe.auth.sl,olympe.jc.R.Ui,olympe.auth.R.ya,olympe.auth.R.xi);D(a,olympe.auth.R.Zo,olympe.auth.Nc,olympe.auth.R.ya,olympe.P.R.mj,olympe.P.R.Hk,olympe.auth.R.jj,olympe.jc.R.Ui);
467
- va(a,olympe.auth.R.jj);E(a,olympe.auth.R.Fa,[olympe.auth.R.ya,olympe.P.R.mj,olympe.auth.R.Zo,olympe.host.R.Gk,olympe.host.R.Qe,new olympe.U.pb(olympe.auth.R.qj,olympe.U.Cg.C.Yk),new olympe.U.pb(olympe.auth.R.jj,olympe.U.Cg.C.Yk),new olympe.U.ma(olympe.auth.V.tk),new olympe.U.ma(olympe.auth.V.fk),new olympe.U.ma(olympe.auth.V.zm),new olympe.U.ma(olympe.auth.V.ym),new olympe.U.ma(olympe.auth.V.uj)],(b,c,d,e,f,g,h,k,m,n,p,q)=>{const r=[new olympe.auth.ac.Tk(d,g),new olympe.auth.ac.Rh(d),new olympe.auth.ac.bg(d,
468
- h)];h&&r.push(new olympe.auth.ac.bl(h,Sc(d.Si,olympe.P.Nb.$k)));if(!r.map(t=>t.fa()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.V.tk} cannot be found`);return new olympe.auth.Ca(b,c,d,g,h,e.li()?e:null,f,r,new Map([['defaultProvider',k],['autoLogin',m],['autoUser',n],['autoPassword',p],['autoToken',q]]))},!0)},'olympe.auth');olympe.U.run([olympe.auth.R.Fa],a=>{olympe.auth.ge=()=>a});olympe.Na.node.auth={};olympe.Na.node.auth.po=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Na.node.auth.po.sa=[olympe.auth.lj];olympe.U.config(a=>{D(a,olympe.auth.R.jj,olympe.Na.node.auth.po)},'olympe.native.node.auth');olympe.Na.node.jc={};olympe.Na.node.jc.eo=class{constructor(a){this.F={};this.L=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.Na.node.jc.fo(a,this.L));return this.F[a].open()}};olympe.Na.node.jc.eo.sa=[olympe.jc.Yr];olympe.Na.node.jc.fo=class{constructor(a,b){this.name=a;this.L=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
469
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.Na.node.jc.fo.sa=[olympe.jc.Zr];olympe.U.config(function(a){D(a,olympe.jc.R.Ui,olympe.Na.node.jc.eo,olympe.jc.R.ya)},'olympe.native.node.localstorage');olympe.Na.node.storage={};olympe.Na.node.storage.Storage=class{constructor(a){this.L=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Na.node.storage.Storage.sa=[olympe.jc.Storage];olympe.U.config(function(a){ta(a,olympe.jc.R.qj,olympe.Na.node.storage.Storage,olympe.host.R.ya)},'olympe.native.html.storage');olympe.Kf={};olympe.Kf.V={VERSION:'version.version',Cq:'version.branch',Ge:'version.commit',bt:'version.tag',zn:'version.olympe-framework',Dq:'version.build'};olympe.U.config(function(a){F(a,olympe.Kf.V.VERSION,'');F(a,olympe.Kf.V.Cq,'');F(a,olympe.Kf.V.Ge,'');F(a,olympe.Kf.V.bt,'');F(a,olympe.Kf.V.zn,'');F(a,olympe.Kf.V.Dq,'')},'olympe.main');const $d=require('fs');let ya,xa;function ae(a,b){$d.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
470
- function be(){if(void 0!==ya&&void 0!==xa){0===Object.keys(xa).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(ya).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
471
- (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.U.Pq(a);na(a);pa(a.compile())}}function ce(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Na.node.host).Nj)||ec(b.call(a)).then(()=>{console.log('The node backend has stopped successfully');process.exit(0)}).catch(c=>process.exit(1,c))}
472
- olympe.Y.Qd('oConfig.json',ae,function(a){xa=a;be()});ae('version.json',function(a){ya=a;be()});process.on('SIGTERM',ce);process.on('SIGINT',ce);process.on('SIGBREAK',ce);process.on('SIGHUP',ce);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);ce()});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.lc={hd:'ff022000000000000000',yh:'ff02200000000000000e',Fi:'ff02200000000000000f'};olympe.dc.Tn={VERSION:'@v',cp:'@s'};olympe.dc.Ri={Hd:'?'};olympe.dc.kz={oy:'online',Lh:'offline',Sx:'invalidate'};olympe.dc.Pa={SELF:'self',SERVER:'server',Af:'remote',Lh:'offline'};olympe.dc.Jb={NONE:null,jn:'ff023000000000000037',oc:'ff023000000000000137',Se:'ff023000000000000237',Us:'ff023000000000000337'};olympe.dc.Writable=class{Cc(){}bd(){}F(){}Ea(){}Xb(){}};olympe.dc.Es=class{Md(){}W(){}G(){}};function de(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.kc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Qa(a){return a instanceof olympe.dc.kc&&this.tag===a.tag}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.kc(b.tag)}};olympe.dc.kc.sa=[olympe.dc.ne];olympe.dc.kc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.kc.prototype.Qa.J=olympe.D.H.C;function ee(a,b,c,d,e,f,g){e=e?k=>{fe(a,b,c);f(k)}:f;const h=a.db.model(b);d=new olympe.dc.Request(olympe.dc.Request.C.gg,ge(olympe.dc.ie(),b),{tag:b,model:h,content:c,mimeType:d});a.fc.request(d).then(e).catch(null!=g?g:a.L.error.bind(a.L))}function he(a,b,c,d,e,f){c=c instanceof olympe.D.Ja?c.valueOf():c;'string'===typeof c?c=new Blob([Fa(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));ee(a,b,c,d,a.F,e,f)}
473
- function fe(a,b,c){const d=olympe.dc.ja(b);a.C.set(d,c);const e=olympe.Y.jg();ie(a.db,d,f=>{f||(a.C.delete(d),je(a.db,d,e))},e)}
474
- function ke(a,b,c,d){olympe.D.gq([b.bq(),b.X(),b.Nk(),b.Ul()],(e,f,g)=>{if(a.C.has(f))c(a.C.get(f));else{var h=a.F?k=>{fe(a,f,k);c(k)}:c;e.valueOf()?(e=a.db.model(b),e=new olympe.dc.Request(olympe.dc.Request.C.Pf,ge(olympe.dc.ie(),b),{tag:f,model:e}),a.fc.request(e).then(h).catch(null!=d?d:a.L.error.bind(a.L))):(e=Rb(g),e.G=olympe.net.Ia.ResponseType.ph,a.G.C(e,k=>{const m=k.qd();200<=m&&300>m?h(k.getData()):null==d||d(`Failed to download file ${b}. Response code ${m}`)}))}})}
475
- olympe.dc.dr=class{constructor(a,b,c,d,e,f){this.L=a;this.db=b;this.G=c;this.fc=d;this.F=f;this.C=new Map}};function le(a,b){let c=me.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.xe(b);if(null===b)break;c=me.get(b)||null}let e;return null!=(e=c)?e:null}olympe.dc.xr=class{constructor(a,b,c){this.L=a;this.C=b;this.db=b.view;this.F=c;this.Ha=new FinalizationRegistry(d=>{this.L.C()&&this.L.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Ob([d])})}};function ne(a,b){a.origin=b;return a}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Pa.SELF;this.C=b;this.content=null!=c?c:null;this.F=null!=d?d:zc(olympe.auth.ge()).Ce()}getType(){return this.type}yc(){return this.F}uc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
476
- olympe.dc.Request.C={bc:1,me:10,Gn:24,Fk:25,gr:28,Mg:30,ij:31,Jy:32,Ei:33,Uh:40,Vh:41,Em:42,Po:43,qh:45,Gm:46,Bk:47,gg:50,Pf:51,Eg:52,it:60,Ks:61,fr:62,Lx:63,Hq:64,Bi:65,fn:91,hr:93,Xk:95,QUERY_RESULT:97};olympe.dc.Ph=class a{constructor(b,c,d,e,f,g,h,k){this.L=b;this.Z=c;this.C=h;this.sources=new Map;this.F=this.qa(k);this.G=new Map;this.ga(f,g,d,e)}request(b){this.L.debug('Router: sends',b);const c=this.O(b);return this.Lb(c).request(b)}T(b,c){this.L.debug('Router: subscribes',b);const d=this.O(b);return this.Lb(d).K(b,c)}$c(b){const c=b.uc();if(c===this.C){let d;null==(d=this.G.get(b.getType()))||d.forEach(e=>e(b))}else olympe.P.pb.publish(c,b).catch(d=>{this.L.error(`Error while publishing the message ${b} to remote router: ${d}`)})}K(b,
477
- c){let d=this.G.get(b);void 0===d&&(d=[],this.G.set(b,d));d.push(c)}ba(b){return this.sources.has(b)}Lb(b){let c;return null!=(c=this.sources.get(b))?c:this.sources.get(olympe.dc.Pa.Af)}O(b){var c=olympe.dc.Request.C.me,d=olympe.dc.Request.C.Fk,e=olympe.dc.Request.C.Gn,f=olympe.dc.Request.C.Ei,g=olympe.dc.Request.C.Uh;const h=olympe.dc.Request.C.qh,k=olympe.dc.Request.C.gg,m=olympe.dc.Request.C.Eg,n=olympe.dc.Request.C.Pf;switch(b.getType()){case c:d=this.F.get(a.C.me)||[];break;case d:case f:case e:d=
478
- this.F.get(a.C.Gs)||[];break;case g:case h:d=this.F.get(a.C.TRANSACTION)||[];break;case k:case n:case m:d=this.F.get(a.C.cr)||[];break;default:d=[]}c=b.content;e=olympe.auth.Ca.C.Fe;f=olympe.auth.Ca.C.wf;g=Qd(this.Z);e=!(g===e||g===f);for(var p of d){let q;d=p;f=c&&(null==(q=c)?void 0:q.W)&&c.W();g=d.get('type');if(g===a.F.Lh&&e||g===a.F.Jn&&d.get('id')===f||g===a.F.Hd)return p=p.get('destination'),this.L.debug('Request type',b.getType(),'with original destination',b.uc(),'is redirected to',p),p}return b.uc()}qa(b){const c=
479
- Object.values(olympe.dc.Ph.C),d=Object.values(olympe.dc.Ph.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const m=k.type;if(d.includes(m)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',m).set('destinations',n),h.push(n),m===a.F.Jn&&n.set('id',k.id)):this.L.error('Routing rule',f,m,'is not valid. Destinations must be stored in an array')}else this.L.error('Routing rule',f,m,'is not valid. Valid rules are',
480
- d.toString())})}else this.L.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.L.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}ga(b,c,d,e){const f=olympe.D.ef();this.sources.set(olympe.dc.Pa.SERVER,e.init(this));ie(b,this.C,()=>{this.sources.set(olympe.dc.Pa.Af,d.init(this));const g=new Map;olympe.dc.ua.from(this.C,this.C).lb(olympe.dm.DataSource.oi).filter(olympe.dc.query.Da.Qa(olympe.dm.DataSource.Wg,!0)).observe(f).subscribe(h=>
481
- {var k=oe(h);for(var m of k){const [p,q]=g.get(m);c.G(p);c.O(q);k=this.sources.get(m);this.sources.delete(m);var n=void 0;null==(n=k)||n.destroy()}h=pe(h);for(const p of h)if(h=p.X(),!this.sources.has(h)){const q=new olympe.dc.sources.bo(this.L,p);this.sources.set(h,q);m=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy());g.set(h,[m,n]);q.init(this)}});je(b,this.C,'router',!0)},'router')}};olympe.dc.Ph.C={me:'getContext',Gs:'query',TRANSACTION:'transaction',cr:'file'};
482
- olympe.dc.Ph.F={Hd:'default',Lh:'offline',Jn:'id'};olympe.dc.Ha={};const qe=olympe.dc.va.ORIGIN,re=olympe.dc.va.DESTINATION,me=new Map,se=new Map,te=new Map,ue=new Map;function ve(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.pm||[])];return olympe.dc.la.C(b,c,...a)}function we(a,b){ue.set(a,b);return a}function xe(a){return(a=me.get(a))&&a.F||olympe.dc.CloudObject}function ye(a,b,c){const d=a+'@'+(b===re?qe:re);if(se.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);se.set(d,c)}
483
- function ze(a){a=a.X()+'@'+a.La();return se.get(a)||olympe.dc.CloudObject}function R(a,b){b.NAME=a;te.set(a,b)}function S(a){return a.NAME||null}
484
- olympe.dc.la=class{constructor(){}static C(a,b,...c){if(me.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${me.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.U.pb(g):g}}b=new olympe.dc.Ha.Entry(a,b,d);me.set(a,b);return b.F.entry=b}static Rb(a){return(a=a.entry)&&a.X()||null}};function Ae(a,b){a.C=b}function T(a,b){b=b.Pb();ye(b.X(),b.La(),a.F);return b}function Be(a){a.G=!0;return a}
485
- olympe.dc.Ha.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.pm=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Yl()&&b.getParameter(olympe.dc.V.sn)){var d=olympe.dc.Aa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ka.ab('dc').error(d)}return this.pm?(a=[void 0,a].concat(qa(b,this.pm)),new c(...a)):new c(void 0,
486
- a)}ia(a){return new olympe.dc.Ha.Property(a)}oa(a,b=olympe.dc.va.DESTINATION){ye(a,b,this.F);return new olympe.dc.da.qe(a,b)}Yl(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Ha.Entry);olympe.dc.Ha.Entry.prototype.addRelation=olympe.dc.Ha.Entry.prototype.oa;olympe.dc.Ha.Entry.prototype.addProperty=olympe.dc.Ha.Entry.prototype.ia;olympe.dc.Ha.Entry.sa=[olympe.dc.ne];olympe.dc.Ha.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Ha.Property.prototype.getTag=olympe.dc.Ha.Property.prototype.X;olympe.dc.Ha.Property.sa=[olympe.dc.ne];olympe.dc.Ha.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ja(a);this.direction=b;this.origin=c;this.K=d}X(){return this.tag}La(){return this.direction}type(){return this.K}Pb(){return new olympe.dc.Ha.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.K,this.origin)}Qa(a){return a instanceof olympe.dc.Ha.Relation?a.X()===this.X()&&a.La()===this.La():!1}toString(){return this.direction+
487
- this.tag}};olympe.dc.Ha.Relation.prototype.getInverse=olympe.dc.Ha.Relation.prototype.Pb;olympe.dc.Ha.Relation.prototype.getDirection=olympe.dc.Ha.Relation.prototype.La;olympe.dc.Ha.Relation.prototype.getTag=olympe.dc.Ha.Relation.prototype.X;olympe.dc.Ha.Relation.sa=[olympe.dc.ne];olympe.dc.db={};function Ce(a,b){const c=a.G,d=olympe.dc.Aa(),e=olympe.dc.db.Database.C.Mh,f=olympe.dc.db.Database.C.Hd,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Ic('rev-'+b.W());a.L.debug('Generate the reverse graphLayer of',b.W());b.C.forEach((m,n)=>{if(m.K()){k.F(n,olympe.dc.Jb.NONE);for(const [r,t]of m.he())k.Xb(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(m.gf())for(const r of De(d,n,m.Z())){m=c.get(r);const t=new Map;m.forEach((u,w)=>{const x=w[0],y=w.substring(1);
488
- x===e?t.set(y,u):x===f?t.set(w,u):x===g?u.forEach((z,A)=>{k.Ea(y,A,r)}):x===h&&u.forEach((z,A)=>{k.Ea(y,r,A)})});m=m.source();k.Cc(r,m,t)}else{const r=new Map;for(const t of m.Bb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Ee(p,u,!0):p.Ma(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.bd(n,r);for(const [t,u,w]of m.he())w?k.Xb(t,n,u):k.Ea(t,n,u)}}});return k}
489
- function Fe(a,b,c){const d=b.W();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Ge(b,Ce(a,b));a.C.push(d);a.F.set(d,e);a.G.ji(c);a.write(b,!1)}function He(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.Zc(d):d,b)}
490
- olympe.dc.db.Oq=class{constructor(a,b,c,d){this.L=a;this.G=b;this.Aa=c;this.K=d;this.C=[];this.F=new Map}Zc(a){const b=a.W();this.C.includes(b)?this.push(b):this.write(He(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);He(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Ap(this.L,this.G,this.Aa,this.K,b)).write(a)}};
491
- function Ie(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.C.Ae(c);b.Bb().forEach((g,h)=>{f.ia(h,g);b.ub(h)});for(const [g,h,k,m]of b.Cb()){if(!m)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);Je(d,g,n,p)}}function Ke(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.C.Ae(f);b.Bb().forEach((h,k)=>{void 0!==c.Ma(k)&&(g.ia(k,h),b.ub(k))});for(const [h,k,m]of b.he()){const n=c.ld(h,e,k);void 0!==n&&(Je(d,h,f,k),n===m&&Je(a.C,h,f,k))}}
492
- class Ge{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.Aa()}W(){return this.F.W()}Zc(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.gf()?c.K()||Le(this.C,b,f.Z()):c.gf()?(Ie(this,f,c,a),Le(a,b,c.Z())):Ke(this,f,c,a))}return a}};const Me=olympe.dc.lc.hd,Ne=olympe.dc.lc.yh,Oe=olympe.dc.va.ORIGIN,Pe=olympe.dc.va.DESTINATION;
493
- olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Pa.SELF;this.L=b;this.cd=olympe.D.Oa();this.Z=olympe.dc.db.Database.G.IDLE;this.ga=new Map;this.Ba=[];this.O=[];this.qa=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Me.C.vk;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.we=new olympe.dc.db.Me(c,this,b,f);d.get('debug')&&this.hi()}W(){return this.id}getState(){return this.Z}ab(){return this.L}create(b,
494
- c,d,e=!1){var f=this.G(b,!0);if(!f.e&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.ba(f,!0)}e&&f.persist();d&&this.qc(f,d);this.F(a.F.On,b)}update(b,c){c&&(b=this.G(b,!0),this.qc(b,c))}Va(b){const c=this.get(b);void 0!==c&&(this.ba(c,!1),this.F(a.F.Pn,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Me:Qe(c,d);break;case Ne:Re(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case Me:Se(c,d);break;case Ne:Te(c,
495
- d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ue(this.G(c))}Ob(b){for(const c of b)(b=this.get(c))&&Ve(b)}ji(b){b.forEach(c=>{this.G(c).persist()})}ld(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.qn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.pn,b),c&&this.F(a.F.ul,b));return d}Cb(b){We(this.O[0],olympe.Y.jg(),b)}T(b){this.O[0].C.delete(b)}F(b,c,...d){this.ga.has(b)&&this.ga.get(b).forEach(e=>{e(c,...d)})}ba(b,
496
- c){this.qa.set(b,c)}Hf(b,c,d,e){let f;null!=(f=this.O[0])&&Xe(f,b).ia(e?Ye+c:c,d)}di(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===Ze?f?Xe(g,b).link(c,e):Xe(g,b).unlink(c,e):f?Xe(g,b).Vb(c,e):Xe(g,b).qc(c,e))}Vb(b,c,d){let e;null!=(e=this.O[0])&&Xe(e,b).Ad(c,d)}C(b,c){let d=this.ga.get(b);void 0===d&&(d=[],this.ga.set(b,d));d.push(c)}nb(b){this.Ba.push(b)}K(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}ve(){this.Z===a.G.IDLE&&(this.Z=a.G.Aq);this.O.unshift(new olympe.dc.db.$q(this,this.cd))}Ad(){this.Z=
497
- a.G.Ge;this.em();$e(this.O[0]);this.O.shift();0===this.O.length&&(this.Z=a.G.IDLE,this.Ba.forEach(b=>{b()}),af(this.we))}qc(b,c){const d=a.C.Hd;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const m=bf+e;var g=c.get(m);(void 0===g?null:g)!==f&&(g=cf+e,null===f?(c.delete(m),f=(f=c.xe())&&Ee(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),df(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(m,f),df(c,(new Map).set(e,f))))}else b.update(h,k)}em(){const b=this.O[0];
498
- for(const [c,d]of this.qa)this.Wb(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,ef(e)):(ff(e),e.e=f),e.db.F(f?U.zk:U.oc,e.C));return g}).forEach(e=>{e=e.tag();d?Xe(b,e).create():Xe(b,e).delete()});this.qa.clear()}Wb(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Oe+Me)))for(const f of c.values())this.Wb(b,f,d);return d}hi(){const b=a.F.zk,c=a.F.kj,d=new Set,e=new Map;this.C(a.F.On,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===
499
- Ne&&g[1]===Pe){const h=g[2];this.get(h).Ua()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.nb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.L.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.L.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});
500
- e.clear()})}};olympe.dc.db.Database.C={Mh:'$',sr:'~',Hd:'?',dk:'=',Ln:'|',Rm:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.F={pn:0,qn:1,sp:2,ul:3,Sm:4,Tm:5,zk:6,oc:7,kj:8,gl:9,On:10,Pn:11,Jo:12};olympe.dc.db.Database.G={IDLE:0,Aq:1,Ge:2};function gf(a,b,c=[]){const d=b.W();Fe(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(He(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function hf(a,b){a.C.nb(b)}olympe.dc.db.Wq=class{constructor(a,b,c,d,e){this.L=a;this.C=b;this.view=c;this.F=new olympe.dc.db.Oq(a,b,c,d);this.Av=new olympe.dc.db.ns(a,c,b,e)}ab(){return this.L}Zc(a){this.F.Zc(a)}};const jf=olympe.dc.db.Database.C.ORIGIN,kf=olympe.dc.db.Database.C.DESTINATION,lf=olympe.dc.db.Database.C.Mh,mf=olympe.dc.db.Database.C.Hd,nf=olympe.dc.db.Database.C.dk,of=olympe.dc.db.Database.C.Ln,pf=jf+kf,qf=lf+lf,rf=olympe.dc.db.Database.G;let sf=0;function ie(a,b,c,d){a=a.C.G(olympe.dc.ja(b));d=null!=d?d:tf();uf(a,'',d,c)&&a.Ua()&&c(!0,b);return d}
501
- function je(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=vf(e,'',c);void 0!==f&&(a.C.getState()!==rf.Ge||e.K()&&!d||a.C.T(c),d||!e.Ua()&&!e.K()||f(!1,b))}}function De(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.Kj(h,f).forEach(([k,,,m])=>{m&&g.add(k)})}.bind(null,a,b,c)}}function tf(){++sf;return String(sf)}
502
- function wf(a,b,c,d,e){a=a.C.G(olympe.dc.ja(b));c=olympe.dc.ja(c);b=lf+c;e=null!=e?e:tf();if(uf(a,b,e,d)&&a.Ua()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(nf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.C.get(olympe.dc.ja(b));return!a||c&&!a.Ua()?null:a}function xf(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.ja(c),vf(b,lf+c,d),a.C.getState()===rf.Ge&&a.C.T(d))}
503
- function yf(a,b,c,d){a=a.C.G(olympe.dc.ja(b));d=null!=d?d:tf();uf(a,qf,d,c)&&a.Ua()&&a.forEach((e,f)=>{const g=f[0];g!==lf&&g!==nf||c(f.substring(1),e,g===nf)});return d}function zf(a,b,c){b=V(a,b);null!==b&&(vf(b,qf,c),a.C.getState()===rf.Ge&&a.C.T(c))}function Af(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ua()||!c&&g.K())e?d(b.substring(1),b[0],c,h):d(c,h)})}
504
- function W(a,b,c,d,e){a=a.C.G(olympe.dc.ja(b));c=c.La()+c.X();e=null!=e?e:tf();(d=Bf(a,c,e,d))&&a.Ua()&&Af(a,c,!0,d,!1);return e}function Cf(a,b,c,d){const e=a.C.G(olympe.dc.ja(b));a=null!=d?d:tf();const f=Bf(e,pf,a,c);f&&e.Ua()&&e.forEach((g,h)=>{g=h[0];g!==jf&&g!==kf||Af(e,h,!0,f,!0)})}function Df(a,b,c){const d=V(a,b);if(null!==d){const e=vf(d,pf,c);void 0!==e&&(a.C.getState()!==rf.Ge||d.K()||a.C.T(c),!d.Ua()&&!d.K()||d.forEach((f,g)=>{f=g[0];(f===jf||f===kf)&&e&&Af(d,g,!1,e,!0)}))}}
505
- function Ef(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.hl,e=olympe.dm.Relation.C.Ms,f=olympe.dm.Relation.C.tl,g=olympe.dm.Relation.C.Ko,h=lf+c,k=[];b.forEach((m,n)=>{const p=n[0];if(m instanceof olympe.dc.kc&&p===lf)(m=a.C.get(m.X()))&&k.push([m,n.substring(1),null,!0]);else if(p===jf){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&m.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===kf){const q=n.substring(1);let r,t;const u=
506
- null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&m.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function Ff(a,b,c,d,e){const f=a.C.G(olympe.dc.ja(b));e=null!=e?e:tf();const g=Bf(f,of+c,e,d);g&&f.Ua()&&Ef(a,b,c).forEach(([h,...k])=>{h.Ua()&&g(...k,!0,h.tag())})}function Gf(a,b,c,d){const e=V(a,b);if(null!==e){const f=vf(e,of+c,d);void 0!==f&&(a.C.getState()!==rf.Ge||e.K()||a.C.T(d),!e.Ua()&&!e.K()||Ef(a,b,c).forEach(([g,...h])=>{(g.Ua()||g.K())&&f(...h,!1,g.tag())}))}}
507
- function Hf(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===mf&&b.set(c.substring(1),d);return b}function If(a,b,c){return c===olympe.dc.Jb.NONE?0:a.Ma(b,c,!0)||0}function Jf(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===jf||c===kf){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
508
- function Kf(a,b,c){if(!a.Ua(b))return a.L.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ja(b)];for(const f of e){const g=a.fb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.L.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ja(b)}`);return d}function Lf(a,b,c,d){return(c=(a=V(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ua()).length:0}
509
- olympe.dc.$a=class{constructor(a,b){this.L=a;this.C=b}W(){return this.C.W()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.La()+b.X();const e=vf(a,b,c);void 0!==e&&(this.C.getState()!==rf.Ge||a.K()&&!d||this.C.T(c),d||!a.Ua()&&!a.K()||Af(a,b,!1,e,!1))}}Ua(a){a=this.C.get(olympe.dc.ja(a));return!(null==a||!a.Ua())}name(a){let b,c;return null!=(c=null==(b=V(this,a))?void 0:b.Ma(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=V(this,a,!0))?a.model():null)?a.tag():null}xe(a){return(a=(a=V(this,
510
- a,!0))&&a.xe())?a.tag():null}Tj(a){a=V(this,a,!0);return!(!a||!a.xe())}sd(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.ki(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Jf(a){a=V(this,a,!1);return!a||a.O}Ma(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Ma(olympe.dc.ja(b),c);return void 0!==a?a:null}Bb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===lf||!b&&c===nf)&&a.set(d.substring(1),e);return a}Kj(a,b){return Ef(this,a,b).filter(([c])=>c.Ua()).map(([c,
511
- ...d])=>[c.tag(),...d])}fb(a,b){return this.Lj(a,[b])}cm(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.La()+b.X()))?void 0:e.get(olympe.dc.ja(c));return!(null==a||!a.Ua())}Lj(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.La()+c.X()),void 0!==a)for(const e of a.values())e.Ua()&&b.push(e.tag());a=b}return a}Sb(a,b){var c=V(this,a,!0);return c?(c=c.get(b.La()+b.X()))&&1<c.size?(this.L.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),
512
- null):(a=c?c.values().next().value:null)&&a.Ua()?a.tag():null:null}og(a,b,c){a=olympe.dc.ja(a);const d=Kf(this,a,b);d.delete(a);return c?(c=olympe.dc.ja(c),d.has(c)?Array.from(Kf(this,c,b.Pb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Qp(a,b,c){if(!this.Ua(a))return null;b=Kf(this,a,b);const d=[olympe.dc.ja(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Ml(a,b,c){return this.Lj(a,b).find(c)||null}Xt(a,b,c){return this.Lj(a,
513
- b).filter(c)}Up(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.xe();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ua())throw a=`Try to get all extensions of the model ${olympe.dc.ja(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=V(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
514
- return e.map(f=>f.tag())}ki(a,b){const c=olympe.dc.ja(b);return!!this.Qp(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Sd(a){return this.fb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.$a.prototype.getInstances=olympe.dc.$a.prototype.Sd;olympe.dc.$a.prototype.isExtending=olympe.dc.$a.prototype.ki;olympe.dc.$a.prototype.getExtendedModels=olympe.dc.$a.prototype.Up;olympe.dc.$a.prototype.findAllRelated=olympe.dc.$a.prototype.Xt;olympe.dc.$a.prototype.findRelated=olympe.dc.$a.prototype.Ml;
515
- olympe.dc.$a.prototype.findRecursive=olympe.dc.$a.prototype.Qp;olympe.dc.$a.prototype.getRecursiveRelated=olympe.dc.$a.prototype.og;olympe.dc.$a.prototype.getUniqueRelated=olympe.dc.$a.prototype.Sb;olympe.dc.$a.prototype.getMultiRelated=olympe.dc.$a.prototype.Lj;olympe.dc.$a.prototype.isRelated=olympe.dc.$a.prototype.cm;olympe.dc.$a.prototype.getRelated=olympe.dc.$a.prototype.fb;olympe.dc.$a.prototype.getProperties=olympe.dc.$a.prototype.Bb;olympe.dc.$a.prototype.getProperty=olympe.dc.$a.prototype.Ma;
516
- olympe.dc.$a.prototype.isPersisted=olympe.dc.$a.prototype.Jf;olympe.dc.$a.prototype.instanceOf=olympe.dc.$a.prototype.sd;olympe.dc.$a.prototype.isModel=olympe.dc.$a.prototype.Tj;olympe.dc.$a.prototype.extension=olympe.dc.$a.prototype.xe;olympe.dc.$a.prototype.model=olympe.dc.$a.prototype.model;olympe.dc.$a.prototype.name=olympe.dc.$a.prototype.name;olympe.dc.$a.prototype.exist=olympe.dc.$a.prototype.Ua;const Mf=olympe.dc.db.Database.C.ORIGIN,Ze=olympe.dc.db.Database.C.DESTINATION,Ye=olympe.dc.db.Database.C.dk,Nf=olympe.dc.db.Database.C.Mh,Of=olympe.dc.db.Database.C.Ln,Pf=olympe.dc.db.Database.C.Rm,Qf=Mf+Ze,Rf=Nf+Nf,Sf=Array.from(Object.values(olympe.dc.Jb)).filter(a=>null!==a);function We(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
517
- function $e(a){const b=a.K;a.F.forEach((c,d)=>{var e=b.get(d);if(c.K()||c.gf()){var f=e.get(Pf);f&&Tf(a,f,c.K(),d);c.gf()&&a.O.add(d)}for(const [n,p]of c.Bb()){var g=n[0]===Ye,h=g?n.substring(1):n;f=a;var k=e,m=p;const q=k.get(Pf+Nf+h);q&&Tf(f,q,m,g);(k=k.get(Pf+Rf))&&Tf(f,k,h,m,g)}for(const n of c.Cb())Uf(a,e,...n);(e=c.qa)&&Vf(a,b.get(e),c.Wb,!c.gf(),d)});a.F.clear();a.G.clear();Wf(a)}function Xe(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yf(b),a.F.set(b,c));return c}
518
- function Tf(a,b,...c){b.forEach((d,e)=>{We(a,e,d.bind(null,...c))})}function Uf(a,b,c,d,e,f){var g=b.get(Pf+d+c);g&&Tf(a,g,f,e);(g=b.get(Pf+Qf))&&Tf(a,g,c,d,f,e);Xf(a,c,d).forEach((h,k)=>{(k=b.get(Pf+Of+k))&&Tf(a,k,c,d,h,f,e)})}function Vf(a,b,c,d,e){Sf.forEach(f=>{(f=b.get(Pf+Of+f))&&Tf(a,f,c,null,!0,d,e)})}function Wf(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
519
- function Xf(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.K.get(b);e=new Map;Sf.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(Nf+g))?h:0;(c===Mf?12:3)&k&&e.set(g,!!((c===Mf?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.$q=class{constructor(a,b){this.K=a;this.T=b;this.F=new Map;this.O=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function af(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.Me.C.wm:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.Me.C.Ws:a.G=!0,a.run()}}
520
- olympe.dc.db.Me=class{constructor(a,b,c,d){this.L=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.Me.C.vk&&this.init()}run(){const a=this.C;this.L.debug('Start garbage collector with',this.F.size,'instances to check');for(const b of this.F){const c=a.get(b);!c||0<c.c||(this.L.debug('Remove unused instance',b,'from database'),a.ld(b))}this.F.clear();this.G=!1}init(){const a=olympe.dc.db.Database.F.sp,b=olympe.dc.db.Database.F.Pn,c=olympe.dc.db.Database.F.Jo,d=olympe.dc.db.Database.G.IDLE,
521
- e=f=>{this.F.add(f);this.C.getState()===d&&af(this)};this.C.C(olympe.dc.db.Database.F.ul,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.C(c,(f,...g)=>{this.L.error(g[0])})}};olympe.dc.db.Me.C={vk:0,Ws:1,wm:2};olympe.dc.db.Me.F=5E3;function Le(a,b,c=olympe.dc.Jb.NONE){b=a.Kj(b,c);for(const d of b)Yf(a,d,!1),a.C.delete(d)}function Je(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.T(b,olympe.dc.va.DESTINATION,d);a&&a.T(b,olympe.dc.va.ORIGIN,c)}function Zf(a,b,c){let d=a.C.get(b);void 0===d&&(d=new olympe.dc.db.yf(b),a.C.set(b,d));return c?d.Va(c):d}
522
- function Yf(a,b,c){const d=olympe.dc.va.ORIGIN,e=olympe.dc.va.DESTINATION,f=a.C.get(b);for(const [h,k,m]of f.he())if(m||!c){f.T(h,e,k);var g=a.C.get(k);g&&g.T(h,d,b)}for(const [h,k,m]of f.Ob())if(m||!c)f.T(h,d,k),(g=a.C.get(k))&&g.T(h,e,b)}
523
- function $f(a,b){var c=olympe.dc.Aa();if(c.Ua(b)){const d=c.model(b),e=c.source(b),f=c.Bb(b,!0);Hf(c,b).forEach((g,h)=>{f.set(`${olympe.dc.Ri.Hd}${h}`,g)});a.Cc(b,e,f,d);(c=c.xe(b))&&a.Ea(olympe.dc.lc.yh,b,c);f.forEach(g=>{g instanceof olympe.dc.kc&&$f(a,g.X())})}}function*ag(a,b,c,d,e=[]){e.push(b);b=a.Ae(b);for(const [f,g]of b.fb(c))e.includes(f)||(yield*ag(a,f,c,d,e),yield d(f,g))}
524
- olympe.dc.db.Ic=class{constructor(a){this.id=null!=a?a:olympe.Y.$e();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substring(0,a.length-2));return a+'}}'}static tc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Ic(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.yf.tc(b[c]);a.C.set(c,d)}return a}W(){return this.id}Md(a){const b=
525
- olympe.dc.db.yf.C.Vk,c=olympe.dc.db.yf.C.oc,d=olympe.dc.db.yf.C.wj;this.C.forEach((e,f)=>{const g=e.Dd();switch(e.getState()){case b:const h=e.Lb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.ba()?e.Bb():void 0;a.Cc(f,h,k,g);break;case d:e.ba()&&a.bd(f,e.Bb(),g);break;case c:a.F(f,e.Z(),g)}for(const [h,k,m]of e.he())e=this.C.get(k),m?a.Ea(h,f,k,g,e.Dd()):a.Xb(h,f,k,g,e.Dd())})}hh(){return 0===this.C.size}G(){let a=0;this.C.forEach(b=>{a+=b.cd()});
526
- return a}Cc(a,b,c,d=null){b=Zf(this,a).create(b);'string'===typeof d&&this.Ea(olympe.dc.lc.hd,a,d,d,null);c&&b.Bl(c)}bd(a,b,c=null){b&&Zf(this,a,c).Bl(b)}F(a,b=olympe.dc.Jb.NONE,c=null){const d=this.C.get(a);if(d&&d.K())Le(this,a,b);else{Zf(this,a,c).delete(b);for(const e of this.Kj(a,b,!1))this.C.get(e).Bb().clear(),Yf(this,e,!0)}}Ea(a,b,c,d=null,e=null){Zf(this,b,d).link(a,c);Zf(this,c,e).Vb(a,b)}Xb(a,b,c,d=null,e=null){Zf(this,b,d).unlink(a,c);Zf(this,c,e).qc(a,b)}Sd(){return function*(a){for(const b of a.values())if(b.K()||
527
- b.gf()||b.ba())yield b}(this.C)}Ae(a){return this.C.get(olympe.dc.ja(a))||null}he(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.he((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}og(a,b,c=(d,e)=>[d,e]){return ag(this,a,b,c)}Kj(a,b,c=!0){const d=olympe.dm.Relation.C.hl,e=olympe.dm.Relation.C.tl,f=olympe.dc.va.ORIGIN,g=olympe.dc.Aa();a=new Set([a]);const h=new Set;for(const m of a){var k=this.C.get(m);if(void 0!==k){for(const [n,p,q]of k.he())q&&If(g,n,b)&e?
528
- a.add(p):c||q||h.add(`${m}.${n}.${p}`);for(const [n,p,q]of k.Ob())q&&If(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${m}`)}for(const [n,p,q]of Jf(g,m))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${m}`:`${m}.${n}.${q}`)&&If(g,n,b)&k&&a.add(q)}return Array.from(a).filter(m=>this.C.has(m))}};olympe.dc.db.Ic.sa=[olympe.dc.Writable,olympe.dc.Es];const U=olympe.dc.db.Database.F,bg=olympe.dc.db.Database.C.Mh,cf=olympe.dc.db.Database.C.sr,bf=olympe.dc.db.Database.C.Hd,cg=olympe.dc.db.Database.C.dk,dg=olympe.dc.db.Database.C.Rm,X=olympe.dc.va.ORIGIN,Y=olympe.dc.va.DESTINATION,eg=olympe.dc.lc.hd,fg=olympe.dc.lc.yh;function Ee(a,b,c=!1){const d=a.get(bf+b);return c||void 0!==d?d:a.get(cf+b)}
529
- function Qe(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(eg,c)}a.link(eg,b);b.forEach((d,e)=>{if(e[0]===bf||e[0]===cf)e=e.substring(1),gg(a,e,d)});null===a.G||!b.e&&b!==a||a.db.ba(a,!0)}function Re(a,b){const c=a.xe();if(null!==c){if(c===b)return;a.unlink(fg,c)}a.link(fg,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===bf||f[0]===cf)f=f.substring(1),a.has(bf+f)||(a.set(cf+f,e),d.set(f,e))});df(a,d)}
530
- function Se(a,b){a.unlink(eg,b);a.forEach((c,d)=>{c=d.substring(1);gg(a,c,null)});a.db.ba(a,!1)}function Te(a,b){a.unlink(fg,b);const c=new Map;a.forEach((d,e)=>{e[0]===cf&&(a.delete(e),d=e.substring(1),c.set(d,null))});df(a,c)}function Ue(a){a.c++;1===a.c&&a.db.F(U.sp,a.C)}
531
- function Ve(a){0<a.c?--a.c:a.db.F(U.Jo,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.F(U.ul,a.C)}function uf(a,b,c,d){const e=hg(a,dg+b);return e.has(c)?!1:(e.set(c,d),Ue(a),a.db.F(U.Sm,a.C,b,c),!0)}
532
- function vf(a,b,c){const d=ig(a,dg+b,c);void 0!==d&&(Ve(a),a.db.F(U.Tm,a.C,b,c));return d}function Bf(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?Ue(g):Ve(g));d(...f)};return uf(a,b,c,e)?e:null}function jg(a){void 0!==a.F&&(Ve(a),a.db.Vb(a.C,a.F.tag,a.F.Ga),a.F=void 0)}function kg(a,b,c,d){a.e&&a.db.Hf(a.C,b,c,d)}
533
- function df(a,b,c=[]){const d=a.get(X+eg);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>gg(e,g,f))});a=a.get(X+fg);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(bf+k)||(g.set(k,h),null!==h?e.set(cf+k,h):e.delete(cf+k))});df(e,g,[...c,f])}})}function hg(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function lg(a,b,c,d,e){a.db.di(a.C,b,c,d.C,e)}
534
- function ig(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function gg(a,b,c){if(!a.has(bg+b)){const d=cg+b,e=a.get(d);c!==(void 0!==e?e:null)&&(null===c?a.delete(d):a.set(d,c),kg(a,b,c,null!==c))}}function ef(a){a.forEach((b,c)=>{const d=c[0];if(d===X||d===Y){const e=c.substring(1),f=d===X?Y:X;b.forEach(g=>{g.e&&(lg(a,e,d,g,!0),lg(g,e,f,a,!0))})}else if(d===bg||d===cg)c=c.substring(1),kg(a,c,b,d===cg)})}
535
- function ff(a){a.forEach((b,c)=>{const d=c[0];if(d!==dg){var e=c.substring(1);d===X?b.forEach(f=>{f.unlink(e,a)}):d===Y?b.forEach(f=>{a.unlink(e,f)}):d===bg&&a.update(e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag);let c,d;(null==(c=b.get(bg+a.F.Ga))?void 0:null==(d=c.X)?void 0:d.call(c))===a.C&&b.update(a.F.Ga,null)}}
536
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ua(){return this.e}K(){return this.db.K(this.C)}source(){return this.G}model(){const a=this.get(Y+eg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}xe(){const a=this.get(Y+fg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ma(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
537
- var b=this.model();if(b){var c=b.Ma(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.xe())?(c=b.Ma(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Ma(a,b=!1){const c=this.get(bg+a);return b||void 0!==c?c:this.get(cg+a)}update(a,b){const c=bg+a;var d=this.get(c),e=d=void 0===d?null:d;(e instanceof
538
- Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Qa?e.Qa(b):e===b)||(d instanceof olympe.dc.kc&&(jg(this.db.get(d.X())),this.db.Va(d.X())),b instanceof olympe.dc.kc&&(d=this.db.G(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.ab().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.Ga+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(Ue(d),d.db.Vb(d.C,
539
- e,a)),d.F={tag:e,Ga:a}),d=cg+a,null===b?(this.delete(c),b=(b=this.model())&&Ee(b,a),void 0!==b?(this.set(d,b),kg(this,a,b,!0)):kg(this,a,null,!1)):(this.set(c,b),this.delete(d),kg(this,a,b,!1)))}link(a,b){var c=X+a;const d=hg(this,Y+a);c=hg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(U.kj,this.C,a,Y,b.C),this.db.F(U.kj,b.C,a,X,this.C),this.e&&b.e&&(lg(this,a,Y,b,!0),lg(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==ig(this,Y+a,b.C)&&(ig(b,c,this.C),this.db.F(U.gl,this.C,a,Y,b.C),
540
- this.db.F(U.gl,b.C,a,X,this.C),this.e&&b.e&&(lg(this,a,Y,b,!1),lg(b,a,X,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===bg&&a instanceof olympe.dc.kc&&jg(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(bg+this.F.Ga)}};olympe.dc.db.yf=class a{constructor(b){this.nb=b;this.O=this.ga=null;this.Yb=olympe.dc.Jb.NONE;this.G=a.C.wj;this.F=this.C=this.Wb=this.qa=this.properties=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.nb)+', "model": '+JSON.stringify(this.O)+', "src": '+JSON.stringify(this.ga)+', "state": '+JSON.stringify(this.G);if(this.properties){b+=', "properties": {';for(var c of this.properties.keys()){const d=this.properties.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);
541
- b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static tc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.yf(c.tag);b.O=c.model;b.ga=c.src;b.G=c.state;const d=
542
- c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.kc.tc(f):h=olympe.D.tc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.nb}Dd(){return this.O}Lb(){return this.ga}getState(){return this.G}Va(b){if(null===this.O)this.O=b;else if(this.O!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.O}`);
543
- return this}Z(){return this.G===a.C.oc?this.Yb:olympe.dc.Jb.NONE}create(b){this.G=a.C.Vk;this.ga=null!=b?b:null;return this}delete(b=olympe.dc.Jb.NONE){this.G=a.C.oc;this.Yb=b;this.properties=null;return this}ia(b,c){if(this.G===a.C.oc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Bl(b){this.G!==a.C.oc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Ad(b,c){if(null!==this.qa&&this.qa!==b)throw Error('An instance should never be set as complex property of multiple instances');
544
- this.qa=b;this.Wb=c}ub(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.lc.hd&&this.Va(c);this.oa(this.C,b,c,!0);return this}unlink(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.lc.hd&&this.Va(c);this.oa(this.C,b,c,!1);return this}Vb(b,c){null===this.F&&(this.F=new Map);this.oa(this.F,b,c,!0)}qc(b,c){null===this.F&&(this.F=new Map);this.oa(this.F,b,c,!1)}ld(b,c,d){if(c=c===olympe.dc.va.ORIGIN?
545
- this.F:this.C)return(b=c.get(b))&&b.get(d)}T(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.F:this.C)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}K(){return this.G===a.C.Vk}gf(){return this.G===a.C.oc}cd(){let b=this.properties?this.properties.size:0;this.C&&this.C.forEach(c=>{b+=c.size});return b}ba(){return null!==this.properties}Bb(){let b;return null!=(b=this.properties)?b:new Map}Ma(b){if(this.properties)return this.properties.get(b)}fb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,
546
- f]of d)yield c(e,f)}(b.La()===olympe.dc.va.ORIGIN?this.F:this.C)}Sb(b){const c=b.La()===olympe.dc.va.ORIGIN?this.F:this.C;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}he(b=(c,d,e)=>[c,d,e]){return this.Ba(this.C,b)}Ob(b=(c,d,e)=>[c,d,e]){return this.Ba(this.F,b)}Cb(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,m)=>b(h,d,k,m));yield*e(g,(h,k,m)=>b(h,c,k,m))}(this.Ba.bind(this),this.C,this.F)}oa(b,c,d,e){if(this.G!==
547
- a.C.oc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*Ba(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.yf.C={Vk:0,wj:1,oc:2};olympe.dc.db.ns=class{constructor(a,b,c,d){this.L=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.ja(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ua()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Mh+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
548
- d.join(' --M--\x3e ')}this.L.info(a)}else this.L.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.qn,b=olympe.dc.db.Database.F.zk,c=olympe.dc.db.Database.F.oc,d=olympe.dc.db.Database.F.kj,e=olympe.dc.db.Database.F.gl,f=olympe.dc.db.Database.F.Sm,g=olympe.dc.db.Database.F.Tm,h=()=>{};this.C.C(olympe.dc.db.Database.F.pn,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.Cb(()=>{Cf(this.view,k,h,`monitorRelations${k}`)})});this.C.C(c,
549
- k=>{this.C.Cb(()=>{Df(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.Ap=class{constructor(a,b,c,d,e){this.L=a;this.C=b;this.Aa=c;this.G=d;this.K=e}write(a){if(this.G){const b=new mg(this.Aa);a.Md(b);this.L.info(b.flush())}this.C.ve();a.Md(this);this.C.Ad()}Cc(a,b,c){this.C.create(a,b,c,this.K)}bd(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Jb.NONE){for(const c of De(this.Aa,a,b))this.C.Va(c)}Ea(a,b,c){this.C.link(a,b,c)}Xb(a,b,c){this.C.unlink(a,b,c)}};
550
- function ng(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.kc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.pg()+','+f.ng()+','+f.lg()+','+f.kg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=ng(a,f,
551
- (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function og(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function pg(a,b){let c;return b===olympe.dc.lc.hd?'Model':null!=(c=a.db.name(b))?c:b}
552
- class mg{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Cc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${ng(this,c)})`,og(this,d))}bd(a,b,c){this.log(`updateInstance(tag: ${a}, ${ng(this,b)})`,og(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,og(this,c))}Ea(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,pg(this,a))}Xb(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
553
- pg(this,a))}}olympe.dc.db.Ap.sa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={ya:'dc.db.Logger',Dk:'dc.db.gc.Logger',Fa:'dc.db.DatabaseManager',Hi:'dc.db.Database',sk:'dc.db.DBView',Mx:'dc.db.Graph',Kw:'dc.db.DatabaseWriter',Cy:'dc.db.PermissionProcessor',Jh:'dc.db.GraphMonitor'};olympe.dc.db.V={Bn:'db.garbageCollector',Cn:'db.garbageCollectorDelay',Jh:'db.monitor',hn:'db.debug'};
554
- olympe.U.config(function(a){F(a,olympe.dc.db.V.Bn,olympe.dc.db.Me.C.wm);F(a,olympe.dc.db.V.Cn,5E3);F(a,olympe.dc.db.V.Jh,!1);F(a,olympe.dc.db.V.hn,!1);E(a,olympe.dc.db.R.ya,[olympe.ka.R.Fa],b=>b.Dc('db'));E(a,olympe.dc.db.R.Dk,[olympe.ka.R.Fa],b=>b.Dc('gc'));E(a,olympe.dc.db.R.Hi,[olympe.dc.db.R.ya,olympe.dc.db.R.Dk,new olympe.U.ma(olympe.dc.V.cg),new olympe.U.ma(olympe.dc.db.V.Bn),new olympe.U.ma(olympe.dc.db.V.Cn),new olympe.U.ma(olympe.dc.V.Pg),new olympe.U.ma(olympe.dc.db.V.hn)],(b,c,d,e,f,g,
555
- h)=>{e=g?olympe.dc.db.Me.C.vk:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.R.sk,olympe.dc.$a,olympe.dc.db.R.ya,olympe.dc.db.R.Hi);E(a,olympe.dc.db.R.Jh,[olympe.dc.db.R.Fa],b=>b.Av);D(a,olympe.dc.db.R.Fa,olympe.dc.db.Wq,olympe.dc.db.R.ya,olympe.dc.db.R.Hi,olympe.dc.db.R.sk,new olympe.U.ma(olympe.dc.V.qf),new olympe.U.ma(olympe.dc.db.V.Jh))},'olympe.dc.db');
556
- olympe.U.run([olympe.dc.db.R.Hi,olympe.dc.db.R.Jh],(a,b)=>{olympe.Ij().db=a;olympe.Ij().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function qg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
557
- olympe.dc.query.He=class{constructor(a,b,c){this.db=olympe.dc.Aa();this.C=a;this.Ga=b;this.Ih=c}ha(){return{p:this.Ga.X(),o:this.Ih}}toString(){return'sortByQueryPart-'+this.Ih+this.Ga.X()}mg(){const a=this.db.Sb(this.Ga,olympe.dm.Property.typeRel),b=olympe.dc.ja;if(a===b(olympe.dm.String))return qg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return qg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return qg((c,d)=>c.getTime()-d.getTime());olympe.ka.ab('dc.query').warn(`No comparator found for type with tag ${a}`);
558
- return qg(()=>-1)}Ma(){return this.Ga}};function rg(a,b){return new olympe.dc.query.wd((new olympe.dc.transaction.aj(b)).C(a),b)}olympe.dc.query.wd=class{constructor(a,b){this.C=a;this.source=b}static Nl(a){return new olympe.dc.query.wd(new olympe.dc.db.Ic(`DataResult_${a.W()}`),a.Lb())}create(a,b,c){this.C.Cc(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Vc(){return this.C}ha(){const a=new olympe.dc.transaction.Yf;this.C.Md(a);return{s:this.source,p:sg(a)}}};
559
- olympe.dc.query.wd.prototype.createRelation=olympe.dc.query.wd.prototype.Ea;olympe.dc.query.wd.prototype.create=olympe.dc.query.wd.prototype.create;olympe.dc.query.wd.fromQuery=olympe.dc.query.wd.Nl;olympe.dc.ne=class{X(){}};olympe.dc.ne.prototype.getTag=olympe.dc.ne.prototype.X;olympe.dc.Ox=olympe.dc.ne;function tg(a){let b;if(null==(b=a.C)?0:b.hh())if(a=a.K,!a.O){let c;null==(c=a.T)||c.call(a)}}function ug(a,b,c,d,e){tg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.Xb(c,d,e)}
560
- olympe.dc.query.us=class{constructor(a,b,c,d){this.L=a;this.source=b;this.G=c;this.K=d;this.C=this.F=null;this.db=olympe.dc.Aa()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.G}:${a}:notif`;ie(this.db,a,(d,e)=>{if(d){tg(this);let f;null==(f=this.C)||$f(f,e)}else if(b&&zf(this.db,e,c),!this.db.Ua(e)){tg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Jb.NONE)}},c);b&&yf(this.db,a,(d,e,f)=>{tg(this);let g;f||null!=(g=this.C)&&g.bd(a,new Map([[d,e]]))},c)}}stop(a){je(this.db,a,`${this.G}:${a}:notif`)}};olympe.dc.query.bj={ASC:'ASC',DESC:'DESC'};function vg(a){const b=wg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].W():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),m=new Set(k.Sd()),n=new Map,p=a.K.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,x)=>{for(const y of k.F(x)){let z;n.set(y,Array.from(w).map(A=>p?`${x};${A}`:A).reduce((A,J)=>A.add(J),null!=(z=n.get(y))?z:new Set))}m.delete(x)});t&&m.forEach(w=>{const x=p?`${w};${u}`:u;for(const y of k.F(w)){let z;n.set(y,
561
- (null!=(z=n.get(y))?z:new Set).add(x))}})}else m.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),w=new Map;n.forEach((x,y)=>{let z;null==(z=r.get(y))||z.forEach(A=>{let J;const M=null!=(J=w.get(y))?J:new Set;x.forEach(Ka=>M.add(Ka+A));w.set(y,M)});n.delete(y);r.delete(y)});t&&n.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>z+u)))});b[e-1].T()&&r.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>
562
- q+z)))});c.set(g,[w,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function xg(a){if(null===a.F){const b={yb:a.query.mg(),ad:a.ad,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Ka.from(a.Z,vg(a),b)}return a.F}function yg(a,b){a.T=b}function zg(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
563
- function Ag(a,b){let c;return null!=(c=a.C.get(b).Sd())?c:[]}function Bg(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Cg(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.L.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&zg(a);let g;f&&(null==(g=a.je)||g.watch(b,a.K.has(c)));return f}function Dg(a,b,c,d,e,f){null!==a.je&&(d===olympe.dc.va.ORIGIN?ug(a.je,b,c,f,e):ug(a.je,b,c,e,f))}
564
- function Eg(a){a.L.C()&&a.L.debug(`Start sending notifications for query ${a.query.W()}`);const b=new olympe.dc.query.us(a.L,a.query.Lb(),a.query.W(),a);a.C.forEach((c,d)=>{for(const e of c.Sd())b.watch(e,a.K.has(d))});null!=b.C||(b.C=new olympe.dc.db.Ic);a.je=b}function Fg(a){null!==a.je&&(a.L.C()&&a.L.debug(`Stop sending notifications for query ${a.query.W()}`),a.C.forEach(b=>{for(const c of b.Sd())a.je.stop(c)}),a.je=null)}
565
- function Gg(a){a.O=!1;if(null!=(a=a.je)){let b;const c=!(null==(b=a.C)?0:b.hh());a.F=c?a.C:null;c&&(a.C=new olympe.dc.db.Ic,a.L.C()&&a.L.debug(`Commit notification with ${a.F.G()} operations for query ${a.G}`))}}
566
- olympe.dc.query.Co=class{constructor(a,b){this.L=a;this.query=b;this.G=olympe.Y.jb(b.F);this.xa=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.xa.ml);this.K=new Set(b.K);this.ad=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Ka.empty();this.je=this.F=null;a=wg(b);a.forEach(c=>{const d=c.W();this.xa.set(d,c.K());this.C.set(d,c.qa())});b=b.mg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.W())))if(c+=this.K.has(d)?1:0,b===d){this.ad=c;break}}}remove(a,b=this.G,c='root'){b=
567
- this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&zg(this);if(!b.has(a)){let d;null==(d=this.je)||d.stop(a);return!0}return!1}rc(a){const b=a.F,c=olympe.Y.jb(b);a=wg(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.ba(k,this.xa.get(k))).filter(k=>{let m,n;return null!=(n=null==(m=this.xa.get(k))?void 0:m.rc(f))?n:!1});e.set(f.W(),h);return 0<h.length})}};function Hg(a){var b=olympe.dc.query.Da.C.mp;const c=olympe.dc.query.Da.C.rn,d=olympe.dc.query.Da.C.Fi,e=olympe.dc.query.Da.C.Mn,f=olympe.dc.query.Da.C.lo,g=olympe.dc.query.Da.C.Lo,h=olympe.dc.query.Da.C.um,k=olympe.dc.query.Da.C.so;switch(a.pr){case b:return new olympe.dc.query.$.pl(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.Xd(a.p,b,olympe.dc.Aa());case d:return new olympe.dc.query.$.Ie(a.p,
568
- a.s,olympe.dc.Aa(),a.c);case e:return new olympe.dc.query.$.Fh(olympe.dc.Aa(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.$d(Hg(a.v));case g:return new olympe.dc.query.$.Te(a.p,new RegExp(a.r),olympe.dc.Aa(),a.c);case k:return new olympe.dc.query.$.be(...a.p.map(m=>Hg(m)));case h:return new olympe.dc.query.$.dd(...a.p.map(m=>Hg(m)));default:return null}}
569
- olympe.dc.query.Da=class{observe(){}ib(){}compile(){return[[this]]}Wc(){return new olympe.dc.query.$.$d(this)}Bb(){}rc(){}clear(){}ha(){}Ac(){}toString(){}static lv(...a){return new olympe.dc.query.$.pl(a)}static Qa(a,b){return new olympe.dc.query.$.Xd(a,b,olympe.dc.Aa())}static contains(a,b,c=!0){return new olympe.dc.query.$.Ie(a,b,olympe.dc.Aa(),c)}static Uv(a,b,c=!0){return new olympe.dc.query.$.Te(a,b,olympe.dc.Aa(),c)}static Qj(a,b,c=!0){return new olympe.dc.query.$.Fh(olympe.dc.Aa(),a,b,!1,
570
- c)}static ti(a,b,c=!0){return new olympe.dc.query.$.Fh(olympe.dc.Aa(),a,b,!0,c)}static and(...a){return new olympe.dc.query.$.dd(...a)}static or(...a){return new olympe.dc.query.$.be(...a)}static Wc(a){return new olympe.dc.query.$.$d(a)}};olympe.dc.query.Da.not=olympe.dc.query.Da.Wc;olympe.dc.query.Da.or=olympe.dc.query.Da.or;olympe.dc.query.Da.and=olympe.dc.query.Da.and;olympe.dc.query.Da.smallerThan=olympe.dc.query.Da.ti;olympe.dc.query.Da.greaterThan=olympe.dc.query.Da.Qj;
571
- olympe.dc.query.Da.regex=olympe.dc.query.Da.Uv;olympe.dc.query.Da.contains=olympe.dc.query.Da.contains;olympe.dc.query.Da.equals=olympe.dc.query.Da.Qa;olympe.dc.query.Da['in']=olympe.dc.query.Da.lv;olympe.dc.query.Da.C={mp:0,rn:1,Fi:2,Mn:3,lo:4,Lo:5,so:6,um:7};function wg(a){return Array.from(a.xa)}function Ig(a,b=a.G){return 0<=b?a.xa[b].W():olympe.Y.jb(a.F)}function Jg(a,b,c){var d=olympe.dc.Jb.Se;b=olympe.dc.ja(b);const e=ge(olympe.dc.ie(),b);b=(new olympe.dc.ua(b,e)).Ld();b.xa=[new olympe.dc.query.xa.le(Ig(b),d,c)];return b.observe(a)}function Kg(a,b){const c=b.W();let d=a.G+1;for(;d<a.xa.length&&a.xa[d].W()!==c;)d++;b=d<a.xa.length?a.xa:a.xa.concat(b);return new olympe.dc.ua(a.F,a.source,b,d,a.K,a.C)}
572
- function Lg(a){const b=0===a.K.size?a.Ld():a;if(null!==b.C.ad&&!b.K.has(Ig(a,b.C.ad)))throw Error('AndReturn was not called for the current level before sortBy operator');return b}
573
- olympe.dc.ua=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,ad:null,xg:null}){this.db=olympe.dc.Aa();this.F=a;this.source=b;this.xa=c;this.G=d;this.K=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ja(a);b=null!=b?b:ge(olympe.dc.ie(),a);return new olympe.dc.ua(a,b)}static Sj(a,b=!0,c){a=olympe.dc.ja(a);c=null!=c?c:olympe.dc.ie().fromModel(a);return b?(new olympe.dc.ua(a,c)).ig(olympe.dc.CloudObject.extendedByRel,!0).lb(olympe.dc.CloudObject.instancesRel):(new olympe.dc.ua(a,c)).lb(olympe.dc.CloudObject.instancesRel)}static Yb(a,
574
- b,c,d,e=!1){e=e?olympe.dc.ua.Sc.dj:olympe.dc.ua.Sc.th;b=olympe.dc.ja(b);d=null!=d?d:ge(olympe.dc.ie(),b);d=(new olympe.dc.ua(b,d)).Ld();d.xa=[new olympe.dc.query.xa.le(Ig(d),c)];return d.observe(a,e)}lb(a,b=!1){return Kg(this,new olympe.dc.query.xa.Rf(Ig(this),a,b))}ig(a,b=!1,c=!1){return Kg(this,new olympe.dc.query.xa.vf(Ig(this),a,b,c))}Ld(){const a=(new Set(this.K)).add(Ig(this));return new olympe.dc.ua(this.F,this.source,this.xa,this.G,a,this.C)}filter(a){const b=Array.from(this.xa);b[this.G]=
575
- b[this.G].filter(a);return new olympe.dc.ua(this.F,this.source,b,this.G,this.K,this.C)}ai(){return this}fm(a,b=0){return new olympe.dc.ua(this.F,this.source,this.xa,this.G,this.K,{ad:this.C.ad,max:a,offset:b,xg:this.C.xg})}ak(a,b=olympe.dc.query.bj.ASC){if(0>this.G)throw Error('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');const c=this.xa[this.G],d={ad:this.G,max:this.C.max,offset:this.C.offset,xg:this.C.xg},e=Array.from(this.xa);e[this.G]=c.sort(a,
576
- b);return new olympe.dc.ua(this.F,this.source,e,this.G,this.K,d)}mg(){const a=this.C.ad;let b;return null!==a?null==(b=this.xa[a])?void 0:b.mg():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.xa[b].C;for(b--;-1<b&&Ig(this,b)!==d;)b--}return new olympe.dc.ua(this.F,this.source,Array.from(this.xa),b,this.K,this.C)}parse(){const a=new Map,b=Ig(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.K.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,
577
- c);this.db.Tj(this.F)?c.dataType=olympe.dc.ja(this.F):(c.root=olympe.dc.ja(this.F),c.dataType=this.C.xg);this.xa.forEach((d,e)=>{const f=d.W(),g=d.Ac();Object.assign(g,{returned:this.K.has(f),next:[]});a.set(f,g);g.sort&&this.C.ad!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.xa.Rf&&d.O().Qa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.xa.vf&&d.O().Qa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;
578
- null==(h=a.get(d.C))||h.next.push(g)}});return c}ib(a,b=!1){a='function'===typeof a.F?a.F():a;b=b?olympe.dc.ua.Sc.dj:olympe.dc.ua.Sc.el;return olympe.dc.query.Pj().executeQuery(Lg(this),a,b).then(c=>{let d;return null!=(d=null==c?void 0:xg(c))?d:olympe.dc.Ka.empty()})}Bd(){return xg(Mg(olympe.dc.query.Pj(),Lg(this)))}observe(a,b=olympe.dc.ua.Sc.th){a='function'===typeof a.F?a.F():a;return Ng(olympe.dc.query.Pj(),Lg(this),a,olympe.dc.Pa.SELF,b).pipe(rxjs.operators.map(c=>xg(c)),rxjs.operators.distinctUntilChanged())}W(){null===
579
- this.id&&(this.id=olympe.Y.jb(this.F+wg(this).map(a=>a.toString()).join()+Array.from(new Set(this.K)).sort().toString()+this.C.ad+this.C.max+this.C.offset));return this.id}Lb(){return this.source}ha(){let a;return{b:this.F,p:this.xa.map(b=>b.ha()),r:Array.from(this.K),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.ad,rm:null!=(a=this.C.xg)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this.ha())}`}};olympe.dc.ua.prototype.observe=olympe.dc.ua.prototype.observe;
580
- olympe.dc.ua.prototype.executeFromCache=olympe.dc.ua.prototype.Bd;olympe.dc.ua.prototype.execute=olympe.dc.ua.prototype.ib;olympe.dc.ua.prototype.parse=olympe.dc.ua.prototype.parse;olympe.dc.ua.prototype.back=olympe.dc.ua.prototype.back;olympe.dc.ua.prototype.sortBy=olympe.dc.ua.prototype.ak;olympe.dc.ua.prototype.limit=olympe.dc.ua.prototype.fm;olympe.dc.ua.prototype.cast=olympe.dc.ua.prototype.ai;olympe.dc.ua.prototype.filter=olympe.dc.ua.prototype.filter;olympe.dc.ua.prototype.andReturn=olympe.dc.ua.prototype.Ld;
581
- olympe.dc.ua.prototype.followRecursively=olympe.dc.ua.prototype.ig;olympe.dc.ua.prototype.follow=olympe.dc.ua.prototype.lb;olympe.dc.ua.followRule=olympe.dc.ua.Yb;olympe.dc.ua.instancesOf=olympe.dc.ua.Sj;olympe.dc.ua.from=olympe.dc.ua.from;olympe.dc.ua.Sc={th:1,el:2,dj:3};function Mg(a,b){a=new olympe.dc.query.Co(a.L,b);Cg(a,b.F);for(const c of wg(b))c.ib(a);return a}
582
- function Ng(a,b,c,d,e){const f=b.W();let g=a.C.get(f);if(!g){var h=b.Lb();a.L.debug(`Create new subscription for query ${f} for subscriber ${d}, to be executed by the data source ${h}`);h=a.K&&h===olympe.dc.Pa.SERVER?[]:Array.from(a.C.values());g=new olympe.dc.query.Io(a.L,a.F,b,a.O.bind(a,e));a.C.set(f,g);Og(g,k=>a.G.add(k));g.start(h)}return new rxjs.Observable(k=>{const m=()=>{n&&c.we(n);if(p){var q=p;const t=a.C.get(f);a.L.debug(`${d} unsubscribed from ${f}`);if(null==t)q=0;else{var r=t;r.G.delete(q)&&
583
- r.L.debug(`Remove subscriber ${d} for query ${r.query.W()}, now have ${r.G.size} subscribers`);d!==olympe.dc.Pa.SELF&&(r.T--,0===r.T&&Fg(r.C));q=0===r.G.size}q&&(a.L.debug(`No more subscriber to ${f}, remove the subscription`),a.G.delete(f),a.C.delete(f),t.destroy())}k.complete()},n=c.Z(m),p=Pg(g,d,k);return m})}function Qg(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Rg(c)});a.G.clear()}
584
- function Sg(a){a.L.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.me,olympe.dc.Pa.SERVER);return a.fc.request(b).then(c=>{a.F.Zc(c.Vc())})}function Tg(a,b){const c=b.Lb();if(c===olympe.dc.Pa.SELF||a.K&&c===olympe.dc.Pa.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.rc(b)).map(d=>new Promise(e=>d.Xc(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}
585
- function Ug(a){switch(a){case olympe.dc.ua.Sc.th:case olympe.dc.ua.Sc.el:return olympe.dc.Request.C.Mg;case olympe.dc.ua.Sc.dj:return olympe.dc.Request.C.Ei;default:throw Error(`Unknown query type: ${a}`);}}function Vg(a,b,c,d){a.fc.request(b).then(e=>{a.F.Zc(e.Vc());c()}).catch(d)}function Wg(a,b,c){const d=[];for(const e of a.C.values())Xg(e,b,c)&&d.push(new Promise((f,g)=>{const h=new olympe.dc.Request(olympe.dc.Request.C.Mg,b,e.query);Vg(a,h,f,g)}));return Promise.all(d).then()}
586
- olympe.dc.query.Is=class{constructor(a,b,c,d){this.L=a;this.F=b;this.fc=c;this.K=d;this.C=new Map;this.G=new Set;hf(b,()=>Qg(this));c.K(olympe.dc.Request.C.fn,e=>{this.F.Zc(e.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e=a.Lb();if(!(yield Tg(d,a))){var f=Ug(c);f=new olympe.dc.Request(f,e,a);try{const g=yield d.fc.request(f);if(b.zc()||b.mb())return null;d.F.Zc(g.Vc())}catch(g){return d.L.error(`Error while sending a query to data source ${e}: ${g}`),null}}return Mg(d,a)})}O(a,
587
- b,c,d){const e=b.Lb();if(e===olympe.dc.Pa.SELF||this.K&&e===olympe.dc.Pa.SERVER)return c(),null;var f=Ug(a);const g=new olympe.dc.Request(f,e,b);if(a===olympe.dc.ua.Sc.dj)return Vg(this,g,c,d),null;let h;a=n=>{h=[];n&&this.L.info(`Resend subscription ${b.W()} after detection of dead subscription in the remote service`);Vg(this,g,()=>{let p;null==(p=h)||p.forEach(q=>this.F.Zc(q));h=null;c()},d)};const k=b.W();a(!1);f=new olympe.dc.Request(olympe.dc.Request.C.ij,e,b);const m=this.fc.T(f,a.bind(this,
588
- !0)).subscribe(rxjs.Subscriber.create(n=>{Array.isArray(h)?h.push(n):this.F.Zc(n)},n=>{this.L.error(`An error occurred with the subscription ${k}: ${n}`);d(String(n))}));return()=>{this.L.debug(`Unsubscribe to query ${k} from data source ${e}`);m.unsubscribe()}}};function oe(a){return a.K.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function pe(a){return a.G.map(b=>a.F.get(a.C[b]))}function Yg(a){const b=olympe.dc.Aa();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ua(g)?olympe.dc.CloudObject.get(g):(olympe.ka.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ka.create(d,a.a,a.r)}
589
- olympe.dc.Ka=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.K=[];this.hash=''}static empty(){return new olympe.dc.Ka}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}De(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.De().includes(a)}indexOf(a){return null===
590
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.De().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}vc(){return this.Od(0)}Od(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.De();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.De();a.pop();return a}shift(){if(0<this.C.length){const a=this.De();a.shift();return a}return[]}filter(a){return this.De().filter(a)}find(a){return(a=this.De().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
591
- a(this.F.get(b),c))}map(a){return this.De().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.G),Array.from(this.K))}reduce(a,b){return this.De().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.K.concat(...a.map(d=>d.K));return olympe.dc.Ka.create(b,c,a)}static from(a,b,{yb:c,ad:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=
592
- olympe.dc.Aa(),q=c.Ih===olympe.dc.query.bj.ASC?1:-1,r=c.mg(),t=c.Ma();b.sort((u,w)=>{w=w[d];u=p.Ma(u[d],t);w=p.Ma(w,t);return null===u?-q:null===w?q:q*r(u,w)})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.jb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),m=[],n=[];e.forEach(([p],
593
- q)=>{!k.has(p)&&m.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ka.create(e,m,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.jb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.K=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.K}}};olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;
425
+ typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(b=>this.G(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.create(a.r,a.g,a.b,a.a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.G(c)]));case 4:return olympe.Y.Pd().G(a.v);case 5:return new Uint8Array(olympe.Y.Pd().G(a.v));default:return Object.entries(a).reduce((b,[c,d])=>{b[c]=this.G(d);return b},{})}}};const sd=olympe.O.Response.hb.Yo,td=olympe.O.Response.hb.ek,ud=olympe.O.Response.hb.Fb,vd=olympe.O.Response.hb.wp,wd=olympe.O.Response.hb.ol,xd=olympe.O.Request.hb.SEND,yd=olympe.O.Request.hb.GET,zd=olympe.O.Request.hb.PUBLISH,Ad=olympe.O.Request.hb.SUBSCRIBE,Bd=olympe.O.Request.hb.pe,Cd=olympe.O.Request.hb.qp;function qd(a,b){a.C||(a.C=Ka(new olympe.Y.rl(a.F.Xb+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
426
+ function Dd(a){let b,c;a=null!=(c=null==(b=a.Yc())?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.O.errors.pp(a):Error(a)}
427
+ olympe.O.pb=class{constructor(a,b){this.F=olympe.O.eh();this.L=a;this.G=this.C=null;this.P=new olympe.D.Nb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.K=olympe.ka.ab(`Service ${this.L}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.P.onDestroy(b);this.F.connect().then(()=>{tc(this.F,this.L,c=>{const d=new olympe.O.yc(c,this.F,this);switch(c.getType()){case Bd:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Ja(h,g))});d.dd(e).catch(g=>this.K.error('Not able to validate subscription keep alive',
428
+ g));break;case Cd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case zd:a.next(d);break;default:this.F.dd(c,td).then(()=>a.next(d))}})}).catch(c=>this.K.error('Failed to connect to the bus: '+c));return b})}lq(a){this.G=a;return this}stop(){this.clear();this.P.destroy()}clear(){Cc(this.F,this.L).catch(b=>this.K.error('Failed to unsubscribe from '+this.L+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,
429
+ c)})}let a;null==(a=this.C)||a.clear()}static publish(a,b){const c=olympe.O.eh();return c.connect().then(()=>c.request(a,zd,b)).then()}static send(a,b,c={}){const d=olympe.O.eh();return d.connect().then(()=>d.request(a,xd,b,c.timeout)).then(e=>{switch(e.getType()){case sd:break;case ud:throw Dd(e);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){const d=olympe.O.eh();return d.connect().then(()=>d.request(a,yd,b,c.timeout)).then(e=>{switch(e.getType()){case vd:e=
430
+ e.Yc();if(null!==e)return e;throw Error('No payload after request to service: '+a);case ud:throw Dd(e);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.O.eh();return(new rxjs.Observable(g=>{let h=null,k=null;const m=()=>{g.complete();k&&Ec(f,a,k);h&&Cc(f,h).catch(n=>olympe.ka.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(m);f.connect().then(()=>f.request(a,Ad,c,d.timeout)).then(n=>
431
+ {switch(n.getType()){case wd:const p=n.Yc();h=p.topic;tc(f,h,q=>{q.getType()===zd?g.next(q.Yc()):(g.error('Unsupported notification message. It should be a publish'),m())});k=p.id;Dc(f,a,k,p.refresh,q=>g.error(q));gd(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);m()});break;case ud:g.error(Dd(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return m})).pipe(Gc(f,d.onRetry))}};olympe.O.pb.observe=olympe.O.pb.observe;
432
+ olympe.O.pb.get=olympe.O.pb.get;olympe.O.pb.send=olympe.O.pb.send;olympe.O.pb.publish=olympe.O.pb.publish;olympe.O.pb.prototype.stop=olympe.O.pb.prototype.stop;olympe.O.pb.prototype.setUnsubscriptionHandler=olympe.O.pb.prototype.lq;olympe.O.pb.prototype.listen=olympe.O.pb.prototype.listen;olympe.O.Zd={en:1,qf:2,Fb:3,Wf:4,Cw:5,Si:6};olympe.O.hb={Si:1,it:2,br:3,pe:5};olympe.O.cb.C={INIT:'initialize',CONNECTING:'connecting',Le:'disconnected',xh:'connected',$f:'reconnecting',Vg:'waking',zg:'awake',Fb:'error'};olympe.O.cb.F={bj:1,er:-1,vr:-2,bt:-3};olympe.O.cb.G={Vh:0,Qx:23};
433
+ olympe.O.cb.ac={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',
434
+ 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.O.R={qj:'com.ServerManager',mk:'com.BusManager',Jk:'com.HttpManager',de:'com.Serializer',za:'com.Logger',cp:'com.Source',rp:'com.Urls',Ay:'com.peerFileSvcUrl',uo:'com.overloadRetryPolicy'};
435
+ olympe.O.V={Tf:'server.host',hj:'server.port',rj:'server.ssl',lk:'server.basePath',zp:'server.wsPath',xm:'server.autoConnect',fl:'server.reconnectionDelay',yo:'server.pingInterval',yp:'server.messageTimeout',Qo:'server.retryHttpOnOverload',Um:'server.clientVersion',ap:'server.serverVersion',Rs:'server.wakeUpService',Hm:'bus.host',Im:'bus.path',Jm:'bus.port',Om:'bus.vhost',Mm:'bus.ssl',pe:'bus.keepalive',Ks:'bus.reschedulePings',Iq:'bus.clientId',Gq:'bus.clean',Lq:'bus.connectTimeout',np:'bus.tokenTimeout',
436
+ Lm:'bus.shortTimeout',Km:'bus.requestTimeout',Nm:'bus.subscriptionRefreshRate',Gs:'bus.queueQoSZero',Gi:'bus.allowGuest'};
437
+ olympe.U.config(function(a){F(a,olympe.O.V.Tf,'object'===typeof window&&window.location&&window.location.hostname||'localhost');var b=a.getParameter(olympe.O.V.Tf);const c='localhost'===b;F(a,olympe.O.V.hj,c?8080:443);F(a,olympe.O.V.rj,'localhost'!==b);F(a,olympe.O.V.lk,'OlympeServer');F(a,olympe.O.V.zp,'websocket');F(a,olympe.O.V.xm,!0);F(a,olympe.O.V.fl,5E3);F(a,olympe.O.V.yo,5E3);F(a,olympe.O.V.yp,15E3);F(a,olympe.O.V.Qo,5E3);F(a,olympe.O.V.ap,'7.1.2');F(a,olympe.O.V.Hm,b);F(a,olympe.O.V.Im,c?
438
+ '':'/mqtt');F(a,olympe.O.V.Jm,c?15675:443);F(a,olympe.O.V.Mm,'localhost'!==b);F(a,olympe.O.V.Om,c?'/':'');F(a,olympe.O.V.pe,30);F(a,olympe.O.V.Lm,5E3);F(a,olympe.O.V.Km,3E4);F(a,olympe.O.V.Nm,3E5);F(a,olympe.O.V.np,3E5);F(a,olympe.O.V.Gi,!1);b=a.getParameter(olympe.Lf.V.zn);if(void 0!==b)wa(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.O.R.za,[olympe.ka.R.Fa],e=>e.Gc('communication'));E(a,'server.WebSocketRequest',[new olympe.U.ma(olympe.O.V.Tf),
439
+ new olympe.U.ma(olympe.O.V.hj),new olympe.U.ma(olympe.O.V.rj),new olympe.U.ma(olympe.O.V.lk),new olympe.U.ma(olympe.O.V.zp)],(e,f,g,h,k)=>new olympe.net.ai(e,f,(h+'/'+k).replace(/\/+/g,'/').replace(/\/$/,''),g));E(a,'server.wakeUpRequest',[new olympe.U.ma(olympe.O.V.Tf),new olympe.U.ma(olympe.O.V.hj),new olympe.U.ma(olympe.O.V.rj),new olympe.U.ma(olympe.O.V.Rs)],(e,f,g,h)=>{if(null===h||void 0===h)return null;h=h.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.ai(e,f,h,g)});const d=Array.from(Object.values(olympe.O.Kb));
440
+ E(a,olympe.O.R.rp,[new olympe.U.ma(olympe.O.V.Tf),new olympe.U.ma(olympe.O.V.hj),new olympe.U.ma(olympe.O.V.rj),new olympe.U.ma(olympe.O.V.lk),...d.map(e=>new olympe.U.ma(e))],(e,f,g,h,...k)=>{const m=d.map((n,p)=>{p=k[p];p=(new olympe.net.Hh(e,f,`${h}${p?'/'+p:''}`.replace(/\/+/g,'/').replace(/\/$/,''),g)).C();return[n,p]});return new Map(m)});E(a,olympe.O.R.uo,[olympe.O.R.za],e=>({resetOnSuccess:!0,delay:(f,g)=>f instanceof olympe.O.errors.xo?(g=Math.round(Math.random()*(g+1)*4E3),e.warn(`Service overloaded, re-send request in ${g}ms`),
441
+ rxjs.timer(g)):rxjs.throwError(()=>f)}));D(a,olympe.O.R.de,olympe.O.cg);D(a,olympe.O.R.Jk,olympe.O.jr,olympe.O.R.za,olympe.net.R.Fa,olympe.O.R.rp,olympe.O.R.uo);E(a,'server.ManagerConfig',[new olympe.U.ma(olympe.O.V.xm),new olympe.U.ma(olympe.O.V.fl),new olympe.U.ma(olympe.O.V.yo),new olympe.U.ma(olympe.O.V.yp),new olympe.U.ma(olympe.O.V.Um),new olympe.U.ma(olympe.O.V.ap),new olympe.U.ma(olympe.dc.V.Sg),new olympe.U.ma(olympe.O.V.Qo)],(...e)=>{const f='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),
442
+ g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.O.R.qj,olympe.O.cb,olympe.O.R.za,olympe.net.R.Fa,olympe.host.R.Se,'server.WebSocketRequest','server.wakeUpRequest','server.ManagerConfig');E(a,'server.bus.ManagerConfig',[new olympe.U.ma(olympe.O.V.Tf),new olympe.U.ma(olympe.O.V.Hm),new olympe.U.ma(olympe.O.V.Im),new olympe.U.ma(olympe.O.V.Jm),new olympe.U.ma(olympe.O.V.Om),new olympe.U.ma(olympe.O.V.Mm),new olympe.U.ma(olympe.O.V.Gi),new olympe.U.ma(olympe.O.V.Lm),new olympe.U.ma(olympe.O.V.Km),
443
+ new olympe.U.ma(olympe.O.V.Nm),new olympe.U.ma(olympe.O.V.np),new olympe.U.ma(olympe.O.V.pe),new olympe.U.ma(olympe.O.V.Ks),new olympe.U.ma(olympe.O.V.Iq),new olympe.U.ma(olympe.O.V.Gq),new olympe.U.ma(olympe.O.V.fl),new olympe.U.ma(olympe.O.V.Lq),new olympe.U.ma(olympe.O.V.Gs)],(e,f,g,h,k,m,n,p,q,r,t,...u)=>{f=`${m?'wss://':'ws://'}${f}:${h}${g}/ws`;const w='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');u=u.reduce((x,
444
+ y,z)=>{x[w[z]]=y;return x},{});u.vhost=`${k||e.split('.')[0]}`;return new Map([['url',f],['connectionOptions',u],['allowGuest',n],['shortTimeout',p],['requestTimeout',q],['subscriptionsRefreshRate',r],['tokenTimeout',t]])});D(a,olympe.O.R.mk,olympe.O.Pm,olympe.O.R.za,olympe.net.R.Fa,olympe.auth.R.Fa,olympe.host.R.Se,olympe.O.R.de,'server.bus.ManagerConfig')},'olympe.communication');olympe.U.run([olympe.O.R.mk],a=>{olympe.O.eh=()=>a});olympe.auth={};function Ed(a,b){cd(a.C);Uc(a.C,olympe.O.Zd.Wf,c=>{const d=c.c;d===olympe.auth.Pc.C.ds?(a.C.Ad(),b(olympe.auth.Ca.F.Ai,c)):d===olympe.auth.Pc.C.Os&&b(olympe.auth.Ca.F.Kn,c)},'logoutHandler')}
445
+ function Fd(a,b,c){const d=null==b?void 0:b.Pe();if(b instanceof olympe.auth.ej){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Rc();h.access_token=b.Yc().access_token||null;g=`${Rc(a.Kg,olympe.O.Kb.cj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);if(0!==f.hash.length||0!==f.search.length){const g=a.storage.C('AUTH');f.hash='';f.search='';g&&g.set('redirectTo',c,()=>{g.close();e(f.toString())})}else e(c)}else Zc(a.C,olympe.O.Zd.Wf,Object.assign({},
446
+ {c:olympe.auth.Pc.C.es},d&&{idpName:d}),c)}function Gd(a,b,c,d){c.c=b;Zc(a.C,olympe.O.Zd.Wf,c,d)}function Hd(a,b,c){if(b.ng()!==olympe.auth.Ec.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'));else{var d=null==b?void 0:b.Pe();d=d?`?idpName=${d}`:'';d=`${Rc(a.Kg,olympe.O.Kb.cj)}/refresh${d}`;Sc(a.Kg,P(d),b.Rc()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.ej(b.wc(),b.je(),b.Rc(),e,b.Pe()),c(null,e)):c(null,b)}).catch(e=>c(Error(e)))}}
447
+ olympe.auth.Pc=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.Kg=c;this.F=d;this.storage=e;const f=this.storage.C('AUTH');f&&(f.get('redirectTo',g=>{g&&(f.remove('redirectTo'),f.close(),this.F.redirect(g,null,olympe.auth.pj.C.GET))}),f.close())}De(a){Zc(this.C,olympe.O.Zd.Wf,{c:olympe.auth.Pc.C.pe},a)}sg(a,b,c){const d=Rc(this.Kg,olympe.O.Kb.tp);a=P(`${d}/${a}`);Sc(this.Kg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};
448
+ olympe.auth.Pc.C={Wf:1,es:2,Fb:3,pe:5,Vh:6,lr:10,Xs:11,tq:12,SAML:13,Os:14,ds:20};function Ic(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.ig());a.Ba.set(c,b)}function yc(a){return olympe.D.Qa(a.C.vb())}
449
+ function Id(a){a.K.info('Initializing AUTH layer');let b=a.hc;if(a.qa){const c=a.qa.C(),d=Kb(c.parameters);b=d||b;d&&a.qa.F(c.parameters.filter(e=>'authToken'!==e.fa()))}b&&a.storage&&Jd(a.storage,b,c=>{!c&&a.K.error('Could not store authToken')});a.K.debug('Asking to be notified when auth connector gets online');Xc(a.G,()=>{if(a.nb)if(a.F=olympe.auth.Ca.G.qq,a.K.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.ga){const c=new olympe.auth.Request;c.set('username',
450
+ a.ga);c.set('password',a.Ob);a.K.log('Autologin with user "'+a.ga+'"');Kd(a,c)}else Ld(a,'No user specified for auto login',!0);else a.F=olympe.auth.Ca.G.yj,a.K.log('Connector online, attempting to log with token'),Md(a)});Yc(a.G,()=>{switch(olympe.D.Qa(a.P)){case olympe.auth.Ca.C.Ge:const c=olympe.D.Qa(a.C.vb()).wc();a.K.warn(`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ca.C.wf:a.K.warn('Disconnected from server - guest session lost');break;case olympe.auth.Ca.C.Ci:a.K.warn('Disconnected from server - authentication aborted');
451
+ break;case olympe.auth.Ca.C.INIT:a.K.warn('Cannot open auth session - no server connection');break;default:a.K.error('Should not get there, investigate')}Nd(a,olympe.auth.Ca.C.Le)});dd(a.G,c=>{switch(c){case olympe.O.cb.C.Vg:Nd(a,olympe.auth.Ca.C.Vg);break;case olympe.O.cb.C.zg:Nd(a,olympe.auth.Ca.C.zg)}});Ed(a.L,(c,d)=>{if(c===olympe.auth.Ca.F.Ai)Ld(a,'authentication revoked'),a.storage&&Od(a.storage),a.Ba.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ca.F.Kn)a.K.info('Redirection to IDP to invalidate token (SAML)'),
452
+ yc(a),a.storage&&Od(a.storage),a.Cb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Wa=Pd(a);a.ba.F(()=>a.Wj());a.K.log('DONE initializing AUTH layer (waiting for connector to be online)')}
453
+ function Md(a){null!==a.storage?(a.K.debug('Retrieving token from local storage'),a.storage.td(b=>{if(b){const e=new olympe.auth.Request;var c=b.wc();e.set('username',c);c=e;var d=b.Rc();c.set('nonce',d);'string'===typeof b.Pe()&&e.set('idpName',b.Pe());a.K.debug('Token found, trying login with',e);Kd(a,e,'localToken')}else Ld(a,'No token found, cannot perform auto login')})):Ld(a,'Cannot retrieve token: no storage configured, cannot perform auto login',!0)}
454
+ function Nd(a,b){a.K.log('State change: ',Qd(a),'--\x3e',b);a.P.update(b)}function Ld(a,b,c=!1){a.C.update(a.Z);Nd(a,olympe.auth.Ca.C.wf);b=`Authenticated as guest (${b})`;c?a.K.error(b):a.K.info(b)}function Pd(a){const b=[olympe.auth.Ca.C.Ge];a.nb||b.push(olympe.auth.Ca.C.wf);return a.ba.C(()=>{const c=Qd(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}
455
+ function Qd(a){return olympe.D.Qa(a.P.vb())}function Rd(){var a=olympe.public.Va.get();return new Map(a.G.Xb)}function Sd(a,b,c,d=!1){b=b+c?':'+c.message:'';a.K.error(b);a.error.update(olympe.D.rb(b));Nd(a,olympe.auth.Ca.C.Fb);if(d)throw Error(b);}
456
+ function Kd(a,b,c,d){void 0===c&&(c=a.Wb);void 0===c&&Sd(a,'No authentication provider specified',null,!0);const e=a.Qb.get(c);e||Sd(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.T.set('login',d);a.K.log('Sending authentication request using "'+c+'" for '+b);e.td(b,a.Xb.bind(a));Nd(a,olympe.auth.Ca.C.Ci)}function Td(a,b,c){a.T.forEach(d=>{d(b,c)})}
457
+ olympe.auth.Ca=class{constructor(a,b,c,d,e,f,g,h,k){this.K=a;this.G=b;this.L=c;this.storage=d;this.Cb=e;this.qa=f;this.Wb=k.get('defaultProvider');this.nb=!!k.get('autoLogin');this.ga=k.get('autoUser');this.Ob=k.get('autoPassword');this.hc=k.get('autoToken');this.Qb=new Map;this.ba=g;this.Wa='';this.P=olympe.D.ec(String).update(olympe.auth.Ca.C.INIT);this.error=olympe.D.ec(olympe.D.Ja);this.F=null;this.Z=new olympe.auth.Ec('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
458
+ olympe.D.ec(olympe.auth.Ec).update(this.Z);this.T=new Map;this.Ba=new Map;h.forEach(m=>{const n=m.fa();if(this.Qb.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Qb.set(n,m)});Id(this)}getState(){return this.P.vb()}wc(){return this.C.vb().wc()}je(){return this.C.vb().je()}mh(a){const b=yc(this);olympe.D.Qa(this.C)!==this.Z&&b&&b.ng()===olympe.auth.Ec.C.OAUTH2?this.Qb.get('openID').mh(b,(c,d)=>{c?(this.K.error('Failed to refresh oAuth2 access token, error message: ',c.message),
459
+ a(c)):(this.ub(null,d),a(null))}):this.De()}gh(){return this.C.vb().gh()}sg(a,b){let c;const d=null==(c=olympe.D.Qa(this.C.vb()))?void 0:c.Rc();this.L.sg(a,d,b)}Wj(){return olympe.D.Qa(this.C)===this.Z?(this.K.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.K.debug('Sending logout');Od(this.storage);Fd(this.L,yc(this),c=>{c?(Sd(this,'Logout request rejected:',c),b(c)):(this.K.debug('Logout request acknowledged'),a())});this.ba.G(this.Wa)})}De(){Qd(this)===
460
+ olympe.auth.Ca.C.Ge&&this.L.De(a=>{a&&this.K.error('Was not able to send the auth keep alive message:',a.message)})}Xb(a,b){const c=null===this.F?olympe.auth.Ca.G.ks:this.F;this.F=null;a?(Od(this.storage),this.error.update(olympe.D.rb(a.message)),Ld(this,'authentication rejected: '+a.message),Td(this,a,c)):(this.K.info('User '+b.wc()+' (#'+b.je()+') successfully authenticated'),this.C.update(b),Nd(this,olympe.auth.Ca.C.Ge),Td(this,a,c),this.storage&&Jd(this.storage,b),b.ng()===olympe.auth.Ec.C.OAUTH2&&
461
+ Ud(this.Qb.get('openID'),b,this.ub.bind(this)));this.T.has('login')&&this.T.delete('login')}ub(a,b){if(a)this.K.error(`Failed to update token after refresh ${a}`);else if(b){this.C.update(b);let c;null==(c=this.storage)||Jd(c,b);this.K.debug('Token updated')}}};olympe.auth.Ca.C={INIT:'init',Vg:'waking',zg:'awake',Le:'disconnected',wf:'guest',Ci:'authenticating',Fb:'error',Ge:'authenticated'};olympe.auth.Ca.G={ks:'manual',qq:'auto',yj:'tokenOnFirstConnection'};olympe.auth.Ca.F={Ai:'accepted',Kn:'redirect'};olympe.auth.Rh=class{fa(){}td(){}};function Vd(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.oc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Xg&&(a=a.Aa.xb);return a?a.valueOf():a}wc(){return this.get('username')}Rc(){return this.get('nonce')}toString(){return this.wc()+(this.Rc()?' with nonce':'')+(this.get('password')?' with password':'')+(Vd(this)?` with idp name ${Vd(this)}`:'')}};olympe.auth.Ec=class{constructor(a,b,c,d={},e=null){this.L=a;this.qh=b;this.F=c;this.C=e;this.G=d}wc(){return this.L}je(){return this.qh}Rc(){return this.F}Yc(){return this.G}gh(){return null}Pe(){return this.C}ha(){const a=olympe.Y.Pd(),b=Object.assign({},{user:this.L,userTag:this.qh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.Gp(Ga(a,JSON.stringify(b)))}ng(){return olympe.auth.Ec.C.SRP}};olympe.auth.Ec.C={SAML:'saml',OAUTH2:'oauth2',SRP:'srp'};l=olympe.auth.Ec.prototype;
462
+ l.wc.J=new olympe.D.H(()=>String,[]);l.je.J=new olympe.D.H(()=>String,[]);l.Rc.J=new olympe.D.H(()=>String,[]);l.Yc.J=new olympe.D.H(()=>Object,[]);l.gh.J=new olympe.D.H(()=>String,[]);l.Pe.J=new olympe.D.H(()=>String,[]);l.ha.J=new olympe.D.H(()=>String,[]);l.ng.J=new olympe.D.H(()=>String,[]);olympe.auth.ej=class extends olympe.auth.Ec{constructor(a,b,c,d,e){super(a,b,c,d,e)}gh(){return this.Yc().access_token||null}ng(){return olympe.auth.Ec.C.OAUTH2}};olympe.auth.Wo=class extends olympe.auth.Ec{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.P=d}gh(){return this.P}ng(){return olympe.auth.Ec.C.SAML}ha(){const a=olympe.Y.Pd(),b=Object.assign({},{user:this.wc(),userTag:this.je(),nonce:this.Rc()},this.Pe()&&{idpName:this.Pe()},{payload:this.Yc(),fullToken:this.P});return olympe.Y.Gp(Ga(a,JSON.stringify(b)))}};function Jd(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ha(),e=>{d.close();c&&c(e)})}function Od(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
463
+ olympe.auth.sl=class{constructor(a,b,c){this.C=a;this.K=b;this.key='OlympeToken-'+c.C}td(a){const b=this.C.C('AUTH');this.K.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.K.debug('olympe.auth.TokenStorage: Token retrieved successfully');var e=JSON,f=e.parse;var g=Ha(olympe.Y.Pd().G(olympe.Y.Et(c)));const h=f.call(e,g);let k;h.fullToken?k=new olympe.auth.Wo(h.user,h.userTag,h.nonce,h.fullToken,h.payload,h.idpName):h.payload&&h.payload.id_token?
464
+ k=new olympe.auth.ej(h.user,h.userTag,h.nonce,h.payload,h.idpName):k=new olympe.auth.Ec(h.user,h.userTag,h.nonce,h.payload,h.idpName);d=k}catch(h){this.K.error('Error while unserializing token: ',h.message)}else this.K.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.sl.F='OlympeToken';olympe.auth.sl.C='AUTH';olympe.auth.pj=class{redirect(){}F(){}C(){}};olympe.auth.pj.C={GET:'GET',Og:'POST'};olympe.auth.jk=class{constructor(a){this.C=a||'default'}};olympe.auth.Qb={};function Wd(a,b){return olympe.Y.kb(b+'-olympe-'+a.C[b])}olympe.auth.Qb.ao=class{constructor(a){this.C=a}fa(){return'local'}td(a,b){const c=a.wc();if(c){const d=a.get('password'),e=a.Rc();a.C.delete('password');if(void 0!==e&&Wd(this,c)===e){b(null,new olympe.auth.Ec(c,'',Wd(this,c)));return}a=olympe.Y.kb(d||'');if(this.C[c]===a){b(null,new olympe.auth.Ec(c,'',Wd(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Qb.ao.C='local';olympe.auth.Qb.ao.sa=[olympe.auth.Rh];function Xd(a,b,c){Gd(a.C,olympe.auth.Pc.C.Wf,{token:b.Rc()},(d,e)=>{if(null!==d)c(d);else switch(e.c){case olympe.auth.Pc.C.Fb:c(Error('Invalid token'));break;case olympe.auth.Pc.C.Vh:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,m=e.protocol;'SAML'===m?d=new olympe.auth.Wo(f,g,h,e.samlToken,k,Vd(b)):'openid'===m&&(d=new olympe.auth.ej(f,g,h,k,Vd(b)))}c(null,d);break;default:c(Error('Unknown response from server'))}})}
465
+ olympe.auth.Qb.Vk=class{constructor(a,b){this.C=a;this.storage=b}fa(){return'localToken'}td(a,b){this.storage.td(c=>{Xd(this,a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Qb.Vk.C='localToken';olympe.auth.Qb.Vk.sa=[olympe.auth.Rh];function Ud(a,b,c){var d=parseInt(b.Yc().access_token_exp||'0',10);0<d&&(d=1E3*d-Date.now()-6E4,0<d?setTimeout(()=>{a.mh(b,c)},d):c(Error('oAuth2 token has expired so it cannot be refreshed'),null))}olympe.auth.Qb.cl=class{constructor(a,b,c){this.C=b;this.F=a;this.G=c}fa(){return'openID'}td(a){const b=encodeURIComponent(this.C.C());a=Vd(a)?`idpName=${Vd(a)}&`:'';this.C.redirect(`${this.G}/auth?${a}url=${b}`,null,olympe.auth.pj.C.GET)}mh(a,b){Hd(this.F,a,(c,d)=>{c?b(c):d&&(b(null,d),Ud(this,d,b))})}};
466
+ olympe.auth.Qb.cl.C='openID';olympe.auth.Qb.cl.sa=[olympe.auth.Rh];function Yd(a,b){Gd(a.C,olympe.auth.Pc.C.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Qb.SAML=class{constructor(a,b){this.C=a;this.F=b}fa(){return'saml'}td(a,b){Yd(this,c=>{c?b(c):this.F.F(Vd(a))})}};olympe.auth.Qb.SAML.C='saml';olympe.auth.Qb.SAML.sa=[olympe.auth.Rh];function Zd(a,b,c){const d=olympe.auth.Pc.C.lr,e=olympe.auth.Pc.C.Fb,f=olympe.auth.Pc.C.Xs,g={I:b.wc()};Gd(a.C,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.wc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
467
+ function $d(a,b,c){const d=olympe.auth.Pc.C.tq,e=olympe.auth.Pc.C.Fb,f=olympe.auth.Pc.C.Vh;b={A:b.get('a'),M:b.get('m1'),I:b.wc()};Gd(a.C,d,b,(g,h)=>{if(null!==g)c(g);else switch(h.c){case e:a.K.debug('Login failed, invalid username or password');c(Error('Invalid username or password'));break;case f:g=h.payload;a.K.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Ec(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`))}})}
468
+ olympe.auth.Qb.SRP=class{constructor(a){this.C=a;this.K=olympe.ka.ab('auth')}fa(){return'srp'}td(a,b){const c=a.get('password');a.C.delete('password');this.K.debug('Sending SRP request');Zd(this,a,(d,e,f)=>{this.K.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.wc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);return}this.K.debug('Sending SRP A+M (proof) message');$d(this,a,b)}})}};olympe.auth.Qb.SRP.C='srp';olympe.auth.Qb.SRP.sa=[olympe.auth.Rh];olympe.auth.R={Fa:'auth.Manager',za:'auth.Logger',uj:'auth.Storage',Bi:'auth.appNameToken',nj:'auth.Redirector',Zo:'auth.ServerConnector'};olympe.auth.V={vk:'auth.defaultProvider',hk:'auth.autoLogin',zm:'auth.autoUser',ym:'auth.autoPassword',yj:'auth.token',vm:'auth.appToken',Gi:'bus.allowGuest'};
469
+ olympe.U.config(function(a){F(a,olympe.auth.V.vk,'srp');F(a,olympe.auth.V.hk,!1);F(a,olympe.auth.V.zm,'');F(a,olympe.auth.V.ym,'');F(a,olympe.auth.V.yj,'');F(a,olympe.auth.V.vm,'default');E(a,olympe.auth.R.za,[olympe.ka.R.Fa],b=>b.Gc('auth'));D(a,olympe.auth.R.Bi,olympe.auth.jk,new olympe.U.ma(olympe.auth.V.vm));D(a,olympe.auth.R.uj,olympe.auth.sl,olympe.kc.R.Xi,olympe.auth.R.za,olympe.auth.R.Bi);D(a,olympe.auth.R.Zo,olympe.auth.Pc,olympe.auth.R.za,olympe.O.R.qj,olympe.O.R.Jk,olympe.auth.R.nj,olympe.kc.R.Xi);
470
+ va(a,olympe.auth.R.nj);E(a,olympe.auth.R.Fa,[olympe.auth.R.za,olympe.O.R.qj,olympe.auth.R.Zo,olympe.host.R.Ik,olympe.host.R.Se,new olympe.U.pb(olympe.auth.R.uj,olympe.U.Eg.C.$k),new olympe.U.pb(olympe.auth.R.nj,olympe.U.Eg.C.$k),new olympe.U.ma(olympe.auth.V.vk),new olympe.U.ma(olympe.auth.V.hk),new olympe.U.ma(olympe.auth.V.zm),new olympe.U.ma(olympe.auth.V.ym),new olympe.U.ma(olympe.auth.V.yj)],(b,c,d,e,f,g,h,k,m,n,p,q)=>{const r=[new olympe.auth.Qb.Vk(d,g),new olympe.auth.Qb.SRP(d),new olympe.auth.Qb.SAML(d,
471
+ h)];h&&r.push(new olympe.auth.Qb.cl(d,h,Rc(d.Kg,olympe.O.Kb.cj)));if(!r.map(t=>t.fa()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.V.vk} cannot be found`);return new olympe.auth.Ca(b,c,d,g,h,e.pi()?e:null,f,r,new Map([['defaultProvider',k],['autoLogin',m],['autoUser',n],['autoPassword',p],['autoToken',q]]))},!0)},'olympe.auth');olympe.U.run([olympe.auth.R.Fa],a=>{olympe.auth.ge=()=>a});olympe.Na.node.auth={};olympe.Na.node.auth.po=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Na.node.auth.po.sa=[olympe.auth.pj];olympe.U.config(a=>{D(a,olympe.auth.R.nj,olympe.Na.node.auth.po)},'olympe.native.node.auth');olympe.Na.node.kc={};olympe.Na.node.kc.eo=class{constructor(a){this.F={};this.K=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.Na.node.kc.fo(a,this.K));return this.F[a].open()}};olympe.Na.node.kc.eo.sa=[olympe.kc.Yr];olympe.Na.node.kc.fo=class{constructor(a,b){this.name=a;this.K=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
472
+ b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.Na.node.kc.fo.sa=[olympe.kc.Zr];olympe.U.config(function(a){D(a,olympe.kc.R.Xi,olympe.Na.node.kc.eo,olympe.kc.R.za)},'olympe.native.node.localstorage');olympe.Na.node.storage={};olympe.Na.node.storage.Storage=class{constructor(a){this.K=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Na.node.storage.Storage.sa=[olympe.kc.Storage];olympe.U.config(function(a){ta(a,olympe.kc.R.uj,olympe.Na.node.storage.Storage,olympe.host.R.za)},'olympe.native.html.storage');olympe.Lf={};olympe.Lf.V={VERSION:'version.version',Cq:'version.branch',He:'version.commit',at:'version.tag',zn:'version.olympe-framework',Dq:'version.build'};olympe.U.config(function(a){F(a,olympe.Lf.V.VERSION,'');F(a,olympe.Lf.V.Cq,'');F(a,olympe.Lf.V.He,'');F(a,olympe.Lf.V.at,'');F(a,olympe.Lf.V.zn,'');F(a,olympe.Lf.V.Dq,'')},'olympe.main');const ae=require('fs');let ya,xa;function be(a,b){ae.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
473
+ function ce(){if(void 0!==ya&&void 0!==xa){0===Object.keys(xa).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(ya).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
474
+ (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.U.Pq(a);na(a);pa(a.compile())}}function de(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Na.node.host).Rj)||dc(b.call(a)).then(()=>{console.log('The node backend has stopped successfully');process.exit(0)}).catch(c=>process.exit(1,c))}
475
+ olympe.Y.Qd('oConfig.json',be,function(a){xa=a;ce()});be('version.json',function(a){ya=a;ce()});process.on('SIGTERM',de);process.on('SIGINT',de);process.on('SIGBREAK',de);process.on('SIGHUP',de);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);de()});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.mc={md:'ff022000000000000000',Bh:'ff02200000000000000e',Ji:'ff02200000000000000f'};olympe.dc.Tn={VERSION:'@v',cp:'@s'};olympe.dc.Vi={Hd:'?'};olympe.dc.jz={ny:'online',Oh:'offline',Rx:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',Af:'remote',Oh:'offline'};olympe.dc.Mb={NONE:null,jn:'ff023000000000000037',pc:'ff023000000000000137',Bf:'ff023000000000000237',Ts:'ff023000000000000337'};olympe.dc.Writable=class{Fc(){}gd(){}F(){}Ea(){}Yb(){}};olympe.dc.Ds=class{Md(){}W(){}G(){}};function ee(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.lc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}Pa(a){return a instanceof olympe.dc.lc&&this.tag===a.tag}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.lc(b.tag)}};olympe.dc.lc.sa=[olympe.dc.oe];olympe.dc.lc.prototype.toJSON.J=olympe.D.H.C;olympe.dc.lc.prototype.Pa.J=olympe.D.H.C;function fe(a,b,c,d,e,f,g){e=e?k=>{ge(a,b,c);f(k)}:f;const h=a.db.model(b);d=new olympe.dc.Request(olympe.dc.Request.C.fg,he(olympe.dc.ie(),b),{tag:b,model:h,content:c,mimeType:d});a.fc.request(d).then(e).catch(null!=g?g:a.K.error.bind(a.K))}function ie(a,b,c,d,e,f){c=c instanceof olympe.D.Ja?c.valueOf():c;'string'===typeof c?c=new Blob([Fa(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));fe(a,b,c,d,a.F,e,f)}
476
+ function ge(a,b,c){const d=olympe.dc.ja(b);a.C.set(d,c);const e=olympe.Y.ig();je(a.db,d,f=>{f||(a.C.delete(d),ke(a.db,d,e))},e)}
477
+ function le(a,b,c,d){olympe.D.gq([b.bq(),b.X(),b.Pk(),b.Ul()],(e,f,g)=>{if(a.C.has(f))c(a.C.get(f));else{var h=a.F?k=>{ge(a,f,k);c(k)}:c;e.valueOf()?(e=a.db.model(b),e=new olympe.dc.Request(olympe.dc.Request.C.Qf,he(olympe.dc.ie(),b),{tag:f,model:e}),a.fc.request(e).then(h).catch(null!=d?d:a.K.error.bind(a.K))):(e=P(g),e.G=olympe.net.Ia.ResponseType.uh,a.G.C(e,k=>{const m=k.sd();200<=m&&300>m?h(k.getData()):null==d||d(`Failed to download file ${b}. Response code ${m}`)}))}})}
478
+ olympe.dc.dr=class{constructor(a,b,c,d,e,f){this.K=a;this.db=b;this.G=c;this.fc=d;this.F=f;this.C=new Map}};function me(a,b){let c=ne.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.ye(b);if(null===b)break;c=ne.get(b)||null}let e;return null!=(e=c)?e:null}olympe.dc.xr=class{constructor(a,b,c){this.K=a;this.C=b;this.db=b.view;this.F=c;this.Ha=new FinalizationRegistry(d=>{this.K.C()&&this.K.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Ob([d])})}};function oe(a,b){a.origin=b;return a}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ra.SELF;this.C=b;this.content=null!=c?c:null;this.F=null!=d?d:yc(olympe.auth.ge()).je()}getType(){return this.type}wc(){return this.F}uc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
479
+ olympe.dc.Request.C={ac:1,ne:10,Gn:24,Hk:25,gr:28,Pg:30,mj:31,Iy:32,Ii:33,Xh:40,Yh:41,Em:42,Po:43,vh:45,Gm:46,Dk:47,fg:50,Qf:51,Gg:52,ht:60,Js:61,fr:62,Kx:63,Hq:64,Fi:65,fn:91,hr:93,Zk:95,QUERY_RESULT:97};olympe.dc.Th=class a{constructor(b,c,d,e,f,g,h,k){this.K=b;this.Z=c;this.C=h;this.sources=new Map;this.F=this.qa(k);this.G=new Map;this.ga(f,g,d,e)}request(b){this.K.debug('Router: sends',b);const c=this.P(b);return this.Lb(c).request(b)}T(b,c){this.K.debug('Router: subscribes',b);const d=this.P(b);return this.Lb(d).L(b,c)}dd(b){const c=b.uc();if(c===this.C){let d;null==(d=this.G.get(b.getType()))||d.forEach(e=>e(b))}else olympe.O.pb.publish(c,b).catch(d=>{this.K.error(`Error while publishing the message ${b} to remote router: ${d}`)})}L(b,
480
+ c){let d=this.G.get(b);void 0===d&&(d=[],this.G.set(b,d));d.push(c)}ba(b){return this.sources.has(b)}Lb(b){let c;return null!=(c=this.sources.get(b))?c:this.sources.get(olympe.dc.Ra.Af)}P(b){var c=olympe.dc.Request.C.ne,d=olympe.dc.Request.C.Hk,e=olympe.dc.Request.C.Gn,f=olympe.dc.Request.C.Ii,g=olympe.dc.Request.C.Xh;const h=olympe.dc.Request.C.vh,k=olympe.dc.Request.C.fg,m=olympe.dc.Request.C.Gg,n=olympe.dc.Request.C.Qf;switch(b.getType()){case c:d=this.F.get(a.C.ne)||[];break;case d:case f:case e:d=
481
+ this.F.get(a.C.Fs)||[];break;case g:case h:d=this.F.get(a.C.TRANSACTION)||[];break;case k:case n:case m:d=this.F.get(a.C.cr)||[];break;default:d=[]}c=b.content;e=olympe.auth.Ca.C.Ge;f=olympe.auth.Ca.C.wf;g=Qd(this.Z);e=!(g===e||g===f);for(var p of d){let q;d=p;f=c&&(null==(q=c)?void 0:q.W)&&c.W();g=d.get('type');if(g===a.F.Oh&&e||g===a.F.Jn&&d.get('id')===f||g===a.F.Hd)return p=p.get('destination'),this.K.debug('Request type',b.getType(),'with original destination',b.uc(),'is redirected to',p),p}return b.uc()}qa(b){const c=
482
+ Object.values(olympe.dc.Th.C),d=Object.values(olympe.dc.Th.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const m=k.type;if(d.includes(m)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',m).set('destinations',n),h.push(n),m===a.F.Jn&&n.set('id',k.id)):this.K.error('Routing rule',f,m,'is not valid. Destinations must be stored in an array')}else this.K.error('Routing rule',f,m,'is not valid. Valid rules are',
483
+ d.toString())})}else this.K.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.K.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}ga(b,c,d,e){const f=olympe.D.ff();this.sources.set(olympe.dc.Ra.SERVER,e.init(this));je(b,this.C,()=>{this.sources.set(olympe.dc.Ra.Af,d.init(this));const g=new Map;olympe.dc.ua.from(this.C,this.C).lb(olympe.dm.DataSource.ti).filter(olympe.dc.query.Da.Pa(olympe.dm.DataSource.Zg,!0)).observe(f).subscribe(h=>
484
+ {var k=pe(h);for(var m of k){const [p,q]=g.get(m);c.G(p);c.P(q);k=this.sources.get(m);this.sources.delete(m);var n=void 0;null==(n=k)||n.destroy()}h=qe(h);for(const p of h)if(h=p.X(),!this.sources.has(h)){const q=new olympe.dc.sources.bo(this.K,p);this.sources.set(h,q);m=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy());g.set(h,[m,n]);q.init(this)}});ke(b,this.C,'router',!0)},'router')}};olympe.dc.Th.C={ne:'getContext',Fs:'query',TRANSACTION:'transaction',cr:'file'};
485
+ olympe.dc.Th.F={Hd:'default',Oh:'offline',Jn:'id'};olympe.dc.Ha={};const re=olympe.dc.va.ORIGIN,se=olympe.dc.va.DESTINATION,ne=new Map,te=new Map,ue=new Map,ve=new Map;function we(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.pm||[])];return olympe.dc.la.C(b,c,...a)}function xe(a,b){ve.set(a,b);return a}function ye(a){return(a=ne.get(a))&&a.F||olympe.dc.CloudObject}function ze(a,b,c){const d=a+'@'+(b===se?re:se);if(te.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);te.set(d,c)}
486
+ function Ae(a){a=a.X()+'@'+a.La();return te.get(a)||olympe.dc.CloudObject}function S(a,b){b.NAME=a;ue.set(a,b)}function T(a){return a.NAME||null}
487
+ olympe.dc.la=class{constructor(){}static C(a,b,...c){if(ne.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${ne.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.U.pb(g):g}}b=new olympe.dc.Ha.Entry(a,b,d);ne.set(a,b);return b.F.entry=b}static Sb(a){return(a=a.entry)&&a.X()||null}};function Be(a,b){a.C=b}function U(a,b){b=b.Pb();ze(b.X(),b.La(),a.F);return b}function Ce(a){a.G=!0;return a}
488
+ olympe.dc.Ha.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.pm=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Yl()&&b.getParameter(olympe.dc.V.sn)){var d=olympe.dc.ya();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ka.ab('dc').error(d)}return this.pm?(a=[void 0,a].concat(qa(b,this.pm)),new c(...a)):new c(void 0,
489
+ a)}ia(a){return new olympe.dc.Ha.Property(a)}oa(a,b=olympe.dc.va.DESTINATION){ze(a,b,this.F);return new olympe.dc.da.re(a,b)}Yl(){return this.G}};B('olympe.dc.registry.Entry',olympe.dc.Ha.Entry);olympe.dc.Ha.Entry.prototype.addRelation=olympe.dc.Ha.Entry.prototype.oa;olympe.dc.Ha.Entry.prototype.addProperty=olympe.dc.Ha.Entry.prototype.ia;olympe.dc.Ha.Entry.sa=[olympe.dc.oe];olympe.dc.Ha.Property=class{constructor(a){this.tag=a}X(){return this.tag}};olympe.dc.Ha.Property.prototype.getTag=olympe.dc.Ha.Property.prototype.X;olympe.dc.Ha.Property.sa=[olympe.dc.oe];olympe.dc.Ha.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ja(a);this.direction=b;this.origin=c;this.L=d}X(){return this.tag}La(){return this.direction}type(){return this.L}Pb(){return new olympe.dc.Ha.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.L,this.origin)}Pa(a){return a instanceof olympe.dc.Ha.Relation?a.X()===this.X()&&a.La()===this.La():!1}toString(){return this.direction+
490
+ this.tag}};olympe.dc.Ha.Relation.prototype.getInverse=olympe.dc.Ha.Relation.prototype.Pb;olympe.dc.Ha.Relation.prototype.getDirection=olympe.dc.Ha.Relation.prototype.La;olympe.dc.Ha.Relation.prototype.getTag=olympe.dc.Ha.Relation.prototype.X;olympe.dc.Ha.Relation.sa=[olympe.dc.oe];olympe.dc.db={};function De(a,b){const c=a.G,d=olympe.dc.ya(),e=olympe.dc.db.Database.C.Ph,f=olympe.dc.db.Database.C.Hd,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Lc('rev-'+b.W());a.K.debug('Generate the reverse graphLayer of',b.W());b.C.forEach((m,n)=>{if(m.L()){k.F(n,olympe.dc.Mb.NONE);for(const [r,t]of m.he())k.Yb(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(m.hf())for(const r of Ee(d,n,m.Z())){m=c.get(r);const t=new Map;m.forEach((u,w)=>{const x=w[0],y=w.substring(1);
491
+ x===e?t.set(y,u):x===f?t.set(w,u):x===g?u.forEach((z,A)=>{k.Ea(y,A,r)}):x===h&&u.forEach((z,A)=>{k.Ea(y,r,A)})});m=m.source();k.Fc(r,m,t)}else{const r=new Map;for(const t of m.Bb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Fe(p,u,!0):p.Ma(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.gd(n,r);for(const [t,u,w]of m.he())w?k.Yb(t,n,u):k.Ea(t,n,u)}}});return k}
492
+ function Ge(a,b,c){const d=b.W();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new He(b,De(a,b));a.C.push(d);a.F.set(d,e);a.G.mi(c);a.write(b,!1)}function Ie(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.cd(d):d,b)}
493
+ olympe.dc.db.Oq=class{constructor(a,b,c,d){this.K=a;this.G=b;this.ya=c;this.L=d;this.C=[];this.F=new Map}cd(a){const b=a.W();this.C.includes(b)?this.push(b):this.write(Ie(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Ie(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Ap(this.K,this.G,this.ya,this.L,b)).write(a)}};
494
+ function Je(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.C.Be(c);b.Bb().forEach((g,h)=>{f.ia(h,g);b.ub(h)});for(const [g,h,k,m]of b.Cb()){if(!m)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);Ke(d,g,n,p)}}function Le(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.C.Be(f);b.Bb().forEach((h,k)=>{void 0!==c.Ma(k)&&(g.ia(k,h),b.ub(k))});for(const [h,k,m]of b.he()){const n=c.pd(h,e,k);void 0!==n&&(Ke(d,h,f,k),n===m&&Ke(a.C,h,f,k))}}
495
+ class He{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.ya()}W(){return this.F.W()}cd(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.hf()?c.L()||Me(this.C,b,f.Z()):c.hf()?(Je(this,f,c,a),Me(a,b,c.Z())):Le(this,f,c,a))}return a}};const Ne=olympe.dc.mc.md,Oe=olympe.dc.mc.Bh,Pe=olympe.dc.va.ORIGIN,Qe=olympe.dc.va.DESTINATION;
496
+ olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ra.SELF;this.K=b;this.hd=olympe.D.Oa();this.Z=olympe.dc.db.Database.G.IDLE;this.ga=new Map;this.Ba=[];this.P=[];this.qa=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Ne.C.xk;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.xe=new olympe.dc.db.Ne(c,this,b,f);d.get('debug')&&this.ki()}W(){return this.id}getState(){return this.Z}ab(){return this.K}create(b,
497
+ c,d,e=!1){var f=this.G(b,!0);if(!f.e&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.ba(f,!0)}e&&f.persist();d&&this.hc(f,d);this.F(a.F.On,b)}update(b,c){c&&(b=this.G(b,!0),this.hc(b,c))}Wa(b){const c=this.get(b);void 0!==c&&(this.ba(c,!1),this.F(a.F.Pn,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Ne:Re(c,d);break;case Oe:Se(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case Ne:Te(c,d);break;case Oe:Ue(c,
498
+ d);break;default:c.unlink(b,d)}}ub(b){for(const c of b)Ve(this.G(c))}Ob(b){for(const c of b)(b=this.get(c))&&We(b)}mi(b){b.forEach(c=>{this.G(c).persist()})}pd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.F.qn,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.F.pn,b),c&&this.F(a.F.ul,b));return d}Cb(b){Xe(this.P[0],olympe.Y.ig(),b)}T(b){this.P[0].C.delete(b)}F(b,c,...d){this.ga.has(b)&&this.ga.get(b).forEach(e=>{e(c,...d)})}ba(b,
499
+ c){this.qa.set(b,c)}If(b,c,d,e){let f;null!=(f=this.P[0])&&Ye(f,b).ia(e?Ze+c:c,d)}gi(b,c,d,e,f){let g;null!=(g=this.P[0])&&(d===$e?f?Ye(g,b).link(c,e):Ye(g,b).unlink(c,e):f?Ye(g,b).Wb(c,e):Ye(g,b).hc(c,e))}Wb(b,c,d){let e;null!=(e=this.P[0])&&Ye(e,b).Ad(c,d)}C(b,c){let d=this.ga.get(b);void 0===d&&(d=[],this.ga.set(b,d));d.push(c)}nb(b){this.Ba.push(b)}L(b){return this.P.reduce((c,d)=>d.P.has(b)||c,!1)}we(){this.Z===a.G.IDLE&&(this.Z=a.G.Aq);this.P.unshift(new olympe.dc.db.$q(this,this.hd))}Ad(){this.Z=
500
+ a.G.He;this.em();af(this.P[0]);this.P.shift();0===this.P.length&&(this.Z=a.G.IDLE,this.Ba.forEach(b=>{b()}),bf(this.xe))}hc(b,c){const d=a.C.Hd;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const m=cf+e;var g=c.get(m);(void 0===g?null:g)!==f&&(g=df+e,null===f?(c.delete(m),f=(f=c.ye())&&Fe(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),ef(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(m,f),ef(c,(new Map).set(e,f))))}else b.update(h,k)}em(){const b=this.P[0];
501
+ for(const [c,d]of this.qa)this.Xb(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,ff(e)):(gf(e),e.e=f),e.db.F(f?hf.Bk:hf.pc,e.C));return g}).forEach(e=>{e=e.tag();d?Ye(b,e).create():Ye(b,e).delete()});this.qa.clear()}Xb(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Pe+Ne)))for(const f of c.values())this.Xb(b,f,d);return d}ki(){const b=a.F.Bk,c=a.F.oj,d=new Set,e=new Map;this.C(a.F.On,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===
502
+ Oe&&g[1]===Qe){const h=g[2];this.get(h).Ua()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.nb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.K.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.K.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});
503
+ e.clear()})}};olympe.dc.db.Database.C={Ph:'$',sr:'~',Hd:'?',fk:'=',Ln:'|',Rm:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.F={pn:0,qn:1,sp:2,ul:3,Sm:4,Tm:5,Bk:6,pc:7,oj:8,gl:9,On:10,Pn:11,Jo:12};olympe.dc.db.Database.G={IDLE:0,Aq:1,He:2};function jf(a,b,c=[]){const d=b.W();Ge(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(Ie(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function kf(a,b){a.C.nb(b)}olympe.dc.db.Wq=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.view=c;this.F=new olympe.dc.db.Oq(a,b,c,d);this.zv=new olympe.dc.db.ns(a,c,b,e)}ab(){return this.K}cd(a){this.F.cd(a)}};const lf=olympe.dc.db.Database.C.ORIGIN,mf=olympe.dc.db.Database.C.DESTINATION,nf=olympe.dc.db.Database.C.Ph,of=olympe.dc.db.Database.C.Hd,pf=olympe.dc.db.Database.C.fk,qf=olympe.dc.db.Database.C.Ln,rf=lf+mf,sf=nf+nf,tf=olympe.dc.db.Database.G;let uf=0;function je(a,b,c,d){a=a.C.G(olympe.dc.ja(b));d=null!=d?d:vf();wf(a,'',d,c)&&a.Ua()&&c(!0,b);return d}
504
+ function ke(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=xf(e,'',c);void 0!==f&&(a.C.getState()!==tf.He||e.L()&&!d||a.C.T(c),d||!e.Ua()&&!e.L()||f(!1,b))}}function Ee(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.Oj(h,f).forEach(([k,,,m])=>{m&&g.add(k)})}.bind(null,a,b,c)}}function vf(){++uf;return String(uf)}
505
+ function yf(a,b,c,d,e){a=a.C.G(olympe.dc.ja(b));c=olympe.dc.ja(c);b=nf+c;e=null!=e?e:vf();if(wf(a,b,e,d)&&a.Ua()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(pf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.C.get(olympe.dc.ja(b));return!a||c&&!a.Ua()?null:a}function zf(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.ja(c),xf(b,nf+c,d),a.C.getState()===tf.He&&a.C.T(d))}
506
+ function Af(a,b,c,d){a=a.C.G(olympe.dc.ja(b));d=null!=d?d:vf();wf(a,sf,d,c)&&a.Ua()&&a.forEach((e,f)=>{const g=f[0];g!==nf&&g!==pf||c(f.substring(1),e,g===pf)});return d}function Bf(a,b,c){b=V(a,b);null!==b&&(xf(b,sf,c),a.C.getState()===tf.He&&a.C.T(c))}function Cf(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ua()||!c&&g.L())e?d(b.substring(1),b[0],c,h):d(c,h)})}
507
+ function W(a,b,c,d,e){a=a.C.G(olympe.dc.ja(b));c=c.La()+c.X();e=null!=e?e:vf();(d=Df(a,c,e,d))&&a.Ua()&&Cf(a,c,!0,d,!1);return e}function Ef(a,b,c,d){const e=a.C.G(olympe.dc.ja(b));a=null!=d?d:vf();const f=Df(e,rf,a,c);f&&e.Ua()&&e.forEach((g,h)=>{g=h[0];g!==lf&&g!==mf||Cf(e,h,!0,f,!0)})}function Ff(a,b,c){const d=V(a,b);if(null!==d){const e=xf(d,rf,c);void 0!==e&&(a.C.getState()!==tf.He||d.L()||a.C.T(c),!d.Ua()&&!d.L()||d.forEach((f,g)=>{f=g[0];(f===lf||f===mf)&&e&&Cf(d,g,!1,e,!0)}))}}
508
+ function Gf(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.hl,e=olympe.dm.Relation.C.Ls,f=olympe.dm.Relation.C.tl,g=olympe.dm.Relation.C.Ko,h=nf+c,k=[];b.forEach((m,n)=>{const p=n[0];if(m instanceof olympe.dc.lc&&p===nf)(m=a.C.get(m.X()))&&k.push([m,n.substring(1),null,!0]);else if(p===lf){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&m.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===mf){const q=n.substring(1);let r,t;const u=
509
+ null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&m.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function Hf(a,b,c,d,e){const f=a.C.G(olympe.dc.ja(b));e=null!=e?e:vf();const g=Df(f,qf+c,e,d);g&&f.Ua()&&Gf(a,b,c).forEach(([h,...k])=>{h.Ua()&&g(...k,!0,h.tag())})}function If(a,b,c,d){const e=V(a,b);if(null!==e){const f=xf(e,qf+c,d);void 0!==f&&(a.C.getState()!==tf.He||e.L()||a.C.T(d),!e.Ua()&&!e.L()||Gf(a,b,c).forEach(([g,...h])=>{(g.Ua()||g.L())&&f(...h,!1,g.tag())}))}}
510
+ function Jf(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===of&&b.set(c.substring(1),d);return b}function Kf(a,b,c){return c===olympe.dc.Mb.NONE?0:a.Ma(b,c,!0)||0}function Lf(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===lf||c===mf){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
511
+ function Mf(a,b,c){if(!a.Ua(b))return a.K.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ja(b)];for(const f of e){const g=a.fb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.K.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ja(b)}`);return d}function Nf(a,b,c,d){return(c=(a=V(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ua()).length:0}
512
+ olympe.dc.$a=class{constructor(a,b){this.K=a;this.C=b}W(){return this.C.W()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.La()+b.X();const e=xf(a,b,c);void 0!==e&&(this.C.getState()!==tf.He||a.L()&&!d||this.C.T(c),d||!a.Ua()&&!a.L()||Cf(a,b,!1,e,!1))}}Ua(a){a=this.C.get(olympe.dc.ja(a));return!(null==a||!a.Ua())}name(a){let b,c;return null!=(c=null==(b=V(this,a))?void 0:b.Ma(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=V(this,a,!0))?a.model():null)?a.tag():null}ye(a){return(a=(a=V(this,
513
+ a,!0))&&a.ye())?a.tag():null}oi(a){a=V(this,a,!0);return!(!a||!a.ye())}Zc(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.ni(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Kf(a){a=V(this,a,!1);return!a||a.P}Ma(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Ma(olympe.dc.ja(b),c);return void 0!==a?a:null}Bb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===nf||!b&&c===pf)&&a.set(d.substring(1),e);return a}Oj(a,b){return Gf(this,a,b).filter(([c])=>c.Ua()).map(([c,
514
+ ...d])=>[c.tag(),...d])}fb(a,b){return this.Pj(a,[b])}cm(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.La()+b.X()))?void 0:e.get(olympe.dc.ja(c));return!(null==a||!a.Ua())}Pj(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.La()+c.X()),void 0!==a)for(const e of a.values())e.Ua()&&b.push(e.tag());a=b}return a}Tb(a,b){var c=V(this,a,!0);return c?(c=c.get(b.La()+b.X()))&&1<c.size?(this.K.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),
515
+ null):(a=c?c.values().next().value:null)&&a.Ua()?a.tag():null:null}og(a,b,c){a=olympe.dc.ja(a);const d=Mf(this,a,b);d.delete(a);return c?(c=olympe.dc.ja(c),d.has(c)?Array.from(Mf(this,c,b.Pb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Qp(a,b,c){if(!this.Ua(a))return null;b=Mf(this,a,b);const d=[olympe.dc.ja(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Ml(a,b,c){return this.Pj(a,b).find(c)||null}Wt(a,b,c){return this.Pj(a,
516
+ b).filter(c)}Up(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.ye();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ua())throw a=`Try to get all extensions of the model ${olympe.dc.ja(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=V(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
517
+ return e.map(f=>f.tag())}ni(a,b){const c=olympe.dc.ja(b);return!!this.Qp(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Sd(a){return this.fb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.$a.prototype.getInstances=olympe.dc.$a.prototype.Sd;olympe.dc.$a.prototype.isExtending=olympe.dc.$a.prototype.ni;olympe.dc.$a.prototype.getExtendedModels=olympe.dc.$a.prototype.Up;olympe.dc.$a.prototype.findAllRelated=olympe.dc.$a.prototype.Wt;olympe.dc.$a.prototype.findRelated=olympe.dc.$a.prototype.Ml;
518
+ olympe.dc.$a.prototype.findRecursive=olympe.dc.$a.prototype.Qp;olympe.dc.$a.prototype.getRecursiveRelated=olympe.dc.$a.prototype.og;olympe.dc.$a.prototype.getUniqueRelated=olympe.dc.$a.prototype.Tb;olympe.dc.$a.prototype.getMultiRelated=olympe.dc.$a.prototype.Pj;olympe.dc.$a.prototype.isRelated=olympe.dc.$a.prototype.cm;olympe.dc.$a.prototype.getRelated=olympe.dc.$a.prototype.fb;olympe.dc.$a.prototype.getProperties=olympe.dc.$a.prototype.Bb;olympe.dc.$a.prototype.getProperty=olympe.dc.$a.prototype.Ma;
519
+ olympe.dc.$a.prototype.isPersisted=olympe.dc.$a.prototype.Kf;olympe.dc.$a.prototype.instanceOf=olympe.dc.$a.prototype.Zc;olympe.dc.$a.prototype.isModel=olympe.dc.$a.prototype.oi;olympe.dc.$a.prototype.extension=olympe.dc.$a.prototype.ye;olympe.dc.$a.prototype.model=olympe.dc.$a.prototype.model;olympe.dc.$a.prototype.name=olympe.dc.$a.prototype.name;olympe.dc.$a.prototype.exist=olympe.dc.$a.prototype.Ua;const Of=olympe.dc.db.Database.C.ORIGIN,$e=olympe.dc.db.Database.C.DESTINATION,Ze=olympe.dc.db.Database.C.fk,Pf=olympe.dc.db.Database.C.Ph,Qf=olympe.dc.db.Database.C.Ln,Rf=olympe.dc.db.Database.C.Rm,Sf=Of+$e,Tf=Pf+Pf,Uf=Array.from(Object.values(olympe.dc.Mb)).filter(a=>null!==a);function Xe(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
520
+ function af(a){const b=a.L;a.F.forEach((c,d)=>{var e=b.get(d);if(c.L()||c.hf()){var f=e.get(Rf);f&&Vf(a,f,c.L(),d);c.hf()&&a.P.add(d)}for(const [n,p]of c.Bb()){var g=n[0]===Ze,h=g?n.substring(1):n;f=a;var k=e,m=p;const q=k.get(Rf+Pf+h);q&&Vf(f,q,m,g);(k=k.get(Rf+Tf))&&Vf(f,k,h,m,g)}for(const n of c.Cb())Wf(a,e,...n);(e=c.qa)&&Xf(a,b.get(e),c.Xb,!c.hf(),d)});a.F.clear();a.G.clear();Yf(a)}function Ye(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yf(b),a.F.set(b,c));return c}
521
+ function Vf(a,b,...c){b.forEach((d,e)=>{Xe(a,e,d.bind(null,...c))})}function Wf(a,b,c,d,e,f){var g=b.get(Rf+d+c);g&&Vf(a,g,f,e);(g=b.get(Rf+Sf))&&Vf(a,g,c,d,f,e);Zf(a,c,d).forEach((h,k)=>{(k=b.get(Rf+Qf+k))&&Vf(a,k,c,d,h,f,e)})}function Xf(a,b,c,d,e){Uf.forEach(f=>{(f=b.get(Rf+Qf+f))&&Vf(a,f,c,null,!0,d,e)})}function Yf(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
522
+ function Zf(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.L.get(b);e=new Map;Uf.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(Pf+g))?h:0;(c===Of?12:3)&k&&e.set(g,!!((c===Of?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.$q=class{constructor(a,b){this.L=a;this.T=b;this.F=new Map;this.P=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function bf(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.Ne.C.wm:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.Ne.C.Vs:a.G=!0,a.run()}}
523
+ olympe.dc.db.Ne=class{constructor(a,b,c,d){this.K=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.Ne.C.xk&&this.init()}run(){const a=this.C;this.K.debug('Start garbage collector with',this.F.size,'instances to check');for(const b of this.F){const c=a.get(b);!c||0<c.c||(this.K.debug('Remove unused instance',b,'from database'),a.pd(b))}this.F.clear();this.G=!1}init(){const a=olympe.dc.db.Database.F.sp,b=olympe.dc.db.Database.F.Pn,c=olympe.dc.db.Database.F.Jo,d=olympe.dc.db.Database.G.IDLE,
524
+ e=f=>{this.F.add(f);this.C.getState()===d&&bf(this)};this.C.C(olympe.dc.db.Database.F.ul,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.C(c,(f,...g)=>{this.K.error(g[0])})}};olympe.dc.db.Ne.C={xk:0,Vs:1,wm:2};olympe.dc.db.Ne.F=5E3;function Me(a,b,c=olympe.dc.Mb.NONE){b=a.Oj(b,c);for(const d of b)$f(a,d,!1),a.C.delete(d)}function Ke(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.T(b,olympe.dc.va.DESTINATION,d);a&&a.T(b,olympe.dc.va.ORIGIN,c)}function ag(a,b,c){let d=a.C.get(b);void 0===d&&(d=new olympe.dc.db.yf(b),a.C.set(b,d));return c?d.Wa(c):d}
525
+ function $f(a,b,c){const d=olympe.dc.va.ORIGIN,e=olympe.dc.va.DESTINATION,f=a.C.get(b);for(const [h,k,m]of f.he())if(m||!c){f.T(h,e,k);var g=a.C.get(k);g&&g.T(h,d,b)}for(const [h,k,m]of f.Ob())if(m||!c)f.T(h,d,k),(g=a.C.get(k))&&g.T(h,e,b)}
526
+ function bg(a,b){var c=olympe.dc.ya();if(c.Ua(b)){const d=c.model(b),e=c.source(b),f=c.Bb(b,!0);Jf(c,b).forEach((g,h)=>{f.set(`${olympe.dc.Vi.Hd}${h}`,g)});a.Fc(b,e,f,d);(c=c.ye(b))&&a.Ea(olympe.dc.mc.Bh,b,c);f.forEach(g=>{g instanceof olympe.dc.lc&&bg(a,g.X())})}}function*cg(a,b,c,d,e=[]){e.push(b);b=a.Be(b);for(const [f,g]of b.fb(c))e.includes(f)||(yield*cg(a,f,c,d,e),yield d(f,g))}
527
+ olympe.dc.db.Lc=class{constructor(a){this.id=null!=a?a:olympe.Y.af();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substring(0,a.length-2));return a+'}}'}static tc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Lc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.yf.tc(b[c]);a.C.set(c,d)}return a}W(){return this.id}Md(a){const b=
528
+ olympe.dc.db.yf.C.Xk,c=olympe.dc.db.yf.C.pc,d=olympe.dc.db.yf.C.Aj;this.C.forEach((e,f)=>{const g=e.Dd();switch(e.getState()){case b:const h=e.Lb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.ba()?e.Bb():void 0;a.Fc(f,h,k,g);break;case d:e.ba()&&a.gd(f,e.Bb(),g);break;case c:a.F(f,e.Z(),g)}for(const [h,k,m]of e.he())e=this.C.get(k),m?a.Ea(h,f,k,g,e.Dd()):a.Yb(h,f,k,g,e.Dd())})}kh(){return 0===this.C.size}G(){let a=0;this.C.forEach(b=>{a+=b.hd()});
529
+ return a}Fc(a,b,c,d=null){b=ag(this,a).create(b);'string'===typeof d&&this.Ea(olympe.dc.mc.md,a,d,d,null);c&&b.Bl(c)}gd(a,b,c=null){b&&ag(this,a,c).Bl(b)}F(a,b=olympe.dc.Mb.NONE,c=null){const d=this.C.get(a);if(d&&d.L())Me(this,a,b);else{ag(this,a,c).delete(b);for(const e of this.Oj(a,b,!1))this.C.get(e).Bb().clear(),$f(this,e,!0)}}Ea(a,b,c,d=null,e=null){ag(this,b,d).link(a,c);ag(this,c,e).Wb(a,b)}Yb(a,b,c,d=null,e=null){ag(this,b,d).unlink(a,c);ag(this,c,e).hc(a,b)}Sd(){return function*(a){for(const b of a.values())if(b.L()||
530
+ b.hf()||b.ba())yield b}(this.C)}Be(a){return this.C.get(olympe.dc.ja(a))||null}he(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.he((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}og(a,b,c=(d,e)=>[d,e]){return cg(this,a,b,c)}Oj(a,b,c=!0){const d=olympe.dm.Relation.C.hl,e=olympe.dm.Relation.C.tl,f=olympe.dc.va.ORIGIN,g=olympe.dc.ya();a=new Set([a]);const h=new Set;for(const m of a){var k=this.C.get(m);if(void 0!==k){for(const [n,p,q]of k.he())q&&Kf(g,n,b)&e?
531
+ a.add(p):c||q||h.add(`${m}.${n}.${p}`);for(const [n,p,q]of k.Ob())q&&Kf(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${m}`)}for(const [n,p,q]of Lf(g,m))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${m}`:`${m}.${n}.${q}`)&&Kf(g,n,b)&k&&a.add(q)}return Array.from(a).filter(m=>this.C.has(m))}};olympe.dc.db.Lc.sa=[olympe.dc.Writable,olympe.dc.Ds];const hf=olympe.dc.db.Database.F,dg=olympe.dc.db.Database.C.Ph,df=olympe.dc.db.Database.C.sr,cf=olympe.dc.db.Database.C.Hd,eg=olympe.dc.db.Database.C.fk,fg=olympe.dc.db.Database.C.Rm,X=olympe.dc.va.ORIGIN,Y=olympe.dc.va.DESTINATION,gg=olympe.dc.mc.md,hg=olympe.dc.mc.Bh;function Fe(a,b,c=!1){const d=a.get(cf+b);return c||void 0!==d?d:a.get(df+b)}
532
+ function Re(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(gg,c)}a.link(gg,b);b.forEach((d,e)=>{if(e[0]===cf||e[0]===df)e=e.substring(1),ig(a,e,d)});null===a.G||!b.e&&b!==a||a.db.ba(a,!0)}function Se(a,b){const c=a.ye();if(null!==c){if(c===b)return;a.unlink(hg,c)}a.link(hg,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===cf||f[0]===df)f=f.substring(1),a.has(cf+f)||(a.set(df+f,e),d.set(f,e))});ef(a,d)}
533
+ function Te(a,b){a.unlink(gg,b);a.forEach((c,d)=>{c=d.substring(1);ig(a,c,null)});a.db.ba(a,!1)}function Ue(a,b){a.unlink(hg,b);const c=new Map;a.forEach((d,e)=>{e[0]===df&&(a.delete(e),d=e.substring(1),c.set(d,null))});ef(a,c)}function Ve(a){a.c++;1===a.c&&a.db.F(hf.sp,a.C)}
534
+ function We(a){0<a.c?--a.c:a.db.F(hf.Jo,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.F(hf.ul,a.C)}function wf(a,b,c,d){const e=jg(a,fg+b);return e.has(c)?!1:(e.set(c,d),Ve(a),a.db.F(hf.Sm,a.C,b,c),!0)}
535
+ function xf(a,b,c){const d=kg(a,fg+b,c);void 0!==d&&(We(a),a.db.F(hf.Tm,a.C,b,c));return d}function Df(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?Ve(g):We(g));d(...f)};return wf(a,b,c,e)?e:null}function lg(a){void 0!==a.F&&(We(a),a.db.Wb(a.C,a.F.tag,a.F.Ga),a.F=void 0)}function mg(a,b,c,d){a.e&&a.db.If(a.C,b,c,d)}
536
+ function ef(a,b,c=[]){const d=a.get(X+gg);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>ig(e,g,f))});a=a.get(X+hg);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(cf+k)||(g.set(k,h),null!==h?e.set(df+k,h):e.delete(df+k))});ef(e,g,[...c,f])}})}function jg(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function ng(a,b,c,d,e){a.db.gi(a.C,b,c,d.C,e)}
537
+ function kg(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function ig(a,b,c){if(!a.has(dg+b)){const d=eg+b,e=a.get(d);c!==(void 0!==e?e:null)&&(null===c?a.delete(d):a.set(d,c),mg(a,b,c,null!==c))}}function ff(a){a.forEach((b,c)=>{const d=c[0];if(d===X||d===Y){const e=c.substring(1),f=d===X?Y:X;b.forEach(g=>{g.e&&(ng(a,e,d,g,!0),ng(g,e,f,a,!0))})}else if(d===dg||d===eg)c=c.substring(1),mg(a,c,b,d===eg)})}
538
+ function gf(a){a.forEach((b,c)=>{const d=c[0];if(d!==fg){var e=c.substring(1);d===X?b.forEach(f=>{f.unlink(e,a)}):d===Y?b.forEach(f=>{a.unlink(e,f)}):d===dg&&a.update(e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag);let c,d;(null==(c=b.get(dg+a.F.Ga))?void 0:null==(d=c.X)?void 0:d.call(c))===a.C&&b.update(a.F.Ga,null)}}
539
+ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.P=!1;this.db=b}tag(){return this.C}Ua(){return this.e}L(){return this.db.L(this.C)}source(){return this.G}model(){const a=this.get(Y+gg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}ye(){const a=this.get(Y+hg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ma(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
540
+ var b=this.model();if(b){var c=b.Ma(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.ye())?(c=b.Ma(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Ma(a,b=!1){const c=this.get(dg+a);return b||void 0!==c?c:this.get(eg+a)}update(a,b){const c=dg+a;var d=this.get(c),e=d=void 0===d?null:d;(e instanceof
541
+ Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Pa?e.Pa(b):e===b)||(d instanceof olympe.dc.lc&&(lg(this.db.get(d.X())),this.db.Wa(d.X())),b instanceof olympe.dc.lc&&(d=this.db.G(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.ab().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.Ga+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(Ve(d),d.db.Wb(d.C,
542
+ e,a)),d.F={tag:e,Ga:a}),d=eg+a,null===b?(this.delete(c),b=(b=this.model())&&Fe(b,a),void 0!==b?(this.set(d,b),mg(this,a,b,!0)):mg(this,a,null,!1)):(this.set(c,b),this.delete(d),mg(this,a,b,!1)))}link(a,b){var c=X+a;const d=jg(this,Y+a);c=jg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(hf.oj,this.C,a,Y,b.C),this.db.F(hf.oj,b.C,a,X,this.C),this.e&&b.e&&(ng(this,a,Y,b,!0),ng(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==kg(this,Y+a,b.C)&&(kg(b,c,this.C),this.db.F(hf.gl,this.C,a,Y,
543
+ b.C),this.db.F(hf.gl,b.C,a,X,this.C),this.e&&b.e&&(ng(this,a,Y,b,!1),ng(b,a,X,this,!1)))}persist(){this.P=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===dg&&a instanceof olympe.dc.lc&&lg(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(dg+this.F.Ga)}};olympe.dc.db.yf=class a{constructor(b){this.nb=b;this.P=this.ga=null;this.cc=olympe.dc.Mb.NONE;this.G=a.C.Aj;this.F=this.C=this.Xb=this.qa=this.properties=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.nb)+', "model": '+JSON.stringify(this.P)+', "src": '+JSON.stringify(this.ga)+', "state": '+JSON.stringify(this.G);if(this.properties){b+=', "properties": {';for(var c of this.properties.keys()){const d=this.properties.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);
544
+ b+=', '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}if(this.C){b+=', "relations": {';for(const d of this.C.keys()){c=this.C.get(d);b+=JSON.stringify(d)+': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substring(0,b.length-2));b+='}'}return b+'}'}static tc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.yf(c.tag);b.P=c.model;b.ga=c.src;b.G=c.state;const d=
545
+ c.properties;if(d){b.properties=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.lc.tc(f):h=olympe.D.tc(f));null!==h&&void 0!==h&&b.properties.set(e,h)}}if(c=c.relations){b.C=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.C.set(f,e)}}return b}tag(){return this.nb}Dd(){return this.P}Lb(){return this.ga}getState(){return this.G}Wa(b){if(null===this.P)this.P=b;else if(this.P!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.P}`);
546
+ return this}Z(){return this.G===a.C.pc?this.cc:olympe.dc.Mb.NONE}create(b){this.G=a.C.Xk;this.ga=null!=b?b:null;return this}delete(b=olympe.dc.Mb.NONE){this.G=a.C.pc;this.cc=b;this.properties=null;return this}ia(b,c){if(this.G===a.C.pc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Bl(b){this.G!==a.C.pc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Ad(b,c){if(null!==this.qa&&this.qa!==b)throw Error('An instance should never be set as complex property of multiple instances');
547
+ this.qa=b;this.Xb=c}ub(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.md&&this.Wa(c);this.oa(this.C,b,c,!0);return this}unlink(b,c){null===this.C&&(this.C=new Map);b===olympe.dc.mc.md&&this.Wa(c);this.oa(this.C,b,c,!1);return this}Wb(b,c){null===this.F&&(this.F=new Map);this.oa(this.F,b,c,!0)}hc(b,c){null===this.F&&(this.F=new Map);this.oa(this.F,b,c,!1)}pd(b,c,d){if(c=c===olympe.dc.va.ORIGIN?
548
+ this.F:this.C)return(b=c.get(b))&&b.get(d)}T(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.F:this.C)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}L(){return this.G===a.C.Xk}hf(){return this.G===a.C.pc}hd(){let b=this.properties?this.properties.size:0;this.C&&this.C.forEach(c=>{b+=c.size});return b}ba(){return null!==this.properties}Bb(){let b;return null!=(b=this.properties)?b:new Map}Ma(b){if(this.properties)return this.properties.get(b)}fb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,
549
+ f]of d)yield c(e,f)}(b.La()===olympe.dc.va.ORIGIN?this.F:this.C)}Tb(b){const c=b.La()===olympe.dc.va.ORIGIN?this.F:this.C;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}he(b=(c,d,e)=>[c,d,e]){return this.Ba(this.C,b)}Ob(b=(c,d,e)=>[c,d,e]){return this.Ba(this.F,b)}Cb(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,m)=>b(h,d,k,m));yield*e(g,(h,k,m)=>b(h,c,k,m))}(this.Ba.bind(this),this.C,this.F)}oa(b,c,d,e){if(this.G!==
550
+ a.C.pc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*Ba(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.yf.C={Xk:0,Aj:1,pc:2};olympe.dc.db.ns=class{constructor(a,b,c,d){this.K=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.ja(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ua()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.Ph+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
551
+ d.join(' --M--\x3e ')}this.K.info(a)}else this.K.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.qn,b=olympe.dc.db.Database.F.Bk,c=olympe.dc.db.Database.F.pc,d=olympe.dc.db.Database.F.oj,e=olympe.dc.db.Database.F.gl,f=olympe.dc.db.Database.F.Sm,g=olympe.dc.db.Database.F.Tm,h=()=>{};this.C.C(olympe.dc.db.Database.F.pn,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.Cb(()=>{Ef(this.view,k,h,`monitorRelations${k}`)})});this.C.C(c,
552
+ k=>{this.C.Cb(()=>{Ff(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.Ap=class{constructor(a,b,c,d,e){this.K=a;this.C=b;this.ya=c;this.G=d;this.L=e}write(a){if(this.G){const b=new og(this.ya);a.Md(b);this.K.info(b.flush())}this.C.we();a.Md(this);this.C.Ad()}Fc(a,b,c){this.C.create(a,b,c,this.L)}gd(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Mb.NONE){for(const c of Ee(this.ya,a,b))this.C.Wa(c)}Ea(a,b,c){this.C.link(a,b,c)}Yb(a,b,c){this.C.unlink(a,b,c)}};
553
+ function pg(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.lc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.pg()+','+f.mg()+','+f.kg()+','+f.jg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=pg(a,f,
554
+ (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function qg(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function rg(a,b){let c;return b===olympe.dc.mc.md?'Model':null!=(c=a.db.name(b))?c:b}
555
+ class og{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Fc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${pg(this,c)})`,qg(this,d))}gd(a,b,c){this.log(`updateInstance(tag: ${a}, ${pg(this,b)})`,qg(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,qg(this,c))}Ea(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,rg(this,a))}Yb(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
556
+ rg(this,a))}}olympe.dc.db.Ap.sa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={za:'dc.db.Logger',Fk:'dc.db.gc.Logger',Fa:'dc.db.DatabaseManager',Li:'dc.db.Database',uk:'dc.db.DBView',Lx:'dc.db.Graph',Jw:'dc.db.DatabaseWriter',By:'dc.db.PermissionProcessor',Mh:'dc.db.GraphMonitor'};olympe.dc.db.V={Bn:'db.garbageCollector',Cn:'db.garbageCollectorDelay',Mh:'db.monitor',hn:'db.debug'};
557
+ olympe.U.config(function(a){F(a,olympe.dc.db.V.Bn,olympe.dc.db.Ne.C.wm);F(a,olympe.dc.db.V.Cn,5E3);F(a,olympe.dc.db.V.Mh,!1);F(a,olympe.dc.db.V.hn,!1);E(a,olympe.dc.db.R.za,[olympe.ka.R.Fa],b=>b.Gc('db'));E(a,olympe.dc.db.R.Fk,[olympe.ka.R.Fa],b=>b.Gc('gc'));E(a,olympe.dc.db.R.Li,[olympe.dc.db.R.za,olympe.dc.db.R.Fk,new olympe.U.ma(olympe.dc.V.bg),new olympe.U.ma(olympe.dc.db.V.Bn),new olympe.U.ma(olympe.dc.db.V.Cn),new olympe.U.ma(olympe.dc.V.Sg),new olympe.U.ma(olympe.dc.db.V.hn)],(b,c,d,e,f,g,
558
+ h)=>{e=g?olympe.dc.db.Ne.C.xk:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.R.uk,olympe.dc.$a,olympe.dc.db.R.za,olympe.dc.db.R.Li);E(a,olympe.dc.db.R.Mh,[olympe.dc.db.R.Fa],b=>b.zv);D(a,olympe.dc.db.R.Fa,olympe.dc.db.Wq,olympe.dc.db.R.za,olympe.dc.db.R.Li,olympe.dc.db.R.uk,new olympe.U.ma(olympe.dc.V.qf),new olympe.U.ma(olympe.dc.db.V.Mh))},'olympe.dc.db');
559
+ olympe.U.run([olympe.dc.db.R.Li,olympe.dc.db.R.Mh],(a,b)=>{olympe.Mj().db=a;olympe.Mj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function sg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
560
+ olympe.dc.query.Ie=class{constructor(a,b,c){this.db=olympe.dc.ya();this.C=a;this.Ga=b;this.Lh=c}ha(){return{p:this.Ga.X(),o:this.Lh}}toString(){return'sortByQueryPart-'+this.Lh+this.Ga.X()}lg(){const a=this.db.Tb(this.Ga,olympe.dm.Property.typeRel),b=olympe.dc.ja;if(a===b(olympe.dm.String))return sg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return sg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return sg((c,d)=>c.getTime()-d.getTime());olympe.ka.ab('dc.query').warn(`No comparator found for type with tag ${a}`);
561
+ return sg(()=>-1)}Ma(){return this.Ga}};function tg(a,b){return new olympe.dc.query.xd((new olympe.dc.transaction.fj(b)).C(a),b)}olympe.dc.query.xd=class{constructor(a,b){this.C=a;this.source=b}static Nl(a){return new olympe.dc.query.xd(new olympe.dc.db.Lc(`DataResult_${a.W()}`),a.Lb())}create(a,b,c){this.C.Fc(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Xc(){return this.C}ha(){const a=new olympe.dc.transaction.Yf;this.C.Md(a);return{s:this.source,p:ug(a)}}};
562
+ olympe.dc.query.xd.prototype.createRelation=olympe.dc.query.xd.prototype.Ea;olympe.dc.query.xd.prototype.create=olympe.dc.query.xd.prototype.create;olympe.dc.query.xd.fromQuery=olympe.dc.query.xd.Nl;olympe.dc.oe=class{X(){}};olympe.dc.oe.prototype.getTag=olympe.dc.oe.prototype.X;olympe.dc.Nx=olympe.dc.oe;function vg(a){let b;if(null==(b=a.C)?0:b.kh())if(a=a.L,!a.P){let c;null==(c=a.T)||c.call(a)}}function wg(a,b,c,d,e){vg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.Yb(c,d,e)}
563
+ olympe.dc.query.us=class{constructor(a,b,c,d){this.K=a;this.source=b;this.G=c;this.L=d;this.C=this.F=null;this.db=olympe.dc.ya()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.G}:${a}:notif`;je(this.db,a,(d,e)=>{if(d){vg(this);let f;null==(f=this.C)||bg(f,e)}else if(b&&Bf(this.db,e,c),!this.db.Ua(e)){vg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Mb.NONE)}},c);b&&Af(this.db,a,(d,e,f)=>{vg(this);let g;f||null!=(g=this.C)&&g.gd(a,new Map([[d,e]]))},c)}}stop(a){ke(this.db,a,`${this.G}:${a}:notif`)}};olympe.dc.query.gj={ASC:'ASC',DESC:'DESC'};function xg(a){const b=yg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].W():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),m=new Set(k.Sd()),n=new Map,p=a.L.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,x)=>{for(const y of k.F(x)){let z;n.set(y,Array.from(w).map(A=>p?`${x};${A}`:A).reduce((A,J)=>A.add(J),null!=(z=n.get(y))?z:new Set))}m.delete(x)});t&&m.forEach(w=>{const x=p?`${w};${u}`:u;for(const y of k.F(w)){let z;n.set(y,
564
+ (null!=(z=n.get(y))?z:new Set).add(x))}})}else m.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),w=new Map;n.forEach((x,y)=>{let z;null==(z=r.get(y))||z.forEach(A=>{let J;const M=null!=(J=w.get(y))?J:new Set;x.forEach(La=>M.add(La+A));w.set(y,M)});n.delete(y);r.delete(y)});t&&n.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>z+u)))});b[e-1].T()&&r.forEach((x,y)=>{w.set(y,new Set(Array.from(x).map(z=>
565
+ q+z)))});c.set(g,[w,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function zg(a){if(null===a.F){const b={yb:a.query.lg(),ed:a.ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Ka.from(a.Z,xg(a),b)}return a.F}function Ag(a,b){a.T=b}function Bg(a){if(!a.P){null!==a.F&&(a.Z=a.F);a.F=null;a.P=!0;let b;null==(b=a.T)||b.call(a)}}
566
+ function Cg(a,b){let c;return null!=(c=a.C.get(b).Sd())?c:[]}function Dg(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Eg(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.K.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Bg(a);let g;f&&(null==(g=a.ke)||g.watch(b,a.L.has(c)));return f}function Fg(a,b,c,d,e,f){null!==a.ke&&(d===olympe.dc.va.ORIGIN?wg(a.ke,b,c,f,e):wg(a.ke,b,c,e,f))}
567
+ function Gg(a){a.K.C()&&a.K.debug(`Start sending notifications for query ${a.query.W()}`);const b=new olympe.dc.query.us(a.K,a.query.Lb(),a.query.W(),a);a.C.forEach((c,d)=>{for(const e of c.Sd())b.watch(e,a.L.has(d))});null!=b.C||(b.C=new olympe.dc.db.Lc);a.ke=b}function Hg(a){null!==a.ke&&(a.K.C()&&a.K.debug(`Stop sending notifications for query ${a.query.W()}`),a.C.forEach(b=>{for(const c of b.Sd())a.ke.stop(c)}),a.ke=null)}
568
+ function Ig(a){a.P=!1;if(null!=(a=a.ke)){let b;const c=!(null==(b=a.C)?0:b.kh());a.F=c?a.C:null;c&&(a.C=new olympe.dc.db.Lc,a.K.C()&&a.K.debug(`Commit notification with ${a.F.G()} operations for query ${a.G}`))}}
569
+ olympe.dc.query.Co=class{constructor(a,b){this.K=a;this.query=b;this.G=olympe.Y.kb(b.F);this.xa=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.xa.ml);this.L=new Set(b.L);this.ed=-1;this.P=!1;this.T=null;this.Z=olympe.dc.Ka.empty();this.ke=this.F=null;a=yg(b);a.forEach(c=>{const d=c.W();this.xa.set(d,c.L());this.C.set(d,c.qa())});b=b.lg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.W())))if(c+=this.L.has(d)?1:0,b===d){this.ed=c;break}}}remove(a,b=this.G,c='root'){b=
570
+ this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Bg(this);if(!b.has(a)){let d;null==(d=this.ke)||d.stop(a);return!0}return!1}rc(a){const b=a.F,c=olympe.Y.kb(b);a=yg(a);const d=[];for(const [f,g]of this.C){if(g.P(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.ba(k,this.xa.get(k))).filter(k=>{let m,n;return null!=(n=null==(m=this.xa.get(k))?void 0:m.rc(f))?n:!1});e.set(f.W(),h);return 0<h.length})}};function Jg(a){var b=olympe.dc.query.Da.C.mp;const c=olympe.dc.query.Da.C.rn,d=olympe.dc.query.Da.C.Ji,e=olympe.dc.query.Da.C.Mn,f=olympe.dc.query.Da.C.lo,g=olympe.dc.query.Da.C.Lo,h=olympe.dc.query.Da.C.um,k=olympe.dc.query.Da.C.so;switch(a.pr){case b:return new olympe.dc.query.$.pl(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.Xd(a.p,b,olympe.dc.ya());case d:return new olympe.dc.query.$.Je(a.p,
571
+ a.s,olympe.dc.ya(),a.c);case e:return new olympe.dc.query.$.Ih(olympe.dc.ya(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.$d(Jg(a.v));case g:return new olympe.dc.query.$.Ue(a.p,new RegExp(a.r),olympe.dc.ya(),a.c);case k:return new olympe.dc.query.$.be(...a.p.map(m=>Jg(m)));case h:return new olympe.dc.query.$.jd(...a.p.map(m=>Jg(m)));default:return null}}
572
+ olympe.dc.query.Da=class{observe(){}jb(){}compile(){return[[this]]}$c(){return new olympe.dc.query.$.$d(this)}Bb(){}rc(){}clear(){}ha(){}Bc(){}toString(){}static kv(...a){return new olympe.dc.query.$.pl(a)}static Pa(a,b){return new olympe.dc.query.$.Xd(a,b,olympe.dc.ya())}static contains(a,b,c=!0){return new olympe.dc.query.$.Je(a,b,olympe.dc.ya(),c)}static Tv(a,b,c=!0){return new olympe.dc.query.$.Ue(a,b,olympe.dc.ya(),c)}static Tj(a,b,c=!0){return new olympe.dc.query.$.Ih(olympe.dc.ya(),a,b,!1,
573
+ c)}static yi(a,b,c=!0){return new olympe.dc.query.$.Ih(olympe.dc.ya(),a,b,!0,c)}static and(...a){return new olympe.dc.query.$.jd(...a)}static or(...a){return new olympe.dc.query.$.be(...a)}static $c(a){return new olympe.dc.query.$.$d(a)}};olympe.dc.query.Da.not=olympe.dc.query.Da.$c;olympe.dc.query.Da.or=olympe.dc.query.Da.or;olympe.dc.query.Da.and=olympe.dc.query.Da.and;olympe.dc.query.Da.smallerThan=olympe.dc.query.Da.yi;olympe.dc.query.Da.greaterThan=olympe.dc.query.Da.Tj;
574
+ olympe.dc.query.Da.regex=olympe.dc.query.Da.Tv;olympe.dc.query.Da.contains=olympe.dc.query.Da.contains;olympe.dc.query.Da.equals=olympe.dc.query.Da.Pa;olympe.dc.query.Da['in']=olympe.dc.query.Da.kv;olympe.dc.query.Da.C={mp:0,rn:1,Ji:2,Mn:3,lo:4,Lo:5,so:6,um:7};function yg(a){return Array.from(a.xa)}function Kg(a,b=a.G){return 0<=b?a.xa[b].W():olympe.Y.kb(a.F)}function Lg(a,b,c,d=!1){var e=olympe.dc.Mb.Bf;d=d?olympe.dc.ua.Dc.Qh:olympe.dc.ua.Dc.Bg;b=olympe.dc.ja(b);const f=he(olympe.dc.ie(),b);b=(new olympe.dc.ua(b,f)).Ld();b.xa=[new olympe.dc.query.xa.me(Kg(b),e,c)];return b.observe(a,d)}
575
+ function Mg(a,b){const c=b.W();let d=a.G+1;for(;d<a.xa.length&&a.xa[d].W()!==c;)d++;b=d<a.xa.length?a.xa:a.xa.concat(b);return new olympe.dc.ua(a.F,a.source,b,d,a.L,a.C)}function Ng(a){const b=0===a.L.size?a.Ld():a;if(null!==b.C.ed&&!b.L.has(Kg(a,b.C.ed)))throw Error('AndReturn was not called for the current level before sortBy operator');return b}
576
+ olympe.dc.ua=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,ed:null,xg:null}){this.db=olympe.dc.ya();this.F=a;this.source=b;this.xa=c;this.G=d;this.L=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ja(a);b=null!=b?b:he(olympe.dc.ie(),a);return new olympe.dc.ua(a,b)}static Vj(a,b=!0,c){a=olympe.dc.ja(a);c=null!=c?c:olympe.dc.ie().fromModel(a);return b?(new olympe.dc.ua(a,c)).hg(olympe.dc.CloudObject.extendedByRel,!0).lb(olympe.dc.CloudObject.instancesRel):(new olympe.dc.ua(a,c)).lb(olympe.dc.CloudObject.instancesRel)}static cc(a,
577
+ b,c,d,e=!1){e=e?olympe.dc.ua.Dc.Qh:olympe.dc.ua.Dc.Bg;b=olympe.dc.ja(b);d=null!=d?d:he(olympe.dc.ie(),b);d=(new olympe.dc.ua(b,d)).Ld();d.xa=[new olympe.dc.query.xa.me(Kg(d),c)];return d.observe(a,e)}lb(a,b=!1){return Mg(this,new olympe.dc.query.xa.Sf(Kg(this),a,b))}hg(a,b=!1,c=!1){return Mg(this,new olympe.dc.query.xa.vf(Kg(this),a,b,c))}Ld(){const a=(new Set(this.L)).add(Kg(this));return new olympe.dc.ua(this.F,this.source,this.xa,this.G,a,this.C)}filter(a){const b=Array.from(this.xa);b[this.G]=
578
+ b[this.G].filter(a);return new olympe.dc.ua(this.F,this.source,b,this.G,this.L,this.C)}di(){return this}fm(a,b=0){return new olympe.dc.ua(this.F,this.source,this.xa,this.G,this.L,{ed:this.C.ed,max:a,offset:b,xg:this.C.xg})}ck(a,b=olympe.dc.query.gj.ASC){if(0>this.G)throw Error('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');const c=this.xa[this.G],d={ed:this.G,max:this.C.max,offset:this.C.offset,xg:this.C.xg},e=Array.from(this.xa);e[this.G]=c.sort(a,
579
+ b);return new olympe.dc.ua(this.F,this.source,e,this.G,this.L,d)}lg(){const a=this.C.ed;let b;return null!==a?null==(b=this.xa[a])?void 0:b.lg():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=this.xa[b].C;for(b--;-1<b&&Kg(this,b)!==d;)b--}return new olympe.dc.ua(this.F,this.source,Array.from(this.xa),b,this.L,this.C)}parse(){const a=new Map,b=Kg(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.L.has(b),optional:!1,inheritance:!1,next:[]};a.set(b,
580
+ c);this.db.oi(this.F)?c.dataType=olympe.dc.ja(this.F):(c.root=olympe.dc.ja(this.F),c.dataType=this.C.xg);this.xa.forEach((d,e)=>{const f=d.W(),g=d.Bc();Object.assign(g,{returned:this.L.has(f),next:[]});a.set(f,g);g.sort&&this.C.ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.xa.Sf&&d.P().Pa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.xa.vf&&d.P().Pa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;
581
+ null==(h=a.get(d.C))||h.next.push(g)}});return c}jb(a,b=!1){a='function'===typeof a.F?a.F():a;b=b?olympe.dc.ua.Dc.Qh:olympe.dc.ua.Dc.el;return olympe.dc.query.Sj().executeQuery(Ng(this),a,b).then(c=>{let d;return null!=(d=null==c?void 0:zg(c))?d:olympe.dc.Ka.empty()})}Bd(){return zg(Og(olympe.dc.query.Sj(),Ng(this)))}observe(a,b=olympe.dc.ua.Dc.Bg){a='function'===typeof a.F?a.F():a;return Pg(olympe.dc.query.Sj(),Ng(this),a,olympe.dc.Ra.SELF,b).pipe(rxjs.operators.map(c=>zg(c)),rxjs.operators.distinctUntilChanged())}W(){null===
582
+ this.id&&(this.id=olympe.Y.kb(this.F+yg(this).map(a=>a.toString()).join()+Array.from(new Set(this.L)).sort().toString()+this.C.ed+this.C.max+this.C.offset));return this.id}Lb(){return this.source}ha(){let a;return{b:this.F,p:this.xa.map(b=>b.ha()),r:Array.from(this.L),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.ed,rm:null!=(a=this.C.xg)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this.ha())}`}};olympe.dc.ua.prototype.observe=olympe.dc.ua.prototype.observe;
583
+ olympe.dc.ua.prototype.executeFromCache=olympe.dc.ua.prototype.Bd;olympe.dc.ua.prototype.execute=olympe.dc.ua.prototype.jb;olympe.dc.ua.prototype.parse=olympe.dc.ua.prototype.parse;olympe.dc.ua.prototype.back=olympe.dc.ua.prototype.back;olympe.dc.ua.prototype.sortBy=olympe.dc.ua.prototype.ck;olympe.dc.ua.prototype.limit=olympe.dc.ua.prototype.fm;olympe.dc.ua.prototype.cast=olympe.dc.ua.prototype.di;olympe.dc.ua.prototype.filter=olympe.dc.ua.prototype.filter;olympe.dc.ua.prototype.andReturn=olympe.dc.ua.prototype.Ld;
584
+ olympe.dc.ua.prototype.followRecursively=olympe.dc.ua.prototype.hg;olympe.dc.ua.prototype.follow=olympe.dc.ua.prototype.lb;olympe.dc.ua.followRule=olympe.dc.ua.cc;olympe.dc.ua.instancesOf=olympe.dc.ua.Vj;olympe.dc.ua.from=olympe.dc.ua.from;olympe.dc.ua.Dc={Bg:1,el:2,Qh:3};function Og(a,b){a=new olympe.dc.query.Co(a.K,b);Eg(a,b.F);for(const c of yg(b))c.jb(a);return a}
585
+ function Pg(a,b,c,d,e){const f=b.W();let g=a.C.get(f);if(!g){var h=b.Lb();a.K.debug(`Create new subscription for query ${f} for subscriber ${d}, to be executed by the data source ${h}`);h=a.L&&h===olympe.dc.Ra.SERVER?[]:Array.from(a.C.values());g=new olympe.dc.query.Io(a.K,a.F,b,a.P.bind(a,e));a.C.set(f,g);Qg(g,k=>a.G.add(k));g.start(h)}return new rxjs.Observable(k=>{const m=()=>{n&&c.xe(n);if(p){var q=p;const t=a.C.get(f);a.K.debug(`${d} unsubscribed from ${f}`);if(null==t)q=0;else{var r=t;r.G.delete(q)&&
586
+ r.K.debug(`Remove subscriber ${d} for query ${r.query.W()}, now have ${r.G.size} subscribers`);d!==olympe.dc.Ra.SELF&&(r.T--,0===r.T&&Hg(r.C));q=0===r.G.size}q&&(a.K.debug(`No more subscriber to ${f}, remove the subscription`),a.G.delete(f),a.C.delete(f),t.destroy())}k.complete()},n=c.Z(m),p=Rg(g,d,k);return m})}function Sg(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Tg(c)});a.G.clear()}
587
+ function Ug(a){a.K.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.ne,olympe.dc.Ra.SERVER);return a.fc.request(b).then(c=>{a.F.cd(c.Xc())})}function Vg(a,b){const c=b.Lb();if(c===olympe.dc.Ra.SELF||a.L&&c===olympe.dc.Ra.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.rc(b)).map(d=>new Promise(e=>d.ad(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}
588
+ function Wg(a){switch(a){case olympe.dc.ua.Dc.Bg:case olympe.dc.ua.Dc.el:return olympe.dc.Request.C.Pg;case olympe.dc.ua.Dc.Qh:return olympe.dc.Request.C.Ii;default:throw Error(`Unknown query type: ${a}`);}}function Xg(a,b,c,d){a.fc.request(b).then(e=>{a.F.cd(e.Xc());c()}).catch(d)}function Yg(a,b,c){const d=[];for(const e of a.C.values())Zg(e,b,c)&&d.push(new Promise((f,g)=>{const h=new olympe.dc.Request(olympe.dc.Request.C.Pg,b,e.query);Xg(a,h,f,g)}));return Promise.all(d).then()}
589
+ olympe.dc.query.Hs=class{constructor(a,b,c,d){this.K=a;this.F=b;this.fc=c;this.L=d;this.C=new Map;this.G=new Set;kf(b,()=>Sg(this));c.L(olympe.dc.Request.C.fn,e=>{this.F.cd(e.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e=a.Lb();if(!(yield Vg(d,a))){var f=Wg(c);f=new olympe.dc.Request(f,e,a);try{const g=yield d.fc.request(f);if(b.Ac()||b.mb())return null;d.F.cd(g.Xc())}catch(g){return d.K.error(`Error while sending a query to data source ${e}: ${g}`),null}}return Og(d,a)})}P(a,
590
+ b,c,d){const e=b.Lb();if(e===olympe.dc.Ra.SELF||this.L&&e===olympe.dc.Ra.SERVER)return c(),null;var f=Wg(a);const g=new olympe.dc.Request(f,e,b);if(a===olympe.dc.ua.Dc.Qh)return Xg(this,g,c,d),null;let h;a=n=>{h=[];n&&this.K.info(`Resend subscription ${b.W()} after detection of dead subscription in the remote service`);Xg(this,g,()=>{let p;null==(p=h)||p.forEach(q=>this.F.cd(q));h=null;c()},d)};const k=b.W();a(!1);f=new olympe.dc.Request(olympe.dc.Request.C.mj,e,b);const m=this.fc.T(f,a.bind(this,
591
+ !0)).subscribe(rxjs.Subscriber.create(n=>{Array.isArray(h)?h.push(n):this.F.cd(n)},n=>{this.K.error(`An error occurred with the subscription ${k}: ${n}`);d(String(n))}));return()=>{this.K.debug(`Unsubscribe to query ${k} from data source ${e}`);m.unsubscribe()}}};function pe(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function qe(a){return a.G.map(b=>a.F.get(a.C[b]))}function $g(a){const b=olympe.dc.ya();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ua(g)?olympe.dc.CloudObject.get(g):(olympe.ka.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ka.create(d,a.a,a.r)}
592
+ olympe.dc.Ka=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.Ka}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ee(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ee().includes(a)}indexOf(a){return null===
593
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ee().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}vc(){return this.Od(0)}Od(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ee();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ee();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ee();a.shift();return a}return[]}filter(a){return this.Ee().filter(a)}find(a){return(a=this.Ee().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
594
+ a(this.F.get(b),c))}map(a){return this.Ee().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.Ee().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Ka.create(b,c,a)}static from(a,b,{yb:c,ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=
595
+ olympe.dc.ya(),q=c.Lh===olympe.dc.query.gj.ASC?1:-1,r=c.lg(),t=c.Ma();b.sort((u,w)=>{w=w[d];u=p.Ma(u[d],t);w=p.Ma(w,t);return null===u?-q:null===w?q:q*r(u,w)})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.kb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),m=[],n=[];e.forEach(([p],
596
+ q)=>{!k.has(p)&&m.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ka.create(e,m,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.kb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.L}}};olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;
594
597
  olympe.dc.Ka.prototype.map=olympe.dc.Ka.prototype.map;olympe.dc.Ka.prototype.forEach=olympe.dc.Ka.prototype.forEach;olympe.dc.Ka.prototype.find=olympe.dc.Ka.prototype.find;olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.Od;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.vc;
595
- olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.De;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Zg(a){return 1<a.size()?(olympe.ka.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.vc()||null}olympe.dc.Lc=class{constructor(a){this.query=a}static from(a){return new olympe.dc.Lc(olympe.dc.ua.from(a))}lb(a){return new olympe.dc.Lc(this.query.lb(a))}ai(){return this}ib(a){return this.query.ib(a).then(b=>Zg(b))}Bd(){return Zg(this.query.Bd())}};olympe.dc.Lc.prototype.executeFromCache=olympe.dc.Lc.prototype.Bd;
596
- olympe.dc.Lc.prototype.execute=olympe.dc.Lc.prototype.ib;olympe.dc.Lc.prototype.cast=olympe.dc.Lc.prototype.ai;olympe.dc.Lc.prototype.follow=olympe.dc.Lc.prototype.lb;const $g=olympe.dc.va.ORIGIN,ah=olympe.dc.va.DESTINATION;function Og(a,b){yg(a.C,()=>b(a.query.W()))}function Pg(a,b,c){const d=a.ba;a.ba++;a.G.set(d,c);b===olympe.dc.Pa.SELF?a.Xc(e=>e?c.error(e):c.next(a.C)):(a.T++,1===a.T&&a.Xc(()=>Eg(a.C)));a.L.debug(`Add subscriber ${b} for query ${a.query.W()}, now have ${a.G.size} subscribers`);return d}
597
- function Xg(a,b,c){if(a.query.Lb()!==b)return!1;c.Md(a.ga);(b=a.ga.flush())&&a.L.debug(`Subscription ${a.query.W()} is considered as obsolete after the transaction ${c.W()} applied on DB`);return b}function Rg(a){Gg(a.C);a.G.forEach(b=>{b.next(a.C)})}function bh(a,b,c){const d=[],e=new olympe.async.ej(olympe.D.ef());for(const f of b)f.rc(a.query)&&e.add(g=>f.Xc(h=>{!h&&d.push(f);g()}));oc(e,f=>c(f?d:[]));e.start()}
598
- function ch(a){const b=a.query.W(),c=new Map,d=p=>{const q=c.get(p);return q?1===q.size?Array.from(q)[0]:(r,t,u,w)=>q.forEach(x=>x(r,t,u,w)):()=>{}},e=wg(a.query),f=a.C;for(let p=e.length-1;0<=p;p--){var g=e[p];const q=g.W(),r=g.C;g=g.observe(f,d(q));let t;c.set(r,(null!=(t=c.get(r))?t:new Set).add(g))}const h=a.db,k=a.query.F,m=olympe.Y.jb(k),n=ie(h,k,(p,q)=>{p?Cg(f,q):f.remove(q);d(m)(p,q,null,b)});a.Z.push(()=>{je(h,k,n)});dh(a)}
599
- function eh(a){const b=a.qa(a.query,()=>{null!==a.O&&ch(a)},c=>{a.L.error(`Error while ensuring coverage of a query to data source ${a.query.Lb()}: ${c}`);dh(a)});b&&a.Z.push(b)}function dh(a){const b=a.O;a.O=null;null==b||b.forEach(c=>c())}
600
- olympe.dc.query.Io=class{constructor(a,b,c,d){this.L=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Co(this.L,c);this.T=0;this.ba=1;this.Z=[];this.G=new Map;this.O=[()=>Gg(this.C)];this.qa=d;this.ga=new fh(a,this.db,c,this.C);this.F=this.K=null}start(a){bh(this,a,b=>{0<b.length?(this.K=new Set(b),this.K.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),ch(this)):eh(this)})}rc(a){return this.query.Lb()===a.Lb()&&(this.query.W()===a.W()||(null===this.O||this.query.F===a.F)&&this.C.rc(a))}Xc(a){null!==
601
- this.O?this.O.push(a):a();return this}destroy(a){a?this.L.error(`Destroy subscription ${this.query.W()} after error: ${a}`):this.L.debug(`Destroy subscription ${this.query.W()}`);let b;null==(b=this.F)||b.forEach(d=>{d.K.delete(this);0===d.K.size&&(d.K=null,eh(d))});let c;null==(c=this.K)||c.forEach(d=>{d.F.delete(this);0===d.F.size&&(d.F=null)});this.Z.forEach(d=>d());this.G.forEach(d=>a?d.error(a):d.complete())}};function gh(a,b){return a.G.has(ah+b)||a.G.has($g+b)}
602
- class fh{constructor(a,b,c,d){this.L=a;this.db=b;this.K=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of wg(c)){a=f.W();this.T.push(a);if(f instanceof olympe.dc.query.xa.Rf||f instanceof olympe.dc.query.xa.vf){a=f.O();a=`${a.La()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}hh(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.W());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=
603
- !1;return a}Cc(){}bd(a,b){if(!(this.C||!this.O&&this.db.Ua(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Bg(this.K,a,e)))}}F(a){this.C||this.db.Ua(a)&&!this.O||this.C||(this.C=this.T.some(b=>Bg(this.K,a,b)))}Ea(a,b,c){if(!this.C&&gh(this,a)){var d=this.db.Ua(b),e=this.db.Ua(c);if(d&&!e||!d&&e){const f=this.G.get(ah+a);a=this.G.get($g+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Bg(this.K,b,g.C)))||e&&(null==a?void 0:a.some(g=>Bg(this.K,c,g.C))))}}}Xb(a,b,
604
- c){if(!this.C&&this.O&&gh(this,a)&&this.db.cm(b,new olympe.dc.Ha.Relation(a),c)){const d=this.G.get(ah+a);a=this.G.get($g+a);const e=this.K;this.C||(this.C=(null==d?void 0:d.some(f=>Bg(e,b,f.C)&&Bg(e,c,f.W())))||(null==a?void 0:a.some(f=>Bg(e,c,f.C)&&Bg(e,b,f.W()))))}}}olympe.dc.query.Io.sa=[olympe.dc.Writable];function ih(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
598
+ olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ee;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function ah(a){return 1<a.size()?(olympe.ka.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.vc()||null}olympe.dc.Nc=class{constructor(a){this.query=a}static from(a){return new olympe.dc.Nc(olympe.dc.ua.from(a))}lb(a){return new olympe.dc.Nc(this.query.lb(a))}di(){return this}jb(a){return this.query.jb(a).then(b=>ah(b))}Bd(){return ah(this.query.Bd())}};olympe.dc.Nc.prototype.executeFromCache=olympe.dc.Nc.prototype.Bd;
599
+ olympe.dc.Nc.prototype.execute=olympe.dc.Nc.prototype.jb;olympe.dc.Nc.prototype.cast=olympe.dc.Nc.prototype.di;olympe.dc.Nc.prototype.follow=olympe.dc.Nc.prototype.lb;const bh=olympe.dc.va.ORIGIN,ch=olympe.dc.va.DESTINATION;function Qg(a,b){Ag(a.C,()=>b(a.query.W()))}function Rg(a,b,c){const d=a.ba;a.ba++;a.G.set(d,c);b===olympe.dc.Ra.SELF?a.ad(e=>e?c.error(e):c.next(a.C)):(a.T++,1===a.T&&a.ad(()=>Gg(a.C)));a.K.debug(`Add subscriber ${b} for query ${a.query.W()}, now have ${a.G.size} subscribers`);return d}
600
+ function Zg(a,b,c){if(a.query.Lb()!==b)return!1;c.Md(a.ga);(b=a.ga.flush())&&a.K.debug(`Subscription ${a.query.W()} is considered as obsolete after the transaction ${c.W()} applied on DB`);return b}function Tg(a){Ig(a.C);a.G.forEach(b=>{b.next(a.C)})}function dh(a,b,c){const d=[],e=new olympe.async.ij(olympe.D.ff());for(const f of b)f.rc(a.query)&&e.add(g=>f.ad(h=>{!h&&d.push(f);g()}));nc(e,f=>c(f?d:[]));e.start()}
601
+ function eh(a){const b=a.query.W(),c=new Map,d=p=>{const q=c.get(p);return q?1===q.size?Array.from(q)[0]:(r,t,u,w)=>q.forEach(x=>x(r,t,u,w)):()=>{}},e=yg(a.query),f=a.C;for(let p=e.length-1;0<=p;p--){var g=e[p];const q=g.W(),r=g.C;g=g.observe(f,d(q));let t;c.set(r,(null!=(t=c.get(r))?t:new Set).add(g))}const h=a.db,k=a.query.F,m=olympe.Y.kb(k),n=je(h,k,(p,q)=>{p?Eg(f,q):f.remove(q);d(m)(p,q,null,b)});a.Z.push(()=>{ke(h,k,n)});fh(a)}
602
+ function gh(a){const b=a.qa(a.query,()=>{null!==a.P&&eh(a)},c=>{a.K.error(`Error while ensuring coverage of a query to data source ${a.query.Lb()}: ${c}`);fh(a)});b&&a.Z.push(b)}function fh(a){const b=a.P;a.P=null;null==b||b.forEach(c=>c())}
603
+ olympe.dc.query.Io=class{constructor(a,b,c,d){this.K=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Co(this.K,c);this.T=0;this.ba=1;this.Z=[];this.G=new Map;this.P=[()=>Ig(this.C)];this.qa=d;this.ga=new hh(a,this.db,c,this.C);this.F=this.L=null}start(a){dh(this,a,b=>{0<b.length?(this.L=new Set(b),this.L.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),eh(this)):gh(this)})}rc(a){return this.query.Lb()===a.Lb()&&(this.query.W()===a.W()||(null===this.P||this.query.F===a.F)&&this.C.rc(a))}ad(a){null!==
604
+ this.P?this.P.push(a):a();return this}destroy(a){a?this.K.error(`Destroy subscription ${this.query.W()} after error: ${a}`):this.K.debug(`Destroy subscription ${this.query.W()}`);let b;null==(b=this.F)||b.forEach(d=>{d.L.delete(this);0===d.L.size&&(d.L=null,gh(d))});let c;null==(c=this.L)||c.forEach(d=>{d.F.delete(this);0===d.F.size&&(d.F=null)});this.Z.forEach(d=>d());this.G.forEach(d=>a?d.error(a):d.complete())}};function ih(a,b){return a.G.has(ch+b)||a.G.has(bh+b)}
605
+ class hh{constructor(a,b,c,d){this.K=a;this.db=b;this.L=d;this.T=[];this.P=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of yg(c)){a=f.W();this.T.push(a);if(f instanceof olympe.dc.query.xa.Sf||f instanceof olympe.dc.query.xa.vf){a=f.P();a=`${a.La()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}jh(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.W());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=
606
+ !1;return a}Fc(){}gd(a,b){if(!(this.C||!this.P&&this.db.Ua(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Dg(this.L,a,e)))}}F(a){this.C||this.db.Ua(a)&&!this.P||this.C||(this.C=this.T.some(b=>Dg(this.L,a,b)))}Ea(a,b,c){if(!this.C&&ih(this,a)){var d=this.db.Ua(b),e=this.db.Ua(c);if(d&&!e||!d&&e){const f=this.G.get(ch+a);a=this.G.get(bh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Dg(this.L,b,g.C)))||e&&(null==a?void 0:a.some(g=>Dg(this.L,c,g.C))))}}}Yb(a,b,
607
+ c){if(!this.C&&this.P&&ih(this,a)&&this.db.cm(b,new olympe.dc.Ha.Relation(a),c)){const d=this.G.get(ch+a);a=this.G.get(bh+a);const e=this.L;this.C||(this.C=(null==d?void 0:d.some(f=>Dg(e,b,f.C)&&Dg(e,c,f.W())))||(null==a?void 0:a.some(f=>Dg(e,c,f.C)&&Dg(e,b,f.W()))))}}}olympe.dc.query.Io.sa=[olympe.dc.Writable];function kh(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
605
608
  olympe.dc.query.Relation=class extends olympe.dc.Ha.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static tc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.La(),null!=b?b:a instanceof olympe.dc.da.ce)}Pb(){const a=
606
- olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={ya:'dc.query.Logger',hj:'dc.query.QueryProcessor'};olympe.U.config(function(a){E(a,olympe.dc.query.R.ya,[olympe.ka.R.Fa],b=>b.Dc('query'));D(a,olympe.dc.query.R.hj,olympe.dc.query.Is,olympe.dc.query.R.ya,olympe.dc.db.R.Fa,olympe.dc.R.Ng,new olympe.U.ma(olympe.dc.V.Pg))});olympe.U.run([olympe.dc.query.R.hj],a=>{olympe.dc.query.Pj=()=>a});olympe.dc.query.$={};olympe.dc.query.$.dd=class extends olympe.dc.query.Da{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Wc(){return new olympe.dc.query.$.be(...this.$.map(a=>a.Wc()))}Bb(){return this.$.flatMap(a=>a.Bb())}rc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ib(a){return this.$.reduce((b,c)=>b&&c.ib(a),!0)}observe(a,b,c){const d=
607
- Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.jb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Da.C.um,p:this.$.map(a=>a.ha())}}Ac(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.jb('AND-'+b+a+d))})}};olympe.dc.query.$.Ie=class extends olympe.dc.query.Da{constructor(a,b,c,d=!1){super();this.Ga=olympe.dc.ja(a);this.substring=b;this.db=c;this.C=d}Bb(){return[this.Ga]}rc(a,b){return a instanceof olympe.dc.query.$.Ie&&a.Ga===this.Ga?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Ma(){return this.Ga}ib(a){return this.apply(this.db.Ma(a,
608
- this.Ga))}observe(a,b,c){wf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.jb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ga+'-'+this.substring+'-'+this.C}clear(a,b){xf(this.db,a,this.Ga,olympe.Y.jb(b+a+this.toString()))}Ac(){return{name:'CONTAINS',property:this.Ma(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Da.C.Fi,p:this.Ga,s:this.substring,
609
- c:this.C}}};olympe.dc.query.$.Xd=class extends olympe.dc.query.Da{constructor(a,b,c){super();this.Ga=olympe.dc.ja(a);this.C=null!=b?b:null;this.db=c}Bb(){return[this.Ga]}rc(a){if(a instanceof olympe.dc.query.$.Xd&&this.Ga===a.Ga)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Qa(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Qa(a.C)}else return this.C===a.C;return!1}ib(a){return this.apply(this.db.Ma(a,
610
- this.Ga))}observe(a,b,c){wf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.jb(b+a+this.toString()));null===this.C&&null===this.db.Ma(a,this.Ga)&&c(!0)}clear(a,b){xf(this.db,a,this.Ga,olympe.Y.jb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Qa(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Qa(this.C):!1:a===this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?
611
- b:'null';return'Equals-'+this.Ga+'-'+c}Ac(){return{name:'EQUALS',property:this.Ga,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.pg().valueOf(),g:this.C.ng().valueOf(),b:this.C.lg().valueOf(),a:this.C.kg().valueOf()}}return{pr:olympe.dc.query.Da.C.rn,p:this.Ga,t:a,v:b}}};function jh(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function kh(a,b){return'number'===typeof a.C?a.C:a.db.Ma(b,a.C)}function lh(a,b,c){return olympe.Y.jb(c+b+a.C+a.Ga)}
612
- olympe.dc.query.$.Fh=class extends olympe.dc.query.Da{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ga=olympe.dc.ja(b);this.C='number'===typeof c?c:olympe.dc.ja(c);this.F=d;this.G=e}Wc(){return new olympe.dc.query.$.Fh(this.db,this.Ga,this.C,!this.F,!this.G)}Bb(){return[this.Ga]}rc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.Fh&&this.Ga===a.Ga?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
613
- this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Ma(){return this.Ga}ib(a){return jh(this,this.db.Ma(a,this.Ga),kh(this,a))}observe(a,b,c){'string'===typeof this.C&&wf(this.db,a,this.C,d=>{const e=this.db.Ma(a,this.Ga);null!==e&&c(jh(this,e,d))},lh(this,a,b));wf(this.db,a,this.Ga,d=>{const e=kh(this,a);c(null!==e?jh(this,d,e):!0)},lh(this,a,b))}clear(a,b){xf(this.db,a,this.Ga,lh(this,a,b));'string'===typeof this.C&&xf(this.db,a,this.C,lh(this,a,b))}Ac(){return{name:'INEQUALITY_OPERATOR',
614
- property:this.Ma(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Da.C.Mn,p:this.Ga,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ga+'-'+this.G+'-'+this.C}};olympe.dc.query.$.$d=class extends olympe.dc.query.Da{constructor(a){super();this.C=a}Wc(){return this.C}Bb(){return this.C.Bb()}rc(a,b){return a instanceof olympe.dc.query.$.$d?this.C.rc(a.C,b):this.C.rc(a,!b)}ib(a){return!this.C.ib(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.jb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Ac(){return{name:'NOT',predicate:this.C.Ac()}}ha(){return{pr:olympe.dc.query.Da.C.lo,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.Y.jb('NOT'+
615
- b+a))}};olympe.dc.query.$.be=class extends olympe.dc.query.Da{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}Wc(){return new olympe.dc.query.$.dd(...this.$.map(a=>a.Wc()))}Bb(){return this.$.flatMap(a=>a.Bb())}rc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ib(a){return this.$.reduce((b,c)=>b||c.ib(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
616
- k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.jb('OR-'+b+a+h),f.bind(null,h))})}Ac(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Da.C.so,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.jb('OR-'+b+a+d))})}};olympe.dc.query.$.Te=class extends olympe.dc.query.Da{constructor(a,b,c,d=!0){super();this.Ga=olympe.dc.ja(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}Bb(){return[this.Ga]}rc(a){return a instanceof olympe.dc.query.$.Te&&this.Ga===a.Ga&&this.C.toString()===a.C.toString()}Ma(){return this.Ga}ib(a){return this.apply(this.db.Ma(a,this.Ga))}observe(a,b,c){wf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.jb(b+a+this.toString()))}apply(a){return'string'===
617
- typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ga+'-'+this.C.toString()+'-'+this.F}Ac(){return{name:'REGEX',property:this.Ma(),pattern:this.C.toString(),caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Da.C.Lo,p:this.Ga,r:this.C.source,c:this.F}}clear(a,b){xf(this.db,a,this.Ga,olympe.Y.jb(b+a+this.toString()))}};olympe.dc.query.$.pl=class extends olympe.dc.query.Da{constructor(a){super();this.C=new Set(a.map(olympe.dc.ja))}Bb(){return[]}rc(a){return a instanceof olympe.dc.query.$.pl&&Array.from(a.C).every(b=>this.C.has(b))}ib(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Ac(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Da.C.mp,t:Array.from(this.C)}}};olympe.dc.query.xa={};function hh(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Bb())?c:[]);let e;a.yb&&d.add(null==(e=a.yb)?void 0:e.Ma().X());return d}function mh(a){if(!a.ga){let b,c;a.ga=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ga}function nh(a,b){for(const c of b)if(a.some(d=>d.rc(c,!1)))return!0;return!1}
618
- function oh(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.jb(h+f+d);e?a.F.observe(f,k,m=>{c||b(m,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function ph(a,b,c){if(null===a.yb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.yb.Ma();h=olympe.Y.jb(h+d);e?wf(a.db,f,k,()=>{zg(b)},h):xf(a.db,f,k,h);c(e,f,g,h)}}
619
- olympe.dc.query.xa.fj=class{constructor(a,b){this.db=olympe.dc.Aa();this.C=a;this.optional=b;this.ga=this.yb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.xa.le(b,a.f);var c=a.o;const d=new olympe.dc.Ha.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.xa.vf(b,d,a.s,c):new olympe.dc.query.xa.Rf(b,d,c);void 0!==a.p&&(b.F=Hg(a.p));void 0!==a.c&&(c=b.W(),a=a.c,a=new olympe.dc.query.He(c,new olympe.dc.Ha.Property(a.p),a.o),b.yb=a);return b}K(){}toString(){let a,
620
- b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.yb)?void 0:b.toString())?d:''}`}Ac(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.yb&&(a.c=this.yb.ha());return a}Z(){}qa(){return new olympe.dc.query.xa.ml}ba(){}W(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}rc(a){const b=mh(this);if(0===b.length)return!0;a=mh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
621
- nh(d,c)))return!1;return!0}filter(a){const b=this.K(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.dd?new olympe.dc.query.$.dd(...Array.from(c.$),a):new olympe.dc.query.$.dd(b.F,a);return b}sort(a,b){const c=this.K();c.yb=new olympe.dc.query.He(this.W(),a,b);return c}mg(){return this.yb}ib(a){if(null!==this.F){var b=this.W();for(const c of Ag(a,b))this.F.ib(c)||a.remove(c,b,null)}}observe(a,b){const c=this.W();return oh(this,ph(this,a,(d,e,f,g)=>{(d?Cg(a,e,c,f):a.remove(e,c,f))&&b(d,e,
622
- f,g)}))}};olympe.dc.query.xa.Bo=class{has(){}O(){}F(){}Sd(){}G(){}remove(){}};olympe.dc.query.xa.dn=class{constructor(a){this.C=null;this.content=new Map;this.K=null!=a?a:null}Sd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.K)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
623
- c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.xa.dn.sa=[olympe.dc.query.xa.Bo];olympe.dc.query.xa.Rf=class extends olympe.dc.query.xa.fj{constructor(a,b,c){super(a,c);this.relation=olympe.dc.query.Relation.from(b,!1)}O(){return this.relation}K(){const a=new olympe.dc.query.xa.Rf(this.C,this.relation,this.optional);a.F=this.F;a.yb=this.yb;return a}Z(){return olympe.Y.jb(this.C+this.relation)}ba(a,b){return b instanceof olympe.dc.query.xa.le?[a]:[a+this.relation,a+ih(this.relation),a+'followRules'].map(c=>olympe.Y.jb(c))}ib(a){const b=this.W();for(const c of Ag(a,this.C))this.db.fb(c,
624
- this.relation).forEach(d=>{Cg(a,d,b,c)});super.ib(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La();return(f,g,h,k)=>{const m=olympe.Y.jb(k+g+this.toString());f?W(this.db,g,this.relation,(n,p)=>{Dg(a,n,d,e,g,p);c(n,p,g,m)},m):this.db.F(g,this.relation,m)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.La()})}Ac(){const a={recursive:!1,relation:this.relation,filter:mh(this).map(b=>b.map(c=>c.Ac())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Ma(),
625
- order:this.yb.Ih});return a}toString(){return`followPart-${this.relation}-${super.toString()}`}};olympe.dc.query.xa.vf=class extends olympe.dc.query.xa.fj{constructor(a,b,c,d){super(a,d);this.relation=olympe.dc.query.Relation.from(b,!0);this.G=c}K(){const a=new olympe.dc.query.xa.vf(this.C,this.relation,this.G,this.optional);a.F=this.F;a.yb=this.yb;return a}Z(){return olympe.Y.jb(this.C+this.relation+this.G)}ba(a,b){return b instanceof olympe.dc.query.xa.le?[a]:[a+this.relation,a+'followRules'].map(c=>olympe.Y.jb(c))}O(){return this.relation}ib(a){const b=this.W();for(const c of Ag(a,this.C))this.G&&
626
- Cg(a,c,b,c),this.db.og(c,this.relation).forEach(d=>{Cg(a,d,b,c)});super.ib(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La(),f=new Set,g=(h,k,m,n,p)=>{k=olympe.Y.jb(k+h+p+m);if(this.G||0<m)0<m&&Dg(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),W(this.db,p,this.relation,g.bind(this,h,k,m+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,m,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),{s:this.G,t:this.relation.X(),d:this.relation.La()})}Ac(){const a=
627
- {recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:mh(this).map(b=>b.map(c=>c.Ac())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Ma(),order:this.yb.Ih});return a}toString(){return`followRecursivelyPart-${this.relation}-${this.G}-${super.toString()}`}};olympe.dc.query.xa.le=class extends olympe.dc.query.xa.fj{constructor(a,b,c){super(a,!1);this.Yb=b;this.G=null!=c?c:null}K(){return new olympe.dc.query.xa.le(this.C,this.Yb,this.G)}Z(){return olympe.Y.jb(this.C+'followRules')}qa(){return new olympe.dc.query.xa.dn(this.G)}ba(a,b){return b instanceof olympe.dc.query.xa.le?[a]:[olympe.Y.jb(a+'followRules')]}rc(a){if(a instanceof olympe.dc.query.xa.Rf||a instanceof olympe.dc.query.xa.vf){var b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION;const d=olympe.dc.lc.hd,
628
- e=olympe.dc.lc.yh,f=olympe.dm.Relation.C.hl,g=olympe.dm.Relation.C.tl;a=a.O();const h=a.La(),k=a.X();if(h===c&&(k===d||k===e))return!0;c=If(this.db,a,this.Yb);b=a.La()===b?f:g;return!!(c&b)}return a instanceof olympe.dc.query.xa.le?this.Yb===a.Yb:!1}ib(a){const b=this.W();for(const c of Ag(a,this.C))for(const d of De(this.db,c,this.Yb))Cg(a,d,b,c)}observe(a,b){const c=this.W(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Ff(this.db,g,this.Yb,(m,n,p,q,r)=>{p&&(p=q?Cg(a,r,c,e):a.remove(r,c,e),null!==n&&Dg(a,
629
- q,m,n,g,r),p&&d(e,q,r,h))},k):Gf(this.db,g,this.Yb,k);b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Y.jb(h+f+this.toString());(e?Cg(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g)}}ha(){return Object.assign(super.ha(),{f:this.Yb})}Ac(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`followRulePart-${this.Yb}-${super.toString()}`}T(){return!1}filter(){olympe.ka.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');
630
- return this}sort(){olympe.ka.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.xa.le.F='followRules';olympe.dc.query.xa.ml=class{constructor(){this.content=new Map}Sd(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.xa.ml.sa=[olympe.dc.query.xa.Bo];olympe.dc.sources={};olympe.dc.sources.wk=class{W(){}init(){}destroy(){}request(){return v(function*(){})}K(){}};const qh=olympe.net.Ia.Jd.GET,rh=olympe.net.Ia.Jd.Lg,sh=olympe.net.Ia.Jd.oc,th=olympe.net.Ia.Jd.Ao,uh=olympe.net.Ia.Jd.ro,vh=olympe.net.Ia.Headers.vh,wh=olympe.net.Ia.Headers.Cm,xh=olympe.net.Ia.Headers.vq,yh=olympe.net.Ia.Headers.uq,zh=olympe.net.Ia.mc.Zi,Ah=olympe.net.Ia.mc.Vm,Bh=olympe.net.Ia.mc.yn,Ch=olympe.net.Ia.mc.Qh,Dh=olympe.net.Ia.mc.ps;
631
- function Eh(a){var b=olympe.U.getParameter(olympe.dc.sources.V.Hg);b=`/${a.ga}/${b}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.O('_DataSourcesHTTPService',b,[qh,rh,sh,th,uh],(c,d,e)=>v(function*(){const f=d.get('sourceId'),g=a.G.get(d.get('sourceId'));if(!g)return Promise.resolve(new olympe.net.xf('Invalid source id',Dh,'Invalid source id'));const h=c.method;if(h===uh)return Promise.resolve(new olympe.net.xf('',zh,'',{[xh]:'*',[yh]:'X-Source-Origin'}));const k=c.Jj();
632
- try{var m=yield Fh(a,k[wh])}catch(r){return new olympe.net.xf(`Invalid token ${r}`,Bh,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Mg,t=olympe.dc.Request.C.Vh,u=olympe.dc.Request.C.Eg,w=olympe.dc.Request.C.Pf,x=olympe.dc.Request.C.gg;let y;switch(n){case r:case t:y=a.F.G(p);break;case x:case u:case w:y={tag:e.get('tag'),model:e.get('model'),mimeType:k[vh]};p instanceof Uint8Array&&(y.content=new Blob([p.buffer]));break;default:throw Error(`Data Http request type not supported ${n}`);
633
- }let z;const A=null!=(z=k['X-Source-Origin'])?z:olympe.dc.Pa.Af;var q=ne(new olympe.dc.Request(n,f,y,m),A);const J=yield g(q),M=J instanceof Blob||J instanceof ArrayBuffer||void 0===J?null!=J?J:'':JSON.stringify(a.F.ha(J));return new olympe.net.xf(M,h===th?Ah:zh)}catch(r){return new olympe.net.xf(`Internal server error: ${r}`,Ch,'Internal server error')}})).catch(c=>a.L.error(`Error while starting the FileService: ${c}`));a.L.debug(`Started HTTP service with path: ${b}`)}
634
- function Gh(a){a.O.Z('_DataSourcesHTTPService').catch(b=>a.L.error(`An error occurred while stopping the data sources http service: ${b}`))}function Hh(a,b,c){0===a.G.size&&(a.O.ba([qh,rh,sh,th,uh],[vh,wh,'X-Source-Origin']),Eh(a));a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Gh(a)}}
635
- function Ih(a,b,c){if(b===olympe.dc.Pa.SERVER){var d;return null!=(d=Sc(a.Z,a.Va.get(c)))?d:null}var e=a.ba.get(b);if(!e){d=a.Ba.Lb(b);if(null===d)return null;e=olympe.dc.sources.V.Ah;const f=olympe.dc.sources.V.Bh,g=olympe.dc.sources.V.Pi,h=olympe.dc.sources.V.Hg;let k;e=`${a.Qd(d,g)?'https':'http'}://${a.Qd(d,e)}:${null!=(k=a.Qd(d,f))?k:a.Qd(d,g)?443:80}`+`${a.ga}/${a.Qd(d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.ba.set(b,e)}return`${e}/${c}`}
636
- function Jh(a,b){return b instanceof olympe.net.Eh?Tc(a.Z,b,zc(a.T).od()):Promise.reject('No http request to send')}function Kh(a,b){var c=Ih(a,b.uc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.uc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=Rb(c,rh,e);P(c,{['X-Source-Origin']:b.origin,[vh]:'application/json'});return Jh(a,c).then(f=>'string'===typeof f?a.F.G(JSON.parse(f)):olympe.dc.query.wd.Nl(d))}
637
- function Lh(a,b){var c=Ih(a,b.uc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.uc()}`);const d=JSON.stringify(a.F.ha(b.content));c=Rb(c,rh,d);P(c,{['X-Source-Origin']:b.origin,[vh]:'application/json'});return Jh(a,c).then()}
638
- function Fh(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):Ja(a.K.C,b)?Promise.resolve(a.K.get(b)):new Promise((c,d)=>{a.T.sg(b,(e,f)=>{e?d(e.message):a.qa||f!==olympe.dm.User.C?(a.K.set(b,f),c(f)):d('Guest cannot access that resource.')})})}
639
- olympe.dc.sources.kr=class{constructor(a,b,c,d,e,f,g){this.L=a;this.O=b;this.Z=c;this.T=d;this.Ba=e;this.F=f;this.G=new Map;this.K=new olympe.Y.ql(6E5);new olympe.D.Mb('Http service of remote data provider');this.ga=g.get('basePath');this.qa=g.get('allowGuest');this.ba=new Map;this.C=new Map;this.Va=new Map([[olympe.dc.Request.C.me,olympe.P.Nb.me],[olympe.dc.Request.C.Pf,olympe.P.Nb.Li],[olympe.dc.Request.C.gg,olympe.P.Nb.Li],[olympe.dc.Request.C.Eg,olympe.P.Nb.Li],[olympe.dc.Request.C.Em,olympe.P.Nb.Dm],
640
- [olympe.dc.Request.C.Po,olympe.P.Nb.Oo],[olympe.dc.Request.C.Fk,olympe.P.Nb.Fn],[olympe.dc.Request.C.Ei,olympe.P.Nb.Qm],[olympe.dc.Request.C.Vh,olympe.P.Nb.TRANSACTION]])}uploadFileContent(a){const {tag:b,model:c,content:d,mimeType:e}=a.content,f=a.uc(),g=Ih(this,f,a.getType());if(!g)return Promise.reject(`No destination URL to upload the file. ${b}`);const h=Rb(f===olympe.dc.Pa.SERVER?`${g}/${b}`:`${g}?tag=${b}&model=${c}`,th,d,olympe.net.Ia.ResponseType.ph);P(h,{[vh]:e||'application/octet-stream'});
641
- f!==olympe.dc.Pa.SERVER&&P(h,{['X-Source-Origin']:a.origin});return Jh(this,h).then(()=>(new URL(h.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.uc();var e=Ih(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=Rb(d===olympe.dc.Pa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,sh,b);d!==olympe.dc.Pa.SERVER&&P(e,{['X-Source-Origin']:a.origin});return Jh(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.uc();
642
- var e=Ih(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to download the file. ${b}`);var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,$g:k})});if(this.C.has(b))return f;this.C.set(b,g);e=Rb(d===olympe.dc.Pa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,qh,b,olympe.net.Ia.ResponseType.ph);d!==olympe.dc.Pa.SERVER&&P(e,{['X-Source-Origin']:a.origin});Jh(this,e).then(h=>{let k;null==(k=this.C.get(b))||k.forEach(m=>m.done(h))}).catch(h=>{let k;null==
643
- (k=this.C.get(b))||k.forEach(m=>m.$g(`${h}`))}).finally(()=>{this.C.delete(b)});return f}Qd(a,b){const [c,d]=b.split('.');let e,f;b=null!=(f=null!=(e=olympe.U.getParameter(`${c}.${a.name().toLowerCase().replace(/\W/g,'_')}.${d}`))?e:olympe.U.getParameter(`${c}.${d}`))?f:null;null===b&&this.L.error(`Impossible to build URL for data source ${a}`);return b}};olympe.dc.sources.Rn=class{constructor(a,b){this.L=a;this.fc=b}};olympe.dc.sources.Rn.mc={Sh:0,Py:1,Qy:3,ly:4};const Mh=olympe.dc.Request.C.bc,Nh=olympe.dc.Request.C.Mg,Oh=olympe.dc.Request.C.ij,Ph=olympe.dc.Request.C.gg,Qh=olympe.dc.Request.C.Pf,Rh=olympe.dc.Request.C.Eg,Sh=olympe.dc.Request.C.qh,Th=olympe.dc.Request.C.Bi,Uh=olympe.dc.Request.C.Uh;
644
- function Vh(a,b){const c=b.W();null===a.F&&(a.F=new olympe.Y.ql(6E4),Ma(a.F,(f,g)=>{a.applyTransaction(g).catch(h=>{a.L.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Na(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.Ic(c);b.Md(e);Ja(a.F.C,c)||a.F.set(c,e)}
645
- function Wh(a,b){const c=b.W();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.Ic(c);let g;null==(g=a.F)||g.delete(c);b.Md(f);return a.applyTransaction(f).catch(h=>{a.L.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Xh(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b).then(d=>d.Vc()));return 0<a.Z?rxjs.interval(a.Z).pipe(rxjs.operators.switchMap(()=>c)):c}
646
- olympe.dc.sources.bo=class{constructor(a,b){this.L=a;this.C=b;this.T=olympe.dc.query.Pj();this.O=olympe.dc.Ql();this.G=new olympe.D.Mb('Context of source '+this.W());let c;this.Z=null!=(c=b.Qd('pollingFrequency'))?c:6E5;this.F=null}W(){return this.C.W()}init(){if(this.W()===olympe.dc.Pa.SELF)return this;(new Promise((a,b)=>{let c=!0;Yh(this.C,this.G).subscribe(rxjs.Subscriber.create(d=>{this.L.debug(`Data source ${this.C.name()} should handle ${d.size()} data types`);c&&(c=!1,a())},b))})).then(()=>
647
- this.C.init(this.G)).catch(a=>{this.L.error(`Error while initialization of DataSource ${this.C.name()} (${this.W()}): ${a}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.W()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;switch(a.getType()){case Mh:const c=olympe.dm.DataSource.bc.Fb,d=olympe.dm.DataSource.bc.Oh;return this.C.healthCheck().then(()=>({s:d})).catch(e=>({s:c,r:String(e)}));case Nh:return this.C.executeQuery(b);
648
- case Sh:return a=b.Vc(),Vh(this,a),this.O.Zc(a),Promise.resolve();case Uh:return this.applyTransaction(b.Vc());case Th:return Wh(this,b.Vc());case Ph:return b.content instanceof Blob?b.content.arrayBuffer().then(e=>this.C.uploadFileContent(b.tag,b.model,new Uint8Array(e))):Promise.reject('File content is undefined');case Qh:return this.C.downloadFileContent(b.tag,b.model);case Rh:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}K(a){if(a.getType()===
649
- Oh){const b=a.content;a=a.origin;return a===olympe.dc.Pa.SELF?Xh(this,b):Ng(this.T,b,this.G,a,olympe.dc.ua.Sc.th).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.je)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a){const b=this;return v(function*(){const c=Zh(a);yield b.C.applyTransaction(c);yield Wg(b.T,b.W(),a);b.O.Zc(a)})}};olympe.dc.sources.bo.sa=[olympe.dc.sources.wk];function Zh(a){const b=olympe.dc.sources.Bf.C.Mq,c=olympe.dc.sources.Bf.C.kt,d=olympe.dc.sources.Bf.C.Qq,e=olympe.dc.sources.Bf.C.Nq,f=olympe.dc.sources.Bf.C.Rq,g=[],h=[],k=[],m=[],n=[];a.C.forEach((p,q)=>{const r=p.Dd();p.K()?g.push($h(b,q,r,p.ba()?p.Bb():null)):p.gf()?k.push($h(d,q,r,null,p.Z())):p.ba()&&h.push($h(c,q,r,p.Bb()));for(const [t,u,w]of p.he())p=a.Ae(u),w?m.push(new ai(e,t,q,u,r,p.Dd())):n.push(new ai(f,t,q,u,r,p.Dd()))});return n.concat(k,g,h,m)}
650
- function $h(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new bi(a,b,c,d,e)}olympe.dc.sources.Bf=class{constructor(a){this.type=a}};class bi extends olympe.dc.sources.Bf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Jb.NONE}}
651
- class ai extends olympe.dc.sources.Bf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Bf.C={Mq:'CREATE',kt:'UPDATE',Qq:'DELETE',Nq:'CREATE_RELATION',Rq:'DELETE_RELATION'};const ci=olympe.dc.Request.C.bc,di=olympe.dc.Request.C.Mg,ei=olympe.dc.Request.C.ij,fi=olympe.dc.Request.C.Uh,gi=olympe.dc.Request.C.Vh,hi=olympe.dc.Request.C.qh,ii=olympe.dc.Request.C.Bi,ji=olympe.dc.Request.C.gg,ki=olympe.dc.Request.C.Pf,li=olympe.dc.Request.C.Eg,mi=olympe.dc.Request.C.Bk;function ni(a,b){return!!a.db.Ma(b,olympe.dm.DataSource.hq)}
652
- function oi(a,b){b=ne(new olympe.dc.Request(mi,olympe.dc.Pa.SELF,{id:b,finalize:olympe.dc.transaction.Cf.C.Xi,error:null}),a.W());let c;null==(c=a.fc)||c.$c(b)}
653
- function pi(a,b,c){return v(function*(){var d=olympe.P.Request.kb.SEND,e=olympe.P.Request.kb.GET;const f=olympe.P.Request.kb.PUBLISH,g=olympe.P.Request.kb.SUBSCRIBE,h=c.request.getType();var k=c.body();let m;if(null==(m=a.fc)||!m.ba(k.uc()))throw Error(`Try to process a message with destination data source ${k.uc()} coming from remote but not started here`);if(h===g){if(k.getType()===ei)d=k.content.W();else throw Error('Not supported type of subscription');e=yield c.hm(d);a.T.set(e,d);e=a.O.get(d);
654
- e||(e=new qi(a.L,d,b,ne(k,olympe.dc.Pa.Af)),a.O.set(d,e));k=e;k.C++;k.L.debug(`Data subscription ${k.F} has ${k.C} subscribers`)}else h===e?(k=yield b.request(k),void 0!==k?yield c.$c(k):a.L.warn(`Request from ${c.source()} requires an output value, but got undefined instead.`)):h===d?(yield b.request(k),yield c.Fp()):h===f&&(yield b.request(k))})}
655
- olympe.dc.sources.Uo=class{constructor(a,b,c,d){this.L=a;this.G=b;this.C=c;this.db=d;this.F=new olympe.D.Mb('Remote Provider Context');this.fc=null;this.Z=new Map;this.O=new Map;this.T=new Map}W(){return olympe.dc.Pa.Af}request(a){const b=olympe.P.pb,c=a.uc(),d=a.getType();this.L.C()&&this.L.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case ci:return b.get(c,a);case di:return ni(this,c)?Kh(this.C,a):b.get(c,a);case fi:const e=a.content.Vc().W();return b.send(c,
656
- a).finally(()=>oi(this,e));case gi:const f=a.content.Vc().W();return(ni(this,c)?Lh(this.C,a):b.send(c,a)).finally(()=>oi(this,f));case hi:case ii:return b.publish(c,a).catch(g=>{this.L.error(`An error occurred while sending message to another data source: ${g}`)});case ji:return ni(this,c)?this.C.uploadFileContent(a):b.get(c,a);case ki:return ni(this,c)?this.C.downloadFileContent(a):b.get(c,a);case li:return ni(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.W()}`)}}K(a,
657
- b){const c=a.uc(),d=a.getType();this.L.C()&&this.L.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ei?olympe.P.pb.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){this.fc=a;olympe.dc.ua.from(this.G,this.G).lb(olympe.dm.DataSource.oi).filter(olympe.dc.query.Da.Qa(olympe.dm.DataSource.Wg,!0)).filter(olympe.dc.query.Da.Qa(olympe.dm.DataSource.Pp,!0)).observe(this.F).subscribe(b=>
658
- {pe(b).forEach(this.ga.bind(this,a));oe(b).forEach(c=>{let d;null==(d=this.Z.get(c))||d.destroy();this.Z.delete(c)})});this.db.Ma(this.G,olympe.dm.DataSource.Pp)&&(new olympe.P.pb(this.G,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.$c(b):this.L.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}ga(a,b){const c=b.X(),d=new olympe.D.Mb(`Published data provider context ${c}`,this.F),e=new olympe.P.pb(c,
659
- d);this.Z.set(c,d);b.get(olympe.dm.DataSource.hq)&&(b=Hh(this.C,c,a.request.bind(a)),d.onDestroy(b,'stopFileService'));e.lq(this.ba.bind(this)).listen().subscribe(f=>{f.lh().then(()=>pi(this,a,f)).catch(g=>{this.L.warn(`Error occurred while processing request from ${f.source()}: ${g}`);return f.$g(Error(g))})})}ba(a){const b=this.T.get(a);this.T.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.L.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),
660
- a=!0):(a.L.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};class qi{constructor(a,b,c,d){this.L=a;this.F=b;this.C=0;this.G=c.T(d).subscribe(e=>{olympe.P.pb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))})}}olympe.dc.sources.Uo.sa=[olympe.dc.sources.wk];olympe.dc.sources.dg=class extends olympe.P.dg{constructor(a){super();this.db=a;this.K=new Map}ha(a){a=this.C(a);if(0<this.K.size){const b=Array.from(this.K.values());this.K.clear();return{t:0,i:b,v:a}}return a}G(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.F(g)])));c.Cc(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Ic);olympe.dc.Ql().Zc(b);return this.F(a.v)}return this.F(a)}C(a){switch(!0){case a instanceof
661
- olympe.dc.CloudObject||'function'===typeof(null==a?void 0:a.X):return a=a.X(),this.O(a),{t:10,v:a};case a instanceof olympe.dc.ua:return{t:11,v:a.ha()};case a instanceof olympe.dc.Ka:return{t:12,v:a.ha(this.O.bind(this))};case a instanceof olympe.dc.db.Ic:const b=new olympe.dc.transaction.Yf;a.Md(b);return{t:13,i:a.W(),v:sg(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.uc(),u:a.yc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.vj:return{t:15,r:a.ug(),
662
- p:this.C(a.Vc())};case a instanceof olympe.dc.query.wd:return{t:16,v:a.ha()};default:return super.C(a)}}F(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.F(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.xa.fj.C),c=a.e;return new olympe.dc.ua(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,ad:c.s,xg:c.rm});case 12:return Yg(a.v);case 13:return(new olympe.dc.transaction.aj).C(a.v,a.i);case 14:return c=null!=
663
- (b=this.F(a.c))?b:void 0,ne(new olympe.dc.Request(a.r,a.d,c,a.u),a.o);case 15:return b=this.F(a.p),new olympe.dc.transaction.vj(b,a.r);case 16:return a=a.v,new olympe.dc.query.wd((new olympe.dc.transaction.aj).C(a.p),a.s);default:return super.F(a)}}O(a){if(!this.K.has(a)){var b={};this.db.Bb(a).forEach((d,e)=>{b[e]=this.C(d)});var c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:[]};this.K.set(a,c);for(const [d,e,f]of Jf(this.db,a)){const g=this.K.get(f);void 0!==g&&(e===olympe.dc.va.DESTINATION?
664
- c.r.push({r:d,d:f}):g.r.push({r:d,d:a}))}}}};const ri=olympe.dc.Request.C.me,si=olympe.dc.Request.C.Uh,ti=olympe.dc.Request.C.Vh,ui=olympe.dc.Request.C.qh,vi=olympe.dc.Request.C.Em,wi=olympe.dc.Request.C.Po,xi=olympe.dc.Request.C.Mg,yi=olympe.dc.Request.C.Ei,zi=olympe.dc.Request.C.ij,Ai=olympe.dc.Request.C.Fk,Bi=olympe.dc.Request.C.Gn,Ci=olympe.dc.Request.C.gr,Di=olympe.dc.Request.C.hr,Ei=olympe.dc.Request.C.Eg,Fi=olympe.dc.Request.C.Pf,Gi=olympe.dc.Request.C.gg,Hi=olympe.dc.Request.C.Bk,Ii=olympe.dc.Request.C.it,Ji=olympe.dc.Request.C.Ks,Ki=
665
- olympe.dc.Request.C.fr,Li=olympe.dc.Request.C.Bi,Mi=olympe.dc.Request.C.Hq,Ni=olympe.dc.Request.C.bc;function Oi(a){return Pi(a,olympe.dc.Request.C.me).then(b=>{b=b.p;const c=rg(b,a.W());a.L.C()&&a.L.debug('< Get Context result',b);a.L.K()&&a.L.log('< Get Context result has',b.length,'operations');return c})}
666
- function Qi(a,b){const c=b.Vc();b=new olympe.dc.transaction.Yf({$j:!0,Kd:!1,Xg:!1});c.Md(b);return Pi(a,ti,sg(b)).finally(()=>{Ri(a,Hi,{id:c.W(),finalize:olympe.dc.transaction.Cf.C.Xi})}).then()}function Si(a,b){const c=new olympe.dc.transaction.Yf({Kd:!1,Xg:!1}),d=b.Vc();d.Md(c);return Ti(a,ui,{i:d.W(),r:b.ug(),p:sg(c)},!1).catch(e=>a.L.error(`Error while publishing burst transaction: ${e}`))}
667
- function Ui(a,b){const c=b.W();a.L.C()&&a.L.debug(`Query (${c}) sent to orchestrator: ${b}`);b=Vi(a,b);return Pi(a,Ai,b).then(d=>Wi(a,d))}function Xi(a,b){const c=encodeURI(Ga(olympe.Y.Pd(),JSON.stringify(Vi(a,b))));a.L.C()&&a.L.debug(`Static GraphDef query ${b} sent to orchestrator`);return Pi(a,yi,void 0,`query=${c}&v=${a.version}`).then(d=>Wi(a,d))}
668
- function Ti(a,b,c,d=!0){const e=olympe.P.Zd.en,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{$c(a.F,e,f,(k,m)=>{k?h(k):g(m)})});$c(a.F,e,f);return Promise.resolve()}
669
- function Vi(a,b){const c=wg(b);b={i:b.W(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.xa.le)Object.assign(b,{f:c[0].Yb,q:[]});else{const d=new Map;for(let e=c.length-1;0<=e;e--){const f=c[e],g=f.C;let h;const k=(null!=(h=d.get(g))?h:new Set).add(f);if(f instanceof olympe.dc.query.xa.vf&&f.G){let m;null==(m=d.get(f.W()))||m.forEach(n=>k.add(n))}d.set(g,k)}Object.assign(b,{f:olympe.dc.Jb.NONE,q:c.map(a.T.bind(a,d))})}return b}
670
- function Ri(a,b,c){b=ne(new olympe.dc.Request(b,olympe.dc.Pa.SELF,c),a.W());let d;null==(d=a.fc)||d.$c(b)}
671
- function Pi(a,b,c,d){if(Xc(a.F)){const e=Ih(a.C,a.W(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=Rb(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Ia.Jd.Lg:olympe.net.Ia.Jd.GET,c&&JSON.stringify(c));P(b,{[olympe.net.Ia.Headers.vh]:'application/json'});return Jh(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}a.L.error('Server is disconnected, data request of type',b,'is canceled.');return Promise.reject('Server is disconnected')}
672
- function Wi(a,b){if(b&&'object'===typeof b){if(0<b.s)throw Error(b.info.error.reason);return rg(b.p,a.W())}throw Error('Data result can be created only from Object');}
673
- olympe.dc.sources.hp=class{constructor(a,b,c,d,e,f){this.L=a;this.F=b;this.ba=c;this.Z=d;this.C=e;this.O=new olympe.dc.transaction.aj(this.W());this.G=new Map;this.fc=null;this.version=f||'unknown';const g=olympe.auth.Ca.C.wf,h=olympe.auth.Ca.C.Fe;olympe.D.nc([this.Z.getState()],k=>{k!==g&&k!==h||this.G.forEach((m,n)=>{m.error(new olympe.P.errors.Zk('Connection to server has been recovered',n))})})}W(){return olympe.dc.Pa.SERVER}request(a){var b=a.getType(),c=a.content;switch(b){case Ni:return c=
674
- olympe.dm.DataSource.bc.Fb,a=olympe.dm.DataSource.bc.Oh,Promise.resolve(Xc(this.F)?{s:a}:{s:c,r:'Disconnected'});case ri:return Oi(this);case si:return a=new olympe.dc.transaction.Yf({Kd:!1,Xg:!1}),b=c.Vc(),b.Md(a),Ti(this,si,{i:b.W(),r:c.ug(),p:sg(a)}).then();case ti:return Qi(this,c);case ui:return Si(this,c);case Li:return a=new olympe.dc.transaction.Yf({Kd:!1,Xg:!1}),c=c.Vc(),c.Md(a),Ti(this,Li,{i:c.W(),p:sg(a)}).then();case xi:return Ui(this,c);case yi:return Xi(this,c);case vi:return Xc(this.F)?
675
- (c=Vi(this,olympe.dc.ua.from(c)),c.f=olympe.dc.Jb.jn,c=Rb(Ih(this.C,olympe.dc.Pa.SERVER,vi),olympe.net.Ia.Jd.Lg,JSON.stringify(c),olympe.net.Ia.ResponseType.ph),P(c,{[olympe.net.Ia.Headers.vh]:olympe.net.Ia.bn.JSON}),c=Jh(this.C,c)):(this.L.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case wi:a=c.xB;b=c.debug;c=c.optional;if(Xc(this.F)){var d=Ih(this.C,olympe.dc.Pa.SERVER,wi);c=Rb(d+`?debug=${b}&optional=${c}`,olympe.net.Ia.Jd.Lg,
676
- a);P(c,{[olympe.net.Ia.Headers.vh]:olympe.net.Ia.bn.qt});c=Jh(this.C,c)}else this.L.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected');return c;case Ii:case Ji:case Ki:case Mi:return Ti(this,b,{});case Fi:return this.C.downloadFileContent(a);case Ei:return this.C.deleteFileContent(a);case Gi:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}K(a,b){if(a.getType()===zi){const c=
677
- a.content,d=c.W();return(new rxjs.Observable(e=>{const f=Vi(this,c);this.G.set(d,e);Ti(this,Bi,f).catch(g=>e.error(g))})).pipe(Hc(this.ba,b),rxjs.operators.finalize(()=>{Ti(this,Ci,{i:d}).catch(e=>{this.L.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.fc=a;Vc(this.F,olympe.P.Zd.en,this.ga.bind(this));return this}destroy(){return v(function*(){})}ga(a){var b=
678
- olympe.dc.Request.C.Gm;const c=olympe.dc.Request.C.Xk;var d=a.c;if(d===olympe.dc.Request.C.fn)a=this.O.C(a.p),Ri(this,d,a);else if(d===b){var e=a.error.reason;b=this.O.C(a.p);Ri(this,d,{id:a.i,rollback:b,error:e})}else d===Di?(d=a.i,a=this.O.C(a.p),null==(e=this.G.get(d))||e.next(a)):d===c&&Ri(this,Hi,{id:a.i,finalize:olympe.dc.transaction.Cf.C.Xk,error:0<a.s?a.info.error.reason:null})}T(a,b){if(b instanceof olympe.dc.query.xa.Rf||b instanceof olympe.dc.query.xa.vf){const c=b.O();let d;b=Array.from(null!=
679
- (d=a.get(b.W()))?d:[]);return{t:c.X(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.T.bind(this,a))}}return{}}};olympe.dc.sources.hp.sa=[olympe.dc.sources.wk];function ge(a,b){let c;return null!=(c=a.db.source(b))?c:a.T}
680
- function Yi(a,b){let c;null==(c=a.G)||c.destroy();a.G=new olympe.D.Mb(`Source solver ${b.X()}`,olympe.D.ef());b.lb(olympe.dm.xd.G.Pb()).lb(olympe.dm.xd.C).Ld().back().lb(olympe.dm.xd.F).Ld().observe(a.G).subscribe(d=>{pe(d).forEach(([e,f])=>{a.F.set(e.X(),f.W())});oe(d).forEach(([e])=>{a.F.delete(e)})});b.lb(olympe.dm.tb.G).observe(a.G).subscribe(d=>{let e,f;a.K=null!=(f=null==(e=d.vc())?void 0:e.W())?f:null});a.G.onDestroy(()=>{a.F.clear();a.K=null})}
681
- olympe.dc.sources.sj=class{constructor(a,b,c){this.db=a;this.C=b;this.T=c;this.F=new Map;this.K=this.G=null;this.O=!1}fromModel(a){a=olympe.dc.ja(a);return this.F.has(a)?this.F.get(a):this.K&&this.Z(a)?this.K:this.T}Lb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Pa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ua(a)&&this.db.sd(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}Z(){return!1}init(){if(!this.O){this.O=!0;var a=new olympe.dc.Ra;
682
- Z(a.create(olympe.dm.DataSource,this.C).jh(this.C),olympe.dm.DataSource.Wg,!0);a.Ea(olympe.dm.DataSource.oi,this.C,this.C);a.ib(()=>{olympe.dc.ua.from(this.C).observe(olympe.D.ef()).subscribe(()=>{})})}}};olympe.dc.sources.R={ya:'dc.sources.Logger',Ik:'dc.sources.HTTPService',wr:'dc.sources.IOService',No:'dc.sources.RemoteProvider',$o:'dc.sources.ServerProvider',my:'dc.sources.OfflineProvider',Ue:'dc.sources.SourceSolver',de:'dc.sources.Serializer'};olympe.dc.sources.V={Ah:'data.httpHost',Bh:'data.httpPort',Pi:'data.httpSSL',Hg:'data.httpBasePath',sq:'offline.autoSync',rq:'offline.autoPersist',Xs:'offline.syncTimeout',VERSION:'version.version'};
683
- olympe.U.config(function(a){F(a,olympe.dc.sources.V.sq,!1);F(a,olympe.dc.sources.V.rq,!1);F(a,olympe.dc.sources.V.Xs,3E4);const b=a.getParameter(olympe.P.V.Sf)||'localhost',c='localhost'===b;F(a,olympe.dc.sources.V.Hg,'/data');F(a,olympe.dc.sources.V.Ah,b);F(a,olympe.dc.sources.V.Bh,c?3141:443);F(a,olympe.dc.sources.V.Pi,!c);E(a,olympe.dc.sources.R.ya,[olympe.ka.R.Fa],d=>d.Dc('data'));D(a,olympe.dc.sources.R.de,olympe.dc.sources.dg,olympe.dc.R.Je);ua(a,olympe.P.R.de,olympe.dc.sources.R.de);E(a,olympe.dc.sources.R.Ik,
684
- [olympe.dc.sources.R.ya,olympe.net.R.yj,olympe.P.R.Hk,olympe.auth.R.Fa,olympe.dc.sources.R.Ue,olympe.P.R.de,new olympe.U.ma(olympe.net.V.Hg),new olympe.U.ma(olympe.auth.V.Ci)],(d,e,f,g,h,k,m,n,p)=>{m=(new Map(p)).set('basePath',m).set('allowGuest',n);return new olympe.dc.sources.kr(d,e,f,g,h,k,m)});D(a,olympe.dc.sources.R.wr,olympe.dc.sources.Rn,olympe.dc.sources.R.ya,olympe.dc.R.Ng,olympe.net.R.Fa,olympe.auth.R.Fa);D(a,olympe.dc.sources.R.No,olympe.dc.sources.Uo,olympe.dc.sources.R.ya,new olympe.U.ma(olympe.dc.V.cg),
685
- olympe.dc.sources.R.Ik,olympe.dc.R.Je);D(a,olympe.dc.sources.R.$o,olympe.dc.sources.hp,olympe.dc.sources.R.ya,olympe.P.R.mj,olympe.P.R.kk,olympe.auth.R.Fa,olympe.dc.sources.R.Ik,new olympe.U.ma(olympe.dc.sources.V.VERSION));D(a,olympe.dc.sources.R.Ue,olympe.dc.sources.sj,olympe.dc.R.Je,new olympe.U.ma(olympe.dc.V.cg),new olympe.U.ma(olympe.dc.V.uk))},'olympe.dc.sources');olympe.U.run([olympe.dc.sources.R.Ue],a=>{olympe.dc.ie=()=>a});olympe.dc.transaction={};olympe.dc.rh=class a{constructor(b,c){this.id=b||olympe.Y.hc();this.F=new olympe.D.Mb('BurstTransaction#'+this.id,c);this.Cb=Zi(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.K=new Set;this.C=null;this.nb=olympe.U.getParameter(olympe.dc.transaction.V.Fm)||30;this.qa=[]}static C(b,c){return`${b},${c}`}Ob(b){for(const c of this.qa)c(b);this.stop()}Va(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ga(this.K);0<b.size&&$i(this,b,!1);this.K.clear()}ga(b){const c=
686
- new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}ba(b,c,d){this.Ba(b,c,d);this.Cb(b,c,d);null===this.C&&(this.C=setTimeout(this.Va.bind(this),this.nb))}Ba(b,c,d){b=a.C(b,c);this.G.set(b,d);this.K.add(b)}ub(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ja(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ja(f),this.ub(d,e)!==g&&this.ba(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
687
- c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ja(b),f=olympe.dc.ja(c);void 0===e||void 0===f?olympe.dc.gh().ab().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.jm([d],g=>{this.T=!0;g instanceof olympe.dc.kc?olympe.dc.gh().ab().error('Cannot send complex property values in burst transactions'):this.ba(e,f,g.valueOf())})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();this.qa.length=0}getContext(){return this.F}W(){return this.id}ug(){return!1}O(b){if(this.T){this.T=
688
- !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.K.clear();const c=this.ga(new Set(this.G.keys()));$i(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.rh.prototype.complete=olympe.dc.rh.prototype.complete;olympe.dc.rh.prototype.push=olympe.dc.rh.prototype.push;olympe.dc.vo=class{C(){}toString(){}};olympe.dc.transaction.aj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Pa.SERVER}C(b,c){c=new olympe.dc.db.Ic(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Cc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.bd(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.Xb(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
689
- e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Ri.Hd+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
690
- case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.kc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function aj(a,b){let c;return null!=(c=a.sources.get(b))?c:ge(a.K,b)}function bj(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Ae(b))?void 0:c.Dd())?d:a.db.model(b))?e:null}function cj(a,b){let c;return null!=(c=a.O.get(b))?c:a.db.Jf(b)||!a.db.Ua(b)}function dj(a){return Array.from(a.C.Sd()).filter(b=>!b.gf()).map(b=>b.tag())}function ej(a,b,c,d){d(a.C);c&&a.G&&b!==olympe.dc.Pa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Ic(a.id),a.F.set(b,c)),d(c))}
691
- function fj(a,b,c){const d=aj(a,b),e=cj(a,b),f=bj(a,b);ej(a,d,e,g=>{g.F(b,c,f)})}
692
- olympe.dc.transaction.Fs=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.hc();this.K=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.Ic(this.id);this.sources=new Map;this.O=new Map;this.G=!0}hh(){return 0===this.C.C.size}persist(a){this.G=a}Cc(a,b,c,d,e){let f;const g=null!=(f=null!=d?d:this.sources.get(a))?f:this.K.fromModel(b);this.sources.set(a,g);this.O.set(a,c&&this.G);ej(this,g,c,h=>{h.Cc(a,g,e,b)})}bd(a,b){const c=aj(this,a),d=cj(this,a),e=bj(this,a);ej(this,c,d,f=>{f.bd(a,null!=b?b:
693
- new Map,e)})}Ea(a,b,c){const d=aj(this,b),e=aj(this,c);let f=cj(this,b)&&cj(this,c)&&d!==olympe.dc.Pa.SELF&&e!==olympe.dc.Pa.SELF;f&&d!==e&&a!==olympe.dc.lc.hd&&(olympe.ka.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);ej(this,d,f,g=>{g.Ea(a,b,c,bj(this,b),bj(this,c))})}Xb(a,b,c){const d=aj(this,b),e=aj(this,c);let f=cj(this,b)&&cj(this,c)&&d!==olympe.dc.Pa.SELF&&e!==olympe.dc.Pa.SELF;f&&d!==e&&a!==olympe.dc.lc.hd&&(olympe.ka.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
694
- f=!1);ej(this,d,f,g=>{g.Xb(a,b,c,bj(this,b),bj(this,c))})}};function gj(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.Tn.cp)if(e===olympe.dc.Pa.SELF)d[g]=olympe.dc.Aa().W();else{if(e===olympe.dc.Pa.SERVER)continue}else g.startsWith(olympe.dc.Ri.Hd)&&(g='fd'+g.substring(1));e=a.Z(e);c&&e instanceof Object&&8===e.c?a.T.set(g,e):d[g]=e}return d}function hj(a){if(0===a.T.size)return null;const b=Object.create(null);a.T.forEach((c,d)=>{b[d]=c});a.T.clear();return b}
695
- class ij{constructor(){this.T=new Map}Z(a){return a instanceof olympe.D.Ja||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.Za?(a=a instanceof olympe.D.Za?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.pg().valueOf(),g:a.ng().valueOf(),b:a.lg().valueOf(),a:a.kg().valueOf()}:a&&'function'===
696
- typeof a.X?{c:8,t:a.X()}:a}}function sg(a){const b=a.K.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.K=[];return b}
697
- olympe.dc.transaction.Yf=class{constructor({$j:a=!1,Xg:b=!0,Kd:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.K=[];this.$j=null!=a?a:!1;this.Kd=null!=c?c:!0;this.Xg=null!=b?b:!0;this.Z=olympe.D?new ij:new class extends ij{Z(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(sg(this))}Cc(a,b,c,d=null){c=gj(this.Z,null!=c?c:null,this.$j);c={o:1,t:a,p:c};this.Xg&&(c.s=b);this.Kd&&d&&(c.m=d);this.O.push(c);this.$j&&(b=hj(this.Z))&&this.C.push({o:2,t:a,p:b})}bd(a,
698
- b,c=null){b=gj(this.Z,b||null,!1);a={o:2,t:a,p:b};this.Kd&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.Kd&&c&&(a.m=c);this.G.push(a)}Ea(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.Kd&&d&&(a.lm=d);this.Kd&&e&&(a.rm=e);this.T.push(a)}Xb(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
699
- if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.Kd&&d&&(a.lm=d);this.Kd&&e&&(a.rm=e);this.K.push(a)}};olympe.dc.transaction.Yf.sa=[olympe.dc.Writable];function jj(a,b){b&&a.gb.push(b);return b}function kj(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();jj(a,new olympe.dc.transaction.gb.ln(e,b));jj(a,new olympe.dc.transaction.gb.rk(e,b,d));return c}
700
- function lj(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
701
- olympe.dc.Ra=class{constructor(a){this.id=a||olympe.Y.hc();this.gb=[];this.G=new Map;this.K=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ja(a)))?b:olympe.dc.Aa().model(a)}persist(a){this.K=a;return this}C(a){a.persist(this.K);const b=this.gb;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){b=jj(this,new olympe.dc.transaction.gb.qk(a,b));this.G.set(b.X(),olympe.dc.ja(a));return b}pi(a,b=!0){const c=olympe.dc.ja(a);var d=this.gb.find(h=>h instanceof olympe.dc.transaction.gb.qk&&
702
- h.X()===c);if(d)return d.persist(b);d=olympe.dc.Aa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+a);if(d.Jf(a))return null;let f;const g=null!=(f=d.source(a))?f:olympe.dc.ie().fromModel(e);a=this.create(e,a).persist(b).jh(g);for(const [h,k,m]of Jf(d,a))h!==olympe.dc.lc.hd&&d.Jf(m)&&this.Ea(h,k===olympe.dc.va.DESTINATION?a:m,k===olympe.dc.va.DESTINATION?m:a);return a}delete(a,b=olympe.dc.Jb.oc){jj(this,new olympe.dc.transaction.gb.mn(a,b))}update(a,
703
- b,c){return jj(this,new olympe.dc.transaction.gb.ot(a,b,c))}Ea(a,b,c){jj(this,new olympe.dc.transaction.gb.rk(a,b,c))}Xb(a,b,c){jj(this,new olympe.dc.transaction.gb.Xq(a,b,c))}Jl(a,b){jj(this,new olympe.dc.transaction.gb.ln(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Ri.Hd+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,
704
- a,d);return d}Mp(a,b,c='',{EA:d=olympe.dm.Relation.K.ws,PA:e=olympe.dm.Relation.C.Ko,KA:f=olympe.dm.Relation.C.Bq,pB:g=olympe.dm.Relation.C.mr,BA:h=olympe.dm.ek.NONE,mB:k=olympe.dm.Relation.O|h}={},m=olympe.Y.hc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.qa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ga,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.ni,
705
- a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}ug(){return!1}Cl(a){this.F.push(olympe.D.Oa().G(a))}ib(a,b){a=lj([...this.F,a].filter(c=>'function'===typeof c));mj(this,a,b)}Kl(a){a=lj([...this.F,a]);nj(olympe.dc.gh(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ra.sa=[olympe.dc.vo];function Zi(a){var b=olympe.dc.gh();const c=a.W();b.K.set(c,a);a.getContext().onDestroy(()=>{b.K.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Ic(c);g.bd(d,(new Map).set(e,f),b.db.model(d));b.F.Zc(g)}}
706
- function $i(a,b,c,d){var e=olympe.dc.gh();const f=olympe.dc.Request.C.qh,g=olympe.dc.Request.C.Bi,h=a.W();a=a.ug();const k=new Map;for(const m of b.keys()){const n=e.db.source(m);if(n===olympe.dc.Pa.SELF)continue;let p=k.get(n);p||(p=new olympe.dc.db.Ic(h),k.set(n,p));p.bd(m,b.get(m),e.db.model(m))}for(const [m,n]of k)b=new olympe.dc.Request(c?g:f,m,new olympe.dc.transaction.vj(n,a)),b=e.fc.request(b),c&&d&&b.then(()=>d(!0)).catch(p=>d(!1,`${p}`))}
707
- function mj(a,b,c){var d=olympe.dc.gh();if(c&&'function'===typeof b){const e=a.W();d.G.set(e,b);nj(d,a,(f,g)=>{f||(d.G.delete(e),b(f,g))},!1)}else nj(d,a,b,!1)}function oj(a){const b=olympe.dc.Request.C.Bk;a.fc.K(olympe.dc.Request.C.Gm,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.K.get(c);void 0!==f&&(a.K.delete(c),f.Ob(d));a.F.Zc(e);a.L.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.fc.K(b,c=>{c=c.content;pj(a,c.id,c.finalize,c.error)})}
708
- function nj(a,b,c,d=!1){c=c?olympe.D.Oa().G(c):void 0;const e=b.W(),f=new olympe.dc.transaction.Fs(a.db,a.T,e);b.C(f);if(f.hh())null==c||c(!0);else{a.C.set(e,[]);var g=dj(f);a.F.C.ub(g);var h=g.filter(m=>cj(f,m)),k=[gf(a.F,f.C,h),c];qj(a,f,h).then(m=>{k.splice(1,0,m);rj(a,e,g,f.F.size+1);return sj(a,f,d,b.ug())}).then(()=>{k.forEach(m=>null==m?void 0:m(!0,null));pj(a,e,olympe.dc.transaction.Cf.C.Xi,null)}).catch(m=>{a.L.error(m);k.forEach(n=>null==n?void 0:n(!1,m));tj(a,e)})}}
709
- function qj(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.sd(n,olympe.dm.File)&&void 0!==(null==(p=d.Ae(n))?void 0:p.Ma(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(null);const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],m=olympe.Y.Pd();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return new Promise((q,r)=>{m.F(p,t=>{if(null===t)m.T(p),q();else{var u=n.X(),
710
- w,x=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';he(a.Z,u,t,x,y=>{const z=h.reduce((A,J)=>A||J.Ae(u),null);null!==z&&(y=(new Map).set(e,y).set(f,!0).set(g,new Date),z.Bl(y),k.push([u,y]));m.T(p);q()},r)}})});2048<p.length&&a.L.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.bd(q,r);return p},new olympe.dc.db.Ic);return gf(a.F,
711
- n)})}function rj(a,b,c,d){const e=olympe.D.ef(),f=new olympe.async.ej(e);0<a.timeout&&nc(f,a.timeout);const g=olympe.dc.transaction.Cf.C.qs;let h=!0;const k=a.C.get(b);for(let m=0;m<d;m++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});oc(f,(m,n)=>{m||a.L.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.F.C.Ob(c);tj(a,b)});f.start()}
712
- function sj(a,b,c,d){const e=c?olympe.dc.Request.C.Vh:olympe.dc.Request.C.Uh;return Promise.all(Array.from(b.F).map(([f,g])=>a.fc.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.vj(g,d))))).then()}function pj(a,b,c,d){(a=(a=a.C.get(b))&&a.pop())&&a(c,d)}function tj(a,b){var c;null==(c=a.C.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Cf.C.Xi,null)});a.C.delete(b);if(0===a.C.size){for(const d of a.O)d();a.O=[]}a.G.has(b)&&(c=a.G.get(b),a.G.delete(b),c(!0))}
713
- function uj(a,b){0<a.C.size?a.O.push(olympe.D.Oa().G(b)):b()}olympe.dc.transaction.Cf=class{constructor(a,b,c,d,e,f){this.L=a;this.F=b;this.db=b.view;this.fc=c;this.T=d;this.Z=e;this.timeout=f;this.K=new Map;this.C=new Map;this.O=[];this.G=new Map;oj(this)}ab(){return this.L}};olympe.dc.transaction.Cf.C={Xk:0,Xi:1,qs:2};olympe.dc.transaction.vj=class{constructor(a,b=!1){this.C=a;this.F=b}ug(){return this.F}Vc(){return this.C}};olympe.dc.transaction.R={ya:'dc.transaction.Logger',Fa:'dc.transaction.Manager'};olympe.dc.transaction.V={TIMEOUT:'dc.transaction.timeout',Fm:'dc.transaction.burstInterval'};
714
- olympe.U.config(function(a){F(a,olympe.dc.transaction.V.TIMEOUT,6E4);F(a,olympe.dc.transaction.V.Fm,30);E(a,olympe.dc.transaction.R.ya,[olympe.ka.R.Fa],b=>b.Dc('dc'));D(a,olympe.dc.transaction.R.Fa,olympe.dc.transaction.Cf,olympe.dc.transaction.R.ya,olympe.dc.db.R.Fa,olympe.dc.R.Ng,olympe.dc.sources.R.Ue,olympe.dc.R.Ki,new olympe.U.ma(olympe.dc.transaction.V.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.gb={};function vj(a){return olympe.dc.ja(a)}function wj(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Sa(e));return c}olympe.dc.transaction.gb.Nf=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Sa(a){a=olympe.D.Sa(a);return void 0===a||null===a?null:olympe.D.cq(a)?a.valueOf():a}};olympe.dc.transaction.gb.Nf.sa=[olympe.dc.vo];function Z(a,b,c){a.G.set(olympe.dc.ja(b),c);return a}
715
- olympe.dc.transaction.gb.qk=class extends olympe.dc.transaction.gb.Nf{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ja(b))?c:olympe.Y.$e();this.model=olympe.dc.ja(a);this.source=null;this.G=new Map;this.F=!0}X(){return this.tag}Rb(){return this.model}persist(a){this.F=a;return this}jh(a){this.source=a;return this}C(a){const b=olympe.dc.Aa(),c=this.Rb(),d=this.X();if(!c)throw Error('OperationError: Cannot create instance, model tag is undefined');if(b.Ua(d)&&!b.Jf(d)&&this.F){const e=
716
- new Map([...b.Bb(d,!0),...wj(this,this.G)]);for(const f of e.values())if(f instanceof olympe.dc.kc&&!cj(a,f.X())){const g=new olympe.dc.Ra;g.pi(f.X());g.C(a)}a.Cc(d,c,this.F,this.source,e);for(const [f,g,h]of Jf(b,d))cj(a,h)&&(g===olympe.dc.va.ORIGIN?a.Ea(f,h,d):a.Ea(f,d,h))}else b.Ua(d)||a.Cc(d,c,this.F,this.source,wj(this,this.G))}toString(){return`CreateInstance(${this.Rb()}, ${this.X()})`}};olympe.dc.transaction.gb.qk.sa=[olympe.dc.ne];olympe.dc.transaction.gb.rk=class extends olympe.dc.transaction.gb.Nf{constructor(a,b,c){super();this.relation=a instanceof olympe.dc.Ha.Relation?a:new olympe.dc.Ha.Relation(vj(a));this.origin=olympe.dc.ja(b);this.F=olympe.dc.ja(c)}getType(){return this.relation.X()}La(){return this.relation.La()}C(a){const b=this.relation.X();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.lc.hd)throw Error('OperationError: Cannot create the instance -> model relation');
717
- if(''===this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');if(''===this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.va.DESTINATION?a.Ea(b,this.origin,this.F):a.Ea(b,this.F,this.origin)}toString(){return`CreateRelation('${this.relation.La()}${this.relation.X()}, ${this.origin}, ${this.F})`}};olympe.dc.transaction.gb.Vw=class extends olympe.dc.transaction.gb.Nf{constructor(a,b=olympe.dc.Jb.oc){super();this.model=a;this.Yb=b}Rb(){return vj(this.model)}C(a){const b=this.Rb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Aa();for(const d of c.Sd(b))d!==b&&(new olympe.dc.transaction.gb.mn(d,this.Yb)).C(a)}toString(){return`DeleteAllInstances(${this.Rb()}, ${this.Yb})`}};olympe.dc.transaction.gb.ln=class extends olympe.dc.transaction.gb.Nf{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ha.Relation?a:new olympe.dc.Ha.Relation(olympe.dc.ja(a));this.origin=olympe.dc.ja(b)}getType(){return vj(this.relation)}La(){return this.Sa(this.relation).La()}C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.lc.hd)throw Error('OperationError: Cannot delete the instance -> model relation');
718
- const c=this.origin;if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');var d=olympe.dc.Aa();const e=this.La();d=d.fb(c,this.relation);for(const f of d)e===olympe.dc.va.DESTINATION?a.Xb(b,c,f):a.Xb(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.gb.mn=class extends olympe.dc.transaction.gb.Nf{constructor(a,b=olympe.dc.Jb.oc){super();this.tag=a;this.Yb=b}X(){return vj(this.tag)}C(a){const b=olympe.dc.Aa(),c=this.X();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');b.Ua(c)&&fj(a,c,this.Yb)}toString(){return'DeleteInstance('+this.X()+', '+this.Yb+')'}};olympe.dc.transaction.gb.Xq=class extends olympe.dc.transaction.gb.rk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.lc.hd)throw Error('OperationError: Cannot delete the instance -> model relation');const c=this.origin;if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.F;if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
719
- this.relation.La()===olympe.dc.va.DESTINATION?a.Xb(b,c,d):a.Xb(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.X()+', '+this.origin+', '+this.F+')'}};olympe.dc.transaction.gb.ot=class extends olympe.dc.transaction.gb.Nf{constructor(a,b,c){super();this.tag=a;this.F=new Map;void 0!==b&&this.F.set(vj(b),c)}X(){return vj(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Aa();var d;if(!(null!=(d=a.C.Ae(b))&&d.K()||c.Ua(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');d=wj(this,this.F);for(const [f,g]of d){var e=c.Ma(b,f);e instanceof
720
- olympe.dc.kc&&fj(a,e.X(),olympe.dc.Jb.oc);g instanceof olympe.dc.kc&&!cj(a,g.X())&&(e=new olympe.dc.Ra,e.pi(g.X()),e.C(a))}a.bd(b,d)}toString(){return'UpdateInstance('+this.X()+', '+wj(this,this.F)+')'}};olympe.dc.ja=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Sa(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.X?b=a.X():'function'===typeof a&&(b=olympe.dc.la.Rb(a)));return b||''};B('olympe.dc.instanceToTag',olympe.dc.ja);olympe.dc.Aa=function(){return olympe.dc.Ql().view};olympe.dc.register=function(a,b){olympe.dc.la.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.Ha.Property(a)};
721
- olympe.dc.Mp=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ha.Relation(a,b):new olympe.dc.Ha.Relation(a,d,b,c)};olympe.dc.Mt=function(a){return a.Pb()};olympe.dc.Db={};olympe.dc.Db.Hl=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.rb(a):a instanceof olympe.D.Ja?a:null;olympe.dc.Db.El=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Hb(a):a instanceof olympe.D.ea?a:null;olympe.dc.Db.Gl=a=>'number'===typeof a||a instanceof Number?olympe.D.na(a):'string'===typeof a||a instanceof String?olympe.D.na(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
722
- olympe.dc.Db.Fl=function(a){return'number'===typeof a||a instanceof Number?wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.Za(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.Za(a):a instanceof olympe.D.Za?a:null};olympe.dc.Db.Hp=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Ab(a.valueOf()):null};olympe.dc.Db.Ip=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.kc?de(a):null;
723
- olympe.dc.Db.hg=a=>a instanceof olympe.dc.kc?de(a):a;olympe.dc.Db.GA=a=>{switch(typeof a){case 'boolean':return olympe.D.Hb(a);case 'number':return olympe.D.na(a);case 'string':return olympe.D.rb(a);case 'object':if(a instanceof Date)return olympe.D.Fv(a)}return a};
724
- olympe.dc.Db.YA=a=>{switch(a){case olympe.D.ea:return olympe.dc.Db.El;case olympe.D.Ja:return olympe.dc.Db.Hl;case olympe.D.aa:return olympe.dc.Db.Gl;case olympe.D.Za:return olympe.dc.Db.Fl;case olympe.D.Color:return olympe.dc.Db.Hp;case olympe.dc.CloudObject:return olympe.dc.Db.Ip;default:return olympe.dc.Db.hg}};olympe.dc.ic={};olympe.dc.He=class{fa(){}K(){}G(){}O(){}ha(){}toString(){}};function xj(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Gb();return b}function yj(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.W()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ka.ab('dc').warn(a))}
725
- function zj(a){const b=new olympe.D.Mb('listDef toObservable');return new rxjs.Observable(c=>{b.run(()=>{olympe.D.nc([a],d=>{c.next(d.valueOf())})});b.onDestroy(()=>{c.complete()});return()=>b.destroy()})}
726
- olympe.dc.ta=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.ra([a],olympe.dc.ja,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||xj(this),this.C=null)}ge(){return olympe.dc.ge()}ib(){if(null===this.C){const a=olympe.dc.ic.Hu();this.C=Aj(a,this);null!==this.valueType&&this.C.gd(this.valueType);olympe.D.Oa().Z(()=>{var b=this.C.W();a.L.debug('QueryMGR: [ID:',
727
- b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}Ub(){null===this.C&&this.ib();return this.C}gd(a){this.valueType=a;null!==this.C&&this.C.gd(this.valueType)}Gb(){return null!==this.C?this.C.Gb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Cd(){return this.F}Ok(){return this.da}Xc(a,b){return this.Ub().Xc(a,b)}Xj(a){this.Ub().Xj(a)}Gr(){return this.Ub().ld()}Fr(){return this.Ub().T()}get(a){return this.Ub().get(a)}eh(){return this.Ub().eh()}bh(a){const b=
728
- this.Ub();yj(b,'getCurrent');return b.bh(a)}has(a){return this.Ub().has(a)}tg(a){const b=this.Ub();yj(b,'hasCurrent');return b.tg(a)}Od(a){return this.Ub().Od(a)}Gv(a){return zj(this.Od(a))}ze(a){const b=this.Ub();yj(b,'getCurrentAt');return b.ze(a)}Be(a){return this.Ub().Be(a)}af(a){const b=this.Ub();yj(b,'getCurrentKeyAt');return b.af(a)}Ed(a){return this.Ub().Ed(a)}Lv(a){return zj(this.Ed(a))}bf(a){const b=this.Ub();yj(b,'getCurrentRank');return b.bf(a)}vc(){return this.Ub().vc()}Hv(){return zj(this.vc())}cf(){return this.Ub().cf()}Ne(){return this.Ub().Ne()}Mv(){return zj(this.Ne())}If(){const a=
729
- this.Ub();yj(a,'getCurrentSize');return a.If()}forEach(a,b){this.Ub().forEach(a,b)}Nd(a){const b=this.Ub();yj(b,'forEachCurrentValue');return b.Nd(a)}ci(a,b,c,d){a=new olympe.dc.da.Ig(a,b);(new olympe.dc.ta(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
730
- if(c instanceof olympe.dc.Ha.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ta(this.F,a);b.gd(xj(b)||this.valueType||Object);return b}bk(a){return this.transform(new olympe.dc.da.We(a))}filter(a){return this.transform(new olympe.dc.da.Le(a))}Gf(){const a=new olympe.dc.Vi(this.F,null===this.valueType?void 0:this.valueType);let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);
731
- return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Sa(this.F)+a+')'}Er(){return this.Ub().Uf()}wc(){return olympe.D.ra([this.Ne()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.rb(b+']')},olympe.D.Ja)}};olympe.dc.ta.prototype.filter=olympe.dc.ta.prototype.filter;olympe.dc.ta.prototype.union=olympe.dc.ta.prototype.bk;olympe.dc.ta.prototype.transform=olympe.dc.ta.prototype.transform;
732
- olympe.dc.ta.prototype.forEachCurrentValue=olympe.dc.ta.prototype.Nd;olympe.dc.ta.prototype.forEach=olympe.dc.ta.prototype.forEach;olympe.dc.ta.prototype.getCurrentSize=olympe.dc.ta.prototype.If;olympe.dc.ta.prototype.observeSize=olympe.dc.ta.prototype.Mv;olympe.dc.ta.prototype.observeFirst=olympe.dc.ta.prototype.Hv;olympe.dc.ta.prototype.getCurrentRank=olympe.dc.ta.prototype.bf;olympe.dc.ta.prototype.observeRank=olympe.dc.ta.prototype.Lv;olympe.dc.ta.prototype.getCurrentAt=olympe.dc.ta.prototype.ze;
733
- olympe.dc.ta.prototype.observeAt=olympe.dc.ta.prototype.Gv;olympe.dc.ta.prototype.offReady=olympe.dc.ta.prototype.Xj;olympe.dc.ta.prototype.onReady=olympe.dc.ta.prototype.Xc;olympe.dc.ta.prototype.getBaseTag=olympe.dc.ta.prototype.Cd;olympe.dc.ta.sa=[olympe.D.Oc];l=olympe.dc.ta.prototype;l.ge.J=olympe.D.H.C;l.ib.J=olympe.D.H.K();l.Ub.J=new olympe.D.H(()=>olympe.dc.ic.Subscription,[]);l.gd.J=new olympe.D.H(()=>{},[]);l.Cd.J=new olympe.D.H(()=>String,[]);l.Ok.J=new olympe.D.H(()=>Array,[]);
734
- l.Xc.J=new olympe.D.H(()=>String,[]);l.Xj.J=new olympe.D.H(()=>{},[]);l.Gr.J=olympe.D.H.O;l.Fr.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.eh.J=new olympe.D.H(()=>Array,[]);l.bh.J=olympe.D.H.C;l.has.J=olympe.D.H.O;l.tg.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.ze.J=olympe.D.H.C;l.Be.J=new olympe.D.H(()=>String,[]);l.af.J=olympe.D.H.C;l.Ed.J=olympe.D.H.G;l.bf.J=olympe.D.H.C;
735
- l.vc.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.cf.J=new olympe.D.H(()=>String,[]);l.Ne.J=olympe.D.H.G;l.If.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Nd.J=olympe.D.H.C;l.ci.J=new olympe.D.H(()=>{},[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.bk.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.filter.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Gf.J=new olympe.D.H(()=>olympe.dc.Vi,[]);l.toString.J=olympe.D.H.C;l.Er.J=olympe.D.H.C;l.wc.J=olympe.D.H.F;const Bj={nw:'append',Ak:'filter_not',wn:'filter_and',xn:'filter_or'};function Cj(a,b){a=Dj(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Ta.Am(a,b)).F}
736
- olympe.dc.Vi=class{constructor(a,b){this.C=Dj(a);this.L=olympe.ka.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.gb=[]}Oe(){return new olympe.dc.ta(this.C,this.da,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ej('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ha.Property)throw new Ej('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.C)throw new Ej('transform',
737
- 'one of the argument is not a Transformer '+d);const e=d.Gb();null!==e&&(this.valueType=e);this.da.push(d)}return this}bk(a){this.da.push(new olympe.dc.da.We(a));return this}kw(a){this.da.push(new olympe.dc.da.We(Dj(a)));return this}Ir(a){this.valueType=a;return this}lb(a){this.da.push(a);this.valueType=a.Gb()||olympe.dc.CloudObject;return this}$t(a){for(const b of a)this.da.push(b),this.valueType=b.Gb()||olympe.dc.CloudObject;return this}Zt(a,b,c){a=new olympe.dc.da.ce(a,a.La(),b,c);this.da.push(a);
738
- this.valueType=a.Gb()||olympe.dc.CloudObject;return this}Yt(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.La())}a=new olympe.dc.da.Wi(b,c);this.da.push(a);this.valueType=a.Gb()||olympe.dc.CloudObject;return this}Hr(){this.lb(olympe.dc.CloudObject.instancesRel);return this}ye(a){var b=this.gb.pop();b===Bj.Ak&&(a=new olympe.dc.$.$d(a),b=this.gb.pop());switch(b){case Bj.wn:b=this.da.pop().F;b instanceof olympe.dc.$.dd?(b=b.$,b.push(a),a=new olympe.dc.$.dd(...b)):
739
- a=new olympe.dc.$.dd(b,a);b=this.gb.pop();break;case Bj.xn:b=this.da.pop().F,b instanceof olympe.dc.$.be?(b=b.$,b.push(a),a=new olympe.dc.$.be(...b)):a=new olympe.dc.$.be(b,a),b=this.gb.pop()}b===Bj.Ak&&(a=new olympe.dc.$.$d(a),this.gb.pop());this.da.push(new olympe.dc.da.Le(a));return this}Ut(a,b,c){return this.ye(new olympe.dc.$.Xd(Cj(a,c),new olympe.dc.Ta.ke(b)))}contains(a,b,c=!1,d){return this.ye(new olympe.dc.$.Ie(Cj(a,d),new olympe.dc.Ta.ke(b),c))}sd(a){if(!(a instanceof Array))throw new Ej('instanceOf',
740
- 'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Dj(a[c]));return this.ye(new olympe.dc.$.Gh(b))}Rj(a){return this.ye(new olympe.dc.$.Xd(new olympe.dc.Ta.Wh,new olympe.dc.Ta.ke(Dj(a))))}Vt(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Wc().Rj(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Wc().Rj(a[b])}return this}ii(a,b){if(!(a instanceof Array))throw new Ej('hasRelated','Provided argument "relations" must be an array.');
741
- const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.ye(new olympe.dc.$.Ch(c,d,b))}Qj(a,b,c){a=Cj(a,c);return this.ye(new olympe.dc.$.Ni(a,new olympe.dc.Ta.ke(b)))}ti(a,b,c){a=Cj(a,c);return this.ye(new olympe.dc.$.rj(a,new olympe.dc.Ta.ke(b)))}yv(a,b,c,d){a=Cj(a,d);return this.ye(new olympe.dc.$.Te(a,b,c))}filter(a){const b=new class extends olympe.dc.$.Mf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.ye(b)}Wc(){this.gb.push(Bj.Ak);return this}and(){this.da[this.da.length-
742
- 1]instanceof olympe.dc.da.Le&&this.gb.push(Bj.wn);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.Le&&this.gb.push(Bj.xn);return this}ak(a,b,c){a=Dj(a);let d=null;switch(olympe.dc.Aa().Sb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.N.X():d=new olympe.dc.cc.String(new olympe.dc.Ta.Th(a,c));break;case olympe.dm.Number.N.X():d=new olympe.dc.cc.Number(new olympe.dc.Ta.Kh(a,c));break;case olympe.dm.DateTime.N.X():d=new olympe.dc.cc.DateTime(new olympe.dc.Ta.wh(a,c))}c=d;null!==
743
- c&&this.da.push(new olympe.dc.da.eg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.cc.Mf{K(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.eg(d,c));return this}Qt(){this.da.push(new olympe.dc.da.xh);return this}fm(a,b){this.da.push(new olympe.dc.da.Ig(a,b));return this}};class Ej extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
744
- function Dj(a){return'string'===typeof a||a instanceof olympe.D.Ja?a:'function'===typeof a?olympe.dc.la.Rb(a):olympe.D.Ya(a)?a.Aj===olympe.D.Ja?a:olympe.D.ra([a],b=>olympe.D.rb(olympe.dc.ja(b)),olympe.D.Ja):a.X()}l=olympe.dc.Vi.prototype;l.Oe.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.transform.J=olympe.D.H.K();l.bk.J=olympe.D.H.K();l.kw.J=olympe.D.H.K();l.Ir.J=olympe.D.H.K();l.lb.J=olympe.D.H.K();l.$t.J=olympe.D.H.K();l.Zt.J=olympe.D.H.K();l.Yt.J=olympe.D.H.K();l.Hr.J=olympe.D.H.K();l.ye.J=olympe.D.H.K();
745
- l.Ut.J=olympe.D.H.K();l.contains.J=olympe.D.H.K();l.sd.J=olympe.D.H.K();l.Rj.J=olympe.D.H.K();l.Vt.J=olympe.D.H.K();l.ii.J=olympe.D.H.K();l.Qj.J=olympe.D.H.K();l.ti.J=olympe.D.H.K();l.yv.J=olympe.D.H.K();l.filter.J=olympe.D.H.K();l.Wc.J=olympe.D.H.K();l.and.J=olympe.D.H.K();l.or.J=olympe.D.H.K();l.ak.J=olympe.D.H.K();l.sort.J=olympe.D.H.K();l.Qt.J=olympe.D.H.K();l.fm.J=olympe.D.H.K();function Aj(a,b){const c=b.Cd();var d=new olympe.dc.query.Ds;let e;e=c;olympe.D.Ya(e)&&(e=d.add(c));b=(b=b.Ok())?Array.isArray(b)?b:[b]:null;d=olympe.dc.ic.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.L.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.ic.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
746
- function Fj(a,b){if(b.T())a.L.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.L.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Tb.lp(a.db,a.L),d=b.W();olympe.D.nc([b.Cd()],e=>{const f=olympe.dc.ja(e);a.L.debug('ListProcessor: [ID:',b.W(),'] - Booting with baseTag',f);b.di()||b.ji();ie(a.db,f,Gj(a,b,c),d);olympe.D.Oa().Z(()=>je(a.db,f,d));a.db.Ua(f.valueOf())||Hj(c);b.T()||(Hj(c),b.qc([]))})}}
747
- function Ij(a,b,c,d){const e=[b.Cd()],f=k=>k instanceof olympe.dc.da.We;let g;const h=(null!=(g=b.rg())?g:[]).filter(f);for(const k of h){e.push(k.Cd());let m;h.push(...(null!=(m=k.rg())?m:[]).filter(f))}uj(a.O,()=>{olympe.D.nc(e,()=>{const k=b.ve(c);Jj(a,k,b.W(),d)})})}
748
- function Jj(a,b,c,d){a.L.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Oa(),f=new olympe.async.ej(e);b.forEach(g=>{f.add((h,k)=>{let m=!1;Ng(a.K,g,e,olympe.dc.Pa.SELF,olympe.dc.ua.Sc.th).subscribe(rxjs.Subscriber.create(()=>{m||(m=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.W()} has encountered an error: ${n}`))))})});oc(f,(g,h)=>d(h));f.start()}
749
- function Gj(a,b,c){const d=new olympe.dc.Tb.Ai;let e=!1;const f=olympe.D.Oa(),g=b.rg(),h=[];h[g?g.length:0]=(k,m,n,p)=>{f.zc()||f.mb()||(k?b.tg(n)?a.L.warn('Adding the same index twice (should never happen) for sub #',b.W(),', index #',n,', tag #',m):(a.L.debug('ListProcessor: [ID:',b.W(),'] - Adding Instance',m,'to the subscription'),b.Ad(n,m)):(a.L.debug('ListProcessor: [ID:',b.W(),'] - Removing Instance',m,'from the subscription'),b.hi(n)),e||(Kj(c,()=>{p.Df();Hj(c)}),f.run(()=>p.ge().Lf(b.qc.bind(b))),
750
- e=!0),Lj(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,m)=>{const n=b.W();c.register(n,null);const p=d.C(k,m,n,null);if(null!==p)h[0](k,m,n,Mj(p,k,m,n))}}
751
- olympe.dc.ic.hs=class{constructor(a,b,c,d,e){this.L=a;this.db=b;this.F=e;this.O=c;this.K=d;this.C=new Map;this.G=new olympe.D.Mb('Legacy ListDef processor')}process(a){const b=a.W();var c=this.C.get(b);c||(c=new olympe.dc.ic.$s(a),this.C.set(b,c));c.counter++;Nj(c)?this.L.debug('ListProcessor: [ID:',b,'] - id already processed'):(this.L.debug('ListProcessor: [ID:',b,'] - NOT processed yet.'),c=a.Hf(),this.F&&c===olympe.dc.Pa.SERVER||c===olympe.dc.Pa.SELF?(this.L.debug('QueryMGR: [ID:',b,'] - Local subscription, no need for coverage check, booting subscription '),
752
- Fj(this,a)):Ij(this,a,c,d=>{d?this.L.error(d):Fj(this,a)}))}};function Oj(a){return olympe.D.Ya(a)?'Node#'+a.za.W():String(a)}function Pj(a,b){return olympe.D.Ya(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
753
- olympe.dc.query.Ds=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.Ya(a)?'n'+a.za.W():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Da=class{fa(){}C(){}F(){}ha(){}toString(){}};olympe.dc.ic.Subscription=class a extends olympe.D.zi{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Mb('context subscription '+b,e));this.id=b;this.cd=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.Fd(olympe.dc.ic.Subscription.C.INIT));this.Wb=!1;this.ba=this.Vb=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.jb(e)}catch(f){e=olympe.Y.hc()}return e}W(){return this.id}Cd(){return this.cd}rg(){return this.da}Hf(){const b=
754
- olympe.dc.ie(),c=olympe.D.Sa(this.Cd());let d;return olympe.dc.CloudObject.instancesRel.Qa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):ge(b,c)}di(){const b=olympe.D.Sa(this.G);return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.ep}ji(){if(this.G.za.mb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Vb;this.Vb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);tb(this.G,olympe.D.Fd(olympe.dc.ic.Subscription.C.ep))}ld(){return olympe.D.ra([this.G],
755
- ()=>{},olympe.D.ea)}T(){const b=this.G.za.xb;return b&&b.valueOf()>=olympe.dc.ic.Subscription.C.Oh}Xc(b,c){this.T()?b(this):(null===this.ba&&(this.ba=new Map),void 0===c&&(c=olympe.Y.hc()),this.ba.set(c,olympe.D.Oa().G(b)));return c||''}Xj(b){null!==this.ba&&b&&this.ba.delete(b)}Ob(){const b=olympe.dc.ic.Subscription.C.Oh;if(!this.G.za.mb()&&olympe.D.Sa(this.G)!==b&&(this.Ye(),tb(this.G,b),null!==this.ba)){for(const c of this.ba.values())c(this);this.ba=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}qc(b){if(!this.G.za.mb()){for(let c=
756
- 0,d=b.length;c<d;c++)this.yl(b[c],c);if(this.T())this.Ye();else{this.Wb=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Ob()}}}Ad(b,c){if(!this.G.za.mb()&&(this.Cj(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Wb&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Ob()}}hi(b){this.G.za.mb()||(this.xl(b),
757
- this.Zh(b,!this.T()))}Uf(){return this.T()?super.Uf():'Subscription is not ready!'}ve(b){const c=olympe.D.Sa(this.Cd());return olympe.dc.ic.Subscription.F(c,b,this.rg())}static F(b,c,d){var e=olympe.dc.ua.from(b,c).Ld();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.qe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.lb(h,!0))}else if(e instanceof olympe.dc.da.ce){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ig(h,!0,!0))}else if(e instanceof
758
- olympe.dc.da.We)e=a.F(olympe.D.Sa(e.Cd()),c,e.rg()),b.push(...e);else if(e instanceof olympe.dc.da.Le||e instanceof olympe.dc.da.eg){const h=e.G();b=b.map(k=>{for(const m of h){for(const n of m)k=n.recursive?k.ig(n,!0,!0):k.lb(n,!0);k=k.back(m.length)}return k})}return b}};olympe.dc.ic.Subscription.C={INIT:0,ep:1,Oh:2};olympe.dc.ic.Subscription.prototype.Uf.J=olympe.D.H.C;function Nj(a){const b=a.F;a.F=!0;return b}olympe.dc.ic.$s=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.Ve=class{fa(){}Gb(){}C(){}ha(){}toString(){}};olympe.dc.Eo=class{G(){}};olympe.dc.xj=class{fa(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.cc={};let Qj=0;olympe.dc.cc.Mf=class{constructor(){this.id=Qj++}fa(){return'CustomLocalComparator#'+Qj}O(){return[]}K(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.fa()}"}`}toString(){return this.fa()+'()'}};olympe.dc.cc.Mf.sa=[olympe.dc.He];olympe.dc.cc.DateTime=class{constructor(a){this.C=a}fa(){return S(olympe.dc.cc.DateTime)}O(){return this.C.C()}K(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ha(a){return'{"c":"'+this.fa()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.cc.DateTime);olympe.dc.cc.DateTime.sa=[olympe.dc.He];olympe.dc.cc.Number=class{constructor(a){this.C=a}fa(){return S(olympe.dc.cc.Number)}O(){return this.C.C()}K(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.fa()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.cc.Number);olympe.dc.cc.Number.sa=[olympe.dc.He];olympe.dc.cc.String=class{constructor(a){this.C=a}fa(){return S(olympe.dc.cc.String)}O(){return this.C.C()}K(a,b){return olympe.D.ra([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Ja)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.fa()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.cc.String);olympe.dc.cc.String.sa=[olympe.dc.He];olympe.dc.$={};let Rj=0;olympe.dc.$.Mf=class{constructor(){this.id=Rj++}fa(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.fa()}"}`}toString(){return this.fa()+'()'}};olympe.dc.$.Mf.sa=[olympe.dc.Da];olympe.dc.$.gk=class{constructor(a,b){this.G=a;this.K=b}fa(){}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.ra([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Hb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.ea))}O(){}ha(a){return'{"c":"'+this.fa()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return this.fa().replace(/^.+\./,'')+'('+this.G.toString()+','+this.K.toString()+')'}};
759
- olympe.dc.$.gk.sa=[olympe.dc.Da];olympe.dc.$.dd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}fa(){return S(olympe.dc.$.dd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ra(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Hb(c.every(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.fa()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
760
- a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.dd);olympe.dc.$.dd.sa=[olympe.dc.Da];olympe.dc.$.mk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.ra([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Hb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}fa(){return S(olympe.dc.$.mk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.Ya(this.G)?this.G.za.xb.valueOf():this.G.valueOf();return'{"c":"'+this.fa()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.Ya(this.G)?this.G.za.xb.valueOf():this.G.valueOf();
761
- return this.fa().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.mk);olympe.dc.$.mk.sa=[olympe.dc.Da];olympe.dc.$.Ie=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}fa(){return S(olympe.dc.$.Ie)}F(){return[this.source.C(),this.value.C()]}Lb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.ra([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Hb(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Pj(a,this.G);
762
- return'{"c":"'+this.fa()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Oj(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.Ie);olympe.dc.$.Ie.sa=[olympe.dc.Da];olympe.dc.$.Xd=class{constructor(a,b){this.G=a;this.K=b}fa(){return S(olympe.dc.$.Xd)}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.ra([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.ud?c.ud(d):'object'===typeof d&&void 0!==d.ud?d.ud(c):olympe.D.Hb(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.fa()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.K.toString()+
763
- ')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.Xd);olympe.dc.$.Xd.sa=[olympe.dc.Da];olympe.dc.$.Zq=class extends olympe.dc.$.Xd{constructor(a,b){super(a,new olympe.dc.Ta.ke(b))}};olympe.dc.$.Zq.sa=[olympe.dc.Da];olympe.dc.$.Ni=class extends olympe.dc.$.gk{constructor(a,b){super(a,b)}fa(){return S(olympe.dc.$.Ni)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Ni);olympe.dc.$.Ch=class{constructor(a,b,c){this.G=[];this.K=c instanceof Array?c:void 0!==c?[olympe.dc.ja(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.ce?this.G.push(new Sj(c.X(),c.La(),c.G,c.F)):this.G.push(new Sj(olympe.dc.ja(c),b[d],1,1))}fa(){return S(olympe.dc.$.Ch)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.Y.hc(),e=olympe.dc.Aa();let f=0;a=(h,k)=>{0!==this.K.length&&!this.K.includes(k)||
764
- c.getContext().mb()||c.getContext().zc()||(f+=h?1:-1,c.update(0<f))};const g=this.G;for(let h=g.length-1;0<=h;h--)a=Tj(g[h],e,a,d+h);ie(e,b,a,d);c.getContext().onDestroy(()=>{je(e,b,d)});return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(0!==this.K.length?',"'+this.K.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.K.length?'#'+this.K.toString()+', ':'')+this.G.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.Ch);
765
- function Tj(a,b,c,d){const e=Object.create(null);d+=olympe.Y.jg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class Sj extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.La()}, ${this.F}, ${this.C}`}}olympe.dc.$.Ch.sa=[olympe.dc.Da];olympe.dc.$.Jk=class{constructor(a,b,c){this.G=[];this.K=void 0!==c?c.map(olympe.dc.ja):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.ce?this.G.push(new Uj(c.X(),c.La(),c.G,c.F)):this.G.push(new Uj(olympe.dc.ja(c),b[d],1,1))}fa(){return S(olympe.dc.$.Jk)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.dc.Aa(),e=olympe.Y.jg();let f=(k,m,n)=>{m&&(null===this.K||this.K.includes(n))&&k(1)};
766
- const g=this.G;for(let k=g.length-1;0<=k;k--)f=Vj(g[k],d,f,e+k);let h=0;ie(d,b,f.bind(null,k=>{c.getContext().zc()||c.getContext().mb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>je(d,b,e));return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(null!==this.K?',"'+this.K.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.K?'#['+this.K.toString()+'], ':'')+this.G.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.Jk);
767
- function Vj(a,b,c,d){const e=a.G,f=a.O,g=new Set,h=(m,n,p)=>{f.has(n)?f.get(n).set(d+p,m):f.set(n,(new Map).set(d+p,m))},k=(m,n,p,q,r)=>{const t=olympe.Y.jg();if(q){const u=p+r,w=x=>{const y=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==y&&null!==y&&(g.add(u),e.set(r,(e.get(r)||0)+x),Array.from(y.values()).forEach(z=>z(x)));g.delete(u)};h(m,r,p);e.has(r)?m(e.get(r)):(n>=a.F&&c(x=>
768
- {e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class Uj extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.La()}, ${this.F}, ${this.C}`}}olympe.dc.$.Jk.sa=[olympe.dc.Da];olympe.dc.$.Gh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ja(b))}):this.G.add(olympe.dc.ja(a))}fa(){return S(olympe.dc.$.Gh)}F(){return[]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.Aa();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ja(olympe.dc.CloudObject))c.update(olympe.D.Hb(this.G.has(k))),f();else{for(const m of e)if(m.tag===k)throw Error(`You should never extend a model to itself (${k})`);
769
- this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new Wj(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new Wj(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Wj{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.jg()}}
770
- R('olympe.dc.predicates.InstanceOf',olympe.dc.$.Gh);olympe.dc.$.Gh.sa=[olympe.dc.Da];olympe.dc.$.$d=class{constructor(a){this.G=a}fa(){return S(olympe.dc.$.$d)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.ra([this.G.C(a,b)],c=>olympe.D.Hb(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.fa()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};R('olympe.dc.predicates.Not',olympe.dc.$.$d);olympe.dc.$.$d.sa=[olympe.dc.Da];olympe.dc.$.be=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}fa(){return S(olympe.dc.$.be)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ra(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Hb(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.fa()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
771
- ')'}};R('olympe.dc.predicates.Or',olympe.dc.$.be);olympe.dc.$.be.sa=[olympe.dc.Da];olympe.dc.$.Te=class{constructor(a,b,c){this.source=a;this.K=b;this.G=void 0===c?!0:c}fa(){return S(olympe.dc.$.Te)}F(){return[this.source.C()]}Lb(){return this.source}C(a,b){return a.run(()=>olympe.D.ra([this.source.getValue(a,b),this.K,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Hb((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=Pj(a,this.K);a=Pj(a,this.G);return'{"c":"'+this.fa()+'","a":['+b+','+c+','+a+
772
- ']}'}toString(){const a=Oj(this.G);return'Regex('+this.source.toString()+','+this.K+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.Te);olympe.dc.$.Te.sa=[olympe.dc.Da];olympe.dc.$.rj=class extends olympe.dc.$.gk{constructor(a,b){super(a,b)}fa(){return S(olympe.dc.$.rj)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.rj);olympe.dc.Tb={};olympe.dc.Tb.Ai=class{constructor(){this.ba=this.K=this.T=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.K;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.Tb.Ji(this),this.T=c,this.K=b):this.K=this.T=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.ba){const a=[];null!==
773
- this.K&&(0<=this.F?Xj(Yj(this.K,this.F),a):a.push(this.T));this.ba(a)}}Lf(a){this.ba=a}};olympe.dc.Tb.Ai.sa=[olympe.dc.Tb.Ca];function Mj(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.Tb.Ji(a.C,a));return a.F}function Yj(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Xj(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.Tb.Ji=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}ge(){return this.C}Df(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Zj extends olympe.dc.Tb.Ji{constructor(a,b,c){super(a);this.T=b;this.tag=c;this.ba=this.Z=this.K=!1;this.G=null}}
774
- function ak(a,b,c,d,e){const f=Object.create(null),g=a.qa,h=a.K;let k,m,n;a.ga=!0;m=0;for(n=g.length;m<n;m++)f[g[m]]=null;g.length=0;m=c;for(n=Math.min(b.length,d);m<n;m++)k=b[m],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.K||(c.K=!0,e(!0,c.tag,c.T,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.K&&(c.K=!1,e(!1,c.tag,c.T,c)),c.Z&&(c.G=null,delete h[k]),delete f[k]);a.ga=!1;null!==a.F&&a.G()}
775
- olympe.dc.Tb.Uk=class{constructor(){this.K={};this.qa=[];this.F=null;this.ga=!1;this.T=[];this.ba=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ga){var a=this.qa,b=a.length,c=this.K,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.T);else{if(!e.ba){var f=e,g=this.F;f.ba=!0;f.G=Yj(f,
776
- g)}null!==e.G&&Xj(e.G,this.T)}}this.ba&&this.ba(this.T)}}Lf(a){this.ba=a}C(a,b,c){let d=this.K[c];a?void 0===d?(d=new Zj(this,c,b),this.K[c]=d):(d.tag=b,d.Z=!1):void 0!==d&&(d.Z=!0);return d}};olympe.dc.Tb.Uk.sa=[olympe.dc.Tb.Ca];olympe.dc.Tb.Ca=class{constructor(){}C(){}O(){}Z(){}G(){}Lf(){}};function bk(a,b){olympe.D.jf(a.value)?(a.node=olympe.D.im(a.value,b),bb(a.node)||b()):b()}function ck(a,b){if(olympe.D.jf(a.value)){const c=olympe.D.Oa(),d=a.K;olympe.D.nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>bk(a,b)),olympe.D.Oa().destroy())})}}
777
- class dk extends olympe.dc.Tb.Ji{constructor(a,b,c){super(a);this.Z=b;this.value=c;this.K=this.Sa();this.position=this.node=null;this.T=!1;this.G=null}Sa(){const a=olympe.D.Sa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}mb(){return null===this.value}}
778
- function ek(a,b){if(!b.mb()){var c=a.F;var d=a.qa,e=b.Sa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].K,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].K,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.K=b.Sa();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
779
- function fk(a){const b=a.qa;a.F.sort((c,d)=>b(c.Sa(),d.Sa()))}
780
- olympe.dc.Tb.kp=class{constructor(a){this.qa=a;this.K=null;this.F=[];this.T=[];this.ba=null;this.ga=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new dk(this,c,d),this.ga.set(b,f),this.O()?bk(f,()=>ek(this,f)):(f.position=e.length,e.push(f));else{f=this.ga.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ga.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.K}Z(a){if(null!==this.K)throw Error('Manager already activated (depth='+
781
- this.K+')');this.K=a;fk(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;ck(d,()=>ek(this,d))}this.G()}G(){if(null===this.K)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.K;b.T=!0;b.G=Yj(b,c)}0>this.K?this.T.push(e.Z):e.G&&Xj(e.G,this.T)}this.ba&&this.ba(this.T)}Lf(a){this.ba=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
782
- a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.Tb.kp.sa=[olympe.dc.Tb.Ca];function Hj(a){if(!a.F){for(let b in a.G)gk(a.G[b]);a.F=!0}a.K=null;a.O=null}function Kj(a,b,c){a.G[c||'root'].T=b}function Lj(a,b,c){a.G[c||'root'].Df(b)}function hk(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Lf(a.db,b,c,d),e[f]=g);return g}function ik(a,b){a.F||a.C.Df(b)}function jk(a,b,c,d,e){if(!a.F){let f=hk(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=hk(a,c,d,olympe.dc.va.ORIGIN));0===f&&ik(a,b)}}
783
- function kk(a,b){const c=a.G[b];void 0!==c?(a.L&&a.L.debug('Set current block to',b,null!==c.G?'parent = '+c.G.W():''),a.C=c):a.L&&a.L.error('Try to set a block that does not exists:',b)}function lk(a){const b=String(++a.T),c=a.C;a.G[b]=new mk(b,c);nk(c,b);c.K||(c.K=()=>kk(a,c.W()));return b}function ok(a,b){const c=a.C;a.C.K=()=>{kk(a,c.W());b()}}function pk(a,b){gk(b?a.G[b]:a.C)}
784
- olympe.dc.Tb.lp=class{constructor(a,b){this.db=a;this.L=b||null;this.K=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new mk('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=hk(this,c,d,e),d=this.K[b]||0,this.K[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function nk(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function gk(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
785
- class mk{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.K=this.F=null;this.O=!1}W(){return this.id}Df(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&gk(this)}notify(a){const b=this.K,c=this.F;if(this.O)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Ta={};function qk(a,b,c,d){const e=olympe.dc.Aa(),f=new olympe.dc.Tb.Ai,g=new olympe.dc.Tb.lp(e);let h=!1;const k=Object.create(null),m=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.zc()||a.mb()||(h||(Kj(g,()=>{u.Df();Hj(g)}),u.ge().Lf(m),h=!0),q?k[t]=r:delete k[t],Lj(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.hc();ie(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Mj(t,q,b,p))},p);a.onDestroy(()=>{je(e,b,p)});e.Ua(b)||Hj(g)}
786
- function rk(a,b,c){const d=c.getContext(),e=olympe.dc.Aa(),f=a.G(),g=wf(e,b,a.K,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>xf(e,b,a.K,g))}
787
- olympe.dc.Ta.nh=class{constructor(a,b,c){this.K=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.qe||d instanceof olympe.dc.da.ce)||null;this.F=c||null;this.defaultValue=null}fa(){}Gb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}yg(a){this.defaultValue=a;return this}rg(){return this.da}Cd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Gb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&ub(c,this.defaultValue);
788
- b=this.F||b;null!==this.da?qk(a,b,this.da,d=>{rk(this,d,c)}):rk(this,b,c);return c.vb()}ha(a){const b=Pj(a,this.K),c=Pj(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.fa()}","a":["${b}",${d},${c}]}`}toString(){const a=Oj(this.K),b=this.F?','+Oj(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.fa().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Ta.nh.sa=[olympe.dc.xj];olympe.dc.Ta.Am=class{constructor(a,b){if(olympe.D.jf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.Aa();const e=d.Sb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.og(e,olympe.dc.CloudObject.extendRel,olympe.dm.pe);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.N.X():d=new olympe.dc.Ta.Th(c,b);break;case olympe.dm.Number.N.X():d=new olympe.dc.Ta.Kh(c,
789
- b);break;case olympe.dm.Boolean.N.X():d=new olympe.dc.Ta.Di(c,b);break;case olympe.dm.DateTime.N.X():d=new olympe.dc.Ta.wh(c,b)}this.F=d}fa(){return this.F.fa()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Ta.Am.sa=[olympe.dc.xj];olympe.dc.Ta.Di=class extends olympe.dc.Ta.nh{constructor(a,b,c){super(a,b,c)}fa(){return S(olympe.dc.Ta.Di)}G(){return olympe.dc.Db.El}Gb(){return olympe.D.ea}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Ta.Di);olympe.dc.Ta.ke=class{constructor(a){this.value=a}fa(){return S(olympe.dc.Ta.ke)}C(){return[]}getValue(){return this.value}ha(a){a=Pj(a,this.value);return`{"c":"${this.fa()}","a":[${a}]}`}toString(){return`Constant(${Oj(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.Ta.ke);olympe.dc.Ta.ke.sa=[olympe.dc.xj];olympe.dc.Ta.wh=class extends olympe.dc.Ta.nh{constructor(a,b,c){super(a,b,c)}fa(){return S(olympe.dc.Ta.wh)}G(){return olympe.dc.Db.Fl}Gb(){return olympe.D.Za}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Ta.wh);olympe.dc.Ta.Kh=class extends olympe.dc.Ta.nh{constructor(a,b,c){super(a,b,c)}fa(){return S(olympe.dc.Ta.Kh)}G(){return olympe.dc.Db.Gl}Gb(){return olympe.D.aa}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.Ta.Kh);olympe.dc.Ta.Th=class extends olympe.dc.Ta.nh{constructor(a,b,c){super(a,b,c)}fa(){return S(olympe.dc.Ta.Th)}G(){return olympe.dc.Db.Hl}Gb(){return olympe.D.Ja}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.Ta.Th);olympe.dc.Ta.Wh=class{fa(){return S(olympe.dc.Ta.Wh)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.fa()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.Ta.Wh);olympe.dc.Ta.Wh.sa=[olympe.dc.xj];olympe.dc.da={};olympe.dc.da.xh=class{Gb(){return null}fa(){return S(olympe.dc.da.xh)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Mj(h,!0,f,f))):(d[f]++,ik(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Mj(h,!1,f,f)))}}ha(){return'{"c":"'+this.fa()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.xh);olympe.dc.da.xh.sa=[olympe.dc.Ve];olympe.dc.da.Le=class{constructor(a){this.F=a}Gb(){return null}fa(){return S(olympe.dc.da.Le)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&ik(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Mj(h,k,f,g)))}const e={};return(f,g,h,k)=>{const m='@'+h;if(f){let n=this.F.C(a,g);olympe.D.Ya(n)&&(n=n.za);olympe.D.hf(n)?(b.F||void 0!==olympe.D.Sa(n)||ik(b,h),e[m]=n,a.run(()=>{olympe.D.nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[m]&&(e[m].destroy(),delete e[m]),
790
- d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.fa()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.Le);olympe.dc.da.Le.sa=[olympe.dc.Ve,olympe.dc.Eo];olympe.dc.da.Ck=class{constructor(a,b,c,d){this.F=new olympe.dc.Ha.Relation(olympe.dc.ja(a),c||olympe.dc.va.DESTINATION);this.G=new olympe.dc.Ha.Relation(olympe.dc.ja(b),d||olympe.dc.va.DESTINATION)}Gb(){return ze(this.F)}fa(){return S(olympe.dc.da.Ck)}C(a,b,c){const d=olympe.dc.Aa(),e={},f=this.F.X(),g=this.F.La(),h=this.G.X(),k=this.G.La();let m=null,n=null;const p=(r,t,u,w,x,y)=>{if(x){if(x=()=>{const z=olympe.Y.jb(u+g+(f+'_'+r)+y,20),A=Mj(t,!0,y,z);m=r;n=()=>{c(!1,y,z,Mj(t,!1,y,z))};b.register(z,
791
- u,w,f,g);c(!0,y,z,A)},x.$p=r,e[w]=x,null===m||r<m)n&&n(),x()}else if(m===r){n();e[w]=!0;x=Infinity;let z=null;for(let A=Object.keys(e),J=A.length,M=0;M<J;M++){let Ka=e[A[M]];Ka.$p<x&&(x=Ka.$p,z=Ka)}z&&z()}},q=(r,t,u,w,x)=>{w?e[x]||(e[x]=!0,jk(b,u,x,f,g),jk(b,u,x,h,k),W(d,x,this.F,p.bind(this,r,t,u,x),u+'_val'),W(d,x,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(x,this.G,u+'_follow'),d.F(x,this.F,u+'_val'),delete e[x])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.fa()+'","a":["'+this.F.toString()+
792
- '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.Ck);olympe.dc.da.Ck.sa=[olympe.dc.Ve];olympe.dc.da.Ig=class{constructor(a,b){this.start=a;this.F=b}Gb(){return null}fa(){return S(olympe.dc.da.Ig)}C(a,b,c){const d=new olympe.dc.Tb.Uk;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);ak(d,e,f,n,c)}};a.run(()=>olympe.D.nc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));ok(b,k);const m=lk(b);kk(b,m);return(n,p,q,r)=>{h||(r.ge().Lf(t=>{e=t;pk(b,m)}),Kj(b,()=>r.Df(),m),h=!0);d.C(n,p,q,null);Lj(b,q,m)}}ha(a){return'{"c":"'+
793
- this.fa()+'","a":['+Pj(a,this.start)+','+Pj(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Sa(this.start)},${olympe.D.Sa(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.Ig);olympe.dc.da.Ig.sa=[olympe.dc.Ve];function sk(a){return a.F.map(b=>b.X())}
794
- olympe.dc.da.Wi=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.F=a.map(c=>new olympe.dc.Ha.Relation(c,this.direction))}Gb(){return olympe.dc.CloudObject}fa(){return S(olympe.dc.da.Wi)}La(){return this.direction}C(a,b,c){const d=olympe.dc.Aa(),e=(f,g,h,k)=>W(d,f,k,(m,n)=>{var p=k.La();var q=k.X();p=olympe.Y.jb(g+p+q+n,20);q=Mj(h,m,n,p);m&&b.register(p,g,f,k.X(),k.La());c(m,n,p,q)},g);return(f,g,h,k)=>{f?this.F.forEach(m=>{jk(b,h,g,m.X(),m.La());e(g,h,k,m)}):this.F.forEach(m=>
795
- {d.F(g,m,h)})}}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(sk(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+sk(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Wi);olympe.dc.da.Wi.sa=[olympe.dc.Ve];olympe.dc.da.ce=class extends olympe.dc.Ha.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Gb(){return ze(this)}fa(){return S(olympe.dc.da.ce)}C(a,b,c){const d=olympe.dc.Aa(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.La(),m=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.fb(r,this);p+=1;for(let u=0,w=t.length;u<w;u++){if(void 0!==e[t[u]]||r===t[u])continue;const x=olympe.Y.jb(q+k+(h+'_'+p)+t[u],20);b.register(x,
796
- q,r,h,k||g);null===k&&b.register(x,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&m(p,t,w);p>=this.G?c(u,w,t,Mj(r,u,w,t)):jk(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(x,y)=>{const z=p+1,A=olympe.Y.jb(t+k+(h+'_'+z)+y,20);n(z,w,r,A,x,y)},t)):(d.F(w,this,t),delete e[w]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.fa()+'","a":["'+this.X()+'","'+this.La()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.La()+this.X()+'['+this.G+'..'+this.F+'])'}};
797
- R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.ce);olympe.dc.da.ce.sa=[olympe.dc.Ve];olympe.dc.da.qe=class extends olympe.dc.Ha.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Gb(){return ze(this)}fa(){return S(olympe.dc.da.qe)}Pb(){return new olympe.dc.da.qe(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}C(a,b,c){const d=olympe.dc.Aa(),e=this.X(),f=this.La();return(g,h,k,m)=>{jk(b,k,h,e,f);g?W(d,h,this,(n,p)=>{const q=olympe.Y.jb(k+f+e+p,20),r=Mj(m,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
798
- this.fa()+'","a":["'+this.X()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.qe);olympe.dc.da.qe.sa=[olympe.dc.Ve];olympe.dc.da.eg=class{constructor(a,b){this.yb=a;this.F=void 0===b?!0:!!b}Gb(){return null}fa(){return S(olympe.dc.da.eg)}mg(){return this.yb}G(){return[this.yb.O()]}C(a,b,c){const d=new olympe.dc.Tb.kp(a.G(this.F?this.yb.G.bind(this.yb):(e,f)=>this.yb.G(f,e)));return(e,f,g)=>{var h=e?this.yb.K(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.fa()+'","a":['+this.yb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.yb.toString()+','+JSON.stringify(this.F)+')'}};
799
- R('olympe.dc.transformers.Sort',olympe.dc.da.eg);olympe.dc.da.eg.sa=[olympe.dc.Ve,olympe.dc.Eo];function tk(a,b,c,d,e,f){function g(n,p){if(m)for(var q=m.length-1;0<=q;q--)f=m[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Mj(q,n,p,h))}const h=olympe.Y.hc(),k=olympe.dc.Aa(),m=a.da;b.run(()=>olympe.D.nc([a.F],n=>{uk(k,n,g,h);void 0===k.model(n)&&Hj(e)}))}function uk(a,b,c,d){const e=b&&b.valueOf();e&&(ie(a,e,c,d),olympe.D.Oa().Z(()=>je(a,e,d)))}
800
- olympe.dc.da.We=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.ta?(this.F=a.Cd(),this.da=a.Ok()):(this.F=a,b&&(this.da=b))}Gb(){return null}fa(){return S(olympe.dc.da.We)||''}rg(){return this.da}Cd(){return this.F}C(a,b,c){const d=new olympe.dc.Tb.Uk,e=new olympe.dc.Tb.Ai;let f=[],g=[],h=!1,k=!1;const m=lk(b),n=lk(b);ok(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):pk(b);ak(d,p,0,p.length,c)});kk(b,n);tk(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Oa();u.zc()||
801
- u.mb()||(k||(t.ge().Lf(w=>{g=w;pk(b,n)}),Kj(b,()=>t.Df(),n),k=!0),d.C(p,q,r),Lj(b,r,n))});kk(b,m);return(p,q,r,t)=>{h||(t.ge().Lf(u=>{f=u;pk(b,m)}),Kj(b,()=>t.Df(),m),h=!0);d.C(p,q,r,m);Lj(b,r,m)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.fa()+'","a":['+Pj(a,this.F)+','+b+']}'}toString(){const a=olympe.D.Ya(this.F)?'N:'+this.F.za.W():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
802
- R('olympe.dc.transformers.Union',olympe.dc.da.We);olympe.dc.da.We.sa=[olympe.dc.Ve];olympe.dc.da.To={Jx:1,qr:-1,nr:0};olympe.dc.da.jz={ow:!0,Ow:!1};olympe.dc.ic.R={Yn:'dc.legacy.listdefProcessor'};olympe.U.config(a=>{D(a,olympe.dc.ic.R.Yn,olympe.dc.ic.hs,olympe.dc.query.R.ya,olympe.dc.R.Je,olympe.dc.transaction.R.Fa,olympe.dc.query.R.hj,new olympe.U.ma(olympe.dc.V.Pg))});olympe.U.run([olympe.dc.ic.R.Yn],a=>{olympe.dc.ic.Hu=()=>a});function vk(a){const b=olympe.dc.Aa(),c=new Map;b.Up(a).forEach(d=>{b.fb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
803
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Aa();this.model=null}static Cc(a,b,c,...d){b=olympe.dc.ja(b);var e=me.get(b)||null;(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){var b=olympe.dc.Vp();a=olympe.dc.ja(a);var c=le(b,b.db.model(a));null===c&&b.L.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
609
+ olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={za:'dc.query.Logger',lj:'dc.query.QueryProcessor'};olympe.U.config(function(a){E(a,olympe.dc.query.R.za,[olympe.ka.R.Fa],b=>b.Gc('query'));D(a,olympe.dc.query.R.lj,olympe.dc.query.Hs,olympe.dc.query.R.za,olympe.dc.db.R.Fa,olympe.dc.R.Qg,new olympe.U.ma(olympe.dc.V.Sg))});olympe.U.run([olympe.dc.query.R.lj],a=>{olympe.dc.query.Sj=()=>a});olympe.dc.query.$={};olympe.dc.query.$.jd=class extends olympe.dc.query.Da{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}$c(){return new olympe.dc.query.$.be(...this.$.map(a=>a.$c()))}Bb(){return this.$.flatMap(a=>a.Bb())}rc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}jb(a){return this.$.reduce((b,c)=>b&&c.jb(a),!0)}observe(a,b,c){const d=
610
+ Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.kb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Da.C.um,p:this.$.map(a=>a.ha())}}Bc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.kb('AND-'+b+a+d))})}};olympe.dc.query.$.Je=class extends olympe.dc.query.Da{constructor(a,b,c,d=!1){super();this.Ga=olympe.dc.ja(a);this.substring=b;this.db=c;this.C=d}Bb(){return[this.Ga]}rc(a,b){return a instanceof olympe.dc.query.$.Je&&a.Ga===this.Ga?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Ma(){return this.Ga}jb(a){return this.apply(this.db.Ma(a,
611
+ this.Ga))}observe(a,b,c){yf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.kb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ga+'-'+this.substring+'-'+this.C}clear(a,b){zf(this.db,a,this.Ga,olympe.Y.kb(b+a+this.toString()))}Bc(){return{name:'CONTAINS',property:this.Ma(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Da.C.Ji,p:this.Ga,s:this.substring,
612
+ c:this.C}}};olympe.dc.query.$.Xd=class extends olympe.dc.query.Da{constructor(a,b,c){super();this.Ga=olympe.dc.ja(a);this.C=null!=b?b:null;this.db=c}Bb(){return[this.Ga]}rc(a){if(a instanceof olympe.dc.query.$.Xd&&this.Ga===a.Ga)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Pa(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Pa(a.C)}else return this.C===a.C;return!1}jb(a){return this.apply(this.db.Ma(a,
613
+ this.Ga))}observe(a,b,c){yf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.kb(b+a+this.toString()));null===this.C&&null===this.db.Ma(a,this.Ga)&&c(!0)}clear(a,b){zf(this.db,a,this.Ga,olympe.Y.kb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Pa(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Pa(this.C):!1:a===this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?
614
+ b:'null';return'Equals-'+this.Ga+'-'+c}Bc(){return{name:'EQUALS',property:this.Ga,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.pg().valueOf(),g:this.C.mg().valueOf(),b:this.C.kg().valueOf(),a:this.C.jg().valueOf()}}return{pr:olympe.dc.query.Da.C.rn,p:this.Ga,t:a,v:b}}};function lh(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function mh(a,b){return'number'===typeof a.C?a.C:a.db.Ma(b,a.C)}function nh(a,b,c){return olympe.Y.kb(c+b+a.C+a.Ga)}
615
+ olympe.dc.query.$.Ih=class extends olympe.dc.query.Da{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ga=olympe.dc.ja(b);this.C='number'===typeof c?c:olympe.dc.ja(c);this.F=d;this.G=e}$c(){return new olympe.dc.query.$.Ih(this.db,this.Ga,this.C,!this.F,!this.G)}Bb(){return[this.Ga]}rc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.Ih&&this.Ga===a.Ga?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
616
+ this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Ma(){return this.Ga}jb(a){return lh(this,this.db.Ma(a,this.Ga),mh(this,a))}observe(a,b,c){'string'===typeof this.C&&yf(this.db,a,this.C,d=>{const e=this.db.Ma(a,this.Ga);null!==e&&c(lh(this,e,d))},nh(this,a,b));yf(this.db,a,this.Ga,d=>{const e=mh(this,a);c(null!==e?lh(this,d,e):!0)},nh(this,a,b))}clear(a,b){zf(this.db,a,this.Ga,nh(this,a,b));'string'===typeof this.C&&zf(this.db,a,this.C,nh(this,a,b))}Bc(){return{name:'INEQUALITY_OPERATOR',
617
+ property:this.Ma(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Da.C.Mn,p:this.Ga,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ga+'-'+this.G+'-'+this.C}};olympe.dc.query.$.$d=class extends olympe.dc.query.Da{constructor(a){super();this.C=a}$c(){return this.C}Bb(){return this.C.Bb()}rc(a,b){return a instanceof olympe.dc.query.$.$d?this.C.rc(a.C,b):this.C.rc(a,!b)}jb(a){return!this.C.jb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.kb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Bc(){return{name:'NOT',predicate:this.C.Bc()}}ha(){return{pr:olympe.dc.query.Da.C.lo,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.Y.kb('NOT'+
618
+ b+a))}};olympe.dc.query.$.be=class extends olympe.dc.query.Da{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}$c(){return new olympe.dc.query.$.jd(...this.$.map(a=>a.$c()))}Bb(){return this.$.flatMap(a=>a.Bb())}rc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}jb(a){return this.$.reduce((b,c)=>b||c.jb(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
619
+ k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.kb('OR-'+b+a+h),f.bind(null,h))})}Bc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Da.C.so,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.kb('OR-'+b+a+d))})}};olympe.dc.query.$.Ue=class extends olympe.dc.query.Da{constructor(a,b,c,d=!0){super();this.Ga=olympe.dc.ja(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}Bb(){return[this.Ga]}rc(a){return a instanceof olympe.dc.query.$.Ue&&this.Ga===a.Ga&&this.C.toString()===a.C.toString()}Ma(){return this.Ga}jb(a){return this.apply(this.db.Ma(a,this.Ga))}observe(a,b,c){yf(this.db,a,this.Ga,d=>{c(this.apply(d))},olympe.Y.kb(b+a+this.toString()))}apply(a){return'string'===
620
+ typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.Ga+'-'+this.C.toString()+'-'+this.F}Bc(){return{name:'REGEX',property:this.Ma(),pattern:this.C.toString(),caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Da.C.Lo,p:this.Ga,r:this.C.source,c:this.F}}clear(a,b){zf(this.db,a,this.Ga,olympe.Y.kb(b+a+this.toString()))}};olympe.dc.query.$.pl=class extends olympe.dc.query.Da{constructor(a){super();this.C=new Set(a.map(olympe.dc.ja))}Bb(){return[]}rc(a){return a instanceof olympe.dc.query.$.pl&&Array.from(a.C).every(b=>this.C.has(b))}jb(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Bc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Da.C.mp,t:Array.from(this.C)}}};olympe.dc.query.xa={};function jh(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Bb())?c:[]);let e;a.yb&&d.add(null==(e=a.yb)?void 0:e.Ma().X());return d}function oh(a){if(!a.ga){let b,c;a.ga=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ga}function ph(a,b){for(const c of b)if(a.some(d=>d.rc(c,!1)))return!0;return!1}
621
+ function qh(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.kb(h+f+d);e?a.F.observe(f,k,m=>{c||b(m,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function rh(a,b,c){if(null===a.yb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.yb.Ma();h=olympe.Y.kb(h+d);e?yf(a.db,f,k,()=>{Bg(b)},h):zf(a.db,f,k,h);c(e,f,g,h)}}
622
+ olympe.dc.query.xa.jj=class{constructor(a,b){this.db=olympe.dc.ya();this.C=a;this.optional=b;this.ga=this.yb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.xa.me(b,a.f);var c=a.o;const d=new olympe.dc.Ha.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.xa.vf(b,d,a.s,c):new olympe.dc.query.xa.Sf(b,d,c);void 0!==a.p&&(b.F=Jg(a.p));void 0!==a.c&&(c=b.W(),a=a.c,a=new olympe.dc.query.Ie(c,new olympe.dc.Ha.Property(a.p),a.o),b.yb=a);return b}L(){}toString(){let a,
623
+ b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.yb)?void 0:b.toString())?d:''}`}Bc(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.yb&&(a.c=this.yb.ha());return a}Z(){}qa(){return new olympe.dc.query.xa.ml}ba(){}W(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}rc(a){const b=oh(this);if(0===b.length)return!0;a=oh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
624
+ ph(d,c)))return!1;return!0}filter(a){const b=this.L(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.jd?new olympe.dc.query.$.jd(...Array.from(c.$),a):new olympe.dc.query.$.jd(b.F,a);return b}sort(a,b){const c=this.L();c.yb=new olympe.dc.query.Ie(this.W(),a,b);return c}lg(){return this.yb}jb(a){if(null!==this.F){var b=this.W();for(const c of Cg(a,b))this.F.jb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.W();return qh(this,rh(this,a,(d,e,f,g)=>{(d?Eg(a,e,c,f):a.remove(e,c,f))&&b(d,e,
625
+ f,g)}))}};olympe.dc.query.xa.Bo=class{has(){}P(){}F(){}Sd(){}G(){}remove(){}};olympe.dc.query.xa.dn=class{constructor(a){this.C=null;this.content=new Map;this.L=null!=a?a:null}Sd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}P(a){let b;return(null==(b=this.L)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
626
+ c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.xa.dn.sa=[olympe.dc.query.xa.Bo];olympe.dc.query.xa.Sf=class extends olympe.dc.query.xa.jj{constructor(a,b,c){super(a,c);this.relation=olympe.dc.query.Relation.from(b,!1)}P(){return this.relation}L(){const a=new olympe.dc.query.xa.Sf(this.C,this.relation,this.optional);a.F=this.F;a.yb=this.yb;return a}Z(){return olympe.Y.kb(this.C+this.relation)}ba(a,b){return b instanceof olympe.dc.query.xa.me?[a]:[a+this.relation,a+kh(this.relation),a+'followRules'].map(c=>olympe.Y.kb(c))}jb(a){const b=this.W();for(const c of Cg(a,this.C))this.db.fb(c,
627
+ this.relation).forEach(d=>{Eg(a,d,b,c)});super.jb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La();return(f,g,h,k)=>{const m=olympe.Y.kb(k+g+this.toString());f?W(this.db,g,this.relation,(n,p)=>{Fg(a,n,d,e,g,p);c(n,p,g,m)},m):this.db.F(g,this.relation,m)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.La()})}Bc(){const a={recursive:!1,relation:this.relation,filter:oh(this).map(b=>b.map(c=>c.Bc())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Ma(),
628
+ order:this.yb.Lh});return a}toString(){return`followPart-${this.relation}-${super.toString()}`}};olympe.dc.query.xa.vf=class extends olympe.dc.query.xa.jj{constructor(a,b,c,d){super(a,d);this.relation=olympe.dc.query.Relation.from(b,!0);this.G=c}L(){const a=new olympe.dc.query.xa.vf(this.C,this.relation,this.G,this.optional);a.F=this.F;a.yb=this.yb;return a}Z(){return olympe.Y.kb(this.C+this.relation+this.G)}ba(a,b){return b instanceof olympe.dc.query.xa.me?[a]:[a+this.relation,a+'followRules'].map(c=>olympe.Y.kb(c))}P(){return this.relation}jb(a){const b=this.W();for(const c of Cg(a,this.C))this.G&&
629
+ Eg(a,c,b,c),this.db.og(c,this.relation).forEach(d=>{Eg(a,d,b,c)});super.jb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La(),f=new Set,g=(h,k,m,n,p)=>{k=olympe.Y.kb(k+h+p+m);if(this.G||0<m)0<m&&Fg(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),W(this.db,p,this.relation,g.bind(this,h,k,m+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,m,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),{s:this.G,t:this.relation.X(),d:this.relation.La()})}Bc(){const a=
630
+ {recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:oh(this).map(b=>b.map(c=>c.Bc())),optional:this.T()};this.yb&&(a.sort={property:this.yb.Ma(),order:this.yb.Lh});return a}toString(){return`followRecursivelyPart-${this.relation}-${this.G}-${super.toString()}`}};olympe.dc.query.xa.me=class extends olympe.dc.query.xa.jj{constructor(a,b,c){super(a,!1);this.cc=b;this.G=null!=c?c:null}L(){return new olympe.dc.query.xa.me(this.C,this.cc,this.G)}Z(){return olympe.Y.kb(this.C+'followRules')}qa(){return new olympe.dc.query.xa.dn(this.G)}ba(a,b){return b instanceof olympe.dc.query.xa.me?[a]:[olympe.Y.kb(a+'followRules')]}rc(a){if(a instanceof olympe.dc.query.xa.Sf||a instanceof olympe.dc.query.xa.vf){var b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION;const d=olympe.dc.mc.md,
631
+ e=olympe.dc.mc.Bh,f=olympe.dm.Relation.C.hl,g=olympe.dm.Relation.C.tl;a=a.P();const h=a.La(),k=a.X();if(h===c&&(k===d||k===e))return!0;c=Kf(this.db,a,this.cc);b=a.La()===b?f:g;return!!(c&b)}return a instanceof olympe.dc.query.xa.me?this.cc===a.cc:!1}jb(a){const b=this.W();for(const c of Cg(a,this.C))for(const d of Ee(this.db,c,this.cc))Eg(a,d,b,c)}observe(a,b){const c=this.W(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Hf(this.db,g,this.cc,(m,n,p,q,r)=>{p&&(p=q?Eg(a,r,c,e):a.remove(r,c,e),null!==n&&Fg(a,
632
+ q,m,n,g,r),p&&d(e,q,r,h))},k):If(this.db,g,this.cc,k);b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Y.kb(h+f+this.toString());(e?Eg(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g)}}ha(){return Object.assign(super.ha(),{f:this.cc})}Bc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`followRulePart-${this.cc}-${super.toString()}`}T(){return!1}filter(){olympe.ka.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');
633
+ return this}sort(){olympe.ka.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.xa.me.F='followRules';olympe.dc.query.xa.ml=class{constructor(){this.content=new Map}Sd(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}P(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.xa.ml.sa=[olympe.dc.query.xa.Bo];olympe.dc.sources={};olympe.dc.sources.yk=class{W(){}init(){}destroy(){}request(){return v(function*(){})}L(){}};const sh=olympe.net.Ia.Jd.GET,th=olympe.net.Ia.Jd.Og,uh=olympe.net.Ia.Jd.pc,vh=olympe.net.Ia.Jd.Ao,wh=olympe.net.Ia.Jd.ro,xh=olympe.net.Ia.Headers.yh,yh=olympe.net.Ia.Headers.Cm,zh=olympe.net.Ia.Headers.vq,Ah=olympe.net.Ia.Headers.uq,Bh=olympe.net.Ia.nc.bj,Ch=olympe.net.Ia.nc.Vm,Dh=olympe.net.Ia.nc.yn,Eh=olympe.net.Ia.nc.Uh,Fh=olympe.net.Ia.nc.ps;
634
+ function Gh(a){var b=olympe.U.getParameter(olympe.dc.sources.V.Jg);b=`/${a.ga}/${b}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.P.P('_DataSourcesHTTPService',b,[sh,th,uh,vh,wh],(c,d,e)=>v(function*(){const f=d.get('sourceId'),g=a.G.get(d.get('sourceId'));if(!g)return Promise.resolve(new olympe.net.xf('Invalid source id',Fh,'Invalid source id'));const h=c.method;if(h===wh)return Promise.resolve(new olympe.net.xf('',Bh,'',{[zh]:'*',[Ah]:'X-Source-Origin'}));const k=c.Nj();
635
+ try{var m=yield Hh(a,k[yh])}catch(r){return new olympe.net.xf(`Invalid token ${r}`,Dh,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Pg,t=olympe.dc.Request.C.Yh,u=olympe.dc.Request.C.Gg,w=olympe.dc.Request.C.Qf,x=olympe.dc.Request.C.fg;let y;switch(n){case r:case t:y=a.F.G(p);break;case x:case u:case w:y={tag:e.get('tag'),model:e.get('model'),mimeType:k[xh]};p instanceof Uint8Array&&(y.content=new Blob([p.buffer]));break;default:throw Error(`Data Http request type not supported ${n}`);
636
+ }let z;const A=null!=(z=k['X-Source-Origin'])?z:olympe.dc.Ra.Af;var q=oe(new olympe.dc.Request(n,f,y,m),A);const J=yield g(q),M=J instanceof Blob||J instanceof ArrayBuffer||void 0===J?null!=J?J:'':JSON.stringify(a.F.ha(J));return new olympe.net.xf(M,h===vh?Ch:Bh)}catch(r){return new olympe.net.xf(`Internal server error: ${r}`,Eh,'Internal server error')}})).catch(c=>a.K.error(`Error while starting the FileService: ${c}`));a.K.debug(`Started HTTP service with path: ${b}`)}
637
+ function Ih(a){a.P.Z('_DataSourcesHTTPService').catch(b=>a.K.error(`An error occurred while stopping the data sources http service: ${b}`))}function Jh(a,b,c){0===a.G.size&&(a.P.ba([sh,th,uh,vh,wh],[xh,yh,'X-Source-Origin']),Gh(a));a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Ih(a)}}
638
+ function Kh(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Rc(a.Z,a.Wa.get(c)))?d:null}var e=a.ba.get(b);if(!e){d=a.Ba.Lb(b);if(null===d)return null;e=olympe.dc.sources.V.Dh;const f=olympe.dc.sources.V.Eh,g=olympe.dc.sources.V.Ti,h=olympe.dc.sources.V.Jg;let k;e=`${a.Qd(d,g)?'https':'http'}://${a.Qd(d,e)}:${null!=(k=a.Qd(d,f))?k:a.Qd(d,g)?443:80}`+`${a.ga}/${a.Qd(d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.ba.set(b,e)}return`${e}/${c}`}
639
+ function Lh(a,b){return b instanceof olympe.net.Hh?Sc(a.Z,b,yc(a.T).Rc()):Promise.reject('No http request to send')}function Mh(a,b){var c=Kh(a,b.uc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.uc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=P(c,th,e);Q(c,{['X-Source-Origin']:b.origin,[xh]:'application/json'});return Lh(a,c).then(f=>'string'===typeof f?a.F.G(JSON.parse(f)):olympe.dc.query.xd.Nl(d))}
640
+ function Nh(a,b){var c=Kh(a,b.uc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.uc()}`);const d=JSON.stringify(a.F.ha(b.content));c=P(c,th,d);Q(c,{['X-Source-Origin']:b.origin,[xh]:'application/json'});return Lh(a,c).then()}
641
+ function Hh(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):Ja(a.L.C,b)?Promise.resolve(a.L.get(b)):new Promise((c,d)=>{a.T.sg(b,(e,f)=>{e?d(e.message):a.qa||f!==olympe.dm.User.C?(a.L.set(b,f),c(f)):d('Guest cannot access that resource.')})})}
642
+ olympe.dc.sources.kr=class{constructor(a,b,c,d,e,f,g){this.K=a;this.P=b;this.Z=c;this.T=d;this.Ba=e;this.F=f;this.G=new Map;this.L=new olympe.Y.ql(6E5);new olympe.D.Nb('Http service of remote data provider');this.ga=g.get('basePath');this.qa=g.get('allowGuest');this.ba=new Map;this.C=new Map;this.Wa=new Map([[olympe.dc.Request.C.ne,olympe.O.Kb.ne],[olympe.dc.Request.C.Qf,olympe.O.Kb.Pi],[olympe.dc.Request.C.fg,olympe.O.Kb.Pi],[olympe.dc.Request.C.Gg,olympe.O.Kb.Pi],[olympe.dc.Request.C.Em,olympe.O.Kb.Dm],
643
+ [olympe.dc.Request.C.Po,olympe.O.Kb.Oo],[olympe.dc.Request.C.Hk,olympe.O.Kb.Fn],[olympe.dc.Request.C.Ii,olympe.O.Kb.Qm],[olympe.dc.Request.C.Yh,olympe.O.Kb.TRANSACTION]])}uploadFileContent(a){const {tag:b,model:c,content:d,mimeType:e}=a.content,f=a.uc(),g=Kh(this,f,a.getType());if(!g)return Promise.reject(`No destination URL to upload the file. ${b}`);const h=P(f===olympe.dc.Ra.SERVER?`${g}/${b}`:`${g}?tag=${b}&model=${c}`,vh,d,olympe.net.Ia.ResponseType.uh);Q(h,{[xh]:e||'application/octet-stream'});
644
+ f!==olympe.dc.Ra.SERVER&&Q(h,{['X-Source-Origin']:a.origin});return Lh(this,h).then(()=>(new URL(h.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.uc();var e=Kh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,uh,b);d!==olympe.dc.Ra.SERVER&&Q(e,{['X-Source-Origin']:a.origin});return Lh(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.uc();
645
+ var e=Kh(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to download the file. ${b}`);var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,dh:k})});if(this.C.has(b))return f;this.C.set(b,g);e=P(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,sh,b,olympe.net.Ia.ResponseType.uh);d!==olympe.dc.Ra.SERVER&&Q(e,{['X-Source-Origin']:a.origin});Lh(this,e).then(h=>{let k;null==(k=this.C.get(b))||k.forEach(m=>m.done(h))}).catch(h=>{let k;null==(k=
646
+ this.C.get(b))||k.forEach(m=>m.dh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}Qd(a,b){const [c,d]=b.split('.');let e,f;b=null!=(f=null!=(e=olympe.U.getParameter(`${c}.${a.name().toLowerCase().replace(/\W/g,'_')}.${d}`))?e:olympe.U.getParameter(`${c}.${d}`))?f:null;null===b&&this.K.error(`Impossible to build URL for data source ${a}`);return b}};olympe.dc.sources.Rn=class{constructor(a,b){this.K=a;this.fc=b}};olympe.dc.sources.Rn.nc={Vh:0,Oy:1,Py:3,ky:4};const Oh=olympe.dc.Request.C.ac,Ph=olympe.dc.Request.C.Pg,Qh=olympe.dc.Request.C.mj,Rh=olympe.dc.Request.C.fg,Sh=olympe.dc.Request.C.Qf,Th=olympe.dc.Request.C.Gg,Uh=olympe.dc.Request.C.vh,Vh=olympe.dc.Request.C.Fi,Wh=olympe.dc.Request.C.Xh;
647
+ function Xh(a,b){const c=b.W();null===a.F&&(a.F=new olympe.Y.ql(6E4),Ma(a.F,(f,g)=>{a.applyTransaction(g).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Na(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.Lc(c);b.Md(e);Ja(a.F.C,c)||a.F.set(c,e)}
648
+ function Yh(a,b){const c=b.W();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.Lc(c);let g;null==(g=a.F)||g.delete(c);b.Md(f);return a.applyTransaction(f).catch(h=>{a.K.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Zh(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b).then(d=>d.Xc()));return 0<a.Z?rxjs.interval(a.Z).pipe(rxjs.operators.switchMap(()=>c)):c}
649
+ olympe.dc.sources.bo=class{constructor(a,b){this.K=a;this.C=b;this.T=olympe.dc.query.Sj();this.P=olympe.dc.Ql();this.G=new olympe.D.Nb('Context of source '+this.W());let c;this.Z=null!=(c=b.Qd('pollingFrequency'))?c:6E5;this.F=null}W(){return this.C.W()}init(){if(this.W()===olympe.dc.Ra.SELF)return this;(new Promise((a,b)=>{let c=!0;$h(this.C,this.G).subscribe(rxjs.Subscriber.create(d=>{this.K.debug(`Data source ${this.C.name()} should handle ${d.size()} data types`);c&&(c=!1,a())},b))})).then(()=>
650
+ this.C.init(this.G)).catch(a=>{this.K.error(`Error while initialization of DataSource ${this.C.name()} (${this.W()}): ${a}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.W()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;switch(a.getType()){case Oh:const c=olympe.dm.DataSource.ac.Fb,d=olympe.dm.DataSource.ac.Sh;return this.C.healthCheck().then(()=>({s:d})).catch(e=>({s:c,r:String(e)}));case Ph:return this.C.executeQuery(b);
651
+ case Uh:return a=b.Xc(),Xh(this,a),this.P.cd(a),Promise.resolve();case Wh:return this.applyTransaction(b.Xc());case Vh:return Yh(this,b.Xc());case Rh:return b.content instanceof Blob?b.content.arrayBuffer().then(e=>this.C.uploadFileContent(b.tag,b.model,new Uint8Array(e))):Promise.reject('File content is undefined');case Sh:return this.C.downloadFileContent(b.tag,b.model);case Th:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}L(a){if(a.getType()===
652
+ Qh){const b=a.content;a=a.origin;return a===olympe.dc.Ra.SELF?Zh(this,b):Pg(this.T,b,this.G,a,olympe.dc.ua.Dc.Bg).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.ke)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a){const b=this;return v(function*(){const c=ai(a);yield b.C.applyTransaction(c);yield Yg(b.T,b.W(),a);b.P.cd(a)})}};olympe.dc.sources.bo.sa=[olympe.dc.sources.yk];function ai(a){const b=olympe.dc.sources.Cf.C.Mq,c=olympe.dc.sources.Cf.C.jt,d=olympe.dc.sources.Cf.C.Qq,e=olympe.dc.sources.Cf.C.Nq,f=olympe.dc.sources.Cf.C.Rq,g=[],h=[],k=[],m=[],n=[];a.C.forEach((p,q)=>{const r=p.Dd();p.L()?g.push(bi(b,q,r,p.ba()?p.Bb():null)):p.hf()?k.push(bi(d,q,r,null,p.Z())):p.ba()&&h.push(bi(c,q,r,p.Bb()));for(const [t,u,w]of p.he())p=a.Be(u),w?m.push(new ci(e,t,q,u,r,p.Dd())):n.push(new ci(f,t,q,u,r,p.Dd()))});return n.concat(k,g,h,m)}
653
+ function bi(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new di(a,b,c,d,e)}olympe.dc.sources.Cf=class{constructor(a){this.type=a}};class di extends olympe.dc.sources.Cf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Mb.NONE}}
654
+ class ci extends olympe.dc.sources.Cf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Cf.C={Mq:'CREATE',jt:'UPDATE',Qq:'DELETE',Nq:'CREATE_RELATION',Rq:'DELETE_RELATION'};const ei=olympe.dc.Request.C.ac,fi=olympe.dc.Request.C.Pg,gi=olympe.dc.Request.C.mj,hi=olympe.dc.Request.C.Xh,ii=olympe.dc.Request.C.Yh,ji=olympe.dc.Request.C.vh,ki=olympe.dc.Request.C.Fi,li=olympe.dc.Request.C.fg,mi=olympe.dc.Request.C.Qf,ni=olympe.dc.Request.C.Gg,oi=olympe.dc.Request.C.Dk;function pi(a,b){return!!a.db.Ma(b,olympe.dm.DataSource.hq)}
655
+ function qi(a,b){b=oe(new olympe.dc.Request(oi,olympe.dc.Ra.SELF,{id:b,finalize:olympe.dc.transaction.Df.C.$i,error:null}),a.W());let c;null==(c=a.fc)||c.dd(b)}
656
+ function ri(a,b,c){return v(function*(){var d=olympe.O.Request.hb.SEND,e=olympe.O.Request.hb.GET;const f=olympe.O.Request.hb.PUBLISH,g=olympe.O.Request.hb.SUBSCRIBE,h=c.nh();var k=c.body();let m;if(null==(m=a.fc)||!m.ba(k.uc()))throw Error(`Try to process a message with destination data source ${k.uc()} coming from remote but not started here`);if(h===g){if(k.getType()===gi)d=k.content.W();else throw Error('Not supported type of subscription');e=yield c.hm(d);a.T.set(e,d);e=a.P.get(d);e||(e=new si(a.K,
657
+ d,b,oe(k,olympe.dc.Ra.Af)),a.P.set(d,e));k=e;k.C++;k.K.debug(`Data subscription ${k.F} has ${k.C} subscribers`)}else h===e?(k=yield b.request(k),void 0!==k?yield c.dd(k):a.K.warn(`Request from ${c.source()} requires an output value, but got undefined instead.`)):h===d?(yield b.request(k),yield c.Fp()):h===f&&(yield b.request(k))})}
658
+ olympe.dc.sources.Uo=class{constructor(a,b,c,d){this.K=a;this.G=b;this.C=c;this.db=d;this.F=new olympe.D.Nb('Remote Provider Context');this.fc=null;this.Z=new Map;this.P=new Map;this.T=new Map}W(){return olympe.dc.Ra.Af}request(a){const b=olympe.O.pb,c=a.uc(),d=a.getType();this.K.C()&&this.K.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case ei:return b.get(c,a);case fi:return pi(this,c)?Mh(this.C,a):b.get(c,a);case hi:const e=a.content.Xc().W();return b.send(c,
659
+ a).finally(()=>qi(this,e));case ii:const f=a.content.Xc().W();return(pi(this,c)?Nh(this.C,a):b.send(c,a)).finally(()=>qi(this,f));case ji:case ki:return b.publish(c,a).catch(g=>{this.K.error(`An error occurred while sending message to another data source: ${g}`)});case li:return pi(this,c)?this.C.uploadFileContent(a):b.get(c,a);case mi:return pi(this,c)?this.C.downloadFileContent(a):b.get(c,a);case ni:return pi(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.W()}`)}}L(a,
660
+ b){const c=a.uc(),d=a.getType();this.K.C()&&this.K.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===gi?olympe.O.pb.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){this.fc=a;olympe.dc.ua.from(this.G,this.G).lb(olympe.dm.DataSource.ti).filter(olympe.dc.query.Da.Pa(olympe.dm.DataSource.Zg,!0)).filter(olympe.dc.query.Da.Pa(olympe.dm.DataSource.Pp,!0)).observe(this.F).subscribe(b=>
661
+ {qe(b).forEach(this.ga.bind(this,a));pe(b).forEach(c=>{let d;null==(d=this.Z.get(c))||d.destroy();this.Z.delete(c)})});this.db.Ma(this.G,olympe.dm.DataSource.Pp)&&(new olympe.O.pb(this.G,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.dd(b):this.K.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}ga(a,b){const c=b.X(),d=new olympe.D.Nb(`Published data provider context ${c}`,this.F),e=new olympe.O.pb(c,
662
+ d);this.Z.set(c,d);b.get(olympe.dm.DataSource.hq)&&(b=Jh(this.C,c,a.request.bind(a)),d.onDestroy(b,'stopHttpService'));e.lq(this.ba.bind(this)).listen().subscribe(f=>{f.qh().then(()=>ri(this,a,f)).catch(g=>{this.K.warn(`Error occurred while processing request from ${f.source()}: ${g}`);return f.dh(Error(g))})})}ba(a){const b=this.T.get(a);this.T.delete(a);if(a=b)null==(a=this.P.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.K.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),
663
+ a=!0):(a.K.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.P.delete(b)}};class si{constructor(a,b,c,d){this.K=a;this.F=b;this.C=0;this.G=c.T(d).subscribe(e=>{olympe.O.pb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))})}}olympe.dc.sources.Uo.sa=[olympe.dc.sources.yk];olympe.dc.sources.cg=class extends olympe.O.cg{constructor(a){super();this.db=a;this.L=new Map}ha(a){a=this.C(a);if(0<this.L.size){const b=Array.from(this.L.values());this.L.clear();return{t:0,i:b,v:a}}return a}G(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.F(g)])));c.Fc(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Lc);olympe.dc.Ql().cd(b);return this.F(a.v)}return this.F(a)}C(a){switch(!0){case a instanceof
664
+ olympe.dc.CloudObject||'function'===typeof(null==a?void 0:a.X):return a=a.X(),this.P(a),{t:10,v:a};case a instanceof olympe.dc.ua:return{t:11,v:a.ha()};case a instanceof olympe.dc.Ka:return{t:12,v:a.ha(this.P.bind(this))};case a instanceof olympe.dc.db.Lc:const b=new olympe.dc.transaction.Yf;a.Md(b);return{t:13,i:a.W(),v:ug(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.uc(),u:a.wc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.zj:return{t:15,r:a.ug(),
665
+ p:this.C(a.Xc())};case a instanceof olympe.dc.query.xd:return{t:16,v:a.ha()};default:return super.C(a)}}F(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.F(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.xa.jj.C),c=a.e;return new olympe.dc.ua(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,ed:c.s,xg:c.rm});case 12:return $g(a.v);case 13:return(new olympe.dc.transaction.fj).C(a.v,a.i);case 14:return c=null!=
666
+ (b=this.F(a.c))?b:void 0,oe(new olympe.dc.Request(a.r,a.d,c,a.u),a.o);case 15:return b=this.F(a.p),new olympe.dc.transaction.zj(b,a.r);case 16:return a=a.v,new olympe.dc.query.xd((new olympe.dc.transaction.fj).C(a.p),a.s);default:return super.F(a)}}P(a){if(!this.L.has(a)){var b={};this.db.Bb(a).forEach((d,e)=>{b[e]=this.C(d)});var c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:[]};this.L.set(a,c);for(const [d,e,f]of Lf(this.db,a)){const g=this.L.get(f);void 0!==g&&(e===olympe.dc.va.DESTINATION?
667
+ c.r.push({r:d,d:f}):g.r.push({r:d,d:a}))}}}};const ti=olympe.dc.Request.C.ne,ui=olympe.dc.Request.C.Xh,vi=olympe.dc.Request.C.Yh,wi=olympe.dc.Request.C.vh,xi=olympe.dc.Request.C.Em,yi=olympe.dc.Request.C.Po,zi=olympe.dc.Request.C.Pg,Ai=olympe.dc.Request.C.Ii,Bi=olympe.dc.Request.C.mj,Ci=olympe.dc.Request.C.Hk,Di=olympe.dc.Request.C.Gn,Ei=olympe.dc.Request.C.gr,Fi=olympe.dc.Request.C.hr,Gi=olympe.dc.Request.C.Gg,Hi=olympe.dc.Request.C.Qf,Ii=olympe.dc.Request.C.fg,Ji=olympe.dc.Request.C.Dk,Ki=olympe.dc.Request.C.ht,Li=olympe.dc.Request.C.Js,Mi=
668
+ olympe.dc.Request.C.fr,Ni=olympe.dc.Request.C.Fi,Oi=olympe.dc.Request.C.Hq,Pi=olympe.dc.Request.C.ac;function Qi(a){return Ri(a,olympe.dc.Request.C.ne).then(b=>{b=b.p;const c=tg(b,a.W());a.K.C()&&a.K.debug('< Get Context result',b);a.K.L()&&a.K.log('< Get Context result has',b.length,'operations');return c})}
669
+ function Si(a,b){const c=b.Xc();b=new olympe.dc.transaction.Yf({bk:!0,Kd:!1,$g:!1});c.Md(b);return Ri(a,vi,ug(b)).finally(()=>{Ti(a,Ji,{id:c.W(),finalize:olympe.dc.transaction.Df.C.$i})}).then()}function Ui(a,b){const c=new olympe.dc.transaction.Yf({Kd:!1,$g:!1}),d=b.Xc();d.Md(c);return Vi(a,wi,{i:d.W(),r:b.ug(),p:ug(c)},!1).catch(e=>a.K.error(`Error while publishing burst transaction: ${e}`))}
670
+ function Wi(a,b){const c=b.W();a.K.C()&&a.K.debug(`Query (${c}) sent to orchestrator: ${b}`);b=Xi(a,b);return Ri(a,Ci,b).then(d=>Yi(a,d))}function Zi(a,b){const c=encodeURI(Ga(olympe.Y.Pd(),JSON.stringify(Xi(a,b))));a.K.C()&&a.K.debug(`Static GraphDef query ${b} sent to orchestrator`);return Ri(a,Ai,void 0,`query=${c}&v=${a.version}`).then(d=>Yi(a,d))}
671
+ function Vi(a,b,c,d=!0){const e=olympe.O.Zd.en,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Zc(a.F,e,f,(k,m)=>{k?h(k):g(m)})});Zc(a.F,e,f);return Promise.resolve()}
672
+ function Xi(a,b){const c=yg(b);b={i:b.W(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.xa.me)Object.assign(b,{f:c[0].cc,q:[]});else{const d=new Map;for(let e=c.length-1;0<=e;e--){const f=c[e],g=f.C;let h;const k=(null!=(h=d.get(g))?h:new Set).add(f);if(f instanceof olympe.dc.query.xa.vf&&f.G){let m;null==(m=d.get(f.W()))||m.forEach(n=>k.add(n))}d.set(g,k)}Object.assign(b,{f:olympe.dc.Mb.NONE,q:c.map(a.T.bind(a,d))})}return b}
673
+ function Ti(a,b,c){b=oe(new olympe.dc.Request(b,olympe.dc.Ra.SELF,c),a.W());let d;null==(d=a.fc)||d.dd(b)}
674
+ function Ri(a,b,c,d){if(Wc(a.F)){const e=Kh(a.C,a.W(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=P(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Ia.Jd.Og:olympe.net.Ia.Jd.GET,c&&JSON.stringify(c));Q(b,{[olympe.net.Ia.Headers.yh]:'application/json'});return Lh(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}a.K.error('Server is disconnected, data request of type',b,'is canceled.');return Promise.reject('Server is disconnected')}
675
+ function Yi(a,b){if(b&&'object'===typeof b){if(0<b.s)throw Error(b.info.error.reason);return tg(b.p,a.W())}throw Error('Data result can be created only from Object');}
676
+ olympe.dc.sources.hp=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.ba=c;this.Z=d;this.C=e;this.P=new olympe.dc.transaction.fj(this.W());this.G=new Map;this.fc=null;this.version=f||'unknown';const g=olympe.auth.Ca.C.wf,h=olympe.auth.Ca.C.Ge;olympe.D.oc([this.Z.getState()],k=>{k!==g&&k!==h||this.G.forEach((m,n)=>{m.error(new olympe.O.errors.al('Connection to server has been recovered',n))})})}W(){return olympe.dc.Ra.SERVER}request(a){var b=a.getType(),c=a.content;switch(b){case Pi:return c=
677
+ olympe.dm.DataSource.ac.Fb,a=olympe.dm.DataSource.ac.Sh,Promise.resolve(Wc(this.F)?{s:a}:{s:c,r:'Disconnected'});case ti:return Qi(this);case ui:return a=new olympe.dc.transaction.Yf({Kd:!1,$g:!1}),b=c.Xc(),b.Md(a),Vi(this,ui,{i:b.W(),r:c.ug(),p:ug(a)}).then();case vi:return Si(this,c);case wi:return Ui(this,c);case Ni:return a=new olympe.dc.transaction.Yf({Kd:!1,$g:!1}),c=c.Xc(),c.Md(a),Vi(this,Ni,{i:c.W(),p:ug(a)}).then();case zi:return Wi(this,c);case Ai:return Zi(this,c);case xi:return Wc(this.F)?
678
+ (c=Xi(this,olympe.dc.ua.from(c)),c.f=olympe.dc.Mb.jn,c=P(Kh(this.C,olympe.dc.Ra.SERVER,xi),olympe.net.Ia.Jd.Og,JSON.stringify(c),olympe.net.Ia.ResponseType.uh),Q(c,{[olympe.net.Ia.Headers.yh]:olympe.net.Ia.bn.JSON}),c=Lh(this.C,c)):(this.K.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case yi:a=c.wB;b=c.debug;c=c.optional;if(Wc(this.F)){var d=Kh(this.C,olympe.dc.Ra.SERVER,yi);c=P(d+`?debug=${b}&optional=${c}`,olympe.net.Ia.Jd.Og,
679
+ a);Q(c,{[olympe.net.Ia.Headers.yh]:olympe.net.Ia.bn.pt});c=Lh(this.C,c)}else this.K.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected');return c;case Ki:case Li:case Mi:case Oi:return Vi(this,b,{});case Hi:return this.C.downloadFileContent(a);case Gi:return this.C.deleteFileContent(a);case Ii:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}L(a,b){if(a.getType()===Bi){const c=
680
+ a.content,d=c.W();return(new rxjs.Observable(e=>{const f=Xi(this,c);this.G.set(d,e);Vi(this,Di,f).catch(g=>e.error(g))})).pipe(Gc(this.ba,b),rxjs.operators.finalize(()=>{Vi(this,Ei,{i:d}).catch(e=>{this.K.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.G.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){this.fc=a;Uc(this.F,olympe.O.Zd.en,this.ga.bind(this));return this}destroy(){return v(function*(){})}ga(a){var b=
681
+ olympe.dc.Request.C.Gm;const c=olympe.dc.Request.C.Zk;var d=a.c;if(d===olympe.dc.Request.C.fn)a=this.P.C(a.p),Ti(this,d,a);else if(d===b){var e=a.error.reason;b=this.P.C(a.p);Ti(this,d,{id:a.i,rollback:b,error:e})}else d===Fi?(d=a.i,a=this.P.C(a.p),null==(e=this.G.get(d))||e.next(a)):d===c&&Ti(this,Ji,{id:a.i,finalize:olympe.dc.transaction.Df.C.Zk,error:0<a.s?a.info.error.reason:null})}T(a,b){if(b instanceof olympe.dc.query.xa.Sf||b instanceof olympe.dc.query.xa.vf){const c=b.P();let d;b=Array.from(null!=
682
+ (d=a.get(b.W()))?d:[]);return{t:c.X(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.T.bind(this,a))}}return{}}};olympe.dc.sources.hp.sa=[olympe.dc.sources.yk];function he(a,b){let c;return null!=(c=a.db.source(b))?c:a.T}
683
+ function $i(a,b){let c;null==(c=a.G)||c.destroy();a.G=new olympe.D.Nb(`Source solver ${b.X()}`,olympe.D.ff());b.lb(olympe.dm.yd.G.Pb()).lb(olympe.dm.yd.C).Ld().back().lb(olympe.dm.yd.F).Ld().observe(a.G).subscribe(d=>{qe(d).forEach(([e,f])=>{a.F.set(e.X(),f.W())});pe(d).forEach(([e])=>{a.F.delete(e)})});b.lb(olympe.dm.tb.G).observe(a.G).subscribe(d=>{let e,f;a.L=null!=(f=null==(e=d.vc())?void 0:e.W())?f:null});a.G.onDestroy(()=>{a.F.clear();a.L=null})}
684
+ olympe.dc.sources.wj=class{constructor(a,b,c){this.db=a;this.C=b;this.T=c;this.F=new Map;this.L=this.G=null;this.P=!1}fromModel(a){a=olympe.dc.ja(a);return this.F.has(a)?this.F.get(a):this.L&&this.Z(a)?this.L:this.T}Lb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Ra.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ua(a)&&this.db.Zc(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}Z(){return!1}init(){if(!this.P){this.P=!0;var a=new olympe.dc.Sa;
685
+ Z(a.create(olympe.dm.DataSource,this.C).oh(this.C),olympe.dm.DataSource.Zg,!0);a.Ea(olympe.dm.DataSource.ti,this.C,this.C);a.jb(()=>{olympe.dc.ua.from(this.C).observe(olympe.D.ff()).subscribe(()=>{})})}}};olympe.dc.sources.R={za:'dc.sources.Logger',Kk:'dc.sources.HTTPService',wr:'dc.sources.IOService',No:'dc.sources.RemoteProvider',$o:'dc.sources.ServerProvider',ly:'dc.sources.OfflineProvider',Ve:'dc.sources.SourceSolver',de:'dc.sources.Serializer'};olympe.dc.sources.V={Dh:'data.httpHost',Eh:'data.httpPort',Ti:'data.httpSSL',Jg:'data.httpBasePath',sq:'offline.autoSync',rq:'offline.autoPersist',Ws:'offline.syncTimeout',VERSION:'version.version'};
686
+ olympe.U.config(function(a){F(a,olympe.dc.sources.V.sq,!1);F(a,olympe.dc.sources.V.rq,!1);F(a,olympe.dc.sources.V.Ws,3E4);const b=a.getParameter(olympe.O.V.Tf)||'localhost',c='localhost'===b;F(a,olympe.dc.sources.V.Jg,'/data');F(a,olympe.dc.sources.V.Dh,b);F(a,olympe.dc.sources.V.Eh,c?3141:443);F(a,olympe.dc.sources.V.Ti,!c);E(a,olympe.dc.sources.R.za,[olympe.ka.R.Fa],d=>d.Gc('data'));D(a,olympe.dc.sources.R.de,olympe.dc.sources.cg,olympe.dc.R.Ke);ua(a,olympe.O.R.de,olympe.dc.sources.R.de);E(a,olympe.dc.sources.R.Kk,
687
+ [olympe.dc.sources.R.za,olympe.net.R.Cj,olympe.O.R.Jk,olympe.auth.R.Fa,olympe.dc.sources.R.Ve,olympe.O.R.de,new olympe.U.ma(olympe.net.V.Jg),new olympe.U.ma(olympe.auth.V.Gi)],(d,e,f,g,h,k,m,n,p)=>{m=(new Map(p)).set('basePath',m).set('allowGuest',n);return new olympe.dc.sources.kr(d,e,f,g,h,k,m)});D(a,olympe.dc.sources.R.wr,olympe.dc.sources.Rn,olympe.dc.sources.R.za,olympe.dc.R.Qg,olympe.net.R.Fa,olympe.auth.R.Fa);D(a,olympe.dc.sources.R.No,olympe.dc.sources.Uo,olympe.dc.sources.R.za,new olympe.U.ma(olympe.dc.V.bg),
688
+ olympe.dc.sources.R.Kk,olympe.dc.R.Ke);D(a,olympe.dc.sources.R.$o,olympe.dc.sources.hp,olympe.dc.sources.R.za,olympe.O.R.qj,olympe.O.R.mk,olympe.auth.R.Fa,olympe.dc.sources.R.Kk,new olympe.U.ma(olympe.dc.sources.V.VERSION));D(a,olympe.dc.sources.R.Ve,olympe.dc.sources.wj,olympe.dc.R.Ke,new olympe.U.ma(olympe.dc.V.bg),new olympe.U.ma(olympe.dc.V.wk))},'olympe.dc.sources');olympe.U.run([olympe.dc.sources.R.Ve],a=>{olympe.dc.ie=()=>a});olympe.dc.transaction={};olympe.dc.wh=class a{constructor(b,c){this.id=b||olympe.Y.ic();this.F=new olympe.D.Nb('BurstTransaction#'+this.id,c);this.Cb=aj(this);this.T=!1;this.F.onDestroy(()=>this.P());this.Z=new Set;this.G=new Map;this.L=new Set;this.C=null;this.nb=olympe.U.getParameter(olympe.dc.transaction.V.Fm)||30;this.qa=[]}static C(b,c){return`${b},${c}`}Ob(b){for(const c of this.qa)c(b);this.stop()}Wa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ga(this.L);0<b.size&&bj(this,b,!1);this.L.clear()}ga(b){const c=
689
+ new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}ba(b,c,d){this.Ba(b,c,d);this.Cb(b,c,d);null===this.C&&(this.C=setTimeout(this.Wa.bind(this),this.nb))}Ba(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}ub(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ja(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ja(f),this.ub(d,e)!==g&&this.ba(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
690
+ c)=>{this.P((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ja(b),f=olympe.dc.ja(c);void 0===e||void 0===f?olympe.dc.jh().ab().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.jm([d],g=>{this.T=!0;g instanceof olympe.dc.lc?olympe.dc.jh().ab().error('Cannot send complex property values in burst transactions'):this.ba(e,f,g.valueOf())})}),this.F.Z(()=>{this.P()}))}stop(){this.F.destroy();this.qa.length=0}getContext(){return this.F}W(){return this.id}ug(){return!1}P(b){if(this.T){this.T=
691
+ !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.ga(new Set(this.G.keys()));bj(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.wh.prototype.complete=olympe.dc.wh.prototype.complete;olympe.dc.wh.prototype.push=olympe.dc.wh.prototype.push;olympe.dc.vo=class{C(){}toString(){}};olympe.dc.transaction.fj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ra.SERVER}C(b,c){c=new olympe.dc.db.Lc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Fc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.gd(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.Yb(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
692
+ e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Vi.Hd+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
693
+ case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.lc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function cj(a,b){let c;return null!=(c=a.sources.get(b))?c:he(a.L,b)}function dj(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Be(b))?void 0:c.Dd())?d:a.db.model(b))?e:null}function ej(a,b){let c;return null!=(c=a.P.get(b))?c:a.db.Kf(b)||!a.db.Ua(b)}function fj(a){return Array.from(a.C.Sd()).filter(b=>!b.hf()).map(b=>b.tag())}function gj(a,b,c,d){d(a.C);c&&a.G&&b!==olympe.dc.Ra.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Lc(a.id),a.F.set(b,c)),d(c))}
694
+ function hj(a,b,c){const d=cj(a,b),e=ej(a,b),f=dj(a,b);gj(a,d,e,g=>{g.F(b,c,f)})}
695
+ olympe.dc.transaction.Es=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.ic();this.L=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.Lc(this.id);this.sources=new Map;this.P=new Map;this.G=!0}kh(){return 0===this.C.C.size}persist(a){this.G=a}Fc(a,b,c,d,e){let f;const g=null!=(f=null!=d?d:this.sources.get(a))?f:this.L.fromModel(b);this.sources.set(a,g);this.P.set(a,c&&this.G);gj(this,g,c,h=>{h.Fc(a,g,e,b)})}gd(a,b){const c=cj(this,a),d=ej(this,a),e=dj(this,a);gj(this,c,d,f=>{f.gd(a,null!=b?b:
696
+ new Map,e)})}Ea(a,b,c){const d=cj(this,b),e=cj(this,c);let f=ej(this,b)&&ej(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.mc.md&&(olympe.ka.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);gj(this,d,f,g=>{g.Ea(a,b,c,dj(this,b),dj(this,c))})}Yb(a,b,c){const d=cj(this,b),e=cj(this,c);let f=ej(this,b)&&ej(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.mc.md&&(olympe.ka.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
697
+ f=!1);gj(this,d,f,g=>{g.Yb(a,b,c,dj(this,b),dj(this,c))})}};function ij(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.Tn.cp)if(e===olympe.dc.Ra.SELF)d[g]=olympe.dc.ya().W();else{if(e===olympe.dc.Ra.SERVER)continue}else g.startsWith(olympe.dc.Vi.Hd)&&(g='fd'+g.substring(1));e=a.Z(e);c&&e instanceof Object&&8===e.c?a.T.set(g,e):d[g]=e}return d}function jj(a){if(0===a.T.size)return null;const b=Object.create(null);a.T.forEach((c,d)=>{b[d]=c});a.T.clear();return b}
698
+ class kj{constructor(){this.T=new Map}Z(a){return a instanceof olympe.D.Ja||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.Za?(a=a instanceof olympe.D.Za?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.pg().valueOf(),g:a.mg().valueOf(),b:a.kg().valueOf(),a:a.jg().valueOf()}:a&&'function'===
699
+ typeof a.X?{c:8,t:a.X()}:a}}function ug(a){const b=a.L.concat(a.G).concat(a.P).concat(a.C).concat(a.T);a.P=[];a.G=[];a.C=[];a.T=[];a.L=[];return b}
700
+ olympe.dc.transaction.Yf=class{constructor({bk:a=!1,$g:b=!0,Kd:c=!0}={}){this.P=[];this.G=[];this.C=[];this.T=[];this.L=[];this.bk=null!=a?a:!1;this.Kd=null!=c?c:!0;this.$g=null!=b?b:!0;this.Z=olympe.D?new kj:new class extends kj{Z(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(ug(this))}Fc(a,b,c,d=null){c=ij(this.Z,null!=c?c:null,this.bk);c={o:1,t:a,p:c};this.$g&&(c.s=b);this.Kd&&d&&(c.m=d);this.P.push(c);this.bk&&(b=jj(this.Z))&&this.C.push({o:2,t:a,p:b})}gd(a,
701
+ b,c=null){b=ij(this.Z,b||null,!1);a={o:2,t:a,p:b};this.Kd&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.Kd&&c&&(a.m=c);this.G.push(a)}Ea(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.Kd&&d&&(a.lm=d);this.Kd&&e&&(a.rm=e);this.T.push(a)}Yb(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
702
+ if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.Kd&&d&&(a.lm=d);this.Kd&&e&&(a.rm=e);this.L.push(a)}};olympe.dc.transaction.Yf.sa=[olympe.dc.Writable];function lj(a,b){b&&a.gb.push(b);return b}function mj(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();lj(a,new olympe.dc.transaction.gb.ln(e,b));lj(a,new olympe.dc.transaction.gb.tk(e,b,d));return c}
703
+ function nj(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
704
+ olympe.dc.Sa=class{constructor(a){this.id=a||olympe.Y.ic();this.gb=[];this.G=new Map;this.L=!0;this.F=[]}W(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ja(a)))?b:olympe.dc.ya().model(a)}persist(a){this.L=a;return this}C(a){a.persist(this.L);const b=this.gb;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){b=lj(this,new olympe.dc.transaction.gb.sk(a,b));this.G.set(b.X(),olympe.dc.ja(a));return b}vi(a,b=!0){const c=olympe.dc.ja(a);var d=this.gb.find(h=>h instanceof olympe.dc.transaction.gb.sk&&
705
+ h.X()===c);if(d)return d.persist(b);d=olympe.dc.ya();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+a);if(d.Kf(a))return null;let f;const g=null!=(f=d.source(a))?f:olympe.dc.ie().fromModel(e);a=this.create(e,a).persist(b).oh(g);for(const [h,k,m]of Lf(d,a))h!==olympe.dc.mc.md&&d.Kf(m)&&this.Ea(h,k===olympe.dc.va.DESTINATION?a:m,k===olympe.dc.va.DESTINATION?m:a);return a}delete(a,b=olympe.dc.Mb.pc){lj(this,new olympe.dc.transaction.gb.mn(a,b))}update(a,
706
+ b,c){return lj(this,new olympe.dc.transaction.gb.nt(a,b,c))}Ea(a,b,c){lj(this,new olympe.dc.transaction.gb.tk(a,b,c))}Yb(a,b,c){lj(this,new olympe.dc.transaction.gb.Xq(a,b,c))}Jl(a,b){lj(this,new olympe.dc.transaction.gb.ln(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Vi.Hd+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,
707
+ a,d);return d}Mp(a,b,c='',{DA:d=olympe.dm.Relation.L.vs,OA:e=olympe.dm.Relation.C.Ko,JA:f=olympe.dm.Relation.C.Bq,oB:g=olympe.dm.Relation.C.mr,AA:h=olympe.dm.gk.NONE,lB:k=olympe.dm.Relation.P|h}={},m=olympe.Y.ic()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,m),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.qa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ga,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.si,
708
+ a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}ug(){return!1}Cl(a){this.F.push(olympe.D.Oa().G(a))}jb(a,b){a=nj([...this.F,a].filter(c=>'function'===typeof c));oj(this,a,b)}Kl(a){a=nj([...this.F,a]);pj(olympe.dc.jh(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Sa.sa=[olympe.dc.vo];function aj(a){var b=olympe.dc.jh();const c=a.W();b.L.set(c,a);a.getContext().onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Lc(c);g.gd(d,(new Map).set(e,f),b.db.model(d));b.F.cd(g)}}
709
+ function bj(a,b,c,d){var e=olympe.dc.jh();const f=olympe.dc.Request.C.vh,g=olympe.dc.Request.C.Fi,h=a.W();a=a.ug();const k=new Map;for(const m of b.keys()){const n=e.db.source(m);if(n===olympe.dc.Ra.SELF)continue;let p=k.get(n);p||(p=new olympe.dc.db.Lc(h),k.set(n,p));p.gd(m,b.get(m),e.db.model(m))}for(const [m,n]of k)b=new olympe.dc.Request(c?g:f,m,new olympe.dc.transaction.zj(n,a)),b=e.fc.request(b),c&&d&&b.then(()=>d(!0)).catch(p=>d(!1,`${p}`))}
710
+ function oj(a,b,c){var d=olympe.dc.jh();if(c&&'function'===typeof b){const e=a.W();d.G.set(e,b);pj(d,a,(f,g)=>{f||(d.G.delete(e),b(f,g))},!1)}else pj(d,a,b,!1)}function qj(a){const b=olympe.dc.Request.C.Dk;a.fc.L(olympe.dc.Request.C.Gm,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Ob(d));a.F.cd(e);a.K.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.fc.L(b,c=>{c=c.content;rj(a,c.id,c.finalize,c.error)})}
711
+ function pj(a,b,c,d=!1){c=c?olympe.D.Oa().G(c):void 0;const e=b.W(),f=new olympe.dc.transaction.Es(a.db,a.T,e);b.C(f);if(f.kh())null==c||c(!0);else{a.C.set(e,[]);var g=fj(f);a.F.C.ub(g);var h=g.filter(m=>ej(f,m)),k=[jf(a.F,f.C,h),c];sj(a,f,h).then(m=>{k.splice(1,0,m);tj(a,e,g,f.F.size+1);return uj(a,f,d,b.ug())}).then(()=>{k.forEach(m=>null==m?void 0:m(!0,null));rj(a,e,olympe.dc.transaction.Df.C.$i,null)}).catch(m=>{a.K.error(m);k.forEach(n=>null==n?void 0:n(!1,m));vj(a,e)})}}
712
+ function sj(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Zc(n,olympe.dm.File)&&void 0!==(null==(p=d.Be(n))?void 0:p.Ma(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(null);const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],m=olympe.Y.Pd();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return new Promise((q,r)=>{m.F(p,t=>{if(null===t)m.T(p),q();else{var u=n.X(),
713
+ w,x=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';ie(a.Z,u,t,x,y=>{const z=h.reduce((A,J)=>A||J.Be(u),null);null!==z&&(y=(new Map).set(e,y).set(f,!0).set(g,new Date),z.Bl(y),k.push([u,y]));m.T(p);q()},r)}})});2048<p.length&&a.K.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.gd(q,r);return p},new olympe.dc.db.Lc);return jf(a.F,
714
+ n)})}function tj(a,b,c,d){const e=olympe.D.ff(),f=new olympe.async.ij(e);0<a.timeout&&mc(f,a.timeout);const g=olympe.dc.transaction.Df.C.qs;let h=!0;const k=a.C.get(b);for(let m=0;m<d;m++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});nc(f,(m,n)=>{m||a.K.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.F.C.Ob(c);vj(a,b)});f.start()}
715
+ function uj(a,b,c,d){const e=c?olympe.dc.Request.C.Yh:olympe.dc.Request.C.Xh;return Promise.all(Array.from(b.F).map(([f,g])=>a.fc.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.zj(g,d))))).then()}function rj(a,b,c,d){(a=(a=a.C.get(b))&&a.pop())&&a(c,d)}function vj(a,b){var c;null==(c=a.C.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Df.C.$i,null)});a.C.delete(b);if(0===a.C.size){for(const d of a.P)d();a.P=[]}a.G.has(b)&&(c=a.G.get(b),a.G.delete(b),c(!0))}
716
+ function wj(a,b){0<a.C.size?a.P.push(olympe.D.Oa().G(b)):b()}olympe.dc.transaction.Df=class{constructor(a,b,c,d,e,f){this.K=a;this.F=b;this.db=b.view;this.fc=c;this.T=d;this.Z=e;this.timeout=f;this.L=new Map;this.C=new Map;this.P=[];this.G=new Map;qj(this)}ab(){return this.K}};olympe.dc.transaction.Df.C={Zk:0,$i:1,qs:2};olympe.dc.transaction.zj=class{constructor(a,b=!1){this.C=a;this.F=b}ug(){return this.F}Xc(){return this.C}};olympe.dc.transaction.R={za:'dc.transaction.Logger',Fa:'dc.transaction.Manager'};olympe.dc.transaction.V={TIMEOUT:'dc.transaction.timeout',Fm:'dc.transaction.burstInterval'};
717
+ olympe.U.config(function(a){F(a,olympe.dc.transaction.V.TIMEOUT,6E4);F(a,olympe.dc.transaction.V.Fm,30);E(a,olympe.dc.transaction.R.za,[olympe.ka.R.Fa],b=>b.Gc('dc'));D(a,olympe.dc.transaction.R.Fa,olympe.dc.transaction.Df,olympe.dc.transaction.R.za,olympe.dc.db.R.Fa,olympe.dc.R.Qg,olympe.dc.sources.R.Ve,olympe.dc.R.Oi,new olympe.U.ma(olympe.dc.transaction.V.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.gb={};function xj(a){return olympe.dc.ja(a)}function yj(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.gb.Of=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.D.Qa(a);return void 0===a||null===a?null:olympe.D.cq(a)?a.valueOf():a}};olympe.dc.transaction.gb.Of.sa=[olympe.dc.vo];function Z(a,b,c){a.G.set(olympe.dc.ja(b),c);return a}
718
+ olympe.dc.transaction.gb.sk=class extends olympe.dc.transaction.gb.Of{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ja(b))?c:olympe.Y.af();this.model=olympe.dc.ja(a);this.source=null;this.G=new Map;this.F=!0}X(){return this.tag}Sb(){return this.model}persist(a){this.F=a;return this}oh(a){this.source=a;return this}C(a){const b=olympe.dc.ya(),c=this.Sb(),d=this.X();if(!c)throw Error('OperationError: Cannot create instance, model tag is undefined');if(b.Ua(d)&&!b.Kf(d)&&this.F){const e=
719
+ new Map([...b.Bb(d,!0),...yj(this,this.G)]);for(const f of e.values())if(f instanceof olympe.dc.lc&&!ej(a,f.X())){const g=new olympe.dc.Sa;g.vi(f.X());g.C(a)}a.Fc(d,c,this.F,this.source,e);for(const [f,g,h]of Lf(b,d))ej(a,h)&&(g===olympe.dc.va.ORIGIN?a.Ea(f,h,d):a.Ea(f,d,h))}else b.Ua(d)||a.Fc(d,c,this.F,this.source,yj(this,this.G))}toString(){return`CreateInstance(${this.Sb()}, ${this.X()})`}};olympe.dc.transaction.gb.sk.sa=[olympe.dc.oe];olympe.dc.transaction.gb.tk=class extends olympe.dc.transaction.gb.Of{constructor(a,b,c){super();this.relation=a instanceof olympe.dc.Ha.Relation?a:new olympe.dc.Ha.Relation(xj(a));this.origin=olympe.dc.ja(b);this.F=olympe.dc.ja(c)}getType(){return this.relation.X()}La(){return this.relation.La()}C(a){const b=this.relation.X();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.mc.md)throw Error('OperationError: Cannot create the instance -> model relation');
720
+ if(''===this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');if(''===this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.va.DESTINATION?a.Ea(b,this.origin,this.F):a.Ea(b,this.F,this.origin)}toString(){return`CreateRelation('${this.relation.La()}${this.relation.X()}, ${this.origin}, ${this.F})`}};olympe.dc.transaction.gb.Uw=class extends olympe.dc.transaction.gb.Of{constructor(a,b=olympe.dc.Mb.pc){super();this.model=a;this.cc=b}Sb(){return xj(this.model)}C(a){const b=this.Sb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.ya();for(const d of c.Sd(b))d!==b&&(new olympe.dc.transaction.gb.mn(d,this.cc)).C(a)}toString(){return`DeleteAllInstances(${this.Sb()}, ${this.cc})`}};olympe.dc.transaction.gb.ln=class extends olympe.dc.transaction.gb.Of{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ha.Relation?a:new olympe.dc.Ha.Relation(olympe.dc.ja(a));this.origin=olympe.dc.ja(b)}getType(){return xj(this.relation)}La(){return this.Qa(this.relation).La()}C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.md)throw Error('OperationError: Cannot delete the instance -> model relation');
721
+ const c=this.origin;if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');var d=olympe.dc.ya();const e=this.La();d=d.fb(c,this.relation);for(const f of d)e===olympe.dc.va.DESTINATION?a.Yb(b,c,f):a.Yb(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.gb.mn=class extends olympe.dc.transaction.gb.Of{constructor(a,b=olympe.dc.Mb.pc){super();this.tag=a;this.cc=b}X(){return xj(this.tag)}C(a){const b=olympe.dc.ya(),c=this.X();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');b.Ua(c)&&hj(a,c,this.cc)}toString(){return'DeleteInstance('+this.X()+', '+this.cc+')'}};olympe.dc.transaction.gb.Xq=class extends olympe.dc.transaction.gb.tk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.mc.md)throw Error('OperationError: Cannot delete the instance -> model relation');const c=this.origin;if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.F;if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
722
+ this.relation.La()===olympe.dc.va.DESTINATION?a.Yb(b,c,d):a.Yb(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.X()+', '+this.origin+', '+this.F+')'}};olympe.dc.transaction.gb.nt=class extends olympe.dc.transaction.gb.Of{constructor(a,b,c){super();this.tag=a;this.F=new Map;void 0!==b&&this.F.set(xj(b),c)}X(){return xj(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.ya();var d;if(!(null!=(d=a.C.Be(b))&&d.L()||c.Ua(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');d=yj(this,this.F);for(const [f,g]of d){var e=c.Ma(b,f);e instanceof
723
+ olympe.dc.lc&&hj(a,e.X(),olympe.dc.Mb.pc);g instanceof olympe.dc.lc&&!ej(a,g.X())&&(e=new olympe.dc.Sa,e.vi(g.X()),e.C(a))}a.gd(b,d)}toString(){return'UpdateInstance('+this.X()+', '+yj(this,this.F)+')'}};olympe.dc.ja=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Qa(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.X?b=a.X():'function'===typeof a&&(b=olympe.dc.la.Sb(a)));return b||''};B('olympe.dc.instanceToTag',olympe.dc.ja);olympe.dc.ya=function(){return olympe.dc.Ql().view};olympe.dc.register=function(a,b){olympe.dc.la.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.Ha.Property(a)};
724
+ olympe.dc.Mp=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ha.Relation(a,b):new olympe.dc.Ha.Relation(a,d,b,c)};olympe.dc.Lt=function(a){return a.Pb()};olympe.dc.Db={};olympe.dc.Db.Hl=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.rb(a):a instanceof olympe.D.Ja?a:null;olympe.dc.Db.El=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Hb(a):a instanceof olympe.D.ea?a:null;olympe.dc.Db.Gl=a=>'number'===typeof a||a instanceof Number?olympe.D.na(a):'string'===typeof a||a instanceof String?olympe.D.na(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
725
+ olympe.dc.Db.Fl=function(a){return'number'===typeof a||a instanceof Number?wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.Za(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.Za(a):a instanceof olympe.D.Za?a:null};olympe.dc.Db.Hp=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Ab(a.valueOf()):null};olympe.dc.Db.Ip=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.lc?ee(a):null;
726
+ olympe.dc.Db.gg=a=>a instanceof olympe.dc.lc?ee(a):a;olympe.dc.Db.FA=a=>{switch(typeof a){case 'boolean':return olympe.D.Hb(a);case 'number':return olympe.D.na(a);case 'string':return olympe.D.rb(a);case 'object':if(a instanceof Date)return olympe.D.Ev(a)}return a};
727
+ olympe.dc.Db.XA=a=>{switch(a){case olympe.D.ea:return olympe.dc.Db.El;case olympe.D.Ja:return olympe.dc.Db.Hl;case olympe.D.aa:return olympe.dc.Db.Gl;case olympe.D.Za:return olympe.dc.Db.Fl;case olympe.D.Color:return olympe.dc.Db.Hp;case olympe.dc.CloudObject:return olympe.dc.Db.Ip;default:return olympe.dc.Db.gg}};olympe.dc.jc={};olympe.dc.Ie=class{fa(){}L(){}G(){}P(){}ha(){}toString(){}};function zj(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Gb();return b}function Aj(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.W()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ka.ab('dc').warn(a))}
728
+ function Bj(a){const b=new olympe.D.Nb('listDef toObservable');return new rxjs.Observable(c=>{b.run(()=>{olympe.D.oc([a],d=>{c.next(d.valueOf())})});b.onDestroy(()=>{c.complete()});return()=>b.destroy()})}
729
+ olympe.dc.ta=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.ra([a],olympe.dc.ja,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||zj(this),this.C=null)}ge(){return olympe.dc.ge()}jb(){if(null===this.C){const a=olympe.dc.jc.Gu();this.C=Cj(a,this);null!==this.valueType&&this.C.ld(this.valueType);olympe.D.Oa().Z(()=>{var b=this.C.W();a.K.debug('QueryMGR: [ID:',
730
+ b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}Vb(){null===this.C&&this.jb();return this.C}ld(a){this.valueType=a;null!==this.C&&this.C.ld(this.valueType)}Gb(){return null!==this.C?this.C.Gb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Cd(){return this.F}Qk(){return this.da}ad(a,b){return this.Vb().ad(a,b)}Zj(a){this.Vb().Zj(a)}Gr(){return this.Vb().pd()}Fr(){return this.Vb().T()}get(a){return this.Vb().get(a)}hh(){return this.Vb().hh()}fh(a){const b=
731
+ this.Vb();Aj(b,'getCurrent');return b.fh(a)}has(a){return this.Vb().has(a)}tg(a){const b=this.Vb();Aj(b,'hasCurrent');return b.tg(a)}Od(a){return this.Vb().Od(a)}Fv(a){return Bj(this.Od(a))}Ae(a){const b=this.Vb();Aj(b,'getCurrentAt');return b.Ae(a)}Ce(a){return this.Vb().Ce(a)}bf(a){const b=this.Vb();Aj(b,'getCurrentKeyAt');return b.bf(a)}Ed(a){return this.Vb().Ed(a)}Kv(a){return Bj(this.Ed(a))}cf(a){const b=this.Vb();Aj(b,'getCurrentRank');return b.cf(a)}vc(){return this.Vb().vc()}Gv(){return Bj(this.vc())}df(){return this.Vb().df()}Oe(){return this.Vb().Oe()}Lv(){return Bj(this.Oe())}Jf(){const a=
732
+ this.Vb();Aj(a,'getCurrentSize');return a.Jf()}forEach(a,b){this.Vb().forEach(a,b)}Nd(a){const b=this.Vb();Aj(b,'forEachCurrentValue');return b.Nd(a)}fi(a,b,c,d){a=new olympe.dc.da.Lg(a,b);(new olympe.dc.ta(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
733
+ if(c instanceof olympe.dc.Ha.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ta(this.F,a);b.ld(zj(b)||this.valueType||Object);return b}dk(a){return this.transform(new olympe.dc.da.Xe(a))}filter(a){return this.transform(new olympe.dc.da.Me(a))}Hf(){const a=new olympe.dc.Yi(this.F,null===this.valueType?void 0:this.valueType);let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);
734
+ return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Qa(this.F)+a+')'}Er(){return this.Vb().Vf()}xc(){return olympe.D.ra([this.Oe()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ae(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.rb(b+']')},olympe.D.Ja)}};olympe.dc.ta.prototype.filter=olympe.dc.ta.prototype.filter;olympe.dc.ta.prototype.union=olympe.dc.ta.prototype.dk;olympe.dc.ta.prototype.transform=olympe.dc.ta.prototype.transform;
735
+ olympe.dc.ta.prototype.forEachCurrentValue=olympe.dc.ta.prototype.Nd;olympe.dc.ta.prototype.forEach=olympe.dc.ta.prototype.forEach;olympe.dc.ta.prototype.getCurrentSize=olympe.dc.ta.prototype.Jf;olympe.dc.ta.prototype.observeSize=olympe.dc.ta.prototype.Lv;olympe.dc.ta.prototype.observeFirst=olympe.dc.ta.prototype.Gv;olympe.dc.ta.prototype.getCurrentRank=olympe.dc.ta.prototype.cf;olympe.dc.ta.prototype.observeRank=olympe.dc.ta.prototype.Kv;olympe.dc.ta.prototype.getCurrentAt=olympe.dc.ta.prototype.Ae;
736
+ olympe.dc.ta.prototype.observeAt=olympe.dc.ta.prototype.Fv;olympe.dc.ta.prototype.offReady=olympe.dc.ta.prototype.Zj;olympe.dc.ta.prototype.onReady=olympe.dc.ta.prototype.ad;olympe.dc.ta.prototype.getBaseTag=olympe.dc.ta.prototype.Cd;olympe.dc.ta.sa=[olympe.D.Qc];l=olympe.dc.ta.prototype;l.ge.J=olympe.D.H.C;l.jb.J=olympe.D.H.L();l.Vb.J=new olympe.D.H(()=>olympe.dc.jc.Subscription,[]);l.ld.J=new olympe.D.H(()=>{},[]);l.Cd.J=new olympe.D.H(()=>String,[]);l.Qk.J=new olympe.D.H(()=>Array,[]);
737
+ l.ad.J=new olympe.D.H(()=>String,[]);l.Zj.J=new olympe.D.H(()=>{},[]);l.Gr.J=olympe.D.H.P;l.Fr.J=olympe.D.H.C;l.get.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.hh.J=new olympe.D.H(()=>Array,[]);l.fh.J=olympe.D.H.C;l.has.J=olympe.D.H.P;l.tg.J=olympe.D.H.C;l.Od.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.Ae.J=olympe.D.H.C;l.Ce.J=new olympe.D.H(()=>String,[]);l.bf.J=olympe.D.H.C;l.Ed.J=olympe.D.H.G;l.cf.J=olympe.D.H.C;
738
+ l.vc.J=new olympe.D.H(()=>olympe.dc.CloudObject,[],'valueType');l.df.J=new olympe.D.H(()=>String,[]);l.Oe.J=olympe.D.H.G;l.Jf.J=olympe.D.H.C;l.forEach.J=new olympe.D.H(()=>{},[]);l.Nd.J=olympe.D.H.C;l.fi.J=new olympe.D.H(()=>{},[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.dk.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.filter.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Hf.J=new olympe.D.H(()=>olympe.dc.Yi,[]);l.toString.J=olympe.D.H.C;l.Er.J=olympe.D.H.C;l.xc.J=olympe.D.H.F;const Dj={mw:'append',Ck:'filter_not',wn:'filter_and',xn:'filter_or'};function Ej(a,b){a=Fj(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Ta.Am(a,b)).F}
739
+ olympe.dc.Yi=class{constructor(a,b){this.C=Fj(a);this.K=olympe.ka.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.gb=[]}Qe(){return new olympe.dc.ta(this.C,this.da,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Gj('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ha.Property)throw new Gj('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.C)throw new Gj('transform',
740
+ 'one of the argument is not a Transformer '+d);const e=d.Gb();null!==e&&(this.valueType=e);this.da.push(d)}return this}dk(a){this.da.push(new olympe.dc.da.Xe(a));return this}jw(a){this.da.push(new olympe.dc.da.Xe(Fj(a)));return this}Ir(a){this.valueType=a;return this}lb(a){this.da.push(a);this.valueType=a.Gb()||olympe.dc.CloudObject;return this}Zt(a){for(const b of a)this.da.push(b),this.valueType=b.Gb()||olympe.dc.CloudObject;return this}Yt(a,b,c){a=new olympe.dc.da.ce(a,a.La(),b,c);this.da.push(a);
741
+ this.valueType=a.Gb()||olympe.dc.CloudObject;return this}Xt(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.La())}a=new olympe.dc.da.Zi(b,c);this.da.push(a);this.valueType=a.Gb()||olympe.dc.CloudObject;return this}Hr(){this.lb(olympe.dc.CloudObject.instancesRel);return this}ze(a){var b=this.gb.pop();b===Dj.Ck&&(a=new olympe.dc.$.$d(a),b=this.gb.pop());switch(b){case Dj.wn:b=this.da.pop().F;b instanceof olympe.dc.$.jd?(b=b.$,b.push(a),a=new olympe.dc.$.jd(...b)):
742
+ a=new olympe.dc.$.jd(b,a);b=this.gb.pop();break;case Dj.xn:b=this.da.pop().F,b instanceof olympe.dc.$.be?(b=b.$,b.push(a),a=new olympe.dc.$.be(...b)):a=new olympe.dc.$.be(b,a),b=this.gb.pop()}b===Dj.Ck&&(a=new olympe.dc.$.$d(a),this.gb.pop());this.da.push(new olympe.dc.da.Me(a));return this}Tt(a,b,c){return this.ze(new olympe.dc.$.Xd(Ej(a,c),new olympe.dc.Ta.le(b)))}contains(a,b,c=!1,d){return this.ze(new olympe.dc.$.Je(Ej(a,d),new olympe.dc.Ta.le(b),c))}Zc(a){if(!(a instanceof Array))throw new Gj('instanceOf',
743
+ 'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Fj(a[c]));return this.ze(new olympe.dc.$.Jh(b))}Uj(a){return this.ze(new olympe.dc.$.Xd(new olympe.dc.Ta.Zh,new olympe.dc.Ta.le(Fj(a))))}Ut(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.$c().Uj(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().$c().Uj(a[b])}return this}li(a,b){if(!(a instanceof Array))throw new Gj('hasRelated','Provided argument "relations" must be an array.');
744
+ const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.ze(new olympe.dc.$.Fh(c,d,b))}Tj(a,b,c){a=Ej(a,c);return this.ze(new olympe.dc.$.Ri(a,new olympe.dc.Ta.le(b)))}yi(a,b,c){a=Ej(a,c);return this.ze(new olympe.dc.$.vj(a,new olympe.dc.Ta.le(b)))}xv(a,b,c,d){a=Ej(a,d);return this.ze(new olympe.dc.$.Ue(a,b,c))}filter(a){const b=new class extends olympe.dc.$.Nf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.ze(b)}$c(){this.gb.push(Dj.Ck);return this}and(){this.da[this.da.length-
745
+ 1]instanceof olympe.dc.da.Me&&this.gb.push(Dj.wn);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.Me&&this.gb.push(Dj.xn);return this}ck(a,b,c){a=Fj(a);let d=null;switch(olympe.dc.ya().Tb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.N.X():d=new olympe.dc.bc.String(new olympe.dc.Ta.Wh(a,c));break;case olympe.dm.Number.N.X():d=new olympe.dc.bc.Number(new olympe.dc.Ta.Nh(a,c));break;case olympe.dm.DateTime.N.X():d=new olympe.dc.bc.DateTime(new olympe.dc.Ta.zh(a,c))}c=d;null!==
746
+ c&&this.da.push(new olympe.dc.da.dg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.bc.Nf{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.dg(d,c));return this}Pt(){this.da.push(new olympe.dc.da.Ah);return this}fm(a,b){this.da.push(new olympe.dc.da.Lg(a,b));return this}};class Gj extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
747
+ function Fj(a){return'string'===typeof a||a instanceof olympe.D.Ja?a:'function'===typeof a?olympe.dc.la.Sb(a):olympe.D.Ya(a)?a.Ej===olympe.D.Ja?a:olympe.D.ra([a],b=>olympe.D.rb(olympe.dc.ja(b)),olympe.D.Ja):a.X()}l=olympe.dc.Yi.prototype;l.Qe.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.transform.J=olympe.D.H.L();l.dk.J=olympe.D.H.L();l.jw.J=olympe.D.H.L();l.Ir.J=olympe.D.H.L();l.lb.J=olympe.D.H.L();l.Zt.J=olympe.D.H.L();l.Yt.J=olympe.D.H.L();l.Xt.J=olympe.D.H.L();l.Hr.J=olympe.D.H.L();l.ze.J=olympe.D.H.L();
748
+ l.Tt.J=olympe.D.H.L();l.contains.J=olympe.D.H.L();l.Zc.J=olympe.D.H.L();l.Uj.J=olympe.D.H.L();l.Ut.J=olympe.D.H.L();l.li.J=olympe.D.H.L();l.Tj.J=olympe.D.H.L();l.yi.J=olympe.D.H.L();l.xv.J=olympe.D.H.L();l.filter.J=olympe.D.H.L();l.$c.J=olympe.D.H.L();l.and.J=olympe.D.H.L();l.or.J=olympe.D.H.L();l.ck.J=olympe.D.H.L();l.sort.J=olympe.D.H.L();l.Pt.J=olympe.D.H.L();l.fm.J=olympe.D.H.L();function Cj(a,b){const c=b.Cd();var d=new olympe.dc.query.Cs;let e;e=c;olympe.D.Ya(e)&&(e=d.add(c));b=(b=b.Qk())?Array.isArray(b)?b:[b]:null;d=olympe.dc.jc.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.K.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.jc.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
749
+ function Hj(a,b){if(b.T())a.K.debug('ListProcessor: [ID:',b.W(),'] - Subscription already booted, ignoring');else{a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting subscription');var c=new olympe.dc.Ub.lp(a.db,a.K),d=b.W();olympe.D.oc([b.Cd()],e=>{const f=olympe.dc.ja(e);a.K.debug('ListProcessor: [ID:',b.W(),'] - Booting with baseTag',f);b.gi()||b.mi();je(a.db,f,Ij(a,b,c),d);olympe.D.Oa().Z(()=>ke(a.db,f,d));a.db.Ua(f.valueOf())||Jj(c);b.T()||(Jj(c),b.hc([]))})}}
750
+ function Kj(a,b,c,d){const e=[b.Cd()],f=k=>k instanceof olympe.dc.da.Xe;let g;const h=(null!=(g=b.rg())?g:[]).filter(f);for(const k of h){e.push(k.Cd());let m;h.push(...(null!=(m=k.rg())?m:[]).filter(f))}wj(a.P,()=>{olympe.D.oc(e,()=>{const k=b.we(c);Lj(a,k,b.W(),d)})})}
751
+ function Lj(a,b,c,d){a.K.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Oa(),f=new olympe.async.ij(e);b.forEach(g=>{f.add((h,k)=>{let m=!1;Pg(a.L,g,e,olympe.dc.Ra.SELF,olympe.dc.ua.Dc.Bg).subscribe(rxjs.Subscriber.create(()=>{m||(m=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.W()} has encountered an error: ${n}`))))})});nc(f,(g,h)=>d(h));f.start()}
752
+ function Ij(a,b,c){const d=new olympe.dc.Ub.Ei;let e=!1;const f=olympe.D.Oa(),g=b.rg(),h=[];h[g?g.length:0]=(k,m,n,p)=>{f.Ac()||f.mb()||(k?b.tg(n)?a.K.warn('Adding the same index twice (should never happen) for sub #',b.W(),', index #',n,', tag #',m):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Adding Instance',m,'to the subscription'),b.Ad(n,m)):(a.K.debug('ListProcessor: [ID:',b.W(),'] - Removing Instance',m,'from the subscription'),b.ki(n)),e||(Mj(c,()=>{p.Ef();Jj(c)}),f.run(()=>p.ge().Mf(b.hc.bind(b))),
753
+ e=!0),Nj(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,m)=>{const n=b.W();c.register(n,null);const p=d.C(k,m,n,null);if(null!==p)h[0](k,m,n,Oj(p,k,m,n))}}
754
+ olympe.dc.jc.hs=class{constructor(a,b,c,d,e){this.K=a;this.db=b;this.F=e;this.P=c;this.L=d;this.C=new Map;this.G=new olympe.D.Nb('Legacy ListDef processor')}process(a){const b=a.W();var c=this.C.get(b);c||(c=new olympe.dc.jc.Zs(a),this.C.set(b,c));c.counter++;Pj(c)?this.K.debug('ListProcessor: [ID:',b,'] - id already processed'):(this.K.debug('ListProcessor: [ID:',b,'] - NOT processed yet.'),c=a.If(),this.F&&c===olympe.dc.Ra.SERVER||c===olympe.dc.Ra.SELF?(this.K.debug('QueryMGR: [ID:',b,'] - Local subscription, no need for coverage check, booting subscription '),
755
+ Hj(this,a)):Kj(this,a,c,d=>{d?this.K.error(d):Hj(this,a)}))}};function Qj(a){return olympe.D.Ya(a)?'Node#'+a.Aa.W():String(a)}function Rj(a,b){return olympe.D.Ya(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
756
+ olympe.dc.query.Cs=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.Ya(a)?'n'+a.Aa.W():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Da=class{fa(){}C(){}F(){}ha(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.D.Di{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Nb('context subscription '+b,e));this.id=b;this.hd=c;this.da=d||null;this.G=this.P.run(()=>olympe.D.Fd(olympe.dc.jc.Subscription.C.INIT));this.Xb=!1;this.ba=this.Wb=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.kb(e)}catch(f){e=olympe.Y.ic()}return e}W(){return this.id}Cd(){return this.hd}rg(){return this.da}If(){const b=
757
+ olympe.dc.ie(),c=olympe.D.Qa(this.Cd());let d;return olympe.dc.CloudObject.instancesRel.Pa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):he(b,c)}gi(){const b=olympe.D.Qa(this.G);return b&&b.valueOf()>=olympe.dc.jc.Subscription.C.ep}mi(){if(this.G.Aa.mb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Wb;this.Wb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);tb(this.G,olympe.D.Fd(olympe.dc.jc.Subscription.C.ep))}pd(){return olympe.D.ra([this.G],
758
+ ()=>{},olympe.D.ea)}T(){const b=this.G.Aa.xb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.C.Sh}ad(b,c){this.T()?b(this):(null===this.ba&&(this.ba=new Map),void 0===c&&(c=olympe.Y.ic()),this.ba.set(c,olympe.D.Oa().G(b)));return c||''}Zj(b){null!==this.ba&&b&&this.ba.delete(b)}Ob(){const b=olympe.dc.jc.Subscription.C.Sh;if(!this.G.Aa.mb()&&olympe.D.Qa(this.G)!==b&&(this.Ze(),tb(this.G,b),null!==this.ba)){for(const c of this.ba.values())c(this);this.ba=null}}onDestroy(b){this.P.onDestroy(b)}release(){this.P.destroy()}hc(b){if(!this.G.Aa.mb()){for(let c=
759
+ 0,d=b.length;c<d;c++)this.yl(b[c],c);if(this.T())this.Ze();else{this.Xb=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Ob()}}}Ad(b,c){if(!this.G.Aa.mb()&&(this.Gj(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Xb&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Ob()}}ki(b){this.G.Aa.mb()||(this.xl(b),
760
+ this.bi(b,!this.T()))}Vf(){return this.T()?super.Vf():'Subscription is not ready!'}we(b){const c=olympe.D.Qa(this.Cd());return olympe.dc.jc.Subscription.F(c,b,this.rg())}static F(b,c,d){var e=olympe.dc.ua.from(b,c).Ld();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.re){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.lb(h,!0))}else if(e instanceof olympe.dc.da.ce){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.hg(h,!0,!0))}else if(e instanceof
761
+ olympe.dc.da.Xe)e=a.F(olympe.D.Qa(e.Cd()),c,e.rg()),b.push(...e);else if(e instanceof olympe.dc.da.Me||e instanceof olympe.dc.da.dg){const h=e.G();b=b.map(k=>{for(const m of h){for(const n of m)k=n.recursive?k.hg(n,!0,!0):k.lb(n,!0);k=k.back(m.length)}return k})}return b}};olympe.dc.jc.Subscription.C={INIT:0,ep:1,Sh:2};olympe.dc.jc.Subscription.prototype.Vf.J=olympe.D.H.C;function Pj(a){const b=a.F;a.F=!0;return b}olympe.dc.jc.Zs=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.We=class{fa(){}Gb(){}C(){}ha(){}toString(){}};olympe.dc.Eo=class{G(){}};olympe.dc.Bj=class{fa(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.bc={};let Sj=0;olympe.dc.bc.Nf=class{constructor(){this.id=Sj++}fa(){return'CustomLocalComparator#'+Sj}P(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.fa()}"}`}toString(){return this.fa()+'()'}};olympe.dc.bc.Nf.sa=[olympe.dc.Ie];olympe.dc.bc.DateTime=class{constructor(a){this.C=a}fa(){return T(olympe.dc.bc.DateTime)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ha(a){return'{"c":"'+this.fa()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};S('olympe.dc.comparators.DateTime',olympe.dc.bc.DateTime);olympe.dc.bc.DateTime.sa=[olympe.dc.Ie];olympe.dc.bc.Number=class{constructor(a){this.C=a}fa(){return T(olympe.dc.bc.Number)}P(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.fa()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};S('olympe.dc.comparators.Number',olympe.dc.bc.Number);olympe.dc.bc.Number.sa=[olympe.dc.Ie];olympe.dc.bc.String=class{constructor(a){this.C=a}fa(){return T(olympe.dc.bc.String)}P(){return this.C.C()}L(a,b){return olympe.D.ra([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Ja)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.fa()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};S('olympe.dc.comparators.String',olympe.dc.bc.String);olympe.dc.bc.String.sa=[olympe.dc.Ie];olympe.dc.$={};let Tj=0;olympe.dc.$.Nf=class{constructor(){this.id=Tj++}fa(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.fa()}"}`}toString(){return this.fa()+'()'}};olympe.dc.$.Nf.sa=[olympe.dc.Da];olympe.dc.$.ik=class{constructor(a,b){this.G=a;this.L=b}fa(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.ra([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Hb(this.P('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.ea))}P(){}ha(a){return'{"c":"'+this.fa()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return this.fa().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};
762
+ olympe.dc.$.ik.sa=[olympe.dc.Da];olympe.dc.$.jd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}fa(){return T(olympe.dc.$.jd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ra(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Hb(c.every(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.fa()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
763
+ a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.$.jd);olympe.dc.$.jd.sa=[olympe.dc.Da];olympe.dc.$.pk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.ra([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Hb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}fa(){return T(olympe.dc.$.pk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();return'{"c":"'+this.fa()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.Ya(this.G)?this.G.Aa.xb.valueOf():this.G.valueOf();
764
+ return this.fa().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.$.pk);olympe.dc.$.pk.sa=[olympe.dc.Da];olympe.dc.$.Je=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}fa(){return T(olympe.dc.$.Je)}F(){return[this.source.C(),this.value.C()]}Lb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.ra([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Hb(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Rj(a,this.G);
765
+ return'{"c":"'+this.fa()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Qj(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.$.Je);olympe.dc.$.Je.sa=[olympe.dc.Da];olympe.dc.$.Xd=class{constructor(a,b){this.G=a;this.L=b}fa(){return T(olympe.dc.$.Xd)}F(){return[this.G.C(),this.L.C()]}C(a,b){return a.run(()=>olympe.D.ra([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.vd?c.vd(d):'object'===typeof d&&void 0!==d.vd?d.vd(c):olympe.D.Hb(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.fa()+'","a":['+this.G.ha(a)+','+this.L.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
766
+ ')'}};S('olympe.dc.predicates.Equals',olympe.dc.$.Xd);olympe.dc.$.Xd.sa=[olympe.dc.Da];olympe.dc.$.Zq=class extends olympe.dc.$.Xd{constructor(a,b){super(a,new olympe.dc.Ta.le(b))}};olympe.dc.$.Zq.sa=[olympe.dc.Da];olympe.dc.$.Ri=class extends olympe.dc.$.ik{constructor(a,b){super(a,b)}fa(){return T(olympe.dc.$.Ri)}P(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.$.Ri);olympe.dc.$.Fh=class{constructor(a,b,c){this.G=[];this.L=c instanceof Array?c:void 0!==c?[olympe.dc.ja(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.ce?this.G.push(new Uj(c.X(),c.La(),c.G,c.F)):this.G.push(new Uj(olympe.dc.ja(c),b[d],1,1))}fa(){return T(olympe.dc.$.Fh)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.Y.ic(),e=olympe.dc.ya();let f=0;a=(h,k)=>{0!==this.L.length&&!this.L.includes(k)||
767
+ c.getContext().mb()||c.getContext().Ac()||(f+=h?1:-1,c.update(0<f))};const g=this.G;for(let h=g.length-1;0<=h;h--)a=Vj(g[h],e,a,d+h);je(e,b,a,d);c.getContext().onDestroy(()=>{ke(e,b,d)});return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(0!==this.L.length?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.L.length?'#'+this.L.toString()+', ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelated',olympe.dc.$.Fh);
768
+ function Vj(a,b,c,d){const e=Object.create(null);d+=olympe.Y.ig();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var m=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},m)):(delete e[h],b.F(h,a,m))}};return(g,h)=>f(g,h,0)}class Uj extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.La()}, ${this.F}, ${this.C}`}}olympe.dc.$.Fh.sa=[olympe.dc.Da];olympe.dc.$.Lk=class{constructor(a,b,c){this.G=[];this.L=void 0!==c?c.map(olympe.dc.ja):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.ce?this.G.push(new Wj(c.X(),c.La(),c.G,c.F)):this.G.push(new Wj(olympe.dc.ja(c),b[d],1,1))}fa(){return T(olympe.dc.$.Lk)}F(){return[this.G.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(Boolean),!1)),d=olympe.dc.ya(),e=olympe.Y.ig();let f=(k,m,n)=>{m&&(null===this.L||this.L.includes(n))&&k(1)};
769
+ const g=this.G;for(let k=g.length-1;0<=k;k--)f=Xj(g[k],d,f,e+k);let h=0;je(d,b,f.bind(null,k=>{c.getContext().Ac()||c.getContext().mb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>ke(d,b,e));return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(this.G.map(a=>a.ha()))+(null!==this.L?',"'+this.L.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.L?'#['+this.L.toString()+'], ':'')+this.G.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.Lk);
770
+ function Xj(a,b,c,d){const e=a.G,f=a.P,g=new Set,h=(m,n,p)=>{f.has(n)?f.get(n).set(d+p,m):f.set(n,(new Map).set(d+p,m))},k=(m,n,p,q,r)=>{const t=olympe.Y.ig();if(q){const u=p+r,w=x=>{const y=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==y&&null!==y&&(g.add(u),e.set(r,(e.get(r)||0)+x),Array.from(y.values()).forEach(z=>z(x)));g.delete(u)};h(m,r,p);e.has(r)?m(e.get(r)):(n>=a.F&&c(x=>
771
+ {e.set(r,(e.get(r)||0)+x);m(x)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else m(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(m,n,p)=>k(m,0,'origin',n,p)}class Wj extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.P=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.La()}, ${this.F}, ${this.C}`}}olympe.dc.$.Lk.sa=[olympe.dc.Da];olympe.dc.$.Jh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ja(b))}):this.G.add(olympe.dc.ja(a))}fa(){return T(olympe.dc.$.Jh)}F(){return[]}C(a,b){const c=a.run(()=>ub(olympe.D.ec(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.ya();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ja(olympe.dc.CloudObject))c.update(olympe.D.Hb(this.G.has(k))),f();else{for(const m of e)if(m.tag===k)throw Error(`You should never extend a model to itself (${k})`);
772
+ this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new Yj(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new Yj(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.vb()}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Yj{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.ig()}}
773
+ S('olympe.dc.predicates.InstanceOf',olympe.dc.$.Jh);olympe.dc.$.Jh.sa=[olympe.dc.Da];olympe.dc.$.$d=class{constructor(a){this.G=a}fa(){return T(olympe.dc.$.$d)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.ra([this.G.C(a,b)],c=>olympe.D.Hb(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.fa()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};S('olympe.dc.predicates.Not',olympe.dc.$.$d);olympe.dc.$.$d.sa=[olympe.dc.Da];olympe.dc.$.be=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}fa(){return T(olympe.dc.$.be)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ra(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Hb(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.fa()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
774
+ ')'}};S('olympe.dc.predicates.Or',olympe.dc.$.be);olympe.dc.$.be.sa=[olympe.dc.Da];olympe.dc.$.Ue=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}fa(){return T(olympe.dc.$.Ue)}F(){return[this.source.C()]}Lb(){return this.source}C(a,b){return a.run(()=>olympe.D.ra([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Hb((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=Rj(a,this.L);a=Rj(a,this.G);return'{"c":"'+this.fa()+'","a":['+b+','+c+','+a+
775
+ ']}'}toString(){const a=Qj(this.G);return'Regex('+this.source.toString()+','+this.L+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.$.Ue);olympe.dc.$.Ue.sa=[olympe.dc.Da];olympe.dc.$.vj=class extends olympe.dc.$.ik{constructor(a,b){super(a,b)}fa(){return T(olympe.dc.$.vj)}P(a,b){return a<b}};S('olympe.dc.predicates.Smaller',olympe.dc.$.vj);olympe.dc.Ub={};olympe.dc.Ub.Ei=class{constructor(){this.ba=this.L=this.T=this.F=null}P(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.Ub.Ni(this),this.T=c,this.L=b):this.L=this.T=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.ba){const a=[];null!==
776
+ this.L&&(0<=this.F?Zj(ak(this.L,this.F),a):a.push(this.T));this.ba(a)}}Mf(a){this.ba=a}};olympe.dc.Ub.Ei.sa=[olympe.dc.Ub.Ca];function Oj(a,b,c,d){b?a.P[d]=c:delete a.P[d];null===a.F&&(a.F=new olympe.dc.Ub.Ni(a.C,a));return a.F}function ak(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Zj(a,b){a=a.P;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.Ub.Ni=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.P=Object.create(null);this.F=null}ge(){return this.C}Ef(){this.C.P()?this.C.G():this.C.Z(this.depth-1)}};class bk extends olympe.dc.Ub.Ni{constructor(a,b,c){super(a);this.T=b;this.tag=c;this.ba=this.Z=this.L=!1;this.G=null}}
777
+ function ck(a,b,c,d,e){const f=Object.create(null),g=a.qa,h=a.L;let k,m,n;a.ga=!0;m=0;for(n=g.length;m<n;m++)f[g[m]]=null;g.length=0;m=c;for(n=Math.min(b.length,d);m<n;m++)k=b[m],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.T,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.T,c)),c.Z&&(c.G=null,delete h[k]),delete f[k]);a.ga=!1;null!==a.F&&a.G()}
778
+ olympe.dc.Ub.Wk=class{constructor(){this.L={};this.qa=[];this.F=null;this.ga=!1;this.T=[];this.ba=null}P(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ga){var a=this.qa,b=a.length,c=this.L,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.T);else{if(!e.ba){var f=e,g=this.F;f.ba=!0;f.G=ak(f,
779
+ g)}null!==e.G&&Zj(e.G,this.T)}}this.ba&&this.ba(this.T)}}Mf(a){this.ba=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new bk(this,c,b),this.L[c]=d):(d.tag=b,d.Z=!1):void 0!==d&&(d.Z=!0);return d}};olympe.dc.Ub.Wk.sa=[olympe.dc.Ub.Ca];olympe.dc.Ub.Ca=class{constructor(){}C(){}P(){}Z(){}G(){}Mf(){}};function dk(a,b){olympe.D.kf(a.value)?(a.node=olympe.D.im(a.value,b),bb(a.node)||b()):b()}function ek(a,b){if(olympe.D.kf(a.value)){const c=olympe.D.Oa(),d=a.L;olympe.D.oc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>dk(a,b)),olympe.D.Oa().destroy())})}}
780
+ class fk extends olympe.dc.Ub.Ni{constructor(a,b,c){super(a);this.Z=b;this.value=c;this.L=this.Qa();this.position=this.node=null;this.T=!1;this.G=null}Qa(){const a=olympe.D.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}mb(){return null===this.value}}
781
+ function gk(a,b){if(!b.mb()){var c=a.F;var d=a.qa,e=b.Qa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Qa();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
782
+ function hk(a){const b=a.qa;a.F.sort((c,d)=>b(c.Qa(),d.Qa()))}
783
+ olympe.dc.Ub.kp=class{constructor(a){this.qa=a;this.L=null;this.F=[];this.T=[];this.ba=null;this.ga=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new fk(this,c,d),this.ga.set(b,f),this.P()?dk(f,()=>gk(this,f)):(f.position=e.length,e.push(f));else{f=this.ga.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ga.delete(b);null!==f.position&&(this.P()?this.remove(f):delete e[f.position]);f.destroy()}return f}P(){return null!==this.L}Z(a){if(null!==this.L)throw Error('Manager already activated (depth='+
784
+ this.L+')');this.L=a;hk(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;ek(d,()=>gk(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.L;b.T=!0;b.G=ak(b,c)}0>this.L?this.T.push(e.Z):e.G&&Zj(e.G,this.T)}this.ba&&this.ba(this.T)}Mf(a){this.ba=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
785
+ a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.Ub.kp.sa=[olympe.dc.Ub.Ca];function Jj(a){if(!a.F){for(let b in a.G)ik(a.G[b]);a.F=!0}a.L=null;a.P=null}function Mj(a,b,c){a.G[c||'root'].T=b}function Nj(a,b,c){a.G[c||'root'].Ef(b)}function jk(a,b,c,d){const e=a.P,f=b+d+c;let g=e[f];void 0===g&&(g=Nf(a.db,b,c,d),e[f]=g);return g}function kk(a,b){a.F||a.C.Ef(b)}function lk(a,b,c,d,e){if(!a.F){let f=jk(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=jk(a,c,d,olympe.dc.va.ORIGIN));0===f&&kk(a,b)}}
786
+ function mk(a,b){const c=a.G[b];void 0!==c?(a.K&&a.K.debug('Set current block to',b,null!==c.G?'parent = '+c.G.W():''),a.C=c):a.K&&a.K.error('Try to set a block that does not exists:',b)}function nk(a){const b=String(++a.T),c=a.C;a.G[b]=new ok(b,c);pk(c,b);c.L||(c.L=()=>mk(a,c.W()));return b}function qk(a,b){const c=a.C;a.C.L=()=>{mk(a,c.W());b()}}function rk(a,b){ik(b?a.G[b]:a.C)}
787
+ olympe.dc.Ub.lp=class{constructor(a,b){this.db=a;this.K=b||null;this.L=Object.create(null);this.P=Object.create(null);this.F=!1;this.T=0;this.C=new ok('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=jk(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function pk(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function ik(a){a.P=!0;null!==a.G&&a.G.notify(a.id)}
788
+ class ok{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.L=this.F=null;this.P=!1}W(){return this.id}Ef(a){const b=this.T;if(this.P||this.C===a||null===a)b&&b(),!b&&ik(this)}notify(a){const b=this.L,c=this.F;if(this.P)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Ta={};function sk(a,b,c,d){const e=olympe.dc.ya(),f=new olympe.dc.Ub.Ei,g=new olympe.dc.Ub.lp(e);let h=!1;const k=Object.create(null),m=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.Ac()||a.mb()||(h||(Mj(g,()=>{u.Ef();Jj(g)}),u.ge().Mf(m),h=!0),q?k[t]=r:delete k[t],Nj(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.ic();je(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Oj(t,q,b,p))},p);a.onDestroy(()=>{ke(e,b,p)});e.Ua(b)||Jj(g)}
789
+ function tk(a,b,c){const d=c.getContext(),e=olympe.dc.ya(),f=a.G(),g=yf(e,b,a.L,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>zf(e,b,a.L,g))}
790
+ olympe.dc.Ta.sh=class{constructor(a,b,c){this.L=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.re||d instanceof olympe.dc.da.ce)||null;this.F=c||null;this.defaultValue=null}fa(){}Gb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}yg(a){this.defaultValue=a;return this}rg(){return this.da}Cd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Gb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&ub(c,this.defaultValue);
791
+ b=this.F||b;null!==this.da?sk(a,b,this.da,d=>{tk(this,d,c)}):tk(this,b,c);return c.vb()}ha(a){const b=Rj(a,this.L),c=Rj(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.fa()}","a":["${b}",${d},${c}]}`}toString(){const a=Qj(this.L),b=this.F?','+Qj(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.fa().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Ta.sh.sa=[olympe.dc.Bj];olympe.dc.Ta.Am=class{constructor(a,b){if(olympe.D.kf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ya();const e=d.Tb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.og(e,olympe.dc.CloudObject.extendRel,olympe.dm.qe);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.N.X():d=new olympe.dc.Ta.Wh(c,b);break;case olympe.dm.Number.N.X():d=new olympe.dc.Ta.Nh(c,
792
+ b);break;case olympe.dm.Boolean.N.X():d=new olympe.dc.Ta.Hi(c,b);break;case olympe.dm.DateTime.N.X():d=new olympe.dc.Ta.zh(c,b)}this.F=d}fa(){return this.F.fa()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Ta.Am.sa=[olympe.dc.Bj];olympe.dc.Ta.Hi=class extends olympe.dc.Ta.sh{constructor(a,b,c){super(a,b,c)}fa(){return T(olympe.dc.Ta.Hi)}G(){return olympe.dc.Db.El}Gb(){return olympe.D.ea}};S('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Ta.Hi);olympe.dc.Ta.le=class{constructor(a){this.value=a}fa(){return T(olympe.dc.Ta.le)}C(){return[]}getValue(){return this.value}ha(a){a=Rj(a,this.value);return`{"c":"${this.fa()}","a":[${a}]}`}toString(){return`Constant(${Qj(this.value)})`}};S('olympe.dc.valuedefs.Constant',olympe.dc.Ta.le);olympe.dc.Ta.le.sa=[olympe.dc.Bj];olympe.dc.Ta.zh=class extends olympe.dc.Ta.sh{constructor(a,b,c){super(a,b,c)}fa(){return T(olympe.dc.Ta.zh)}G(){return olympe.dc.Db.Fl}Gb(){return olympe.D.Za}};S('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Ta.zh);olympe.dc.Ta.Nh=class extends olympe.dc.Ta.sh{constructor(a,b,c){super(a,b,c)}fa(){return T(olympe.dc.Ta.Nh)}G(){return olympe.dc.Db.Gl}Gb(){return olympe.D.aa}};S('olympe.dc.valuedefs.NumberProperty',olympe.dc.Ta.Nh);olympe.dc.Ta.Wh=class extends olympe.dc.Ta.sh{constructor(a,b,c){super(a,b,c)}fa(){return T(olympe.dc.Ta.Wh)}G(){return olympe.dc.Db.Hl}Gb(){return olympe.D.Ja}};S('olympe.dc.valuedefs.StringProperty',olympe.dc.Ta.Wh);olympe.dc.Ta.Zh=class{fa(){return T(olympe.dc.Ta.Zh)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.fa()+'","a":[]}'}toString(){return'Tag()'}};S('olympe.dc.valuedefs.Tag',olympe.dc.Ta.Zh);olympe.dc.Ta.Zh.sa=[olympe.dc.Bj];olympe.dc.da={};olympe.dc.da.Ah=class{Gb(){return null}fa(){return T(olympe.dc.da.Ah)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Oj(h,!0,f,f))):(d[f]++,kk(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Oj(h,!1,f,f)))}}ha(){return'{"c":"'+this.fa()+'"}'}toString(){return'Distinct()'}};S('olympe.dc.transformers.Distinct',olympe.dc.da.Ah);olympe.dc.da.Ah.sa=[olympe.dc.We];olympe.dc.da.Me=class{constructor(a){this.F=a}Gb(){return null}fa(){return T(olympe.dc.da.Me)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&kk(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Oj(h,k,f,g)))}const e={};return(f,g,h,k)=>{const m='@'+h;if(f){let n=this.F.C(a,g);olympe.D.Ya(n)&&(n=n.Aa);olympe.D.jf(n)?(b.F||void 0!==olympe.D.Qa(n)||kk(b,h),e[m]=n,a.run(()=>{olympe.D.oc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[m]&&(e[m].destroy(),delete e[m]),
793
+ d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.fa()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.da.Me);olympe.dc.da.Me.sa=[olympe.dc.We,olympe.dc.Eo];olympe.dc.da.Ek=class{constructor(a,b,c,d){this.F=new olympe.dc.Ha.Relation(olympe.dc.ja(a),c||olympe.dc.va.DESTINATION);this.G=new olympe.dc.Ha.Relation(olympe.dc.ja(b),d||olympe.dc.va.DESTINATION)}Gb(){return Ae(this.F)}fa(){return T(olympe.dc.da.Ek)}C(a,b,c){const d=olympe.dc.ya(),e={},f=this.F.X(),g=this.F.La(),h=this.G.X(),k=this.G.La();let m=null,n=null;const p=(r,t,u,w,x,y)=>{if(x){if(x=()=>{const z=olympe.Y.kb(u+g+(f+'_'+r)+y,20),A=Oj(t,!0,y,z);m=r;n=()=>{c(!1,y,z,Oj(t,!1,y,z))};b.register(z,
794
+ u,w,f,g);c(!0,y,z,A)},x.$p=r,e[w]=x,null===m||r<m)n&&n(),x()}else if(m===r){n();e[w]=!0;x=Infinity;let z=null;for(let A=Object.keys(e),J=A.length,M=0;M<J;M++){let La=e[A[M]];La.$p<x&&(x=La.$p,z=La)}z&&z()}},q=(r,t,u,w,x)=>{w?e[x]||(e[x]=!0,lk(b,u,x,f,g),lk(b,u,x,h,k),W(d,x,this.F,p.bind(this,r,t,u,x),u+'_val'),W(d,x,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(x,this.G,u+'_follow'),d.F(x,this.F,u+'_val'),delete e[x])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.fa()+'","a":["'+this.F.toString()+
795
+ '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.da.Ek);olympe.dc.da.Ek.sa=[olympe.dc.We];olympe.dc.da.Lg=class{constructor(a,b){this.start=a;this.F=b}Gb(){return null}fa(){return T(olympe.dc.da.Lg)}C(a,b,c){const d=new olympe.dc.Ub.Wk;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);ck(d,e,f,n,c)}};a.run(()=>olympe.D.oc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));qk(b,k);const m=nk(b);mk(b,m);return(n,p,q,r)=>{h||(r.ge().Mf(t=>{e=t;rk(b,m)}),Mj(b,()=>r.Ef(),m),h=!0);d.C(n,p,q,null);Nj(b,q,m)}}ha(a){return'{"c":"'+
796
+ this.fa()+'","a":['+Rj(a,this.start)+','+Rj(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Qa(this.start)},${olympe.D.Qa(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.da.Lg);olympe.dc.da.Lg.sa=[olympe.dc.We];function uk(a){return a.F.map(b=>b.X())}
797
+ olympe.dc.da.Zi=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.F=a.map(c=>new olympe.dc.Ha.Relation(c,this.direction))}Gb(){return olympe.dc.CloudObject}fa(){return T(olympe.dc.da.Zi)}La(){return this.direction}C(a,b,c){const d=olympe.dc.ya(),e=(f,g,h,k)=>W(d,f,k,(m,n)=>{var p=k.La();var q=k.X();p=olympe.Y.kb(g+p+q+n,20);q=Oj(h,m,n,p);m&&b.register(p,g,f,k.X(),k.La());c(m,n,p,q)},g);return(f,g,h,k)=>{f?this.F.forEach(m=>{lk(b,h,g,m.X(),m.La());e(g,h,k,m)}):this.F.forEach(m=>
798
+ {d.F(g,m,h)})}}ha(){return'{"c":"'+this.fa()+'","a":['+JSON.stringify(uk(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+uk(this).join(',')+'])'}};S('olympe.dc.transformers.MultiRelated',olympe.dc.da.Zi);olympe.dc.da.Zi.sa=[olympe.dc.We];olympe.dc.da.ce=class extends olympe.dc.Ha.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Gb(){return Ae(this)}fa(){return T(olympe.dc.da.ce)}C(a,b,c){const d=olympe.dc.ya(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.La(),m=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.fb(r,this);p+=1;for(let u=0,w=t.length;u<w;u++){if(void 0!==e[t[u]]||r===t[u])continue;const x=olympe.Y.kb(q+k+(h+'_'+p)+t[u],20);b.register(x,
799
+ q,r,h,k||g);null===k&&b.register(x,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&m(p,t,w);p>=this.G?c(u,w,t,Oj(r,u,w,t)):lk(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(x,y)=>{const z=p+1,A=olympe.Y.kb(t+k+(h+'_'+z)+y,20);n(z,w,r,A,x,y)},t)):(d.F(w,this,t),delete e[w]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.fa()+'","a":["'+this.X()+'","'+this.La()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.La()+this.X()+'['+this.G+'..'+this.F+'])'}};
800
+ S('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.ce);olympe.dc.da.ce.sa=[olympe.dc.We];olympe.dc.da.re=class extends olympe.dc.Ha.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Gb(){return Ae(this)}fa(){return T(olympe.dc.da.re)}Pb(){return new olympe.dc.da.re(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}C(a,b,c){const d=olympe.dc.ya(),e=this.X(),f=this.La();return(g,h,k,m)=>{lk(b,k,h,e,f);g?W(d,h,this,(n,p)=>{const q=olympe.Y.kb(k+f+e+p,20),r=Oj(m,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
801
+ this.fa()+'","a":["'+this.X()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.X()+')'}};S('olympe.dc.transformers.Related',olympe.dc.da.re);olympe.dc.da.re.sa=[olympe.dc.We];olympe.dc.da.dg=class{constructor(a,b){this.yb=a;this.F=void 0===b?!0:!!b}Gb(){return null}fa(){return T(olympe.dc.da.dg)}lg(){return this.yb}G(){return[this.yb.P()]}C(a,b,c){const d=new olympe.dc.Ub.kp(a.G(this.F?this.yb.G.bind(this.yb):(e,f)=>this.yb.G(f,e)));return(e,f,g)=>{var h=e?this.yb.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.fa()+'","a":['+this.yb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.yb.toString()+','+JSON.stringify(this.F)+')'}};
802
+ S('olympe.dc.transformers.Sort',olympe.dc.da.dg);olympe.dc.da.dg.sa=[olympe.dc.We,olympe.dc.Eo];function vk(a,b,c,d,e,f){function g(n,p){if(m)for(var q=m.length-1;0<=q;q--)f=m[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Oj(q,n,p,h))}const h=olympe.Y.ic(),k=olympe.dc.ya(),m=a.da;b.run(()=>olympe.D.oc([a.F],n=>{wk(k,n,g,h);void 0===k.model(n)&&Jj(e)}))}function wk(a,b,c,d){const e=b&&b.valueOf();e&&(je(a,e,c,d),olympe.D.Oa().Z(()=>ke(a,e,d)))}
803
+ olympe.dc.da.Xe=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.ta?(this.F=a.Cd(),this.da=a.Qk()):(this.F=a,b&&(this.da=b))}Gb(){return null}fa(){return T(olympe.dc.da.Xe)||''}rg(){return this.da}Cd(){return this.F}C(a,b,c){const d=new olympe.dc.Ub.Wk,e=new olympe.dc.Ub.Ei;let f=[],g=[],h=!1,k=!1;const m=nk(b),n=nk(b);qk(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):rk(b);ck(d,p,0,p.length,c)});mk(b,n);vk(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Oa();u.Ac()||
804
+ u.mb()||(k||(t.ge().Mf(w=>{g=w;rk(b,n)}),Mj(b,()=>t.Ef(),n),k=!0),d.C(p,q,r),Nj(b,r,n))});mk(b,m);return(p,q,r,t)=>{h||(t.ge().Mf(u=>{f=u;rk(b,m)}),Mj(b,()=>t.Ef(),m),h=!0);d.C(p,q,r,m);Nj(b,r,m)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.fa()+'","a":['+Rj(a,this.F)+','+b+']}'}toString(){const a=olympe.D.Ya(this.F)?'N:'+this.F.Aa.W():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
805
+ S('olympe.dc.transformers.Union',olympe.dc.da.Xe);olympe.dc.da.Xe.sa=[olympe.dc.We];olympe.dc.da.To={Ix:1,qr:-1,nr:0};olympe.dc.da.iz={nw:!0,Nw:!1};olympe.dc.jc.R={Yn:'dc.legacy.listdefProcessor'};olympe.U.config(a=>{D(a,olympe.dc.jc.R.Yn,olympe.dc.jc.hs,olympe.dc.query.R.za,olympe.dc.R.Ke,olympe.dc.transaction.R.Fa,olympe.dc.query.R.lj,new olympe.U.ma(olympe.dc.V.Sg))});olympe.U.run([olympe.dc.jc.R.Yn],a=>{olympe.dc.jc.Gu=()=>a});function xk(a){const b=olympe.dc.ya(),c=new Map;b.Up(a).forEach(d=>{b.fb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
806
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ya();this.model=null}static Fc(a,b,c,...d){b=olympe.dc.ja(b);var e=ne.get(b)||null;(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){var b=olympe.dc.Vp();a=olympe.dc.ja(a);var c=me(b,b.db.model(a));null===c&&b.K.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
804
807
  This could lead to unwanted behaviour and must be fixed.
805
- For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`);c=c?c.instantiate(a,b.F):new olympe.dc.CloudObject(void 0,a);Object.defineProperty(c,'tag',{value:a,writable:!1});b.C.C.ub([a]);b.Ha.register(c,a);return c}static exists(a){return olympe.dc.Aa().Ua(olympe.dc.ja(a))}static Kp(a,b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.Aa();
806
- let e=null;const f=h=>{null===e&&(e=vk(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Ua(olympe.dc.ja(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Ra(!1);c=a.create(null!=b?b:this,g,c);a.ib().catch(h=>olympe.ka.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Et(){return this.get(this)}static Sj(a){return olympe.dc.ua.Sj(a)}static Bb(){return olympe.dc.Aa().fb(this,olympe.dc.CloudObject.propertyRel).map(a=>
807
- new olympe.dc.Ha.Property(a))}static he(){const a=olympe.dc.Aa();return a.fb(this,olympe.dc.CloudObject.ni).map(b=>new olympe.dc.Ha.Relation(b)).concat(a.fb(this,olympe.dc.CloudObject.Op).map(b=>new olympe.dc.Ha.Relation(b,olympe.dc.va.ORIGIN)))}static Ae(a){return olympe.dc.CloudObject.get(a)}static Cu(a){var b=le(olympe.dc.Vp(),olympe.dc.ja(a));b=b&&b.F;return new olympe.dc.ta(olympe.dc.ja(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}fa(){return this.qb(olympe.dc.CloudObject.nameProp)}Dd(){this.model||
808
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ua.from(this)}Jf(){return this.db.Jf(this)}Lb(){return this.db.source(this)}Du(){return this.db.Tj(this)?olympe.dc.ie().fromModel(this):null}Tp(){return olympe.D.ra([this.fa()],a=>olympe.D.rb(a),olympe.D.Ja,'getDisplayName',olympe.D.rb('('+this.toString()+')'))}Rb(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
809
- {const f=this.db.Ma(this.tag,b);c||null!==f||e.next(f);const g=wf(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.Z(()=>{e.complete();xf(this.db,this.tag,b,g)});return()=>xf(this.db,this.tag,b,g)})}Jv(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=yf(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ha.Property(e),null]):c.next([new olympe.dc.Ha.Property(e),f])});b.Z(()=>{c.complete();zf(this.db,this.tag,d)});return()=>zf(this.db,
810
- this.tag,d)})}Kv(a){return this.observe(olympe.D.Oa(),a)}get(a){return this.db.Ma(this.tag,a)}Ma(a){return this.get(a)}lb(a){return olympe.dc.ua.from(this).lb(a)}Ej(a){return olympe.dc.Lc.from(this).lb(a)}ku(){return this.Zb(olympe.dc.CloudObject.It,olympe.dc.CloudObject)}Pl(){return this.fb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}ff(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=wf(this.db,this.tag,a,olympe.D.Oa().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():
811
- d.update(f)}));d.getContext().onDestroy(()=>xf(this.db,this.tag,a,e));return d.getContext()}qb(a){return N(this.ff(a,olympe.dc.Db.Hl,olympe.D.Ja))}Ec(a){return N(this.ff(a,olympe.dc.Db.Gl,olympe.D.aa))}fh(a){return N(this.ff(a,olympe.dc.Db.El,olympe.D.ea))}gi(a){return N(this.ff(a,olympe.dc.Db.Fl,olympe.D.Za))}Yp(){return N(this.ff(olympe.dm.Color.valueProp,olympe.dc.Db.Hp,olympe.D.Color))}Zp(){return N(this.ff(olympe.sc.workflow.Transition.processRefProp,olympe.dc.Db.Ip,olympe.dc.CloudObject))}fb(a,
812
- b){a=a instanceof olympe.dc.da.qe?a:new olympe.dc.da.qe(a.X(),a.La());return new olympe.dc.ta(this.X(),a,b)}Zb(a,b){return this.fb(a,b).vc()}Rp(a,b){const c=this.db,d=olympe.Y.hc(),e=olympe.D.Oa(),f=new Map;W(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}gw(){return new olympe.dc.ta(this.X(),[],xe(this.X()))}transform(...a){return(new olympe.dc.ta(this.X(),[],this.constructor)).transform(...a)}wc(){return this.Tp()}toString(){if(!this.db.Ua(this.tag))return`unknown object #${this.tag||
813
- 'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Ua(this.tag))return{CloudObject:'Unknown tag'};const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}Ac(a=!1,b=!0){const c={};this.db.Bb(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.kc?
814
- de(d):d});return c}Qa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():!1}ud(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.Qa(b)),olympe.D.ea)}Ot(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ra,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of Jf(b,this))f===d?a.Xb(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.Xb(e,this,g);a.delete(this,olympe.dc.Jb.NONE);c&&a.ib()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Qa;
815
- olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Ac;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Ej;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.lb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ma;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Kv;
816
- olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Jv;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Rb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.Lb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Jf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;
817
- olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Dd;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Cu;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Ae;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.he;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Bb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Sj;
818
- olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Et;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Kp;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.N=olympe.dc.la.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.tB=olympe.dc.CloudObject.N.ia(olympe.dc.Tn.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.N.ia('ff023000000000000011');
819
- B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.eB=olympe.dc.CloudObject.N.ia('ff023000000000000012');olympe.dc.CloudObject.ni=olympe.dc.CloudObject.N.oa('ff02200000000000000a');olympe.dc.CloudObject.Op=olympe.dc.CloudObject.N.oa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.MA=olympe.dc.CloudObject.N.oa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.DA=olympe.dc.CloudObject.N.oa('017ea013caf8e89cedb2');
820
- olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.N.oa('ff02200000000000000c');B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.N.oa('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.N.oa(olympe.dc.lc.hd);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=T(olympe.dc.CloudObject.N,olympe.dc.CloudObject.modelRel);
821
- B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.N.oa(olympe.dc.lc.yh);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=T(olympe.dc.CloudObject.N,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.N.oa(olympe.dc.lc.Fi);
822
- B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.It=T(olympe.dc.CloudObject.N,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Nt=olympe.dc.CloudObject.N.oa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Nt);olympe.dc.lz=olympe.dc.CloudObject;olympe.dc.CloudObject.sa=[olympe.dc.ne];l=olympe.dc.CloudObject.prototype;l.X.J=new olympe.D.H(()=>String,[]);l.name.J=new olympe.D.H(()=>String,[]);l.fa.J=olympe.D.H.F;
823
- l.Dd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Lb.J=new olympe.D.H(()=>String,[]);l.Du.J=new olympe.D.H(()=>String,[]);l.Tp.J=olympe.D.H.F;l.Rb.J=new olympe.D.H(()=>String,[]);l.ku.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Pl.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.ff.J=new olympe.D.H(()=>olympe.D.Node,[]);l.qb.J=olympe.D.H.F;l.Ec.J=olympe.D.H.G;l.fh.J=olympe.D.H.O;l.gi.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Yp.J=new olympe.D.H(()=>olympe.D.Color,[]);
824
- l.Zp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.fb.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Zb.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Rp.J=new olympe.D.H(()=>Function,[]);l.gw.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.wc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Qa.J=olympe.D.H.C;l.ud.J=olympe.D.H.O;l.Ot.J=new olympe.D.H(()=>{},[]);olympe.dc.R={Je:'dc.DBView',Qn:'dc.InstanceManager',ya:'dc.Logger',et:'dc.TransactionLogger',Ki:'dc.FileServiceManager',Ng:'dc.Router'};olympe.dc.V={cg:'dc.tag',Ro:'dc.routing',qf:'dc.debug',Pg:'dc.subscribeAll',uk:'dc.defaultSource',vn:'dc.fileCache',sn:'dc.errorOnAbstractInstantiation'};
825
- olympe.U.config(function(a){F(a,olympe.dc.V.qf,!1);F(a,olympe.dc.V.Ro,{});F(a,olympe.dc.V.Pg,!1);F(a,olympe.dc.V.uk,olympe.dc.Pa.SERVER);F(a,olympe.dc.V.vn,!0);F(a,olympe.dc.V.sn,!0);F(a,olympe.dc.V.cg,olympe.Y.hc());E(a,olympe.dc.R.ya,[olympe.ka.R.Fa],b=>b.Dc('dc'));ua(a,olympe.dc.R.et,olympe.dc.transaction.R.ya);ua(a,olympe.dc.R.Je,olympe.dc.db.R.sk);D(a,olympe.dc.R.Ki,olympe.dc.dr,olympe.dc.R.ya,olympe.dc.R.Je,olympe.net.R.Fa,olympe.dc.R.Ng,olympe.Y.R.Ag,new olympe.U.ma(olympe.dc.V.vn));D(a,olympe.dc.R.Ng,
826
- olympe.dc.Ph,olympe.dc.R.ya,olympe.auth.R.Fa,olympe.dc.sources.R.No,olympe.dc.sources.R.$o,olympe.dc.R.Je,olympe.host.R.Qe,new olympe.U.ma(olympe.dc.V.cg),new olympe.U.ma(olympe.dc.V.Ro));D(a,olympe.dc.R.Qn,olympe.dc.xr,olympe.dc.db.R.Dk,olympe.dc.db.R.Fa,olympe.U.R.Of)},'olympe.dc');
827
- olympe.U.run([olympe.dc.db.R.Fa,olympe.dc.transaction.R.Fa,olympe.dc.R.Qn,olympe.dc.R.Ki,new olympe.U.ma(olympe.dc.V.cg)],(a,b,c,d,e)=>{olympe.dc.Ql=()=>a;olympe.dc.gh=()=>b;olympe.dc.Vp=()=>c;olympe.dc.$A=()=>d;olympe.dc.Pa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.ek={NONE:0,Sw:1,Sq:2,Tw:4,Pw:8,Rw:16,Qw:31,ty:32,py:64,uy:128,qy:256,ys:512,sy:992,Kx:1023};olympe.dm.kd=class extends olympe.dc.CloudObject{fa(){return this.qb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Ja.EMPTY}F(){return olympe.D.ea.C}};olympe.dm.kd.N=olympe.dc.la.C('ff021000000000000002',olympe.dm.kd);olympe.dm.kd.O=olympe.dm.kd.N.ia('ff023000000000000035');olympe.dm.kd.C=olympe.dm.kd.N.oa('ff022000000000000005');olympe.dm.kd.G=we('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.kd.K=we('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
828
- olympe.dm.kd.F=we('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.kd.prototype.fa.J=olympe.D.H.F;olympe.dm.kd.prototype.C.J=olympe.D.H.F;olympe.dm.kd.prototype.F.J=olympe.D.H.O;olympe.dm.User=class extends olympe.dc.CloudObject{xu(){return this.Tl()}fa(){return this.Tl()}Tl(){return this.qb(olympe.dm.User.loginProp)}Kr(){return this.qb(olympe.dm.User.F)}Jr(){return olympe.D.Ja.EMPTY}Wu(){return this.qb(olympe.dm.User.saltProp)}hv(){return this.qb(olympe.dm.User.verifierProp)}Uu(){return this.fb(olympe.dm.User.G,olympe.dm.kd)}};olympe.dm.User.N=olympe.dc.la.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.N.ia('ff023000000000000001');
829
- B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.N.ia('ff023000000000000002');olympe.dm.User.O=olympe.dm.User.N.ia('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.N.ia('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.N.ia('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.K=olympe.dm.User.N.ia('ff023000000000000020');
830
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.N.ia('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.N,olympe.dm.kd.C);olympe.dm.User.T=olympe.dm.User.N.oa('ff022000000000000002');olympe.dm.User.C=we('0163d9653067b6237f62','GUEST_USER');l=olympe.dm.User.prototype;l.xu.J=olympe.D.H.F;l.fa.J=olympe.D.H.F;l.Tl.J=olympe.D.H.F;l.Kr.J=olympe.D.H.F;l.Jr.J=olympe.D.H.F;l.Wu.J=olympe.D.H.F;l.hv.J=olympe.D.H.F;
831
- l.Uu.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tf=class extends olympe.dc.CloudObject{T(){return this.Pl()}nb(){return this.qb(olympe.dm.tf.Va)}};olympe.dm.tf.N=olympe.dc.la.C('01621fb84e3300000000',olympe.dm.tf);olympe.dm.tf.Va=olympe.dm.tf.N.ia('01609de3f292e3c2c6ff');olympe.dm.tf.prototype.T.J=new olympe.D.H(()=>olympe.D.Oc,[]);olympe.dm.tf.prototype.nb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.tf{jv(){return this.qb(olympe.dm.BrickMetadata.Cb)}qd(){return this.qb(olympe.dm.BrickMetadata.qa)}Td(){return null}hu(){return this.fb(olympe.sc.Eb.Comment.C.Pb(),olympe.sc.Eb.Comment)}Mj(){return this.Ej(olympe.dm.BrickMetadata.ga).Bd().Mj()}};olympe.dm.BrickMetadata.N=Be(olympe.dc.la.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Cb=olympe.dm.BrickMetadata.N.ia('01621fb84e320000f001');olympe.dm.BrickMetadata.qa=olympe.dm.BrickMetadata.N.ia('01703376c4a81c0e9d94');
832
- olympe.dm.BrickMetadata.ga=olympe.dm.BrickMetadata.N.oa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.qc={Dy:'private',Ey:'public'};olympe.dm.BrickMetadata.Ob=we('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.mc={$w:'experimental',Ry:'stable',Nw:'deprecated'};l=olympe.dm.BrickMetadata.prototype;l.jv.J=olympe.D.H.F;l.qd.J=olympe.D.H.F;l.Td.J=new olympe.D.H(()=>String,[]);l.hu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Mj.J=olympe.D.H.T;function Yh(a,b){const c=(...d)=>d.reduce((e,f)=>e.lb(f),a.query()).Ld().ig(olympe.dc.CloudObject.extendRel,!0).lb(olympe.dc.CloudObject.ni,!0).lb(olympe.dm.Relation.destinationModelRel).back(2).lb(olympe.dc.CloudObject.propertyRel,!0).lb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([c(olympe.dm.xd.F.Pb(),olympe.dm.xd.C),c(olympe.dm.tb.G.Pb(),olympe.sc.Gc.C.Pb())]).pipe(rxjs.operators.map(([d,...e])=>d.concat(...e)))}
833
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.fc=c}W(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Pa.SERVER:this.tag}Qd(a){let b,c,d;return null!=(d=null!=(c=null!=(b=olympe.U.getParameter(`${'data'}.${this.name().toLowerCase().replace(/\W/g,'_')}.${a}`))?b:olympe.U.getParameter(`${'data'}.${this.X()}.${a}`))?c:olympe.U.getParameter(`${'data'}.${a}`))?d:null}qd(){const a=this;return v(function*(){const b=olympe.dm.DataSource.bc.Vq,c=olympe.dm.DataSource.bc.Fb,
834
- d=new olympe.dc.Request(olympe.dc.Request.C.bc,a.W());return a.fc.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ka.ab('dc').warn(`Source ${a.name()} (${a.W()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.P.errors.pp?b:c)})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.wd.Nl(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');
808
+ For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`);c=c?c.instantiate(a,b.F):new olympe.dc.CloudObject(void 0,a);Object.defineProperty(c,'tag',{value:a,writable:!1});b.C.C.ub([a]);b.Ha.register(c,a);return c}static exists(a){return olympe.dc.ya().Ua(olympe.dc.ja(a))}static Kp(a,b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.ya();
809
+ let e=null;const f=h=>{null===e&&(e=xk(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Ua(olympe.dc.ja(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Sa(!1);c=a.create(null!=b?b:this,g,c);a.jb().catch(h=>olympe.ka.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Dt(){return this.get(this)}static Vj(a){return olympe.dc.ua.Vj(a)}static Bb(){return olympe.dc.ya().fb(this,olympe.dc.CloudObject.propertyRel).map(a=>
810
+ new olympe.dc.Ha.Property(a))}static he(){const a=olympe.dc.ya();return a.fb(this,olympe.dc.CloudObject.si).map(b=>new olympe.dc.Ha.Relation(b)).concat(a.fb(this,olympe.dc.CloudObject.Op).map(b=>new olympe.dc.Ha.Relation(b,olympe.dc.va.ORIGIN)))}static Be(a){return olympe.dc.CloudObject.get(a)}static Bu(a){var b=me(olympe.dc.Vp(),olympe.dc.ja(a));b=b&&b.F;return new olympe.dc.ta(olympe.dc.ja(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}fa(){return this.qb(olympe.dc.CloudObject.nameProp)}Dd(){this.model||
811
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ua.from(this)}Kf(){return this.db.Kf(this)}Lb(){return this.db.source(this)}Cu(){return this.db.oi(this)?olympe.dc.ie().fromModel(this):null}Tp(){return olympe.D.ra([this.fa()],a=>olympe.D.rb(a),olympe.D.Ja,'getDisplayName',olympe.D.rb('('+this.toString()+')'))}Sb(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
812
+ {const f=this.db.Ma(this.tag,b);c||null!==f||e.next(f);const g=yf(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.Z(()=>{e.complete();zf(this.db,this.tag,b,g)});return()=>zf(this.db,this.tag,b,g)})}Iv(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=Af(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ha.Property(e),null]):c.next([new olympe.dc.Ha.Property(e),f])});b.Z(()=>{c.complete();Bf(this.db,this.tag,d)});return()=>Bf(this.db,
813
+ this.tag,d)})}Jv(a){return this.observe(olympe.D.Oa(),a)}get(a){return this.db.Ma(this.tag,a)}Ma(a){return this.get(a)}lb(a){return olympe.dc.ua.from(this).lb(a)}Ij(a){return olympe.dc.Nc.from(this).lb(a)}ju(){return this.Zb(olympe.dc.CloudObject.Ht,olympe.dc.CloudObject)}Pl(){return this.fb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}gf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=yf(this.db,this.tag,a,olympe.D.Oa().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():
814
+ d.update(f)}));d.getContext().onDestroy(()=>zf(this.db,this.tag,a,e));return d.getContext()}qb(a){return N(this.gf(a,olympe.dc.Db.Hl,olympe.D.Ja))}Hc(a){return N(this.gf(a,olympe.dc.Db.Gl,olympe.D.aa))}ih(a){return N(this.gf(a,olympe.dc.Db.El,olympe.D.ea))}ji(a){return N(this.gf(a,olympe.dc.Db.Fl,olympe.D.Za))}Yp(){return N(this.gf(olympe.dm.Color.valueProp,olympe.dc.Db.Hp,olympe.D.Color))}Zp(){return N(this.gf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.Db.Ip,olympe.dc.CloudObject))}fb(a,
815
+ b){a=a instanceof olympe.dc.da.re?a:new olympe.dc.da.re(a.X(),a.La());return new olympe.dc.ta(this.X(),a,b)}Zb(a,b){return this.fb(a,b).vc()}Rp(a,b){const c=this.db,d=olympe.Y.ic(),e=olympe.D.Oa(),f=new Map;W(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}fw(){return new olympe.dc.ta(this.X(),[],ye(this.X()))}transform(...a){return(new olympe.dc.ta(this.X(),[],this.constructor)).transform(...a)}xc(){return this.Tp()}toString(){if(!this.db.Ua(this.tag))return`unknown object #${this.tag||
816
+ 'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Ua(this.tag))return{CloudObject:'Unknown tag'};const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}Bc(a=!1,b=!0){const c={};this.db.Bb(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d instanceof olympe.dc.lc?
817
+ ee(d):d});return c}Pa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():!1}vd(a){return olympe.D.ra([a],b=>olympe.D.Hb(this.Pa(b)),olympe.D.ea)}Nt(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Sa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of Lf(b,this))f===d?a.Yb(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.Yb(e,this,g);a.delete(this,olympe.dc.Mb.NONE);c&&a.jb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Pa;
818
+ olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Bc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Ij;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.lb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ma;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Jv;
819
+ olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Iv;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Sb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.Lb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Kf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;
820
+ olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Dd;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Bu;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Be;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.he;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Bb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Vj;
821
+ olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Dt;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Kp;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.N=olympe.dc.la.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.sB=olympe.dc.CloudObject.N.ia(olympe.dc.Tn.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.N.ia('ff023000000000000011');
822
+ B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.dB=olympe.dc.CloudObject.N.ia('ff023000000000000012');olympe.dc.CloudObject.si=olympe.dc.CloudObject.N.oa('ff02200000000000000a');olympe.dc.CloudObject.Op=olympe.dc.CloudObject.N.oa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.LA=olympe.dc.CloudObject.N.oa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.CA=olympe.dc.CloudObject.N.oa('017ea013caf8e89cedb2');
823
+ olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.N.oa('ff02200000000000000c');B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.N.oa('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.N.oa(olympe.dc.mc.md);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.modelRel);
824
+ B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.N.oa(olympe.dc.mc.Bh);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.N.oa(olympe.dc.mc.Ji);
825
+ B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ht=U(olympe.dc.CloudObject.N,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Mt=olympe.dc.CloudObject.N.oa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Mt);olympe.dc.kz=olympe.dc.CloudObject;olympe.dc.CloudObject.sa=[olympe.dc.oe];l=olympe.dc.CloudObject.prototype;l.X.J=new olympe.D.H(()=>String,[]);l.name.J=new olympe.D.H(()=>String,[]);l.fa.J=olympe.D.H.F;
826
+ l.Dd.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Lb.J=new olympe.D.H(()=>String,[]);l.Cu.J=new olympe.D.H(()=>String,[]);l.Tp.J=olympe.D.H.F;l.Sb.J=new olympe.D.H(()=>String,[]);l.ju.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Pl.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.gf.J=new olympe.D.H(()=>olympe.D.Node,[]);l.qb.J=olympe.D.H.F;l.Hc.J=olympe.D.H.G;l.ih.J=olympe.D.H.P;l.ji.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Yp.J=new olympe.D.H(()=>olympe.D.Color,[]);
827
+ l.Zp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.fb.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Zb.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Rp.J=new olympe.D.H(()=>Function,[]);l.fw.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.transform.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.xc.J=olympe.D.H.F;l.toString.J=olympe.D.H.C;l.Pa.J=olympe.D.H.C;l.vd.J=olympe.D.H.P;l.Nt.J=new olympe.D.H(()=>{},[]);olympe.dc.R={Ke:'dc.DBView',Qn:'dc.InstanceManager',za:'dc.Logger',dt:'dc.TransactionLogger',Oi:'dc.FileServiceManager',Qg:'dc.Router'};olympe.dc.V={bg:'dc.tag',Ro:'dc.routing',qf:'dc.debug',Sg:'dc.subscribeAll',wk:'dc.defaultSource',vn:'dc.fileCache',sn:'dc.errorOnAbstractInstantiation'};
828
+ olympe.U.config(function(a){F(a,olympe.dc.V.qf,!1);F(a,olympe.dc.V.Ro,{});F(a,olympe.dc.V.Sg,!1);F(a,olympe.dc.V.wk,olympe.dc.Ra.SERVER);F(a,olympe.dc.V.vn,!0);F(a,olympe.dc.V.sn,!0);F(a,olympe.dc.V.bg,olympe.Y.ic());E(a,olympe.dc.R.za,[olympe.ka.R.Fa],b=>b.Gc('dc'));ua(a,olympe.dc.R.dt,olympe.dc.transaction.R.za);ua(a,olympe.dc.R.Ke,olympe.dc.db.R.uk);D(a,olympe.dc.R.Oi,olympe.dc.dr,olympe.dc.R.za,olympe.dc.R.Ke,olympe.net.R.Fa,olympe.dc.R.Qg,olympe.Y.R.Ag,new olympe.U.ma(olympe.dc.V.vn));D(a,olympe.dc.R.Qg,
829
+ olympe.dc.Th,olympe.dc.R.za,olympe.auth.R.Fa,olympe.dc.sources.R.No,olympe.dc.sources.R.$o,olympe.dc.R.Ke,olympe.host.R.Se,new olympe.U.ma(olympe.dc.V.bg),new olympe.U.ma(olympe.dc.V.Ro));D(a,olympe.dc.R.Qn,olympe.dc.xr,olympe.dc.db.R.Fk,olympe.dc.db.R.Fa,olympe.U.R.Pf)},'olympe.dc');
830
+ olympe.U.run([olympe.dc.db.R.Fa,olympe.dc.transaction.R.Fa,olympe.dc.R.Qn,olympe.dc.R.Oi,new olympe.U.ma(olympe.dc.V.bg)],(a,b,c,d,e)=>{olympe.dc.Ql=()=>a;olympe.dc.jh=()=>b;olympe.dc.Vp=()=>c;olympe.dc.ZA=()=>d;olympe.dc.Ra.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.gk={NONE:0,Rw:1,Sq:2,Sw:4,Ow:8,Qw:16,Pw:31,sy:32,oy:64,ty:128,py:256,xs:512,qy:992,Jx:1023};olympe.dm.od=class extends olympe.dc.CloudObject{fa(){return this.qb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Ja.EMPTY}F(){return olympe.D.ea.C}};olympe.dm.od.N=olympe.dc.la.C('ff021000000000000002',olympe.dm.od);olympe.dm.od.P=olympe.dm.od.N.ia('ff023000000000000035');olympe.dm.od.C=olympe.dm.od.N.oa('ff022000000000000005');olympe.dm.od.G=xe('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.od.L=xe('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
831
+ olympe.dm.od.F=xe('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.od.prototype.fa.J=olympe.D.H.F;olympe.dm.od.prototype.C.J=olympe.D.H.F;olympe.dm.od.prototype.F.J=olympe.D.H.P;olympe.dm.User=class extends olympe.dc.CloudObject{wu(){return this.Tl()}fa(){return this.Tl()}Tl(){return this.qb(olympe.dm.User.loginProp)}Kr(){return this.qb(olympe.dm.User.F)}Jr(){return olympe.D.Ja.EMPTY}Vu(){return this.qb(olympe.dm.User.saltProp)}gv(){return this.qb(olympe.dm.User.verifierProp)}Tu(){return this.fb(olympe.dm.User.G,olympe.dm.od)}};olympe.dm.User.N=olympe.dc.la.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.N.ia('ff023000000000000001');
832
+ B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.N.ia('ff023000000000000002');olympe.dm.User.P=olympe.dm.User.N.ia('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.N.ia('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.N.ia('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.L=olympe.dm.User.N.ia('ff023000000000000020');
833
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.N.ia('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=U(olympe.dm.User.N,olympe.dm.od.C);olympe.dm.User.T=olympe.dm.User.N.oa('ff022000000000000002');olympe.dm.User.C=xe('0163d9653067b6237f62','GUEST_USER');l=olympe.dm.User.prototype;l.wu.J=olympe.D.H.F;l.fa.J=olympe.D.H.F;l.Tl.J=olympe.D.H.F;l.Kr.J=olympe.D.H.F;l.Jr.J=olympe.D.H.F;l.Vu.J=olympe.D.H.F;l.gv.J=olympe.D.H.F;
834
+ l.Tu.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tf=class extends olympe.dc.CloudObject{T(){return this.Pl()}nb(){return this.qb(olympe.dm.tf.Wa)}};olympe.dm.tf.N=olympe.dc.la.C('01621fb84e3300000000',olympe.dm.tf);olympe.dm.tf.Wa=olympe.dm.tf.N.ia('01609de3f292e3c2c6ff');olympe.dm.tf.prototype.T.J=new olympe.D.H(()=>olympe.D.Qc,[]);olympe.dm.tf.prototype.nb.J=olympe.D.H.F;olympe.dm.BrickMetadata=class extends olympe.dm.tf{hv(){return this.qb(olympe.dm.BrickMetadata.Cb)}sd(){return this.qb(olympe.dm.BrickMetadata.qa)}Td(){return null}gu(){return this.fb(olympe.sc.Eb.Comment.C.Pb(),olympe.sc.Eb.Comment)}Qj(){return this.Ij(olympe.dm.BrickMetadata.ga).Bd().Qj()}};olympe.dm.BrickMetadata.N=Ce(olympe.dc.la.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Cb=olympe.dm.BrickMetadata.N.ia('01621fb84e320000f001');olympe.dm.BrickMetadata.qa=olympe.dm.BrickMetadata.N.ia('01703376c4a81c0e9d94');
835
+ olympe.dm.BrickMetadata.ga=olympe.dm.BrickMetadata.N.oa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.hc={Cy:'private',Dy:'public'};olympe.dm.BrickMetadata.Ob=xe('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.nc={Zw:'experimental',Qy:'stable',Mw:'deprecated'};l=olympe.dm.BrickMetadata.prototype;l.hv.J=olympe.D.H.F;l.sd.J=olympe.D.H.F;l.Td.J=new olympe.D.H(()=>String,[]);l.gu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Qj.J=olympe.D.H.T;function $h(a,b){const c=(...d)=>d.reduce((e,f)=>e.lb(f),a.query()).Ld().hg(olympe.dc.CloudObject.extendRel,!0).lb(olympe.dc.CloudObject.si,!0).lb(olympe.dm.Relation.destinationModelRel).back(2).lb(olympe.dc.CloudObject.propertyRel,!0).lb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([c(olympe.dm.yd.F.Pb(),olympe.dm.yd.C),c(olympe.dm.tb.G.Pb(),olympe.sc.Jc.C.Pb())]).pipe(rxjs.operators.map(([d,...e])=>d.concat(...e)))}
836
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.fc=c}W(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ra.SERVER:this.tag}Qd(a){let b,c,d;return null!=(d=null!=(c=null!=(b=olympe.U.getParameter(`${'data'}.${this.name().toLowerCase().replace(/\W/g,'_')}.${a}`))?b:olympe.U.getParameter(`${'data'}.${this.X()}.${a}`))?c:olympe.U.getParameter(`${'data'}.${a}`))?d:null}sd(){const a=this;return v(function*(){const b=olympe.dm.DataSource.ac.Vq,c=olympe.dm.DataSource.ac.Fb,
837
+ d=new olympe.dc.Request(olympe.dc.Request.C.ac,a.W());return a.fc.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ka.ab('dc').warn(`Source ${a.name()} (${a.W()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.O.errors.pp?b:c)})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.xd.Nl(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');
835
838
  })}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');})}deleteFileContent(){return v(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;
836
839
  olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Qd;
837
- olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.W;olympe.dm.DataSource.N=olympe.dc.la.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Ng);olympe.dm.DataSource.Wg=olympe.dm.DataSource.N.ia('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Wg);olympe.dm.DataSource.JA=olympe.dm.DataSource.N.ia('ff023000000000000061');olympe.dm.DataSource.nB=olympe.dm.DataSource.N.ia('ff023000000000000062');olympe.dm.DataSource.hq=olympe.dm.DataSource.N.ia('ff023000000000000063');
838
- olympe.dm.DataSource.Pp=olympe.dm.DataSource.N.ia('ff023000000000000064');olympe.dm.DataSource.oi=olympe.dm.DataSource.N.oa('ff022000000000000060');olympe.dm.DataSource.SERVER=we('00000000000000000060','Server source');olympe.dm.DataSource.bc={Oh:'ready',Fb:'error',Vq:'down'};olympe.dm.xd=class extends olympe.dc.CloudObject{};olympe.dm.xd.N=olympe.dc.la.C('ff021000000000000070',olympe.dm.xd);olympe.dm.xd.F=olympe.dm.xd.N.oa('ff023000000000000071');olympe.dm.xd.C=olympe.dm.xd.N.oa('ff023000000000000072');olympe.dm.xd.G=olympe.dm.xd.N.oa('ff023000000000000073');olympe.dm.Ab=class extends olympe.dm.BrickMetadata{K(){return new olympe.dc.ta(this.X(),[new olympe.dc.da.ce(olympe.dm.Ab.F.X(),olympe.dc.va.DESTINATION,olympe.dc.da.To.nr,olympe.dc.da.To.qr),olympe.dm.Ab.C])}Td(){return null}C(){return this.fb(olympe.dm.Ab.F,olympe.dm.Ab)}O(){return this.fb(olympe.dm.Ab.C)}};olympe.dm.Ab.N=olympe.dc.la.C('01612df1db9749227626',olympe.dm.Ab);olympe.dm.Ab.F=olympe.dm.Ab.N.oa('016a697ef00ce7554691');olympe.dm.Ab.Ba=T(olympe.dm.Ab.N,olympe.dm.Ab.F);olympe.dm.Ab.C=olympe.dm.Ab.N.oa('016a697ef00ce7554692');
839
- T(olympe.dc.CloudObject.N,olympe.dm.Ab.C);olympe.dm.Ab.prototype.K.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Ab.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Ab.prototype.O.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.xc=class extends olympe.dm.Ab{C(){return this.X()===olympe.dm.xc.ba?this.fb(olympe.dm.xc.O,olympe.dm.Ab):this.fb(olympe.dm.xc.T,olympe.dm.Ab)}};olympe.dm.xc.N=olympe.dc.la.C('ff021000000000000020',olympe.dm.xc);olympe.dm.xc.T=olympe.dm.xc.N.oa('017e9c34cf48bd6965c1');olympe.dm.xc.O=olympe.dm.xc.N.oa('017e9c2e013e06bfffd9');olympe.dm.xc.Ad=olympe.dm.xc.N.oa('01811f12ad77673770d4');olympe.dm.xc.ba=we('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.xc.Vb=we('10000000000000000001','OLYMPE_FOLDER');
840
- olympe.dm.xc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{wu(){return this.qb(olympe.dm.Module.O)}Lu(){return this.Ec(olympe.dm.Module.T)}Lr(){return this.qb(olympe.dm.Module.F)}Pu(){return this.qb(olympe.dm.Module.Z)}iu(){return this.qb(olympe.dm.Module.G)}Mu(){return this.fb(olympe.dm.Module.K,olympe.dm.Module)}Xu(){return this.fb(olympe.dm.Module.C,olympe.dm.ed)}};olympe.dm.Module.N=olympe.dc.la.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.N.ia('ff023000000000000042');
841
- olympe.dm.Module.T=olympe.dm.Module.N.ia('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.N.ia('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.N.ia('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.N.ia('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.N.ia('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.N.oa('ff022000000000000013');olympe.dm.Module.K=olympe.dm.Module.N.oa('ff022000000000000014');
842
- olympe.dm.Module.ba=we('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');l=olympe.dm.Module.prototype;l.wu.J=olympe.D.H.F;l.Lu.J=olympe.D.H.G;l.Lr.J=olympe.D.H.F;l.Pu.J=olympe.D.H.F;l.iu.J=olympe.D.H.F;l.Mu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Xu.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=olympe.Y.Pd().O(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ie().fromModel(a);a=b.create(a,f).jh(g);b=olympe.D.Za.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,b);
843
- this.F=c;this.G=d;this.C=e}Ul(){return this.qb(olympe.dm.File.mimeTypeProp)}Gj(a,b){const c=olympe.D.Oa().G(a),d=b&&olympe.D.Oa().G(b);(a=this.db.Ma(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.K(e,c)},d):ke(this.F,this,e=>{this.C.K(e,c)},e=>{d&&d(e)})}Ol(a,b){this.Gj(c=>{a(Ha(c))},b)}Hj(a,b){const c=olympe.D.Oa().G(a);b=b&&olympe.D.Oa().G(b);const d=this.db.Ma(this,olympe.dm.File.C),e=this.db.Ma(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.Ma(this,olympe.dm.File.mimeTypeProp);
844
- this.C.K(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?ke(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Oa().G(b);olympe.D.gq([a],d=>{const e=new olympe.dc.Ra;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ib(f=>{c&&c(f)})})}Xv(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}Nk(){return this.qb(olympe.dm.File.urlProp)}Un(){return this.qb(olympe.dm.File.fileNameProp)}mu(){return this.gi(olympe.dm.File.creationDateProp)}Ku(){return this.gi(olympe.dm.File.modificationDateProp)}bq(){return this.fh(olympe.dm.File.C)}};
845
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Xv;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Hj;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Ol;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Gj;olympe.dm.File.N=olympe.dc.la.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Ki,olympe.net.R.Fa,olympe.Y.R.Ag);olympe.dm.File.nameProp=olympe.dm.File.N.ia('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
840
+ olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.W;olympe.dm.DataSource.N=olympe.dc.la.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Qg);olympe.dm.DataSource.Zg=olympe.dm.DataSource.N.ia('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Zg);olympe.dm.DataSource.IA=olympe.dm.DataSource.N.ia('ff023000000000000061');olympe.dm.DataSource.mB=olympe.dm.DataSource.N.ia('ff023000000000000062');olympe.dm.DataSource.hq=olympe.dm.DataSource.N.ia('ff023000000000000063');
841
+ olympe.dm.DataSource.Pp=olympe.dm.DataSource.N.ia('ff023000000000000064');olympe.dm.DataSource.ti=olympe.dm.DataSource.N.oa('ff022000000000000060');olympe.dm.DataSource.SERVER=xe('00000000000000000060','Server source');olympe.dm.DataSource.ac={Sh:'ready',Fb:'error',Vq:'down'};olympe.dm.yd=class extends olympe.dc.CloudObject{};olympe.dm.yd.N=olympe.dc.la.C('ff021000000000000070',olympe.dm.yd);olympe.dm.yd.F=olympe.dm.yd.N.oa('ff023000000000000071');olympe.dm.yd.C=olympe.dm.yd.N.oa('ff023000000000000072');olympe.dm.yd.G=olympe.dm.yd.N.oa('ff023000000000000073');olympe.dm.Ab=class extends olympe.dm.BrickMetadata{L(){return new olympe.dc.ta(this.X(),[new olympe.dc.da.ce(olympe.dm.Ab.F.X(),olympe.dc.va.DESTINATION,olympe.dc.da.To.nr,olympe.dc.da.To.qr),olympe.dm.Ab.C])}Td(){return null}C(){return this.fb(olympe.dm.Ab.F,olympe.dm.Ab)}P(){return this.fb(olympe.dm.Ab.C)}};olympe.dm.Ab.N=olympe.dc.la.C('01612df1db9749227626',olympe.dm.Ab);olympe.dm.Ab.F=olympe.dm.Ab.N.oa('016a697ef00ce7554691');olympe.dm.Ab.Ba=U(olympe.dm.Ab.N,olympe.dm.Ab.F);olympe.dm.Ab.C=olympe.dm.Ab.N.oa('016a697ef00ce7554692');
842
+ U(olympe.dc.CloudObject.N,olympe.dm.Ab.C);olympe.dm.Ab.prototype.L.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Ab.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Ab.prototype.P.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.zc=class extends olympe.dm.Ab{C(){return this.X()===olympe.dm.zc.ba?this.fb(olympe.dm.zc.P,olympe.dm.Ab):this.fb(olympe.dm.zc.T,olympe.dm.Ab)}};olympe.dm.zc.N=olympe.dc.la.C('ff021000000000000020',olympe.dm.zc);olympe.dm.zc.T=olympe.dm.zc.N.oa('017e9c34cf48bd6965c1');olympe.dm.zc.P=olympe.dm.zc.N.oa('017e9c2e013e06bfffd9');olympe.dm.zc.Ad=olympe.dm.zc.N.oa('01811f12ad77673770d4');olympe.dm.zc.ba=xe('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.zc.Wb=xe('10000000000000000001','OLYMPE_FOLDER');
843
+ olympe.dm.zc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{vu(){return this.qb(olympe.dm.Module.P)}Ku(){return this.Hc(olympe.dm.Module.T)}Lr(){return this.qb(olympe.dm.Module.F)}Ou(){return this.qb(olympe.dm.Module.Z)}hu(){return this.qb(olympe.dm.Module.G)}Lu(){return this.fb(olympe.dm.Module.L,olympe.dm.Module)}Wu(){return this.fb(olympe.dm.Module.C,olympe.dm.kd)}};olympe.dm.Module.N=olympe.dc.la.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.P=olympe.dm.Module.N.ia('ff023000000000000042');
844
+ olympe.dm.Module.T=olympe.dm.Module.N.ia('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.N.ia('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.N.ia('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.N.ia('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.N.ia('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.N.oa('ff022000000000000013');olympe.dm.Module.L=olympe.dm.Module.N.oa('ff022000000000000014');
845
+ olympe.dm.Module.ba=xe('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');l=olympe.dm.Module.prototype;l.vu.J=olympe.D.H.F;l.Ku.J=olympe.D.H.G;l.Lr.J=olympe.D.H.F;l.Ou.J=olympe.D.H.F;l.hu.J=olympe.D.H.F;l.Lu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Wu.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=olympe.Y.Pd().P(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ie().fromModel(a);a=b.create(a,f).oh(g);b=olympe.D.Za.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,b);
846
+ this.F=c;this.G=d;this.C=e}Ul(){return this.qb(olympe.dm.File.mimeTypeProp)}Kj(a,b){const c=olympe.D.Oa().G(a),d=b&&olympe.D.Oa().G(b);(a=this.db.Ma(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.L(e,c)},d):le(this.F,this,e=>{this.C.L(e,c)},e=>{d&&d(e)})}Ol(a,b){this.Kj(c=>{a(Ha(c))},b)}Lj(a,b){const c=olympe.D.Oa().G(a);b=b&&olympe.D.Oa().G(b);const d=this.db.Ma(this,olympe.dm.File.C),e=this.db.Ma(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.Ma(this,olympe.dm.File.mimeTypeProp);
847
+ this.C.L(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?le(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Oa().G(b);olympe.D.gq([a],d=>{const e=new olympe.dc.Sa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.jb(f=>{c&&c(f)})})}Wv(){this.G.P(this.get(olympe.dm.File.mimeTypeProp))}Pk(){return this.qb(olympe.dm.File.urlProp)}Un(){return this.qb(olympe.dm.File.fileNameProp)}lu(){return this.ji(olympe.dm.File.creationDateProp)}Ju(){return this.ji(olympe.dm.File.modificationDateProp)}bq(){return this.ih(olympe.dm.File.C)}};
848
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Wv;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Lj;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Ol;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Kj;olympe.dm.File.N=olympe.dc.la.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Oi,olympe.net.R.Fa,olympe.Y.R.Ag);olympe.dm.File.nameProp=olympe.dm.File.N.ia('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
846
849
  olympe.dm.File.fileNameProp=olympe.dm.File.N.ia('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.N.ia('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.N.ia('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.N.ia('ff023000000000000052');
847
- B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.N.ia('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.N.ia('ff023000000000000054');olympe.dm.File.N.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.sa=[olympe.D.File];l=olympe.dm.File.prototype;l.Ul.J=olympe.D.H.F;l.Gj.J=new olympe.D.H(()=>{},[]);l.Ol.J=new olympe.D.H(()=>{},[]);
848
- l.Hj.J=new olympe.D.H(()=>{},[]);l.rename.J=olympe.D.H.C;l.Nk.J=olympe.D.H.F;l.Un.J=olympe.D.H.F;l.mu.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ku.J=new olympe.D.H(()=>olympe.D.Za,[]);l.bq.J=olympe.D.H.O;olympe.dm.ed=class extends olympe.dc.CloudObject{C(){return this.qb(olympe.dm.ed.F)}G(){return this.Ec(olympe.dm.ed.G)}F(){return this.fb(olympe.dm.ed.C,olympe.dm.Module)}};olympe.dm.ed.N=olympe.dc.la.C('ff021000000000000041',olympe.dm.ed);olympe.dm.ed.F=olympe.dm.ed.N.ia('ff023000000000000047');olympe.dm.ed.G=olympe.dm.ed.N.ia('ff023000000000000048');olympe.dm.ed.C=olympe.dm.Module.C.Pb();olympe.dm.ed.prototype.C.J=olympe.D.H.F;olympe.dm.ed.prototype.G.J=olympe.D.H.G;
849
- olympe.dm.ed.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tb=class extends olympe.dm.xc{C(){return this.fb(olympe.dm.Ab.F,olympe.dm.Ab)}G(){return this.qb(olympe.dm.tb.Z)}Z(){return this.qb(olympe.dm.tb.ub)}F(){return this.fb(olympe.dm.tb.K,olympe.dm.tb)}};olympe.dm.tb.N=olympe.dc.la.C('0163d9594700fcf61e54',olympe.dm.tb);olympe.dm.tb.Z=olympe.dm.tb.N.ia('017869c7d2833c9492c1');olympe.dm.tb.ub=olympe.dm.tb.N.ia('017869c80bb9929c76d0');olympe.dm.tb.nb=olympe.dm.tb.N.oa('ff02200000000000002a');olympe.dm.tb.K=olympe.dm.tb.N.oa('ff02200000000000002b');
850
- olympe.dm.tb.ld=T(olympe.dm.tb.N,olympe.dm.tb.K);olympe.dm.tb.G=olympe.dm.tb.N.oa('ff02200000000000002c');olympe.dm.tb.cd=olympe.dm.tb.N.oa('017e9c412e2b944bd590');olympe.dm.tb.we=olympe.dm.tb.N.oa('017e9c416872a89d3415');olympe.dm.tb.ve=olympe.dm.tb.N.oa('017ebf8fe5c506662098');T(olympe.dc.CloudObject.N,olympe.dm.tb.nb);olympe.dm.tb.Wb=we('100000000000000000dd','PRIMORDIAL');olympe.dm.tb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tb.prototype.G.J=olympe.D.H.F;
851
- olympe.dm.tb.prototype.Z.J=olympe.D.H.F;olympe.dm.tb.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.Zb(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Zb(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.Ej(olympe.dm.Property.typeRel).Bd()}wc(){return this.C().fa().Jp(this.fa())}};olympe.dm.Property.N=olympe.dc.la.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=T(olympe.dm.Property.N,olympe.dc.CloudObject.propertyRel);
852
- B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.N,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.J=olympe.D.H.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Gu(){return olympe.D.Ja.EMPTY}eu(){return this.Ec(olympe.dm.Relation.F)}Qu(){return this.Ec(olympe.dm.Relation.G)}Sp(){return this.fb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).vc()}Xp(){return this.fb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).vc()}wc(){return this.Xp().fa().concat(['-',this.fa(),'->',this.Sp().fa()])}};olympe.dm.Relation.N=olympe.dc.la.C('ff021000000000000006',olympe.dm.Relation);
853
- olympe.dm.Relation.G=olympe.dm.Relation.N.ia('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ia('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.N.ia(olympe.dc.Jb.jn);olympe.dm.Relation.Z=olympe.dm.Relation.N.ia(olympe.dc.Jb.oc);olympe.dm.Relation.ga=olympe.dm.Relation.N.ia(olympe.dc.Jb.Se);olympe.dm.Relation.qa=olympe.dm.Relation.N.ia(olympe.dc.Jb.Us);olympe.dm.Relation.T=olympe.dm.Relation.N.ia('ff023000000000000031');
854
- olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.N,olympe.dc.CloudObject.ni);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=T(olympe.dm.Relation.N,olympe.dc.CloudObject.Op);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={mr:0,Bq:5,Ko:1,Ms:4,tl:2,hl:8,Zw:10,Ky:6,Ly:9,Hd:6,My:9};olympe.dm.Relation.K={ny:3,ws:4,Yx:5,Xx:6};olympe.dm.Relation.O=olympe.dm.ek.ys+olympe.dm.ek.Sq;
855
- l=olympe.dm.Relation.prototype;l.Gu.J=olympe.D.H.F;l.eu.J=olympe.D.H.G;l.Qu.J=olympe.D.H.G;l.Sp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Xp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.pe=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.pe.N=olympe.dc.la.C('ff021000000000000019',olympe.dm.pe);olympe.dm.String=class extends olympe.dm.pe{getValue(){return this.qb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.N=olympe.dc.la.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.N.ia('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.J=olympe.D.H.F;olympe.dm.String.prototype.toString.J=olympe.D.H.C;olympe.dm.Boolean=class extends olympe.dm.pe{getValue(){return this.fh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.N=olympe.dc.la.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.N.ia('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.J=olympe.D.H.O;olympe.dm.Color=class extends olympe.dm.pe{getValue(){return this.Yp()}};olympe.dm.Color.N=olympe.dc.la.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.N.ia('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.pe{getValue(){return this.gi(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.N=olympe.dc.la.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.N.ia('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Za,[]);olympe.dm.Enum=class extends olympe.dm.String{fa(){return olympe.D.ra([super.fa(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Ja)}Ed(){return this.Ec(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Aa();e=void 0!==e?e:f.Ua(b)&&f.Sd(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
856
- olympe.dm.Enum.N=olympe.dc.la.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.N.ia('017a7690c915975ea995');olympe.dm.Enum.prototype.Ed.J=olympe.D.H.G;olympe.dm.uf=class extends olympe.dm.BrickMetadata{gv(){return this.lb(olympe.dc.CloudObject.instancesRel).ak(olympe.dm.Enum.rankProp,olympe.dc.query.bj.ASC).Bd()}static create(a,b){b=a.create(olympe.dm.uf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.uf.create=olympe.dm.uf.create;olympe.dm.uf.prototype.getValues=olympe.dm.uf.prototype.gv;olympe.dm.uf.N=olympe.dc.la.C('017a768f966fc08ebb98',olympe.dm.uf);olympe.dm.Number=class extends olympe.dm.pe{getValue(){return this.Ec(olympe.dm.Number.valueProp)}};olympe.dm.Number.N=olympe.dc.la.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.N.ia('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.J=olympe.D.H.G;olympe.sc={};olympe.sc.R={ya:'sc.Logger',il:'sc.RootContext',de:'sc.Serializer'};olympe.sc.V={Ee:'sc.app',qf:'sc.debug',gn:'sc.debugger',Tq:'sc.disableTheme',PRODUCTION:'sc.production',xs:'sc.onstartTimeout',Mo:'sc.remoteActionTimeout',qo:'sc.offlineStart'};
857
- olympe.U.config(a=>{F(a,olympe.sc.V.Ee,'');F(a,olympe.sc.V.qo,!1);F(a,olympe.sc.V.qf,!1);F(a,olympe.sc.V.Tq,!0);F(a,olympe.sc.V.PRODUCTION,!1);F(a,olympe.sc.V.xs,2E4);F(a,olympe.sc.V.Mo,1E4);E(a,olympe.sc.R.ya,[olympe.ka.R.Fa],b=>b.Dc('sc'));D(a,olympe.sc.R.de,olympe.sc.dg,olympe.dc.R.Je);ua(a,olympe.dc.sources.R.de,olympe.sc.R.de);E(a,olympe.sc.R.il,[new olympe.U.ma(olympe.sc.V.PRODUCTION)],b=>{const c=new olympe.sc.vd('root','root',null);olympe.sc.km=c;c.set(olympe.sc.wa.C.PRODUCTION,b);return new olympe.sc.wa(c)})},
858
- 'olympe.sc');olympe.U.run([olympe.sc.R.il],a=>{olympe.Ij().ctx=a});olympe.sc.Zl=()=>null!==olympe.dc.Aa().Sb(void 0,olympe.sc.Runnable.C.Pb());olympe.sc.HA=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Bc),olympe.sc.Bc.C,c||null),olympe.sc.Bc.G,d||null);a.Ea(olympe.sc.Bc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.hg=a=>{a=olympe.dc.Db.hg(a);return a instanceof olympe.sc.ae?a.C():a};olympe.sc.cB=a=>{a=de(a);return a instanceof olympe.sc.ae?a.C():a};
859
- olympe.sc.ZA=function(a){const b=olympe.dm.Ab.C.Pb(),c=olympe.dc.CloudObject.containsRel.Pb();var d=olympe.dc.ja(a);if(void 0===d)return[];a=olympe.dc.Aa();var e=a.model(d);const f=[],g=[];let h=[];if(a.ki(e,olympe.dm.Ab))h.push(d);else{for(e=[];null===a.Sb(d,b);){e.push(d);const k=a.Sb(d,c);if(null===k)return olympe.ka.ab('sc').warn(`Object ${d} has no container`),[];a.sd(d,olympe.sc.logic.eb)||k===a.Sb(d,olympe.sc.Runnable.C.Pb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
860
- }g.push(d);h.push(a.Sb(g[0],b))}h=h.concat(a.og(h[0],olympe.dm.Ab.Ba));h=h.concat(a.og(h[h.length-1],olympe.dm.xc.T.Pb()));h=h.concat(a.og(h[h.length-1],olympe.dm.xc.O.Pb()));return[...f,...g,...h].reverse()};olympe.sc.aB=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Tf:a.startsWith('video/')?olympe.sc.Rg:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.pc:olympe.dm.File};
861
- olympe.sc.XA=a=>a instanceof olympe.sc.Tf?'image/*':a instanceof olympe.sc.Rg?'video/*':a instanceof olympe.sc.pc?'font/*,application/font-woff':null;olympe.sc.sb={};function wk(a,b){var c=olympe.sc.wa,d=a.C;a=a.F();b=olympe.dc.ja(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Yg(a,void 0,b);for(d=f.getParent();d&&d.ga&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||xk(g,b,f)}return new c(f)}function yk(a){let b;return null!=(b=a.Sa(olympe.sc.wa.C.PRODUCTION))?b:!1}
862
- olympe.sc.wa=class{constructor(a=olympe.sc.km){this.C=a;this.L=olympe.ka.ab('sc');this.G=null}W(){return this.C.W()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.wa(a)}return this.G}fu(a){const b=olympe.dc.Aa();let c=this.getParent();const d=e=>{if(e.fe()){const f=b.model(e.fe());if(f&&b.Ma(f,olympe.sc.Wa.ba)||a.modelTag&&!b.sd(e.fe(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}fe(){return this.C.fe()}F(){return this.C.C}set(a,
863
- b){this.C.set(a,b);return this}sm(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.ja(a),e=olympe.D.ec(b||Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.W():void 0));return e.vb()}get(a,b=!1){a=this.Sa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
864
- d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=zk(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.wg(a.unsubscribe.bind(a));return this}Wv(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yg(`Runner ${a.name()}`);a.run(b);return b}mw(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}Yv(a){this.set(olympe.sc.wa.C.Of,a);return this}Sa(a,b=!0){return this.C.Sa(a,b)}on(a,
865
- b,c,d=!0){return this.C.on(a,b,c,d)}Yg(a){return new olympe.sc.wa(this.C.Yg(this.F(),a))}Yj(a,b){return this.C.Yj(a,c=>{b(new olympe.sc.wa(c))})}Ou(a){a=Ak(this.C,a);return a===this.C?this:a&&new olympe.sc.wa(a)}destroy(){this.C.destroy()}wg(a,b){return this.C.wg(a,b)}Wj(a){this.C.Wj(a)}onDestroy(a){return this.mb()?(a(),'noId'):this.F().onDestroy(a)}kf(a){this.mb()||this.F().kf(a)}clear(){this.C.clear()}mb(){return this.F().mb()}Ma(a){a=Bk(this.C,a);return null!==a?new olympe.sc.ui.Gw(a,this):null}vu(a){a=
866
- Bk(this.C,a);return null!==a?new olympe.sc.ui.Fw(a,this):null}Iv(...a){return rxjs.combineLatest(a.map(b=>{b=Bk(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Qa(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.wa.prototype.observeMany=olympe.sc.wa.prototype.Iv;olympe.sc.wa.prototype.getEvent=olympe.sc.wa.prototype.vu;olympe.sc.wa.prototype.getProperty=olympe.sc.wa.prototype.Ma;olympe.sc.wa.prototype.isDestroyed=olympe.sc.wa.prototype.mb;
867
- olympe.sc.wa.prototype.clear=olympe.sc.wa.prototype.clear;olympe.sc.wa.prototype.offDestroy=olympe.sc.wa.prototype.kf;olympe.sc.wa.prototype.onDestroy=olympe.sc.wa.prototype.onDestroy;olympe.sc.wa.prototype.offClear=olympe.sc.wa.prototype.Wj;olympe.sc.wa.prototype.onClear=olympe.sc.wa.prototype.wg;olympe.sc.wa.prototype.destroy=olympe.sc.wa.prototype.destroy;olympe.sc.wa.prototype.getOtherContext=olympe.sc.wa.prototype.Ou;olympe.sc.wa.prototype.onContext=olympe.sc.wa.prototype.Yj;
868
- olympe.sc.wa.prototype.createChild=olympe.sc.wa.prototype.Yg;olympe.sc.wa.prototype.setParentElement=olympe.sc.wa.prototype.Yv;olympe.sc.wa.prototype.waitFor=olympe.sc.wa.prototype.mw;olympe.sc.wa.prototype.runner=olympe.sc.wa.prototype.Wv;olympe.sc.wa.prototype.repeat=olympe.sc.wa.prototype.repeat;olympe.sc.wa.prototype.observe=olympe.sc.wa.prototype.observe;olympe.sc.wa.prototype.has=olympe.sc.wa.prototype.has;olympe.sc.wa.prototype.get=olympe.sc.wa.prototype.get;olympe.sc.wa.prototype.remove=olympe.sc.wa.prototype.remove;
869
- olympe.sc.wa.prototype.trigger=olympe.sc.wa.prototype.sm;olympe.sc.wa.prototype.set=olympe.sc.wa.prototype.set;olympe.sc.wa.prototype.getClosest=olympe.sc.wa.prototype.fu;olympe.sc.wa.prototype.getParent=olympe.sc.wa.prototype.getParent;olympe.sc.wa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',Of:'__htmlContainer',Uw:'__dockableElement'};olympe.sc.vp=class extends olympe.sc.wa{constructor(a){super(a);this.K=new olympe.D.Mb('SC Update Context',super.F());const b=a.wg(()=>{b&&a.Wj(b);this.K.destroy()})}F(){return this.K}wg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.hc())}};function zk(a,b){b=olympe.dc.ja(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function Ak(a,b){if(b===a.id||a.K.has(b)||!b)return a;for(a=a.ba;a;){if(b===a.W()||a.K.has(b))return a;const c=Ck(a.F,b);if(c)return c;a=a.getParent()}return null}function Bk(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
870
- function Dk(a){a.C.Z(()=>{Ek(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Sa(olympe.sc.wa.C.TRANSACTION,!1)&&a.L.warn(`The context ${a.W()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.ba)){let d;null==(d=c.F)||d.delete(a.W());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.K.clear();a.ba=null});let b;null==(b=a.ba)||Fk(b,a)}
871
- function Ck(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ga&&!c.id.startsWith('_')&&(a=Ck(c.F,b)))return a;return null}function Gk(a,b){a.Ba=olympe.dc.ja(b);a.ga=b.nd().Zl();b.F().forEach(c=>{a.id===c||a.K.has(c)||(a.K.add(c),xk(a,c,a))});a.Z=b.O()}function Hk(a){a.qa=!0;let b;null==(b=a.F)||b.forEach(c=>{Hk(c)})}function Ik(a){a.qa=!1;let b;null==(b=a.F)||b.forEach(c=>{Ik(c)})}
872
- function Jk(a,...b){var c=olympe.sc.sb.re.C.kl;if(null!==a.sb)for(const {Zj:d,depth:e}of a.sb.values())d.process(a,c,e,...b)}function Kk(a,b,c,d){const e='$'+b;a.T.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Ek(a,f=>{!f.qa&&f.T.has(b)||f.data.has(e)||Kk(f,b,c,d)});a.T.delete(b)}
873
- function Lk(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));olympe.sc.vd.C+=1;const e=olympe.sc.vd.C;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}function xk(a,b,c){a.T.add(b);let d;const e=null==(d=a.G)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Ek(a,f=>{f.T.has(b)||xk(f,b,c)});a.T.delete(b)}function Ek(a,b){let c;null==(c=a.F)||c.forEach(b)}function Mk(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
874
- function Nk(a,b){if(null!==a.sb&&a.sb.has(b)){var {Zj:c,depth:d}=a.sb.get(b);Ek(a,e=>{Nk(e,b)});0===d&&c.F();a.sb.delete(b);0===a.sb.size&&(a.sb=null)}}function Ok(a,b,c=0){null===a.sb&&(a.sb=new Map);a.sb.has(b.W())||(a.sb.set(b.W(),{Zj:b,depth:c}),Ek(a,d=>{(-1===b.G||c<b.G)&&Ok(d,b,c+1)}),a.onDestroy(()=>{Nk(a,b.W())}));b.W()}function Pk(a){var b=olympe.sc.sb.re.F.Af;const c=[];if(null!==a.sb)for(const {Zj:d}of a.sb.values())d.getType()===b&&(c.push(d.W()),d.F(),Nk(a,d.W()))}
875
- function Fk(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
876
- olympe.sc.vd=class{constructor(a,b='no name',c=olympe.sc.km){this.id=a;this.Uc=b;this.K=new Set;this.ba=c;this.C=new olympe.D.Mb('SC Context');this.data=new Map;this.Ba=this.O=this.F=this.G=null;this.ga=!1;this.T=new Set;this.qa=!1;this.Z=null;this.L=olympe.ka.ab('sc');this.sb=null;Dk(this)}W(){return this.id}getParent(){return this.ba}fe(){return this.Ba}set(a,b){if(!this.C.zc()&&!this.C.mb()){const f=olympe.dc.ja(a);var c,d,e;let g;a=null!=(g=null!=(e=null==(c=this.Z)?void 0:c.get('O#'+f))?e:null==
877
- (d=this.Z)?void 0:d.get('IO#'+f))?g:f;c='$'+a;(d=this.data.get(c))&&d.valueOf&&(d=d.valueOf());void 0===b||null===b?void 0!==d&&(this.data.delete(c),null!==this.sb&&0<this.sb.size&&Jk(this,a,null),Kk(this,a,['*',this.id,...this.K],null)):((e=void 0===d)||(e=!('function'===typeof b.Qa?b.Qa(d):b.valueOf()===d.valueOf())),e&&(this.data.set(c,b),null!==this.sb&&0<this.sb.size&&Jk(this,a,b),Kk(this,a,['*',this.id,...this.K],b)))}}on(a,b,c,d=!0){if(this.C.mb()||this.C.zc())return()=>{};const e=zk(this,
878
- a),f=c?olympe.dc.ja(c):'*';a=Lk(this,'@'+f+'.'+e,b);c=c?(c=Ak(this,f))?c.Sa(e,!1):void 0:this.Sa(e);void 0!==c&&b(c);if(d)olympe.D.Oa().onDestroy(a);return a}has(a,b=!1){a='$'+zk(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Yg(a,b,c){const d=null!=c?c:'_'+olympe.Y.hc();if(a.mb()||a.zc())throw Error(`Try to create new child context in a destroyed context ${a.W()}, probably because \`runner()\` is called on a destroyed context`);const e=
879
- a.run(()=>new olympe.sc.vd(d,b,this));null!==this.sb&&0<this.sb.size&&this.sb.forEach(({Zj:f,depth:g})=>{(-1===f.G||g<f.G)&&Ok(e,f,g+1)});return e}Yj(a,b){const c=Ak(this,a);if(c)return b(c),()=>{};const d=Lk(this,'&'+a,e=>{d&&d();b(e)});return d}Sa(a,b=!0){a='$'+zk(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.zc()||this.C.mb()||this.C.destroy()}wg(a,b){if(this.C.mb())a();else return++olympe.sc.vd.C,b=b||
880
- String(olympe.sc.vd.C),null===this.O&&(this.O=new Map),this.O.set(b,a),b;return b||'noId'}Wj(a){null!==this.O&&this.O.delete(a)}onDestroy(a){return this.mb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.zc()&&!this.C.mb()){let a;null==(a=this.O)||a.forEach(b=>b())}}mb(){return this.C.mb()}};olympe.sc.vd.prototype.getParent=olympe.sc.vd.prototype.getParent;olympe.sc.vd.C=0;olympe.sc.vd.F={ur:'I#',zs:'O#',Qx:'IO#'};function Qk(a,b,c){return(c=c.fe())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.sb.re=class{constructor(a=-1){this.id=olympe.Y.$e();this.active=!0;this.G=a}F(){this.active=!1}W(){return this.id}getType(){}process(){}};olympe.sc.sb.re.C={kl:'SET'};olympe.sc.sb.re.F={Af:'REMOTE',$r:'LOCAL'};olympe.sc.yd=class a{constructor(){this.F=this.K=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.rl(1E4);La(this.C,b=>{Pk(b)})}ba(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.yd.C.As:c=this.G.get(e.f);b.$c(c).catch(m=>{d.error('Unable to reply with paths: ',m)});break;case olympe.sc.yd.C.Bs:const h=f+c,k=(m,n,p=0)=>{Mk(m,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=m.fe())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
881
- t])})};b.hm(h).then(()=>{const m=[];k(g,m,0);Ek(g,p=>{k(p,m,1)});olympe.P.pb.publish(h,{t:olympe.sc.yd.C.tr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.sb.Os(h);Ok(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.yd.C.Cs:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.yd.C.yk:void 0!==g&&(this.C.delete(g),Pk(g))}}ga(b,c,d){this.O=new olympe.P.pb('discovery_debug_id',
882
- c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.yd.C.Uq){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.$e(),f=new olympe.D.Mb(this.F,c.F()),this.K=new olympe.P.pb(this.F,f),this.K.listen().subscribe(g=>{this.ba(g,b,d)}));olympe.P.pb.publish(e,{t:olympe.sc.yd.C.pq,n:olympe.U.getParameter(olympe.sc.V.gn)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
883
- d){const e=[],f=olympe.dc.Aa(),g=(h,k)=>{Ek(h,m=>{if(null!==m.fe()){const n=olympe.dc.CloudObject.get(m.fe()).Ej(olympe.sc.Runnable.K).Bd();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,m.W()]),this.T.set(m.W(),m));g(m,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.P.pb.publish(b,{t:olympe.sc.yd.C.wj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ka.ab('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
884
- b||void 0===b)return'<null>';const c=olympe.dc.Aa();if(b instanceof olympe.dc.CloudObject){var d=b.Rb();if(!c.sd(d,olympe.sc.Gc))return b.toString();let f=`${b.Dd().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ua.from(e).ig(olympe.dc.CloudObject.extendRel,!0).Ld().lb(olympe.dc.CloudObject.propertyRel).Ld().Bd();e=olympe.dc.ua.from(e).ig(olympe.dc.CloudObject.extendRel,!0).Ld().lb(olympe.dc.CloudObject.ni).Ld().Bd();d=d.filter(([g])=>g instanceof olympe.sc.Gc);0!==d.length&&(f+=
885
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ma(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Gc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.yd.K='discovery_debug_id';olympe.sc.yd.C={Uq:0,pq:1,As:2,Bs:3,tr:4,wj:5,Cs:6,yk:7};olympe.sc.sb.Wx=class extends olympe.sc.sb.re{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.sb.re.F.$r}process(a,b,c,...d){if(this.active&&b===olympe.sc.sb.re.C.kl){a=Qk(c,zk(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};olympe.sc.sb.Os=class extends olympe.sc.sb.re{constructor(a){super(1);this.K=a;this.C=new Map;this.db=olympe.dc.Aa()}getType(){return olympe.sc.sb.re.F.Af}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.sb.re.C.kl&&void 0!==d[0]&&null!==d[0]){const e=Qk(c,zk(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Dd()instanceof olympe.sc.Gc){const h=yf(this.db,f,()=>{olympe.sc.yd.F(this.K,
886
- e,f)});this.C.set(e,()=>{zf(this.db,f,h)})}olympe.sc.yd.F(this.K,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Mr(){return this.Ec(this.Vl())}Nr(){return this.Ec(this.Wl())}Mj(){return new olympe.D.Ib(this.Ec(this.Vl()),this.Ec(this.Wl()))}Vl(){}Wl(){}};olympe.sc.Metadata.N=olympe.dc.la.C('0161ae936c62f9fcd131',olympe.sc.Metadata);l=olympe.sc.Metadata.prototype;l.Mr.J=olympe.D.H.G;l.Nr.J=olympe.D.H.G;l.Mj.J=olympe.D.H.T;l.Vl.J=olympe.D.H.C;l.Wl.J=olympe.D.H.C;olympe.sc.Bc=class extends olympe.dc.CloudObject{F(){return this.qb(olympe.sc.Bc.G)}C(){return this.qb(olympe.sc.Bc.C)}};olympe.sc.Bc.N=olympe.dc.la.C('01703376c4a81c0e9d90',olympe.sc.Bc);olympe.sc.Bc.G=olympe.sc.Bc.N.ia('01703376c4a81c0e9d91');olympe.sc.Bc.C=olympe.sc.Bc.N.ia('01703376c4a81c0e9d92');olympe.sc.Bc.F=olympe.sc.Bc.N.oa('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.N,olympe.sc.Bc.F);olympe.sc.Bc.prototype.F.J=olympe.D.H.F;olympe.sc.Bc.prototype.C.J=olympe.D.H.F;olympe.sc.td={};olympe.sc.td.ue={Cw:null,Qs:'screenflow',gt:'ui-design',bp:'software-intelligence',Dg:'data-management'};olympe.sc.Mc=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.td.ue.bp}C(){return this.fb(olympe.sc.Mc.C,olympe.sc.logic.Zf)}F(){return this.fb(olympe.sc.Mc.F,olympe.sc.logic.zf)}};olympe.sc.Mc.N=olympe.dc.la.C('011100000000000adef0',olympe.sc.Mc);olympe.sc.Mc.C=olympe.sc.Mc.N.oa('016ac4f59a2917fdef01');olympe.sc.Mc.F=olympe.sc.Mc.N.oa('016ac4f59a2917fdef02');olympe.sc.Mc.N.C=(a,b)=>kj(a,b||'New function signature',olympe.sc.Mc,olympe.sc.logic.Id).X();
887
- olympe.sc.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.Mc.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);function Rk(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Sk(a,b){b=b.filter(c=>'string'===typeof c&&a.db.sd(c,olympe.sc.logic.Kb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ma(c,olympe.sc.logic.Kb.C,!0))?e:0;let f;d=null!=(f=a.db.Ma(d,olympe.sc.logic.Kb.C,!0))?f:0;return c-d});return b}
888
- olympe.sc.Wa=class extends olympe.dm.BrickMetadata{Pr(a,b,c,d,e=!0){e||olympe.ka.ab('sc').error('parameter own= false ignored, investigate');return olympe.D.yg(N(this.ff(a,olympe.dc.Db.hg,c)),d)}Vu(){return this.fb(olympe.sc.Wa.O,olympe.sc.Runnable)}ju(){return this.fb(olympe.sc.Wa.T,olympe.sc.Runnable)}bm(){return this.db.Ma(this,olympe.sc.Wa.ba)}Zl(){return null!==this.db.Sb(this.tag,olympe.sc.Runnable.C.Pb())}Pk(){return this.fb(olympe.sc.Wa.F,olympe.sc.logic.ob)}Ti(){return this.fb(olympe.sc.Wa.G,
889
- olympe.sc.logic.wb)}};olympe.sc.Wa.N=olympe.dc.la.C('0112000000000000def0',olympe.sc.Wa);olympe.sc.Wa.ba=olympe.sc.Wa.N.ia('01692aa71f3108454479');olympe.sc.Wa.nb=olympe.sc.Wa.N.ia('0166446c1f128ebc903a');olympe.sc.Wa.O=olympe.sc.Wa.N.oa('01692a4af82e8984742c');olympe.sc.Wa.T=olympe.sc.Wa.N.oa('01692a4af82e8984742d');olympe.sc.Wa.Z=olympe.sc.Wa.N.oa('01692a4af82e8984742e');olympe.sc.Wa.F=olympe.sc.Wa.N.oa('01621fb84e320000f00a');olympe.sc.Wa.G=olympe.sc.Wa.N.oa('01621fb84e320000f00b');
890
- olympe.sc.Wa.Wb=olympe.sc.Wa.N.oa('0171838bcfed0000e00e');olympe.sc.Wa.Vb=olympe.sc.Wa.N.oa('0171838bcfed0000a00a');l=olympe.sc.Wa.prototype;l.Pr.J=olympe.D.H.C;l.Vu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.ju.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.bm.J=olympe.D.H.C;l.Zl.J=olympe.D.H.C;l.Pk.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Ti.J=new olympe.D.H(()=>olympe.dc.ta,[]);function Tk(a){const b=olympe.dc.CloudObject.Kp(new Map,a);olympe.D.Oa().onDestroy(()=>{const c=new olympe.dc.Ra;c.delete(b);c.ib()});return b}function Uk(a,b){Gk(b.C,a);Rk(a.nd(),b);const c=a.K(),d=Vk(b,c),e=[];c.forEach((f,g)=>{f===a.ba?e[0]=g:f===a.Z&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Wk(a,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
891
- function Xk(a,b){var c=a.Rb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.mb()&&(b.clear(),null!==h)){h=Array.isArray(h)?h:[h];const k=new olympe.sc.vp(b.C);k.F().run(a.update.bind(a,k,h,g));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.L.debug(e):a.L.debug(f),a.qa.bind(a,b),()=>a.L.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
892
- function Yk(a,b,c,d){const e=d.F(),f=W(a.db,b,c,e.G((g,h)=>{const k=wk(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.onDestroy(a.db.F.bind(a.db,b,c,f,!0))}function Vk(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
893
- function Wk(a,b,c){const d=olympe.D.Oa(),e=yf(a.db,a.tag,d.G((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.hg(g)))}));d.onDestroy(()=>{zf(a.db,a.tag,e)})}
894
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.L=c}run(a){a.F().run(()=>{Uk(this,a);this.init(a);if(this.nd().bm())Xk(this,a);else{const b=new olympe.sc.vp(a.C);b.F().run(()=>this.update(b,[],[]))}a.sm(olympe.sc.Wa.nb);a.wg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))})}nd(){return this.Dd()}init(a){this.onInit(a)}update(a,b,c){const d=this.nd();if(d.bm())this.onUpdate(a,b,c);else this.L.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.W()}`),
895
- Yk(this,d,olympe.sc.Wa.O,a),this.ga()&&Yk(this,d,olympe.sc.Wa.Z,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){this.L.error(`Brick ${this.db.name(this.Rb())} (${this.Rb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.nd();return Sk(a,a.db.fb(a.tag,olympe.sc.Wa.F))}getOutputs(){var a=this.nd();return Sk(a,a.db.fb(a.tag,olympe.sc.Wa.G))}F(){return[]}O(){return new Map}ga(){return!1}G(a,
896
- b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.yg(a,d);return a}ub(a,b,c,d,e){olympe.D.jm([d],f=>{b.set(a,olympe.D.cq(f)?f.valueOf():f)});return this.G(a,b,c,e)}K(){return[this.ba,this.Z]}ba(a,b){Wk(this,b,null)}Z(a,b){Wk(this,null,b)}Cb(a,b){const c=this.db,d=olympe.sc.logic.eb.G.Pb(),e=olympe.sc.logic.eb.F,f=olympe.sc.logic.eb.C;this.Rp(d,g=>{var h=g.X();if(h=c.Sb(h,e)||c.Sb(h,f))return Zk(g,a,b.bind(null,h))})}qa(a,b){const c=this.Rb();let d=this.db.name(c);try{const e=[a.fe()];let f=a.getParent();
897
- for(;null!==f&&f.C!==olympe.sc.km;)e.unshift(f.fe()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.L.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.L.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.N=Be(olympe.dc.la.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.K=olympe.sc.Runnable.N.oa('01692a4af82e8984742b');
898
- olympe.sc.Runnable.C=olympe.sc.Runnable.N.oa('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.N,olympe.sc.Wa.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.N,olympe.sc.Wa.T);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.N,olympe.sc.Wa.Z);T(olympe.sc.Wa.N,olympe.sc.Runnable.K);T(olympe.sc.Wa.N,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.nd.J=new olympe.D.H(()=>olympe.sc.Wa,[]);olympe.sc.Runnable.prototype.G.J=new olympe.D.H(()=>Object,[]);olympe.sc.Runnable.prototype.ub.J=olympe.D.H.C;function $k(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.ae)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.ae=class extends olympe.dc.CloudObject{F(){return this.db.fb(this,olympe.sc.ae.C)[0]}C(){return olympe.dc.CloudObject.get($k(this))}toString(){const a=$k(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.ae.N=olympe.dc.la.C('0163c9ae01f2d6e9ca49',olympe.sc.ae);olympe.sc.ae.C=olympe.sc.ae.N.oa('0169b5a8a33144fb0b49');
899
- T(olympe.dc.CloudObject.N,olympe.sc.ae.C);olympe.sc.ae.prototype.F.J=new olympe.D.H(()=>String,[]);olympe.sc.ae.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.kn=class extends olympe.dm.Ab{Td(){return olympe.sc.td.ue.Dg}};olympe.sc.kn.N=olympe.dc.la.C('0163a68ce44f3d1fa84c',olympe.sc.kn);olympe.sc.Gc=class extends olympe.dm.BrickMetadata{};olympe.sc.Gc.N=olympe.dc.la.C('016324fde11a836f76c2',olympe.sc.Gc);olympe.sc.Gc.C=olympe.sc.Gc.N.oa('016324fde11a836087c2');olympe.sc.Gc.N.C=function(a,b){return kj(a,null!=b?b:'New type',olympe.sc.Gc).X()};let al=null;
900
- function bl(a,b){al=a;const c=olympe.D.Oa(),d=c.G(b);olympe.dc.Lc.from(a).lb(olympe.sc.pa.Qc.C).lb(olympe.sc.Rc.C.Pb()).ib(c).then(e=>{if(null!==e){const f=olympe.dc.Aa();Jg(c,e,g=>{g=f.Tj(g)?g:f.model(g);return null!==g&&f.sd(g,olympe.sc.Gc)}).subscribe(()=>{d(olympe.sc.Rc.bc.Zn)})}else olympe.ka.ab('sc').error('No container found for the application',a),d(olympe.sc.Rc.bc.Wk)}).catch(e=>{olympe.ka.ab('sc').error('Error while loading business container:',e.message);d(olympe.sc.Rc.bc.Fb)})}
901
- olympe.sc.Rc=class extends olympe.dc.CloudObject{};olympe.sc.Rc.bc={Zn:0,Wk:1,Fb:2};olympe.sc.Rc.N=olympe.dc.la.C('017b3aa8fae1e3d044dc',olympe.sc.Rc);olympe.sc.Rc.C=olympe.sc.Rc.N.oa('017b3aa8fd1659291b92');olympe.sc.Rc.F=olympe.sc.Rc.N.oa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.N=olympe.dc.la.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Xf=class extends olympe.sc.Map{};olympe.sc.Xf.N=olympe.dc.la.C('01631aacd8276ea98490',olympe.sc.Xf);olympe.sc.File=class extends olympe.dm.File{static Jt(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.jq(a,e,b,c,d);return e}static Kt(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.om(a,e,b,c,d);return e}static jq(a,b,c,d,e){e=null!=e?e:'application/data';d=olympe.Y.Pd().O(new Blob([d],{type:e}));olympe.sc.File.om(a,b,c,d,e)}static om(a,b,c,d,e){const f=olympe.dc.Aa(),g=f.Ua(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.ki(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
902
- h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Ma(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.fq(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.om;olympe.sc.File.setContent=olympe.sc.File.jq;olympe.sc.File.createFromURL=olympe.sc.File.Kt;olympe.sc.File.createFromContent=olympe.sc.File.Jt;
903
- olympe.sc.File.N=ve(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Tf=class extends olympe.sc.File{K(){const a=olympe.D.ec(olympe.D.Ja);this.Hj(b=>{a.update(olympe.D.rb(b))});return a.vb()}};olympe.sc.Tf.N=ve(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Tf);olympe.sc.Tf.N.C=olympe.sc.File.F.bind(null,olympe.sc.Tf);olympe.sc.Tf.prototype.K.J=olympe.D.H.F;olympe.sc.pc=class extends olympe.sc.File{K(){return this.qb(olympe.sc.pc.fontFamilyProp)}O(){return this.qb(olympe.sc.pc.G)}T(){return this.Ec(olympe.sc.pc.K)}};olympe.sc.pc.N=ve(olympe.sc.File,'01647e113043c637b541',olympe.sc.pc);olympe.sc.pc.fontFamilyProp=olympe.sc.pc.N.ia('01647e35ecd24ef0b88d');olympe.sc.pc.G=olympe.sc.pc.N.ia('01647e677f5d1cfbdf42');olympe.sc.pc.K=olympe.sc.pc.N.ia('01647e6780999bf8bd25');
904
- olympe.sc.pc.N.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.pc,a,b,c,d);a.update(c,olympe.sc.pc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.pc.prototype.K.J=olympe.D.H.F;olympe.sc.pc.prototype.O.J=olympe.D.H.F;olympe.sc.pc.prototype.T.J=olympe.D.H.G;olympe.sc.Rg=class extends olympe.sc.File{};olympe.sc.Rg.N=ve(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Rg);olympe.sc.Rg.N.C=olympe.sc.File.F.bind(null,olympe.sc.Rg);olympe.sc.xp=class extends olympe.dc.CloudObject{};olympe.sc.xp.N=olympe.dc.la.C('016421bb3797e22d1c4e',olympe.sc.xp);olympe.sc.logic={};olympe.sc.logic.Hn=(a,b)=>a===b?0:a>b?1:-1;
905
- olympe.sc.logic.Vx=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Sa(b.getType().X());let k,m;if(b===olympe.dc.ja(olympe.dm.String))k=c.valueOf().toLowerCase(),m=p=>p.qb(h).toLowerCase();else if(b===olympe.dc.ja(olympe.dm.Number))k=c.valueOf(),m=p=>p.Ec(h);else if(b===olympe.dc.ja(olympe.dm.DateTime))k=c.getTime(),m=p=>olympe.D.ra([p.gi(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Aa().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
906
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Hn(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Hn(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Gf().filter(p=>olympe.D.ra([m(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Hb(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).Oe())};
907
- olympe.sc.logic.FA=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Ja)return a.mq();if(a instanceof olympe.D.ea)return a.Wp();if('string'===typeof a||'number'===typeof a)return olympe.D.na(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.jo};olympe.sc.logic.Ha={};function cl(a){Ae(a.N,(b,c)=>{b=b.create(a.N.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ha.An=class{constructor(a,b,c){this.N=olympe.dc.la.C(a,b,...c);cl(this)}X(){return this.N.X()}};olympe.sc.logic.Ha.An.sa=[olympe.dc.ne];const dl=Object.create(null),el=new Map;function fl(a){if(void 0===dl[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return xe(a)}function gl(a,b,c=olympe.sc.logic.Function){if(el.has(a))throw c=fl(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.la.C(a,b,...[]);el.set(a,{N:d,VA:b,CA:c});return d}
908
- olympe.sc.logic.la=class{constructor(){}static C(a,b,...c){if(dl[a])throw c=fl(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ha.An(a,b,[olympe.sc.R.ya].concat(c));return dl[a]=b}};olympe.sc.logic.Jw=class{};olympe.sc.logic.Gi=class extends olympe.dc.CloudObject{};olympe.sc.logic.Gi.N=olympe.dc.la.C('01621fb84e320000cf00',olympe.sc.logic.Gi);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.C=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Ju(){return this.C}gu(){return this.code}};B('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.gu;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Ju;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
909
- olympe.sc.logic.zh=class extends olympe.sc.logic.Gi{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.zh.N=olympe.dc.la.C('016eeb5ede9f3094d8f0',olympe.sc.logic.zh);olympe.sc.logic.Kc=class extends olympe.dc.CloudObject{C(){return this.Zb(olympe.sc.logic.Kc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Kc.N=olympe.dc.la.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Kc);olympe.sc.logic.Kc.F=olympe.sc.logic.Kc.N.ia('017bc044aeacce7ffc8f');olympe.sc.logic.Kc.C=olympe.sc.logic.Kc.N.oa('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.N,olympe.sc.logic.Kc.C);olympe.sc.logic.Kc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Zf=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Zf.N=olympe.dc.la.C('016ac4f59c592b862457',olympe.sc.logic.Zf);olympe.sc.logic.Zf.G=olympe.sc.Mc.C.Pb();olympe.sc.logic.Zf.N.C=(a,b,c,d,e)=>{b=kj(a,b||'New Predefined Input',olympe.sc.logic.Zf,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Kc.F,e);a.Ea(olympe.sc.logic.Kc.C,b,c);a.Ea(olympe.sc.Mc.C,d,b);return b.X()};olympe.sc.logic.zf=class extends olympe.sc.logic.Kc{};olympe.sc.logic.zf.N=olympe.dc.la.C('016ac4f59dd99f5df3e1',olympe.sc.logic.zf);olympe.sc.logic.zf.G=T(olympe.sc.logic.zf.N,olympe.sc.Mc.F);olympe.sc.logic.zf.N.C=(a,b,c,d,e)=>{b=kj(a,b||'New Predefined Output',olympe.sc.logic.zf,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Kc.F,e);a.Ea(olympe.sc.logic.Kc.C,b,c);a.Ea(olympe.sc.Mc.F,d,b);return b.X()};olympe.sc.logic.Id=class extends olympe.sc.Wa{Td(){return olympe.sc.td.ue.bp}T(){return this.Pl().Gf().sd([olympe.sc.logic.Function]).and().Wc().sd([olympe.sc.logic.Fc,olympe.sc.logic.Hc]).Oe()}yu(){return this.Pk().Gf().ii([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Zf.G]).Oe()}zu(){return this.Ti().Gf().ii([olympe.dc.CloudObject.modelRel,olympe.sc.logic.zf.G]).Oe()}Rd(a){const b=this.db.Ml(this,[olympe.sc.Wa.F],c=>this.db.model(c)===olympe.dc.ja(a));return b?olympe.dc.CloudObject.get(b):null}df(a){const b=
910
- this.db.Ml(this,[olympe.sc.Wa.G],c=>this.db.model(c)===olympe.dc.ja(a));return b?olympe.dc.CloudObject.get(b):null}dv(){return this.Pk().Gf().ii([olympe.dc.CloudObject.modelRel],olympe.sc.logic.ob).Oe()}ev(){return this.Ti().Gf().ii([olympe.dc.CloudObject.modelRel],olympe.sc.logic.wb).Oe()}};olympe.sc.logic.Id.N=gl('01621fb84e320000f000',olympe.sc.logic.Id,olympe.sc.logic.Function);l=olympe.sc.logic.Id.prototype;l.yu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.zu.J=new olympe.D.H(()=>olympe.dc.ta,[]);
911
- l.Rd.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.df.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.dv.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.ev.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.logic.pf=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63229782039429f')}F(){return this.df('016ac6322acf67eebfe7')}G(){return this.Ti().Gf().lb(olympe.sc.logic.Kb.typeRel).Rj(olympe.sc.logic.zh).Oe().Ne().$l(olympe.D.aa.ZERO)}};olympe.sc.logic.pf.C='016ac63229782039429f';olympe.sc.logic.pf.K='016ac6322acf67eebfe7';olympe.sc.logic.pf.N=gl('01621fb84e320000a000',olympe.sc.logic.pf,olympe.sc.logic.Action);olympe.sc.logic.pf.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);
912
- olympe.sc.logic.pf.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.pf.prototype.G.J=olympe.D.H.O;olympe.sc.logic.Zm=class extends olympe.sc.logic.Id{};olympe.sc.logic.Zm.N=gl('01621fb84e320000f011',olympe.sc.logic.Zm);olympe.sc.logic.Ym=class extends olympe.sc.logic.pf{};olympe.sc.logic.Ym.N=gl('01621fb84e320000f012',olympe.sc.logic.Ym);olympe.sc.logic.Function=class extends olympe.sc.Runnable{K(){return[this.Cb]}O(){const a=olympe.sc.vd.F.ur,b=olympe.sc.vd.F.zs,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}C(a){return this.getOutputs().map(b=>this.db.cm(b,olympe.sc.logic.Kb.typeRel,olympe.sc.logic.Gi)?a.sm.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
913
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.N=olympe.dc.la.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.ya);olympe.sc.logic.Kb=class extends olympe.dc.CloudObject{getType(){return this.Zb(olympe.sc.logic.Kb.typeRel,olympe.dc.CloudObject)}C(){return this.Ec(olympe.sc.logic.Kb.C)}};olympe.sc.logic.Kb.N=olympe.dc.la.C('0168a431d25001540000',olympe.sc.logic.Kb);olympe.sc.logic.Kb.C=olympe.sc.logic.Kb.N.ia('01740c5d4ae4b520dd01');olympe.sc.logic.Kb.typeRel=olympe.sc.logic.Kb.N.oa('0168a431d3b9b7438424');T(olympe.dc.CloudObject.N,olympe.sc.logic.Kb.typeRel);
914
- olympe.sc.logic.Kb.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kb.prototype.C.J=olympe.D.H.G;olympe.sc.logic.ob=class extends olympe.sc.logic.Kb{};olympe.sc.logic.ob.N=olympe.dc.la.C('0168a431d25001540001',olympe.sc.logic.ob);olympe.sc.logic.ob.T=olympe.sc.logic.Kb.N.ia('01740c5d4ae4b520dd02');olympe.sc.logic.ob.O=T(olympe.sc.logic.ob.N,olympe.sc.Wa.F);olympe.sc.logic.ob.F=olympe.sc.logic.ob.N.oa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.ob.G=olympe.sc.logic.ob.N.oa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
915
- olympe.sc.logic.ob.K=olympe.sc.logic.ob.N.oa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.ob.N.C=function(a,b,c,d,e,f=olympe.sc.logic.ob){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ea(olympe.sc.logic.Kb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Kb.C,e);d&&a.Ea(olympe.sc.Wa.F,d,f);return f.X()};olympe.sc.logic.wb=class extends olympe.sc.logic.Kb{};olympe.sc.logic.wb.N=olympe.dc.la.C('0168a431d25001540002',olympe.sc.logic.wb);olympe.sc.logic.wb.O=T(olympe.sc.logic.wb.N,olympe.sc.Wa.G);olympe.sc.logic.wb.F=olympe.sc.logic.wb.N.oa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.wb.K=olympe.sc.logic.wb.N.oa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.wb.G=olympe.sc.logic.wb.N.oa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
916
- olympe.sc.logic.wb.N.C=function(a,b,c,d,e,f=olympe.sc.logic.wb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Kb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Kb.C,e);d&&a.Ea(olympe.sc.Wa.G,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.nd().C().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.N=olympe.dc.la.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.ya);olympe.sc.logic.Fc=class extends olympe.sc.logic.Function{run(a){Uk(this,a);const b=a.getParent(),c=this.db.Sb(this,olympe.sc.logic.Fc.G),d=this.db.Sb(this,olympe.sc.logic.Fc.F);a.on(c,e=>b.set(d,e),this.tag)}Ba(){return this.Zb(olympe.sc.logic.Fc.G,olympe.sc.logic.ob)}Va(){return this.Zb(olympe.sc.logic.Fc.F,olympe.sc.logic.wb)}};olympe.sc.logic.Fc.N=olympe.dc.la.C('01621fb84e32000000a0',olympe.sc.logic.Fc,olympe.sc.R.ya);olympe.sc.logic.Fc.G=T(olympe.sc.logic.Fc.N,olympe.sc.logic.ob.G);
917
- olympe.sc.logic.Fc.F=T(olympe.sc.logic.Fc.N,olympe.sc.logic.wb.K);olympe.sc.logic.Fc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Fc);a.Ea(olympe.sc.logic.Fc.F,b,c);return b.X()};olympe.sc.logic.Fc.prototype.Ba.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Fc.prototype.Va.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Hc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Sb(this,olympe.sc.logic.Hc.F),d=this.db.Sb(this,olympe.sc.logic.Hc.G);b.on(c,e=>a.set(d,e),b.W())}Va(){return this.Zb(olympe.sc.logic.Hc.F,olympe.sc.logic.ob)}Ba(){return this.Zb(olympe.sc.logic.Hc.G,olympe.sc.logic.wb)}};olympe.sc.logic.Hc.N=olympe.dc.la.C('01621fb84e32000000d0',olympe.sc.logic.Hc,olympe.sc.R.ya);olympe.sc.logic.Hc.F=T(olympe.sc.logic.Hc.N,olympe.sc.logic.ob.K);
918
- olympe.sc.logic.Hc.G=T(olympe.sc.logic.Hc.N,olympe.sc.logic.wb.G);olympe.sc.logic.Hc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Hc);a.Ea(olympe.sc.logic.Hc.F,b,c);return b.X()};olympe.sc.logic.Hc.prototype.Va.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Hc.prototype.Ba.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);function Zk(a,b,c){const d=a.db.Sb(a,olympe.sc.logic.eb.T)||a.db.Sb(a,olympe.sc.logic.eb.K),e=a.db.Sb(a,olympe.sc.logic.eb.O),f=a.db.ki(hl(a),olympe.dm.pe)?new olympe.D.Mb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const m=b.Yj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);m();k&&k()}}const h=wf(a.db,a,olympe.sc.logic.eb.valueProp,g);return()=>{g(null);xf(a.db,a,olympe.sc.logic.eb.valueProp,h)}}
919
- function hl(a){let b=null,c=a.db.Sb(a,olympe.sc.logic.eb.F);c?b=a.db.Sb(c,olympe.dm.Property.typeRel):(c=a.db.Sb(a,olympe.sc.logic.eb.C))&&(b=a.db.Sb(c,olympe.sc.logic.Kb.typeRel));return b||olympe.dc.ja(olympe.dc.CloudObject)}
920
- olympe.sc.logic.eb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.L=c}C(a,b,c){const d=olympe.sc.hg(c);null==b||b.qa();b&&d instanceof olympe.dm.pe?null==b||b.run(()=>{olympe.D.nc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.ff(olympe.sc.logic.eb.valueProp,a||olympe.dc.Db.hg,Object)}getType(){const a=this.transform(olympe.sc.logic.eb.C,olympe.sc.logic.Kb.typeRel);a.gd(olympe.dc.CloudObject);return a.vc()}av(){return this.Zb(olympe.sc.logic.eb.O,olympe.dc.CloudObject)}Zu(){return this.Zb(olympe.sc.logic.eb.T,
921
- olympe.sc.logic.wb)}$u(){return this.Zb(olympe.sc.logic.eb.K,olympe.dm.Property)}su(){return this.Zb(olympe.sc.logic.eb.G,olympe.dc.CloudObject)}qu(){return this.Zb(olympe.sc.logic.eb.C,olympe.sc.logic.ob)}ru(){return this.Zb(olympe.sc.logic.eb.F,olympe.dm.Property)}};olympe.sc.logic.eb.N=olympe.dc.la.C('0168a431d91f25780000',olympe.sc.logic.eb,olympe.sc.R.ya);olympe.sc.logic.eb.valueProp=olympe.sc.logic.eb.N.ia('0168a431d91f25780001');olympe.sc.logic.eb.O=olympe.sc.logic.eb.N.oa('0168a431d91f25780002');
922
- olympe.sc.logic.eb.T=T(olympe.sc.logic.eb.N,olympe.sc.logic.wb.F);olympe.sc.logic.eb.K=olympe.sc.logic.eb.N.oa('0168a431d91f25780004');olympe.sc.logic.eb.G=olympe.sc.logic.eb.N.oa('0168a431d91f2578000a');olympe.sc.logic.eb.C=T(olympe.sc.logic.eb.N,olympe.sc.logic.ob.F);olympe.sc.logic.eb.F=olympe.sc.logic.eb.N.oa('0168a431d91f2578000c');T(olympe.dc.CloudObject.N,olympe.sc.logic.eb.O);T(olympe.dm.Property.N,olympe.sc.logic.eb.K);T(olympe.dc.CloudObject.N,olympe.sc.logic.eb.G);
923
- T(olympe.dm.Property.N,olympe.sc.logic.eb.F);l=olympe.sc.logic.eb.prototype;l.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.av.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Zu.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.$u.J=new olympe.D.H(()=>olympe.dm.Property,[]);l.su.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.qu.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.ru.J=new olympe.D.H(()=>olympe.dm.Property,[]);function il(a,b){const c=a.nd(),d=c.Qk().X(),e=c.Rk().X(),f=c.Sk().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.P.pb.get(a.Rb(),g,h).then(k=>{for(const [m,n]of k)m!==e&&m!==f&&b.set(m,n);b.set(e,k.get(e));b.set(f,k.get(f))}).catch(k=>{b.set(f,olympe.sc.logic.zh.create(k.toString(),1))})}},b.W())}
924
- function jl(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();m&&m();try{const p=new Map(a.getOutputs().map(q=>[q,b.get(q)]));f.$c(p).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Rb()}: ${p.message}`),f.$g(n).finally(()=>b.destroy())}}},h=b.W(),k=b.on(c,g,h),m=b.on(d,g,h)}
925
- olympe.sc.logic.Og=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Sa(olympe.sc.wa.C.EDITION))&&b||(this.db.Ma(this,olympe.sc.logic.Og.F)?this.Ba(a):(Uk(this,a),il(this,a)))}Ba(a){const b=this.Rb(),c=this.nd(),d=c.Xn().X(),e=c.Qk().X(),f=c.Rk().X(),g=c.Sk().X();(new olympe.P.pb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yg('remote call'),m=h.body(),n=Mb(()=>{h.$g(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
926
- k.destroy()},this.timeout);jl(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.lh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ja(q)!==p&&(q=this.Rb(),this.L.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,m.get(e))}).catch(p=>{const q=this.Rb();this.L.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.zh.create('Unrecognized User',
927
- 1))})},h=>{const k=this.Rb();this.L.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Og.N=olympe.dc.la.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Og,olympe.sc.R.ya,new olympe.U.ma(olympe.sc.V.Mo));olympe.sc.logic.Og.F=olympe.sc.logic.Og.N.ia('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Lk=class{constructor(a){this.db=olympe.dc.Aa();this.typeRel=a}};olympe.sc.logic.controllers.Lk.C={Mw:-1,Px:1};olympe.sc.logic.controllers.Iy=class extends olympe.sc.logic.controllers.Lk{constructor(){super(olympe.sc.logic.Kc.C)}};olympe.sc.logic.controllers.Oy=class extends olympe.sc.logic.controllers.Lk{constructor(){super(olympe.sc.logic.Kb.typeRel)}};olympe.sc.logic.Fj={};olympe.sc.logic.Fj.Zs=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ja(b);d?olympe.dc.ua.Yb(a,d,olympe.dc.Jb.Se).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.L.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.la.C('0174bf4b7e006e4b788a',olympe.sc.logic.Fj.Zs);olympe.sc.logic.actions={};olympe.sc.logic.Fj.js=class extends olympe.sc.logic.Function{run(a){Uk(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.L.warn('No list to iter upon'),this.L.info(a.W())):f<e?(b(g.ze(f)),f++,c((new Date).getTime())):(Ik(h.C),d((new Date).getTime()))};this.getInputs().forEach((m,n)=>a.on(m,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.If();f=0;Hk(h.C);k();break;case 2:k();break;default:this.L.error('Unhandled input')}},this.tag))}};
928
- olympe.sc.logic.la.C('0171889b060b6cd54300',olympe.sc.logic.Fj.js);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.Mk=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63808535703691c')}};olympe.sc.logic.Qb.Mk.N=gl('0169b6876a03f139d50a',olympe.sc.logic.Qb.Mk);olympe.sc.logic.Qb.Mk.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Qb.al=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63809a9a8e6db96')}F(){return this.df('016ac6380ab003363b3e')}};gl('01646ad602f933b8caaf',olympe.sc.logic.Qb.al);olympe.sc.logic.Qb.al.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Qb.al.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Qb.$i=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac6380bd98f1d91a0')}G(){return this.df('016ac63c589ae38ca3ae')}F(){return this.df('016ac63c5a377fceabaa')}};gl('0168ec42fc01747a98b6',olympe.sc.logic.Qb.$i);olympe.sc.logic.Qb.$i.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Qb.$i.prototype.G.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Qb.$i.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Qb.ag=class extends olympe.sc.logic.Id{Qk(){return this.Rd('017a7b07b09e3b22c8b4')}Xn(){return this.Rd('017a7b07ba05807a74b0')}Rk(){return this.df('017a7b0818c12388d731')}Sk(){return this.df('017a7b085146d5e69aec')}Qr(){return olympe.D.ea.F}};olympe.sc.logic.Qb.ag.K='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.ag.ub='017a7b07ba05807a74b0';olympe.sc.logic.Qb.ag.Ba='017a7b0818c12388d731';olympe.sc.logic.Qb.ag.C='017a7b085146d5e69aec';
929
- olympe.sc.logic.Qb.ag.N=gl('017a7b07a948e30508fa',olympe.sc.logic.Qb.ag,olympe.sc.logic.Og);l=olympe.sc.logic.Qb.ag.prototype;l.Qk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Xn.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Rk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Sk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Qr.J=olympe.D.H.O;olympe.sc.logic.Qb.ip=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63c5b3ed0562740')}};gl('016a9766c230916ea5ec',olympe.sc.logic.Qb.ip);olympe.sc.logic.Qb.ip.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Bm=class extends olympe.sc.Xf{};olympe.sc.query.Bm.N=olympe.dc.la.C('01631aacd8276ea98491',olympe.sc.query.Bm);olympe.sc.query.wo=class extends olympe.dm.Enum{};olympe.sc.query.wo.N=olympe.dc.la.C('01631aacd8276ea98495',olympe.sc.query.wo);olympe.sc.query.Go=class extends olympe.dm.Enum{};olympe.sc.query.Go.N=olympe.dc.la.C('01631aacd8276ea98494',olympe.sc.query.Go);olympe.sc.query.Ho=class extends olympe.sc.Xf{};olympe.sc.query.Ho.N=olympe.dc.la.C('01631aacd8276ea98492',olympe.sc.query.Ho);olympe.sc.query.Sc=class extends olympe.dc.CloudObject{};olympe.sc.query.Sc.N=olympe.dc.la.C('01631aacd8276ea98493',olympe.sc.query.Sc);olympe.sc.cn=class extends olympe.dc.CloudObject{};olympe.sc.cn.N=olympe.dc.la.C('018312ceeb3e93618a85',olympe.sc.cn);olympe.sc.Eb={};olympe.sc.Eb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.qb(olympe.sc.Eb.Comment.K)}F(){return this.qb(olympe.sc.Eb.Comment.G)}C(){return new olympe.D.Ib(this.Ec(olympe.sc.Eb.Comment.O),this.Ec(olympe.sc.Eb.Comment.F))}static Cc(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Eb.Comment.C,b,c);c=a.create(olympe.sc.ui.td.Fo);Z(c,olympe.sc.ui.td.Fo.vB,d.Vn());Z(c,olympe.sc.ui.td.Fo.wB,d.Wn());a.Ea(olympe.dm.BrickMetadata.ga,
930
- b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Eb.Comment.Z=100;olympe.sc.Eb.Comment.T=66;olympe.sc.Eb.Comment.N=olympe.dc.la.C('0184bd886ee1c7adfe09',olympe.sc.Eb.Comment);olympe.sc.Eb.Comment.K=olympe.sc.Eb.Comment.N.ia('0184c80e29ed08a16c5e');olympe.sc.Eb.Comment.G=olympe.sc.Eb.Comment.N.ia('0184bd889f33359cfe75');olympe.sc.Eb.Comment.O=olympe.sc.Eb.Comment.N.ia('0184c3f9406e25a41512');olympe.sc.Eb.Comment.F=olympe.sc.Eb.Comment.N.ia('0184c3f942e4cc136ce8');
931
- olympe.sc.Eb.Comment.C=olympe.sc.Eb.Comment.N.oa('0184be3f135a83fd6cc3');olympe.sc.Eb.Comment.prototype.getType.J=olympe.D.H.F;olympe.sc.Eb.Comment.prototype.F.J=olympe.D.H.F;olympe.sc.Eb.Comment.prototype.C.J=olympe.D.H.T;olympe.sc.Eb.pk=class extends olympe.dm.Enum{};olympe.sc.Eb.pk.C={Bw:'Comment',Vz:'Todo'};olympe.sc.Eb.pk.N=olympe.dc.la.C('0184cc42e06205501bc7',olympe.sc.Eb.pk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.N=olympe.dc.la.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13a');
932
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.N.oa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.N.oa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Re=class extends olympe.sc.logic.Id{Rr(){return this.Rd('017ffe02381f9fac5060')}Ur(){return this.Rd('017ffe02381f9fac5061')}Vr(){return this.Rd('017ffe02381f9fac5062')}ou(){return this.Rd('017ffe02381f9fac5065')}Sr(){return this.df('017ffe02381f9fac5063')}Tr(){return this.df('017ffe02381f9fac5064')}};olympe.sc.workflow.Re.N=gl('017ffde21f5fe0f704ce',olympe.sc.workflow.Re);olympe.sc.workflow.Re.C='017ffe02381f9fac5060';olympe.sc.workflow.Re.cd='017ffe02381f9fac5061';
933
- olympe.sc.workflow.Re.ld='017ffe02381f9fac5062';olympe.sc.workflow.Re.Ba='017ffe02381f9fac5065';olympe.sc.workflow.Re.K='017ffe02381f9fac5063';olympe.sc.workflow.Re.ub='017ffe02381f9fac5064';l=olympe.sc.workflow.Re.prototype;l.Rr.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Ur.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Vr.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.ou.J=new olympe.D.H(()=>Map,[]);l.Sr.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Tr.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.workflow.te=class extends olympe.dm.BrickMetadata{wc(){return this.Zb(olympe.sc.workflow.Workflow.statesRel.Pb(),olympe.sc.workflow.Workflow).fa().concat(['.',this.fa()])}};olympe.sc.workflow.te.N=olympe.dc.la.C('017ffdc2dda51d46b430',olympe.sc.workflow.te);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Zp()}C(){return this.Zb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.te)}G(){return this.Zb(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.te)}wc(){const a=this.Zb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.te);return a.Zb(olympe.sc.workflow.Workflow.statesRel.Pb(),olympe.sc.workflow.Workflow).fa().concat(['.',a.fa(),'->',this.fa()])}};
850
+ B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.N.ia('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.N.ia('ff023000000000000054');olympe.dm.File.N.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.P='application/data';olympe.dm.File.sa=[olympe.D.File];l=olympe.dm.File.prototype;l.Ul.J=olympe.D.H.F;l.Kj.J=new olympe.D.H(()=>{},[]);l.Ol.J=new olympe.D.H(()=>{},[]);
851
+ l.Lj.J=new olympe.D.H(()=>{},[]);l.rename.J=olympe.D.H.C;l.Pk.J=olympe.D.H.F;l.Un.J=olympe.D.H.F;l.lu.J=new olympe.D.H(()=>olympe.D.Za,[]);l.Ju.J=new olympe.D.H(()=>olympe.D.Za,[]);l.bq.J=olympe.D.H.P;olympe.dm.kd=class extends olympe.dc.CloudObject{C(){return this.qb(olympe.dm.kd.F)}G(){return this.Hc(olympe.dm.kd.G)}F(){return this.fb(olympe.dm.kd.C,olympe.dm.Module)}};olympe.dm.kd.N=olympe.dc.la.C('ff021000000000000041',olympe.dm.kd);olympe.dm.kd.F=olympe.dm.kd.N.ia('ff023000000000000047');olympe.dm.kd.G=olympe.dm.kd.N.ia('ff023000000000000048');olympe.dm.kd.C=olympe.dm.Module.C.Pb();olympe.dm.kd.prototype.C.J=olympe.D.H.F;olympe.dm.kd.prototype.G.J=olympe.D.H.G;
852
+ olympe.dm.kd.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tb=class extends olympe.dm.zc{C(){return this.fb(olympe.dm.Ab.F,olympe.dm.Ab)}G(){return this.qb(olympe.dm.tb.Z)}Z(){return this.qb(olympe.dm.tb.ub)}F(){return this.fb(olympe.dm.tb.L,olympe.dm.tb)}};olympe.dm.tb.N=olympe.dc.la.C('0163d9594700fcf61e54',olympe.dm.tb);olympe.dm.tb.Z=olympe.dm.tb.N.ia('017869c7d2833c9492c1');olympe.dm.tb.ub=olympe.dm.tb.N.ia('017869c80bb9929c76d0');olympe.dm.tb.nb=olympe.dm.tb.N.oa('ff02200000000000002a');olympe.dm.tb.L=olympe.dm.tb.N.oa('ff02200000000000002b');
853
+ olympe.dm.tb.pd=U(olympe.dm.tb.N,olympe.dm.tb.L);olympe.dm.tb.G=olympe.dm.tb.N.oa('ff02200000000000002c');olympe.dm.tb.hd=olympe.dm.tb.N.oa('017e9c412e2b944bd590');olympe.dm.tb.xe=olympe.dm.tb.N.oa('017e9c416872a89d3415');olympe.dm.tb.we=olympe.dm.tb.N.oa('017ebf8fe5c506662098');U(olympe.dc.CloudObject.N,olympe.dm.tb.nb);olympe.dm.tb.Xb=xe('100000000000000000dd','PRIMORDIAL');olympe.dm.tb.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.tb.prototype.G.J=olympe.D.H.F;
854
+ olympe.dm.tb.prototype.Z.J=olympe.D.H.F;olympe.dm.tb.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.Zb(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Zb(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.Ij(olympe.dm.Property.typeRel).Bd()}xc(){return this.C().fa().Jp(this.fa())}};olympe.dm.Property.N=olympe.dc.la.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.propertyRel);
855
+ B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.N,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.J=olympe.D.H.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Fu(){return olympe.D.Ja.EMPTY}du(){return this.Hc(olympe.dm.Relation.F)}Pu(){return this.Hc(olympe.dm.Relation.G)}Sp(){return this.fb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).vc()}Xp(){return this.fb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).vc()}xc(){return this.Xp().fa().concat(['-',this.fa(),'->',this.Sp().fa()])}};olympe.dm.Relation.N=olympe.dc.la.C('ff021000000000000006',olympe.dm.Relation);
856
+ olympe.dm.Relation.G=olympe.dm.Relation.N.ia('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.N.ia('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.N.ia(olympe.dc.Mb.jn);olympe.dm.Relation.Z=olympe.dm.Relation.N.ia(olympe.dc.Mb.pc);olympe.dm.Relation.ga=olympe.dm.Relation.N.ia(olympe.dc.Mb.Bf);olympe.dm.Relation.qa=olympe.dm.Relation.N.ia(olympe.dc.Mb.Ts);olympe.dm.Relation.T=olympe.dm.Relation.N.ia('ff023000000000000031');
857
+ olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.si);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=U(olympe.dm.Relation.N,olympe.dc.CloudObject.Op);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={mr:0,Bq:5,Ko:1,Ls:4,tl:2,hl:8,Yw:10,Jy:6,Ky:9,Hd:6,Ly:9};olympe.dm.Relation.L={my:3,vs:4,Xx:5,Wx:6};olympe.dm.Relation.P=olympe.dm.gk.xs+olympe.dm.gk.Sq;
858
+ l=olympe.dm.Relation.prototype;l.Fu.J=olympe.D.H.F;l.du.J=olympe.D.H.G;l.Pu.J=olympe.D.H.G;l.Sp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Xp.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.dm.qe=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.qe.N=olympe.dc.la.C('ff021000000000000019',olympe.dm.qe);olympe.dm.String=class extends olympe.dm.qe{getValue(){return this.qb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.N=olympe.dc.la.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.N.ia('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.J=olympe.D.H.F;olympe.dm.String.prototype.toString.J=olympe.D.H.C;olympe.dm.Boolean=class extends olympe.dm.qe{getValue(){return this.ih(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.N=olympe.dc.la.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.N.ia('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.J=olympe.D.H.P;olympe.dm.Color=class extends olympe.dm.qe{getValue(){return this.Yp()}};olympe.dm.Color.N=olympe.dc.la.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.N.ia('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.qe{getValue(){return this.ji(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.N=olympe.dc.la.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.N.ia('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.J=new olympe.D.H(()=>olympe.D.Za,[]);olympe.dm.Enum=class extends olympe.dm.String{fa(){return olympe.D.ra([super.fa(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Ja)}Ed(){return this.Hc(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.ya();e=void 0!==e?e:f.Ua(b)&&f.Sd(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
859
+ olympe.dm.Enum.N=olympe.dc.la.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.N.ia('017a7690c915975ea995');olympe.dm.Enum.prototype.Ed.J=olympe.D.H.G;olympe.dm.uf=class extends olympe.dm.BrickMetadata{fv(){return this.lb(olympe.dc.CloudObject.instancesRel).ck(olympe.dm.Enum.rankProp,olympe.dc.query.gj.ASC).Bd()}static create(a,b){b=a.create(olympe.dm.uf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.uf.create=olympe.dm.uf.create;olympe.dm.uf.prototype.getValues=olympe.dm.uf.prototype.fv;olympe.dm.uf.N=olympe.dc.la.C('017a768f966fc08ebb98',olympe.dm.uf);olympe.dm.Number=class extends olympe.dm.qe{getValue(){return this.Hc(olympe.dm.Number.valueProp)}};olympe.dm.Number.N=olympe.dc.la.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.N.ia('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.J=olympe.D.H.G;olympe.sc={};olympe.sc.R={za:'sc.Logger',il:'sc.RootContext',de:'sc.Serializer'};olympe.sc.V={Fe:'sc.app',qf:'sc.debug',gn:'sc.debugger',Tq:'sc.disableTheme',PRODUCTION:'sc.production',ws:'sc.onstartTimeout',Mo:'sc.remoteActionTimeout',qo:'sc.offlineStart'};
860
+ olympe.U.config(a=>{F(a,olympe.sc.V.Fe,'');F(a,olympe.sc.V.qo,!1);F(a,olympe.sc.V.qf,!1);F(a,olympe.sc.V.Tq,!0);F(a,olympe.sc.V.PRODUCTION,!1);F(a,olympe.sc.V.ws,2E4);F(a,olympe.sc.V.Mo,1E4);E(a,olympe.sc.R.za,[olympe.ka.R.Fa],b=>b.Gc('sc'));D(a,olympe.sc.R.de,olympe.sc.cg,olympe.dc.R.Ke);ua(a,olympe.dc.sources.R.de,olympe.sc.R.de);E(a,olympe.sc.R.il,[new olympe.U.ma(olympe.sc.V.PRODUCTION)],b=>{const c=new olympe.sc.wd('root','root',null);olympe.sc.km=c;c.set(olympe.sc.wa.C.PRODUCTION,b);return new olympe.sc.wa(c)})},
861
+ 'olympe.sc');olympe.U.run([olympe.sc.R.il],a=>{olympe.Mj().ctx=a});olympe.sc.Zl=()=>null!==olympe.dc.ya().Tb(void 0,olympe.sc.Runnable.C.Pb());olympe.sc.GA=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Cc),olympe.sc.Cc.C,c||null),olympe.sc.Cc.G,d||null);a.Ea(olympe.sc.Cc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.gg=a=>{a=olympe.dc.Db.gg(a);return a instanceof olympe.sc.ae?a.C():a};olympe.sc.bB=a=>{a=ee(a);return a instanceof olympe.sc.ae?a.C():a};
862
+ olympe.sc.YA=function(a){const b=olympe.dm.Ab.C.Pb(),c=olympe.dc.CloudObject.containsRel.Pb();var d=olympe.dc.ja(a);if(void 0===d)return[];a=olympe.dc.ya();var e=a.model(d);const f=[],g=[];let h=[];if(a.ni(e,olympe.dm.Ab))h.push(d);else{for(e=[];null===a.Tb(d,b);){e.push(d);const k=a.Tb(d,c);if(null===k)return olympe.ka.ab('sc').warn(`Object ${d} has no container`),[];a.Zc(d,olympe.sc.logic.eb)||k===a.Tb(d,olympe.sc.Runnable.C.Pb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
863
+ }g.push(d);h.push(a.Tb(g[0],b))}h=h.concat(a.og(h[0],olympe.dm.Ab.Ba));h=h.concat(a.og(h[h.length-1],olympe.dm.zc.T.Pb()));h=h.concat(a.og(h[h.length-1],olympe.dm.zc.P.Pb()));return[...f,...g,...h].reverse()};olympe.sc.$A=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Uf:a.startsWith('video/')?olympe.sc.Ug:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.qc:olympe.dm.File};
864
+ olympe.sc.WA=a=>a instanceof olympe.sc.Uf?'image/*':a instanceof olympe.sc.Ug?'video/*':a instanceof olympe.sc.qc?'font/*,application/font-woff':null;olympe.sc.sb={};function yk(a,b){var c=olympe.sc.wa,d=a.C;a=a.F();b=olympe.dc.ja(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.ah(a,void 0,b);for(d=f.getParent();d&&d.ga&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||zk(g,b,f)}return new c(f)}function Ak(a){let b;return null!=(b=a.Qa(olympe.sc.wa.C.PRODUCTION))?b:!1}
865
+ olympe.sc.wa=class{constructor(a=olympe.sc.km){this.C=a;this.K=olympe.ka.ab('sc');this.G=null}W(){return this.C.W()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.wa(a)}return this.G}eu(a){const b=olympe.dc.ya();let c=this.getParent();const d=e=>{if(e.fe()){const f=b.model(e.fe());if(f&&b.Ma(f,olympe.sc.Xa.ba)||a.modelTag&&!b.Zc(e.fe(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}fe(){return this.C.fe()}F(){return this.C.C}set(a,
866
+ b){this.C.set(a,b);return this}sm(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}vb(a,b,c=!1){const d=olympe.dc.ja(a),e=olympe.D.ec(b||Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.W():void 0));return e.vb()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
867
+ d.next.bind(d),c?void 0:this.C.W(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Bk(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.wg(a.unsubscribe.bind(a));return this}Vv(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ah(`Runner ${a.name()}`);a.run(b);return b}lw(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}Xv(a){this.set(olympe.sc.wa.C.Pf,a);return this}Qa(a,b=!0){return this.C.Qa(a,b)}on(a,
868
+ b,c,d=!0){return this.C.on(a,b,c,d)}ah(a){return new olympe.sc.wa(this.C.ah(this.F(),a))}$j(a,b){return this.C.$j(a,c=>{b(new olympe.sc.wa(c))})}Nu(a){a=Ck(this.C,a);return a===this.C?this:a&&new olympe.sc.wa(a)}destroy(){this.C.destroy()}wg(a,b){return this.C.wg(a,b)}Yj(a){this.C.Yj(a)}onDestroy(a){return this.mb()?(a(),'noId'):this.F().onDestroy(a)}lf(a){this.mb()||this.F().lf(a)}clear(){this.C.clear()}mb(){return this.F().mb()}Ma(a){a=Dk(this.C,a);return null!==a?new olympe.sc.ui.Fw(a,this):null}uu(a){a=
869
+ Dk(this.C,a);return null!==a?new olympe.sc.ui.Ew(a,this):null}Hv(...a){return rxjs.combineLatest(a.map(b=>{b=Dk(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Pa(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}};olympe.sc.wa.prototype.observeMany=olympe.sc.wa.prototype.Hv;olympe.sc.wa.prototype.getEvent=olympe.sc.wa.prototype.uu;olympe.sc.wa.prototype.getProperty=olympe.sc.wa.prototype.Ma;olympe.sc.wa.prototype.isDestroyed=olympe.sc.wa.prototype.mb;
870
+ olympe.sc.wa.prototype.clear=olympe.sc.wa.prototype.clear;olympe.sc.wa.prototype.offDestroy=olympe.sc.wa.prototype.lf;olympe.sc.wa.prototype.onDestroy=olympe.sc.wa.prototype.onDestroy;olympe.sc.wa.prototype.offClear=olympe.sc.wa.prototype.Yj;olympe.sc.wa.prototype.onClear=olympe.sc.wa.prototype.wg;olympe.sc.wa.prototype.destroy=olympe.sc.wa.prototype.destroy;olympe.sc.wa.prototype.getOtherContext=olympe.sc.wa.prototype.Nu;olympe.sc.wa.prototype.onContext=olympe.sc.wa.prototype.$j;
871
+ olympe.sc.wa.prototype.createChild=olympe.sc.wa.prototype.ah;olympe.sc.wa.prototype.setParentElement=olympe.sc.wa.prototype.Xv;olympe.sc.wa.prototype.waitFor=olympe.sc.wa.prototype.lw;olympe.sc.wa.prototype.runner=olympe.sc.wa.prototype.Vv;olympe.sc.wa.prototype.repeat=olympe.sc.wa.prototype.repeat;olympe.sc.wa.prototype.observe=olympe.sc.wa.prototype.observe;olympe.sc.wa.prototype.has=olympe.sc.wa.prototype.has;olympe.sc.wa.prototype.get=olympe.sc.wa.prototype.get;olympe.sc.wa.prototype.remove=olympe.sc.wa.prototype.remove;
872
+ olympe.sc.wa.prototype.trigger=olympe.sc.wa.prototype.sm;olympe.sc.wa.prototype.set=olympe.sc.wa.prototype.set;olympe.sc.wa.prototype.getClosest=olympe.sc.wa.prototype.eu;olympe.sc.wa.prototype.getParent=olympe.sc.wa.prototype.getParent;olympe.sc.wa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',Pf:'__htmlContainer',Tw:'__dockableElement'};olympe.sc.vp=class extends olympe.sc.wa{constructor(a){super(a);this.L=new olympe.D.Nb('SC Update Context',super.F());const b=a.wg(()=>{b&&a.Yj(b);this.L.destroy()})}F(){return this.L}wg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.ic())}};function Bk(a,b){b=olympe.dc.ja(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function Ck(a,b){if(b===a.id||a.L.has(b)||!b)return a;for(a=a.ba;a;){if(b===a.W()||a.L.has(b))return a;const c=Ek(a.F,b);if(c)return c;a=a.getParent()}return null}function Dk(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
873
+ function Fk(a){a.C.Z(()=>{Gk(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Qa(olympe.sc.wa.C.TRANSACTION,!1)&&a.K.warn(`The context ${a.W()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.ba)){let d;null==(d=c.F)||d.delete(a.W());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.L.clear();a.ba=null});let b;null==(b=a.ba)||Hk(b,a)}
874
+ function Ek(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ga&&!c.id.startsWith('_')&&(a=Ek(c.F,b)))return a;return null}function Ik(a,b){a.Ba=olympe.dc.ja(b);a.ga=b.rd().Zl();b.F().forEach(c=>{a.id===c||a.L.has(c)||(a.L.add(c),zk(a,c,a))});a.Z=b.P()}function Jk(a){a.qa=!0;let b;null==(b=a.F)||b.forEach(c=>{Jk(c)})}function Kk(a){a.qa=!1;let b;null==(b=a.F)||b.forEach(c=>{Kk(c)})}
875
+ function Lk(a,...b){var c=olympe.sc.sb.se.C.kl;if(null!==a.sb)for(const {ak:d,depth:e}of a.sb.values())d.process(a,c,e,...b)}function Mk(a,b,c,d){const e='$'+b;a.T.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Gk(a,f=>{!f.qa&&f.T.has(b)||f.data.has(e)||Mk(f,b,c,d)});a.T.delete(b)}
876
+ function Nk(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));olympe.sc.wd.C+=1;const e=olympe.sc.wd.C;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}function zk(a,b,c){a.T.add(b);let d;const e=null==(d=a.G)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Gk(a,f=>{f.T.has(b)||zk(f,b,c)});a.T.delete(b)}function Gk(a,b){let c;null==(c=a.F)||c.forEach(b)}function Ok(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}
877
+ function Pk(a,b){if(null!==a.sb&&a.sb.has(b)){var {ak:c,depth:d}=a.sb.get(b);Gk(a,e=>{Pk(e,b)});0===d&&c.F();a.sb.delete(b);0===a.sb.size&&(a.sb=null)}}function Qk(a,b,c=0){null===a.sb&&(a.sb=new Map);a.sb.has(b.W())||(a.sb.set(b.W(),{ak:b,depth:c}),Gk(a,d=>{(-1===b.G||c<b.G)&&Qk(d,b,c+1)}),a.onDestroy(()=>{Pk(a,b.W())}));b.W()}function Rk(a){var b=olympe.sc.sb.se.F.Af;const c=[];if(null!==a.sb)for(const {ak:d}of a.sb.values())d.getType()===b&&(c.push(d.W()),d.F(),Pk(a,d.W()))}
878
+ function Hk(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
879
+ olympe.sc.wd=class{constructor(a,b='no name',c=olympe.sc.km){this.id=a;this.Wc=b;this.L=new Set;this.ba=c;this.C=new olympe.D.Nb('SC Context');this.data=new Map;this.Ba=this.P=this.F=this.G=null;this.ga=!1;this.T=new Set;this.qa=!1;this.Z=null;this.K=olympe.ka.ab('sc');this.sb=null;Fk(this)}W(){return this.id}getParent(){return this.ba}fe(){return this.Ba}set(a,b){if(!this.C.Ac()&&!this.C.mb()){const f=olympe.dc.ja(a);var c,d,e;let g;a=null!=(g=null!=(e=null==(c=this.Z)?void 0:c.get('O#'+f))?e:null==
880
+ (d=this.Z)?void 0:d.get('IO#'+f))?g:f;c='$'+a;(d=this.data.get(c))&&d.valueOf&&(d=d.valueOf());void 0===b||null===b?void 0!==d&&(this.data.delete(c),null!==this.sb&&0<this.sb.size&&Lk(this,a,null),Mk(this,a,['*',this.id,...this.L],null)):((e=void 0===d)||(e=!('function'===typeof b.Pa?b.Pa(d):b.valueOf()===d.valueOf())),e&&(this.data.set(c,b),null!==this.sb&&0<this.sb.size&&Lk(this,a,b),Mk(this,a,['*',this.id,...this.L],b)))}}on(a,b,c,d=!0){if(this.C.mb()||this.C.Ac())return()=>{};const e=Bk(this,
881
+ a),f=c?olympe.dc.ja(c):'*';a=Nk(this,'@'+f+'.'+e,b);c=c?(c=Ck(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.D.Oa().onDestroy(a);return a}has(a,b=!1){a='$'+Bk(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}ah(a,b,c){const d=null!=c?c:'_'+olympe.Y.ic();if(a.mb()||a.Ac())throw Error(`Try to create new child context in a destroyed context ${a.W()}, probably because \`runner()\` is called on a destroyed context`);const e=
882
+ a.run(()=>new olympe.sc.wd(d,b,this));null!==this.sb&&0<this.sb.size&&this.sb.forEach(({ak:f,depth:g})=>{(-1===f.G||g<f.G)&&Qk(e,f,g+1)});return e}$j(a,b){const c=Ck(this,a);if(c)return b(c),()=>{};const d=Nk(this,'&'+a,e=>{d&&d();b(e)});return d}Qa(a,b=!0){a='$'+Bk(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.Ac()||this.C.mb()||this.C.destroy()}wg(a,b){if(this.C.mb())a();else return++olympe.sc.wd.C,b=b||
883
+ String(olympe.sc.wd.C),null===this.P&&(this.P=new Map),this.P.set(b,a),b;return b||'noId'}Yj(a){null!==this.P&&this.P.delete(a)}onDestroy(a){return this.mb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.Ac()&&!this.C.mb()){let a;null==(a=this.P)||a.forEach(b=>b())}}mb(){return this.C.mb()}};olympe.sc.wd.prototype.getParent=olympe.sc.wd.prototype.getParent;olympe.sc.wd.C=0;olympe.sc.wd.F={ur:'I#',ys:'O#',Px:'IO#'};function Sk(a,b,c){return(c=c.fe())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.sb.se=class{constructor(a=-1){this.id=olympe.Y.af();this.active=!0;this.G=a}F(){this.active=!1}W(){return this.id}getType(){}process(){}};olympe.sc.sb.se.C={kl:'SET'};olympe.sc.sb.se.F={Af:'REMOTE',$r:'LOCAL'};olympe.sc.zd=class a{constructor(){this.F=this.L=this.P=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.rl(1E4);Ka(this.C,b=>{Rk(b)})}ba(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.zd.C.zs:c=this.G.get(e.f);b.dd(c).catch(m=>{d.error('Unable to reply with paths: ',m)});break;case olympe.sc.zd.C.As:const h=f+c,k=(m,n,p=0)=>{Ok(m,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=m.fe())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
884
+ t])})};b.hm(h).then(()=>{const m=[];k(g,m,0);Gk(g,p=>{k(p,m,1)});olympe.O.pb.publish(h,{t:olympe.sc.zd.C.tr,v:m,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.sb.Ns(h);Qk(g,n);this.C.has(g)?Ja(this.C,g):this.C.add(g)}).catch(m=>{d.error('Error notifying on a contextId : ',m)});break;case olympe.sc.zd.C.Bs:void 0!==g&&this.C.has(g)&&Ja(this.C,g);break;case olympe.sc.zd.C.Ak:void 0!==g&&(this.C.delete(g),Rk(g))}}ga(b,c,d){this.P=new olympe.O.pb('discovery_debug_id',
885
+ c);this.P.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.zd.C.Uq){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.af(),f=new olympe.D.Nb(this.F,c.F()),this.L=new olympe.O.pb(this.F,f),this.L.listen().subscribe(g=>{this.ba(g,b,d)}));olympe.O.pb.publish(e,{t:olympe.sc.zd.C.pq,n:olympe.U.getParameter(olympe.sc.V.gn)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
886
+ d){const e=[],f=olympe.dc.ya(),g=(h,k)=>{Gk(h,m=>{if(null!==m.fe()){const n=olympe.dc.CloudObject.get(m.fe()).Ij(olympe.sc.Runnable.L).Bd();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,m.W()]),this.T.set(m.W(),m));g(m,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.O.pb.publish(b,{t:olympe.sc.zd.C.Aj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ka.ab('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
887
+ b||void 0===b)return'<null>';const c=olympe.dc.ya();if(b instanceof olympe.dc.CloudObject){var d=b.Sb();if(!c.Zc(d,olympe.sc.Jc))return b.toString();let f=`${b.Dd().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ua.from(e).hg(olympe.dc.CloudObject.extendRel,!0).Ld().lb(olympe.dc.CloudObject.propertyRel).Ld().Bd();e=olympe.dc.ua.from(e).hg(olympe.dc.CloudObject.extendRel,!0).Ld().lb(olympe.dc.CloudObject.si).Ld().Bd();d=d.filter(([g])=>g instanceof olympe.sc.Jc);0!==d.length&&(f+=
888
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ma(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Jc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.zd.L='discovery_debug_id';olympe.sc.zd.C={Uq:0,pq:1,zs:2,As:3,tr:4,Aj:5,Bs:6,Ak:7};olympe.sc.sb.Vx=class extends olympe.sc.sb.se{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.sb.se.F.$r}process(a,b,c,...d){if(this.active&&b===olympe.sc.sb.se.C.kl){a=Sk(c,Bk(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};olympe.sc.sb.Ns=class extends olympe.sc.sb.se{constructor(a){super(1);this.L=a;this.C=new Map;this.db=olympe.dc.ya()}getType(){return olympe.sc.sb.se.F.Af}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.sb.se.C.kl&&void 0!==d[0]&&null!==d[0]){const e=Sk(c,Bk(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Dd()instanceof olympe.sc.Jc){const h=Af(this.db,f,()=>{olympe.sc.zd.F(this.L,
889
+ e,f)});this.C.set(e,()=>{Bf(this.db,f,h)})}olympe.sc.zd.F(this.L,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Mr(){return this.Hc(this.Vl())}Nr(){return this.Hc(this.Wl())}Qj(){return new olympe.D.Ib(this.Hc(this.Vl()),this.Hc(this.Wl()))}Vl(){}Wl(){}};olympe.sc.Metadata.N=olympe.dc.la.C('0161ae936c62f9fcd131',olympe.sc.Metadata);l=olympe.sc.Metadata.prototype;l.Mr.J=olympe.D.H.G;l.Nr.J=olympe.D.H.G;l.Qj.J=olympe.D.H.T;l.Vl.J=olympe.D.H.C;l.Wl.J=olympe.D.H.C;olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.qb(olympe.sc.Cc.G)}C(){return this.qb(olympe.sc.Cc.C)}};olympe.sc.Cc.N=olympe.dc.la.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.G=olympe.sc.Cc.N.ia('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.N.ia('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.N.oa('01703376c4a81c0e9d93');U(olympe.dc.CloudObject.N,olympe.sc.Cc.F);olympe.sc.Cc.prototype.F.J=olympe.D.H.F;olympe.sc.Cc.prototype.C.J=olympe.D.H.F;olympe.sc.ud={};olympe.sc.ud.ve={Bw:null,Ps:'screenflow',ft:'ui-design',bp:'software-intelligence',Fg:'data-management'};olympe.sc.Oc=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ud.ve.bp}C(){return this.fb(olympe.sc.Oc.C,olympe.sc.logic.Zf)}F(){return this.fb(olympe.sc.Oc.F,olympe.sc.logic.zf)}};olympe.sc.Oc.N=olympe.dc.la.C('011100000000000adef0',olympe.sc.Oc);olympe.sc.Oc.C=olympe.sc.Oc.N.oa('016ac4f59a2917fdef01');olympe.sc.Oc.F=olympe.sc.Oc.N.oa('016ac4f59a2917fdef02');olympe.sc.Oc.N.C=(a,b)=>mj(a,b||'New function signature',olympe.sc.Oc,olympe.sc.logic.Id).X();
890
+ olympe.sc.Oc.prototype.C.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.Oc.prototype.F.J=new olympe.D.H(()=>olympe.dc.ta,[]);function Tk(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Uk(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Zc(c,olympe.sc.logic.Jb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ma(c,olympe.sc.logic.Jb.C,!0))?e:0;let f;d=null!=(f=a.db.Ma(d,olympe.sc.logic.Jb.C,!0))?f:0;return c-d});return b}
891
+ olympe.sc.Xa=class extends olympe.dm.BrickMetadata{Pr(a,b,c,d,e=!0){e||olympe.ka.ab('sc').error('parameter own= false ignored, investigate');return olympe.D.yg(N(this.gf(a,olympe.dc.Db.gg,c)),d)}Uu(){return this.fb(olympe.sc.Xa.P,olympe.sc.Runnable)}iu(){return this.fb(olympe.sc.Xa.T,olympe.sc.Runnable)}bm(){return this.db.Ma(this,olympe.sc.Xa.ba)}Zl(){return null!==this.db.Tb(this.tag,olympe.sc.Runnable.C.Pb())}Rk(){return this.fb(olympe.sc.Xa.F,olympe.sc.logic.ob)}Wi(){return this.fb(olympe.sc.Xa.G,
892
+ olympe.sc.logic.wb)}};olympe.sc.Xa.N=olympe.dc.la.C('0112000000000000def0',olympe.sc.Xa);olympe.sc.Xa.ba=olympe.sc.Xa.N.ia('01692aa71f3108454479');olympe.sc.Xa.nb=olympe.sc.Xa.N.ia('0166446c1f128ebc903a');olympe.sc.Xa.P=olympe.sc.Xa.N.oa('01692a4af82e8984742c');olympe.sc.Xa.T=olympe.sc.Xa.N.oa('01692a4af82e8984742d');olympe.sc.Xa.Z=olympe.sc.Xa.N.oa('01692a4af82e8984742e');olympe.sc.Xa.F=olympe.sc.Xa.N.oa('01621fb84e320000f00a');olympe.sc.Xa.G=olympe.sc.Xa.N.oa('01621fb84e320000f00b');
893
+ olympe.sc.Xa.Xb=olympe.sc.Xa.N.oa('0171838bcfed0000e00e');olympe.sc.Xa.Wb=olympe.sc.Xa.N.oa('0171838bcfed0000a00a');l=olympe.sc.Xa.prototype;l.Pr.J=olympe.D.H.C;l.Uu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.iu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.bm.J=olympe.D.H.C;l.Zl.J=olympe.D.H.C;l.Rk.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.Wi.J=new olympe.D.H(()=>olympe.dc.ta,[]);function Vk(a){const b=olympe.dc.CloudObject.Kp(new Map,a);olympe.D.Oa().onDestroy(()=>{const c=new olympe.dc.Sa;c.delete(b);c.jb()});return b}function Wk(a,b){Ik(b.C,a);Tk(a.rd(),b);const c=a.L(),d=Xk(b,c),e=[];c.forEach((f,g)=>{f===a.ba?e[0]=g:f===a.Z&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Yk(a,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
894
+ function Zk(a,b){var c=a.Sb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.mb()&&(b.clear(),null!==h)){h=Array.isArray(h)?h:[h];const k=new olympe.sc.vp(b.C);k.F().run(a.update.bind(a,k,h,g));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.K.debug(e):a.K.debug(f),a.qa.bind(a,b),()=>a.K.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
895
+ function $k(a,b,c,d){const e=d.F(),f=W(a.db,b,c,e.G((g,h)=>{const k=yk(d,h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.onDestroy(a.db.F.bind(a.db,b,c,f,!0))}function Xk(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
896
+ function Yk(a,b,c){const d=olympe.D.Oa(),e=Af(a.db,a.tag,d.G((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.gg(g)))}));d.onDestroy(()=>{Bf(a.db,a.tag,e)})}
897
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.K=c}run(a){a.F().run(()=>{Wk(this,a);this.init(a);if(this.rd().bm())Zk(this,a);else{const b=new olympe.sc.vp(a.C);b.F().run(()=>this.update(b,[],[]))}a.sm(olympe.sc.Xa.nb);a.wg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))})}rd(){return this.Dd()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.bm())this.onUpdate(a,b,c);else this.K.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.W()}`),
898
+ $k(this,d,olympe.sc.Xa.P,a),this.ga()&&$k(this,d,olympe.sc.Xa.Z,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){this.K.error(`Brick ${this.db.name(this.Sb())} (${this.Sb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.rd();return Uk(a,a.db.fb(a.tag,olympe.sc.Xa.F))}getOutputs(){var a=this.rd();return Uk(a,a.db.fb(a.tag,olympe.sc.Xa.G))}F(){return[]}P(){return new Map}ga(){return!1}G(a,
899
+ b,c,d){a=b.vb(a,c,!0);void 0!==d&&olympe.D.yg(a,d);return a}ub(a,b,c,d,e){olympe.D.jm([d],f=>{b.set(a,olympe.D.cq(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.ba,this.Z]}ba(a,b){Yk(this,b,null)}Z(a,b){Yk(this,null,b)}Cb(a,b){const c=this.db,d=olympe.sc.logic.eb.G.Pb(),e=olympe.sc.logic.eb.F,f=olympe.sc.logic.eb.C;this.Rp(d,g=>{var h=g.X();if(h=c.Tb(h,e)||c.Tb(h,f))return al(g,a,b.bind(null,h))})}qa(a,b){const c=this.Sb();let d=this.db.name(c);try{const e=[a.fe()];let f=a.getParent();
900
+ for(;null!==f&&f.C!==olympe.sc.km;)e.unshift(f.fe()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.K.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.K.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.N=Ce(olympe.dc.la.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.N.oa('01692a4af82e8984742b');
901
+ olympe.sc.Runnable.C=olympe.sc.Runnable.N.oa('01756a18d4921c103111');olympe.sc.Runnable.P=U(olympe.sc.Runnable.N,olympe.sc.Xa.P);olympe.sc.Runnable.T=U(olympe.sc.Runnable.N,olympe.sc.Xa.T);olympe.sc.Runnable.Z=U(olympe.sc.Runnable.N,olympe.sc.Xa.Z);U(olympe.sc.Xa.N,olympe.sc.Runnable.L);U(olympe.sc.Xa.N,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.rd.J=new olympe.D.H(()=>olympe.sc.Xa,[]);olympe.sc.Runnable.prototype.G.J=new olympe.D.H(()=>Object,[]);olympe.sc.Runnable.prototype.ub.J=olympe.D.H.C;function bl(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.ae)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.ae=class extends olympe.dc.CloudObject{F(){return this.db.fb(this,olympe.sc.ae.C)[0]}C(){return olympe.dc.CloudObject.get(bl(this))}toString(){const a=bl(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.ae.N=olympe.dc.la.C('0163c9ae01f2d6e9ca49',olympe.sc.ae);olympe.sc.ae.C=olympe.sc.ae.N.oa('0169b5a8a33144fb0b49');
902
+ U(olympe.dc.CloudObject.N,olympe.sc.ae.C);olympe.sc.ae.prototype.F.J=new olympe.D.H(()=>String,[]);olympe.sc.ae.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.kn=class extends olympe.dm.Ab{Td(){return olympe.sc.ud.ve.Fg}};olympe.sc.kn.N=olympe.dc.la.C('0163a68ce44f3d1fa84c',olympe.sc.kn);olympe.sc.Jc=class extends olympe.dm.BrickMetadata{};olympe.sc.Jc.N=olympe.dc.la.C('016324fde11a836f76c2',olympe.sc.Jc);olympe.sc.Jc.C=olympe.sc.Jc.N.oa('016324fde11a836087c2');olympe.sc.Jc.N.C=function(a,b){return mj(a,null!=b?b:'New type',olympe.sc.Jc).X()};let cl=null;
903
+ function dl(a,b){cl=a;const c=olympe.D.Oa(),d=c.G(b);olympe.dc.Nc.from(a).lb(olympe.sc.pa.Tc.C).lb(olympe.sc.Uc.C.Pb()).jb(c).then(e=>{if(null!==e){const f=olympe.dc.ya();Lg(c,e,g=>{g=f.oi(g)?g:f.model(g);return null!==g&&f.Zc(g,olympe.sc.Jc)}).subscribe(()=>{d(olympe.sc.Uc.ac.Zn)})}else olympe.ka.ab('sc').error('No container found for the application',a),d(olympe.sc.Uc.ac.Yk)}).catch(e=>{olympe.ka.ab('sc').error('Error while loading business container:',e.message);d(olympe.sc.Uc.ac.Fb)})}
904
+ olympe.sc.Uc=class extends olympe.dc.CloudObject{};olympe.sc.Uc.ac={Zn:0,Yk:1,Fb:2};olympe.sc.Uc.N=olympe.dc.la.C('017b3aa8fae1e3d044dc',olympe.sc.Uc);olympe.sc.Uc.C=olympe.sc.Uc.N.oa('017b3aa8fd1659291b92');olympe.sc.Uc.F=olympe.sc.Uc.N.oa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.N=olympe.dc.la.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Xf=class extends olympe.sc.Map{};olympe.sc.Xf.N=olympe.dc.la.C('01631aacd8276ea98490',olympe.sc.Xf);olympe.sc.File=class extends olympe.dm.File{static It(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.jq(a,e,b,c,d);return e}static Jt(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.om(a,e,b,c,d);return e}static jq(a,b,c,d,e){e=null!=e?e:'application/data';d=olympe.Y.Pd().P(new Blob([d],{type:e}));olympe.sc.File.om(a,b,c,d,e)}static om(a,b,c,d,e){const f=olympe.dc.ya(),g=f.Ua(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.ni(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
905
+ h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Ma(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.fq(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.om;olympe.sc.File.setContent=olympe.sc.File.jq;olympe.sc.File.createFromURL=olympe.sc.File.Jt;olympe.sc.File.createFromContent=olympe.sc.File.It;
906
+ olympe.sc.File.N=we(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Uf=class extends olympe.sc.File{L(){const a=olympe.D.ec(olympe.D.Ja);this.Lj(b=>{a.update(olympe.D.rb(b))});return a.vb()}};olympe.sc.Uf.N=we(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Uf);olympe.sc.Uf.N.C=olympe.sc.File.F.bind(null,olympe.sc.Uf);olympe.sc.Uf.prototype.L.J=olympe.D.H.F;olympe.sc.qc=class extends olympe.sc.File{L(){return this.qb(olympe.sc.qc.fontFamilyProp)}P(){return this.qb(olympe.sc.qc.G)}T(){return this.Hc(olympe.sc.qc.L)}};olympe.sc.qc.N=we(olympe.sc.File,'01647e113043c637b541',olympe.sc.qc);olympe.sc.qc.fontFamilyProp=olympe.sc.qc.N.ia('01647e35ecd24ef0b88d');olympe.sc.qc.G=olympe.sc.qc.N.ia('01647e677f5d1cfbdf42');olympe.sc.qc.L=olympe.sc.qc.N.ia('01647e6780999bf8bd25');
907
+ olympe.sc.qc.N.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.qc,a,b,c,d);a.update(c,olympe.sc.qc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.qc.prototype.L.J=olympe.D.H.F;olympe.sc.qc.prototype.P.J=olympe.D.H.F;olympe.sc.qc.prototype.T.J=olympe.D.H.G;olympe.sc.Ug=class extends olympe.sc.File{};olympe.sc.Ug.N=we(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Ug);olympe.sc.Ug.N.C=olympe.sc.File.F.bind(null,olympe.sc.Ug);olympe.sc.xp=class extends olympe.dc.CloudObject{};olympe.sc.xp.N=olympe.dc.la.C('016421bb3797e22d1c4e',olympe.sc.xp);olympe.sc.logic={};olympe.sc.logic.Hn=(a,b)=>a===b?0:a>b?1:-1;
908
+ olympe.sc.logic.Ux=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Qa(b.getType().X());let k,m;if(b===olympe.dc.ja(olympe.dm.String))k=c.valueOf().toLowerCase(),m=p=>p.qb(h).toLowerCase();else if(b===olympe.dc.ja(olympe.dm.Number))k=c.valueOf(),m=p=>p.Hc(h);else if(b===olympe.dc.ja(olympe.dm.DateTime))k=c.getTime(),m=p=>olympe.D.ra([p.ji(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ya().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
909
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Hn(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Hn(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Hf().filter(p=>olympe.D.ra([m(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Hb(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).Qe())};
910
+ olympe.sc.logic.EA=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Ja)return a.mq();if(a instanceof olympe.D.ea)return a.Wp();if('string'===typeof a||'number'===typeof a)return olympe.D.na(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.jo};olympe.sc.logic.Ha={};function el(a){Be(a.N,(b,c)=>{b=b.create(a.N.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ha.An=class{constructor(a,b,c){this.N=olympe.dc.la.C(a,b,...c);el(this)}X(){return this.N.X()}};olympe.sc.logic.Ha.An.sa=[olympe.dc.oe];const fl=Object.create(null),gl=new Map;function hl(a){if(void 0===fl[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return ye(a)}function il(a,b,c=olympe.sc.logic.Function){if(gl.has(a))throw c=hl(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.la.C(a,b,...[]);gl.set(a,{N:d,UA:b,BA:c});return d}
911
+ olympe.sc.logic.la=class{constructor(){}static C(a,b,...c){if(fl[a])throw c=hl(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ha.An(a,b,[olympe.sc.R.za].concat(c));return fl[a]=b}};olympe.sc.logic.Iw=class{};olympe.sc.logic.Ki=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ki.N=olympe.dc.la.C('01621fb84e320000cf00',olympe.sc.logic.Ki);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.C=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Iu(){return this.C}fu(){return this.code}};B('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.fu;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Iu;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
912
+ olympe.sc.logic.Ch=class extends olympe.sc.logic.Ki{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Ch.N=olympe.dc.la.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Ch);olympe.sc.logic.Mc=class extends olympe.dc.CloudObject{C(){return this.Zb(olympe.sc.logic.Mc.C,olympe.dc.CloudObject)}};olympe.sc.logic.Mc.N=olympe.dc.la.C('016ac4f59ee8ea2081ba',olympe.sc.logic.Mc);olympe.sc.logic.Mc.F=olympe.sc.logic.Mc.N.ia('017bc044aeacce7ffc8f');olympe.sc.logic.Mc.C=olympe.sc.logic.Mc.N.oa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.N,olympe.sc.logic.Mc.C);olympe.sc.logic.Mc.prototype.C.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Zf=class extends olympe.sc.logic.Mc{};olympe.sc.logic.Zf.N=olympe.dc.la.C('016ac4f59c592b862457',olympe.sc.logic.Zf);olympe.sc.logic.Zf.G=olympe.sc.Oc.C.Pb();olympe.sc.logic.Zf.N.C=(a,b,c,d,e)=>{b=mj(a,b||'New Predefined Input',olympe.sc.logic.Zf,olympe.sc.logic.ob);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.C,d,b);return b.X()};olympe.sc.logic.zf=class extends olympe.sc.logic.Mc{};olympe.sc.logic.zf.N=olympe.dc.la.C('016ac4f59dd99f5df3e1',olympe.sc.logic.zf);olympe.sc.logic.zf.G=U(olympe.sc.logic.zf.N,olympe.sc.Oc.F);olympe.sc.logic.zf.N.C=(a,b,c,d,e)=>{b=mj(a,b||'New Predefined Output',olympe.sc.logic.zf,olympe.sc.logic.wb);Z(b,olympe.sc.logic.Mc.F,e);a.Ea(olympe.sc.logic.Mc.C,b,c);a.Ea(olympe.sc.Oc.F,d,b);return b.X()};olympe.sc.logic.Id=class extends olympe.sc.Xa{Td(){return olympe.sc.ud.ve.bp}T(){return this.Pl().Hf().Zc([olympe.sc.logic.Function]).and().$c().Zc([olympe.sc.logic.Ic,olympe.sc.logic.Kc]).Qe()}xu(){return this.Rk().Hf().li([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Zf.G]).Qe()}yu(){return this.Wi().Hf().li([olympe.dc.CloudObject.modelRel,olympe.sc.logic.zf.G]).Qe()}Rd(a){const b=this.db.Ml(this,[olympe.sc.Xa.F],c=>this.db.model(c)===olympe.dc.ja(a));return b?olympe.dc.CloudObject.get(b):null}ef(a){const b=
913
+ this.db.Ml(this,[olympe.sc.Xa.G],c=>this.db.model(c)===olympe.dc.ja(a));return b?olympe.dc.CloudObject.get(b):null}bv(){return this.Rk().Hf().li([olympe.dc.CloudObject.modelRel],olympe.sc.logic.ob).Qe()}dv(){return this.Wi().Hf().li([olympe.dc.CloudObject.modelRel],olympe.sc.logic.wb).Qe()}};olympe.sc.logic.Id.N=il('01621fb84e320000f000',olympe.sc.logic.Id,olympe.sc.logic.Function);l=olympe.sc.logic.Id.prototype;l.xu.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.yu.J=new olympe.D.H(()=>olympe.dc.ta,[]);
914
+ l.Rd.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.ef.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.bv.J=new olympe.D.H(()=>olympe.dc.ta,[]);l.dv.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.logic.pf=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63229782039429f')}F(){return this.ef('016ac6322acf67eebfe7')}G(){return this.Wi().Hf().lb(olympe.sc.logic.Jb.typeRel).Uj(olympe.sc.logic.Ch).Qe().Oe().$l(olympe.D.aa.ZERO)}};olympe.sc.logic.pf.C='016ac63229782039429f';olympe.sc.logic.pf.L='016ac6322acf67eebfe7';olympe.sc.logic.pf.N=il('01621fb84e320000a000',olympe.sc.logic.pf,olympe.sc.logic.Action);olympe.sc.logic.pf.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);
915
+ olympe.sc.logic.pf.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.pf.prototype.G.J=olympe.D.H.P;olympe.sc.logic.Zm=class extends olympe.sc.logic.Id{};olympe.sc.logic.Zm.N=il('01621fb84e320000f011',olympe.sc.logic.Zm);olympe.sc.logic.Ym=class extends olympe.sc.logic.pf{};olympe.sc.logic.Ym.N=il('01621fb84e320000f012',olympe.sc.logic.Ym);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.Cb]}P(){const a=olympe.sc.wd.F.ur,b=olympe.sc.wd.F.ys,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}C(a){return this.getOutputs().map(b=>this.db.cm(b,olympe.sc.logic.Jb.typeRel,olympe.sc.logic.Ki)?a.sm.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
916
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.N=olympe.dc.la.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.za);olympe.sc.logic.Jb=class extends olympe.dc.CloudObject{getType(){return this.Zb(olympe.sc.logic.Jb.typeRel,olympe.dc.CloudObject)}C(){return this.Hc(olympe.sc.logic.Jb.C)}};olympe.sc.logic.Jb.N=olympe.dc.la.C('0168a431d25001540000',olympe.sc.logic.Jb);olympe.sc.logic.Jb.C=olympe.sc.logic.Jb.N.ia('01740c5d4ae4b520dd01');olympe.sc.logic.Jb.typeRel=olympe.sc.logic.Jb.N.oa('0168a431d3b9b7438424');U(olympe.dc.CloudObject.N,olympe.sc.logic.Jb.typeRel);
917
+ olympe.sc.logic.Jb.prototype.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Jb.prototype.C.J=olympe.D.H.G;olympe.sc.logic.ob=class extends olympe.sc.logic.Jb{};olympe.sc.logic.ob.N=olympe.dc.la.C('0168a431d25001540001',olympe.sc.logic.ob);olympe.sc.logic.ob.T=olympe.sc.logic.Jb.N.ia('01740c5d4ae4b520dd02');olympe.sc.logic.ob.P=U(olympe.sc.logic.ob.N,olympe.sc.Xa.F);olympe.sc.logic.ob.F=olympe.sc.logic.ob.N.oa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.ob.G=olympe.sc.logic.ob.N.oa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
918
+ olympe.sc.logic.ob.L=olympe.sc.logic.ob.N.oa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.ob.N.C=function(a,b,c,d,e,f=olympe.sc.logic.ob){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ea(olympe.sc.logic.Jb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Jb.C,e);d&&a.Ea(olympe.sc.Xa.F,d,f);return f.X()};olympe.sc.logic.wb=class extends olympe.sc.logic.Jb{};olympe.sc.logic.wb.N=olympe.dc.la.C('0168a431d25001540002',olympe.sc.logic.wb);olympe.sc.logic.wb.P=U(olympe.sc.logic.wb.N,olympe.sc.Xa.G);olympe.sc.logic.wb.F=olympe.sc.logic.wb.N.oa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.wb.L=olympe.sc.logic.wb.N.oa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.wb.G=olympe.sc.logic.wb.N.oa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
919
+ olympe.sc.logic.wb.N.C=function(a,b,c,d,e,f=olympe.sc.logic.wb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Jb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Jb.C,e);d&&a.Ea(olympe.sc.Xa.G,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.rd().C().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.N=olympe.dc.la.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.za);olympe.sc.logic.Ic=class extends olympe.sc.logic.Function{run(a){Wk(this,a);const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Ic.G),d=this.db.Tb(this,olympe.sc.logic.Ic.F);a.on(c,e=>b.set(d,e),this.tag)}Ba(){return this.Zb(olympe.sc.logic.Ic.G,olympe.sc.logic.ob)}Wa(){return this.Zb(olympe.sc.logic.Ic.F,olympe.sc.logic.wb)}};olympe.sc.logic.Ic.N=olympe.dc.la.C('01621fb84e32000000a0',olympe.sc.logic.Ic,olympe.sc.R.za);olympe.sc.logic.Ic.G=U(olympe.sc.logic.Ic.N,olympe.sc.logic.ob.G);
920
+ olympe.sc.logic.Ic.F=U(olympe.sc.logic.Ic.N,olympe.sc.logic.wb.L);olympe.sc.logic.Ic.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Ic);a.Ea(olympe.sc.logic.Ic.F,b,c);return b.X()};olympe.sc.logic.Ic.prototype.Ba.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Ic.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Kc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Tb(this,olympe.sc.logic.Kc.F),d=this.db.Tb(this,olympe.sc.logic.Kc.G);b.on(c,e=>a.set(d,e),b.W())}Wa(){return this.Zb(olympe.sc.logic.Kc.F,olympe.sc.logic.ob)}Ba(){return this.Zb(olympe.sc.logic.Kc.G,olympe.sc.logic.wb)}};olympe.sc.logic.Kc.N=olympe.dc.la.C('01621fb84e32000000d0',olympe.sc.logic.Kc,olympe.sc.R.za);olympe.sc.logic.Kc.F=U(olympe.sc.logic.Kc.N,olympe.sc.logic.ob.L);
921
+ olympe.sc.logic.Kc.G=U(olympe.sc.logic.Kc.N,olympe.sc.logic.wb.G);olympe.sc.logic.Kc.N.C=function(a,b,c){b=a.create(olympe.sc.logic.Kc);a.Ea(olympe.sc.logic.Kc.F,b,c);return b.X()};olympe.sc.logic.Kc.prototype.Wa.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Kc.prototype.Ba.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);function al(a,b,c){const d=a.db.Tb(a,olympe.sc.logic.eb.T)||a.db.Tb(a,olympe.sc.logic.eb.L),e=a.db.Tb(a,olympe.sc.logic.eb.P),f=a.db.ni(jl(a),olympe.dm.qe)?new olympe.D.Nb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const m=b.$j(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);m();k&&k()}}const h=yf(a.db,a,olympe.sc.logic.eb.valueProp,g);return()=>{g(null);zf(a.db,a,olympe.sc.logic.eb.valueProp,h)}}
922
+ function jl(a){let b=null,c=a.db.Tb(a,olympe.sc.logic.eb.F);c?b=a.db.Tb(c,olympe.dm.Property.typeRel):(c=a.db.Tb(a,olympe.sc.logic.eb.C))&&(b=a.db.Tb(c,olympe.sc.logic.Jb.typeRel));return b||olympe.dc.ja(olympe.dc.CloudObject)}
923
+ olympe.sc.logic.eb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.K=c}C(a,b,c){const d=olympe.sc.gg(c);null==b||b.qa();b&&d instanceof olympe.dm.qe?null==b||b.run(()=>{olympe.D.oc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.gf(olympe.sc.logic.eb.valueProp,a||olympe.dc.Db.gg,Object)}getType(){const a=this.transform(olympe.sc.logic.eb.C,olympe.sc.logic.Jb.typeRel);a.ld(olympe.dc.CloudObject);return a.vc()}$u(){return this.Zb(olympe.sc.logic.eb.P,olympe.dc.CloudObject)}Yu(){return this.Zb(olympe.sc.logic.eb.T,
924
+ olympe.sc.logic.wb)}Zu(){return this.Zb(olympe.sc.logic.eb.L,olympe.dm.Property)}ru(){return this.Zb(olympe.sc.logic.eb.G,olympe.dc.CloudObject)}pu(){return this.Zb(olympe.sc.logic.eb.C,olympe.sc.logic.ob)}qu(){return this.Zb(olympe.sc.logic.eb.F,olympe.dm.Property)}};olympe.sc.logic.eb.N=olympe.dc.la.C('0168a431d91f25780000',olympe.sc.logic.eb,olympe.sc.R.za);olympe.sc.logic.eb.valueProp=olympe.sc.logic.eb.N.ia('0168a431d91f25780001');olympe.sc.logic.eb.P=olympe.sc.logic.eb.N.oa('0168a431d91f25780002');
925
+ olympe.sc.logic.eb.T=U(olympe.sc.logic.eb.N,olympe.sc.logic.wb.F);olympe.sc.logic.eb.L=olympe.sc.logic.eb.N.oa('0168a431d91f25780004');olympe.sc.logic.eb.G=olympe.sc.logic.eb.N.oa('0168a431d91f2578000a');olympe.sc.logic.eb.C=U(olympe.sc.logic.eb.N,olympe.sc.logic.ob.F);olympe.sc.logic.eb.F=olympe.sc.logic.eb.N.oa('0168a431d91f2578000c');U(olympe.dc.CloudObject.N,olympe.sc.logic.eb.P);U(olympe.dm.Property.N,olympe.sc.logic.eb.L);U(olympe.dc.CloudObject.N,olympe.sc.logic.eb.G);
926
+ U(olympe.dm.Property.N,olympe.sc.logic.eb.F);l=olympe.sc.logic.eb.prototype;l.getType.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.$u.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.Yu.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Zu.J=new olympe.D.H(()=>olympe.dm.Property,[]);l.ru.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);l.pu.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.qu.J=new olympe.D.H(()=>olympe.dm.Property,[]);function kl(a,b){const c=a.rd(),d=c.Sk().X(),e=c.Tk().X(),f=c.Uk().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.O.pb.get(a.Sb(),g,h).then(k=>{for(const [m,n]of k)m!==e&&m!==f&&b.set(m,n);b.set(e,k.get(e));b.set(f,k.get(f))}).catch(k=>{b.set(f,olympe.sc.logic.Ch.create(k.toString(),1))})}},b.W())}
927
+ function ll(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();m&&m();try{const p=new Map(a.getOutputs().map(q=>[q,b.get(q)]));f.dd(p).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Sb()}: ${p.message}`),f.dh(n).finally(()=>b.destroy())}}},h=b.W(),k=b.on(c,g,h),m=b.on(d,g,h)}
928
+ olympe.sc.logic.Rg=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Qa(olympe.sc.wa.C.EDITION))&&b||(this.db.Ma(this,olympe.sc.logic.Rg.F)?this.Ba(a):(Wk(this,a),kl(this,a)))}Ba(a){const b=this.Sb(),c=this.rd(),d=c.Xn().X(),e=c.Sk().X(),f=c.Tk().X(),g=c.Uk().X();(new olympe.O.pb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.ah('remote call'),m=h.body(),n=Mb(()=>{h.dh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
929
+ k.destroy()},this.timeout);ll(this,k,f,g,n,h);super.run(k);for(const [p,q]of m)p!==e&&k.set(p,q);h.qh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ja(q)!==p&&(q=this.Sb(),this.K.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,m.get(e))}).catch(p=>{const q=this.Sb();this.K.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Ch.create('Unrecognized User',
930
+ 1))})},h=>{const k=this.Sb();this.K.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Rg.N=olympe.dc.la.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Rg,olympe.sc.R.za,new olympe.U.ma(olympe.sc.V.Mo));olympe.sc.logic.Rg.F=olympe.sc.logic.Rg.N.ia('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Nk=class{constructor(a){this.db=olympe.dc.ya();this.typeRel=a}};olympe.sc.logic.controllers.Nk.C={Lw:-1,Ox:1};olympe.sc.logic.controllers.Hy=class extends olympe.sc.logic.controllers.Nk{constructor(){super(olympe.sc.logic.Mc.C)}};olympe.sc.logic.controllers.Ny=class extends olympe.sc.logic.controllers.Nk{constructor(){super(olympe.sc.logic.Jb.typeRel)}};olympe.sc.logic.Jj={};olympe.sc.logic.Jj.Ys=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ja(b);d?olympe.dc.ua.cc(a,d,olympe.dc.Mb.Bf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.K.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.la.C('0174bf4b7e006e4b788a',olympe.sc.logic.Jj.Ys);olympe.sc.logic.actions={};olympe.sc.logic.Jj.js=class extends olympe.sc.logic.Function{run(a){Wk(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.K.warn('No list to iter upon'),this.K.info(a.W())):f<e?(b(g.Ae(f)),f++,c((new Date).getTime())):(Kk(h.C),d((new Date).getTime()))};this.getInputs().forEach((m,n)=>a.on(m,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Jf();f=0;Jk(h.C);k();break;case 2:k();break;default:this.K.error('Unhandled input')}},this.tag))}};
931
+ olympe.sc.logic.la.C('0171889b060b6cd54300',olympe.sc.logic.Jj.js);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ok=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63808535703691c')}};olympe.sc.logic.Rb.Ok.N=il('0169b6876a03f139d50a',olympe.sc.logic.Rb.Ok);olympe.sc.logic.Rb.Ok.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.bl=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63809a9a8e6db96')}F(){return this.ef('016ac6380ab003363b3e')}};il('01646ad602f933b8caaf',olympe.sc.logic.Rb.bl);olympe.sc.logic.Rb.bl.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.bl.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.dj=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac6380bd98f1d91a0')}G(){return this.ef('016ac63c589ae38ca3ae')}F(){return this.ef('016ac63c5a377fceabaa')}};il('0168ec42fc01747a98b6',olympe.sc.logic.Rb.dj);olympe.sc.logic.Rb.dj.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.logic.Rb.dj.prototype.G.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.dj.prototype.F.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.logic.Rb.ag=class extends olympe.sc.logic.Id{Sk(){return this.Rd('017a7b07b09e3b22c8b4')}Xn(){return this.Rd('017a7b07ba05807a74b0')}Tk(){return this.ef('017a7b0818c12388d731')}Uk(){return this.ef('017a7b085146d5e69aec')}Qr(){return olympe.D.ea.F}};olympe.sc.logic.Rb.ag.L='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.ag.ub='017a7b07ba05807a74b0';olympe.sc.logic.Rb.ag.Ba='017a7b0818c12388d731';olympe.sc.logic.Rb.ag.C='017a7b085146d5e69aec';
932
+ olympe.sc.logic.Rb.ag.N=il('017a7b07a948e30508fa',olympe.sc.logic.Rb.ag,olympe.sc.logic.Rg);l=olympe.sc.logic.Rb.ag.prototype;l.Sk.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Xn.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Tk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Uk.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Qr.J=olympe.D.H.P;olympe.sc.logic.Rb.ip=class extends olympe.sc.logic.Id{C(){return this.Rd('016ac63c5b3ed0562740')}};il('016a9766c230916ea5ec',olympe.sc.logic.Rb.ip);olympe.sc.logic.Rb.ip.prototype.C.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);olympe.sc.query={};olympe.sc.query.Bm=class extends olympe.sc.Xf{};olympe.sc.query.Bm.N=olympe.dc.la.C('01631aacd8276ea98491',olympe.sc.query.Bm);olympe.sc.query.wo=class extends olympe.dm.Enum{};olympe.sc.query.wo.N=olympe.dc.la.C('01631aacd8276ea98495',olympe.sc.query.wo);olympe.sc.query.Go=class extends olympe.dm.Enum{};olympe.sc.query.Go.N=olympe.dc.la.C('01631aacd8276ea98494',olympe.sc.query.Go);olympe.sc.query.Ho=class extends olympe.sc.Xf{};olympe.sc.query.Ho.N=olympe.dc.la.C('01631aacd8276ea98492',olympe.sc.query.Ho);olympe.sc.query.Dc=class extends olympe.dc.CloudObject{};olympe.sc.query.Dc.N=olympe.dc.la.C('01631aacd8276ea98493',olympe.sc.query.Dc);olympe.sc.cn=class extends olympe.dc.CloudObject{};olympe.sc.cn.N=olympe.dc.la.C('018312ceeb3e93618a85',olympe.sc.cn);olympe.sc.Eb={};olympe.sc.Eb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.qb(olympe.sc.Eb.Comment.L)}F(){return this.qb(olympe.sc.Eb.Comment.G)}C(){return new olympe.D.Ib(this.Hc(olympe.sc.Eb.Comment.P),this.Hc(olympe.sc.Eb.Comment.F))}static Fc(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Eb.Comment.C,b,c);c=a.create(olympe.sc.ui.ud.Fo);Z(c,olympe.sc.ui.ud.Fo.uB,d.Vn());Z(c,olympe.sc.ui.ud.Fo.vB,d.Wn());a.Ea(olympe.dm.BrickMetadata.ga,
933
+ b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Eb.Comment.Z=100;olympe.sc.Eb.Comment.T=66;olympe.sc.Eb.Comment.N=olympe.dc.la.C('0184bd886ee1c7adfe09',olympe.sc.Eb.Comment);olympe.sc.Eb.Comment.L=olympe.sc.Eb.Comment.N.ia('0184c80e29ed08a16c5e');olympe.sc.Eb.Comment.G=olympe.sc.Eb.Comment.N.ia('0184bd889f33359cfe75');olympe.sc.Eb.Comment.P=olympe.sc.Eb.Comment.N.ia('0184c3f9406e25a41512');olympe.sc.Eb.Comment.F=olympe.sc.Eb.Comment.N.ia('0184c3f942e4cc136ce8');
934
+ olympe.sc.Eb.Comment.C=olympe.sc.Eb.Comment.N.oa('0184be3f135a83fd6cc3');olympe.sc.Eb.Comment.prototype.getType.J=olympe.D.H.F;olympe.sc.Eb.Comment.prototype.F.J=olympe.D.H.F;olympe.sc.Eb.Comment.prototype.C.J=olympe.D.H.T;olympe.sc.Eb.rk=class extends olympe.dm.Enum{};olympe.sc.Eb.rk.C={Aw:'Comment',Uz:'Todo'};olympe.sc.Eb.rk.N=olympe.dc.la.C('0184cc42e06205501bc7',olympe.sc.Eb.rk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.N=olympe.dc.la.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13a');
935
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.N.ia('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.N.oa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.N.oa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Te=class extends olympe.sc.logic.Id{Rr(){return this.Rd('017ffe02381f9fac5060')}Ur(){return this.Rd('017ffe02381f9fac5061')}Vr(){return this.Rd('017ffe02381f9fac5062')}nu(){return this.Rd('017ffe02381f9fac5065')}Sr(){return this.ef('017ffe02381f9fac5063')}Tr(){return this.ef('017ffe02381f9fac5064')}};olympe.sc.workflow.Te.N=il('017ffde21f5fe0f704ce',olympe.sc.workflow.Te);olympe.sc.workflow.Te.C='017ffe02381f9fac5060';olympe.sc.workflow.Te.hd='017ffe02381f9fac5061';
936
+ olympe.sc.workflow.Te.pd='017ffe02381f9fac5062';olympe.sc.workflow.Te.Ba='017ffe02381f9fac5065';olympe.sc.workflow.Te.L='017ffe02381f9fac5063';olympe.sc.workflow.Te.ub='017ffe02381f9fac5064';l=olympe.sc.workflow.Te.prototype;l.Rr.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Ur.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.Vr.J=new olympe.D.H(()=>olympe.sc.logic.ob,[]);l.nu.J=new olympe.D.H(()=>Map,[]);l.Sr.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);l.Tr.J=new olympe.D.H(()=>olympe.sc.logic.wb,[]);olympe.sc.workflow.ue=class extends olympe.dm.BrickMetadata{xc(){return this.Zb(olympe.sc.workflow.Workflow.statesRel.Pb(),olympe.sc.workflow.Workflow).fa().concat(['.',this.fa()])}};olympe.sc.workflow.ue.N=olympe.dc.la.C('017ffdc2dda51d46b430',olympe.sc.workflow.ue);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Zp()}C(){return this.Zb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.ue)}G(){return this.Zb(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.ue)}xc(){const a=this.Zb(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.ue);return a.Zb(olympe.sc.workflow.Workflow.statesRel.Pb(),olympe.sc.workflow.Workflow).fa().concat(['.',a.fa(),'->',this.fa()])}};
934
937
  olympe.sc.workflow.Transition.N=olympe.dc.la.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.N.ia('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.N.oa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.N.oa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.J=new olympe.D.H(()=>olympe.dc.CloudObject,[]);
935
- olympe.sc.workflow.Transition.prototype.C.J=new olympe.D.H(()=>olympe.sc.workflow.te,[]);olympe.sc.workflow.Transition.prototype.G.J=new olympe.D.H(()=>olympe.sc.workflow.te,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.td.ue.Dg}G(){return this.fh(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.Zb(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Gc)}F(){return this.Zb(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.te)}};olympe.sc.workflow.Workflow.N=olympe.dc.la.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.N.ia('017ffdc010e5bcc9c972');
936
- olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.J=olympe.D.H.O;olympe.sc.workflow.Workflow.prototype.C.J=new olympe.D.H(()=>olympe.sc.Gc,[]);
937
- olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.te,[]);olympe.sc.pa={};olympe.sc.pa.Qc=class extends olympe.sc.Wa{Td(){return olympe.sc.td.ue.Qs}};olympe.sc.pa.Qc.N=Be(olympe.dc.la.C('01120300000000adef00',olympe.sc.pa.Qc));olympe.sc.pa.Qc.C=olympe.sc.pa.Qc.N.oa('0171bc1f15da96dfdb89');olympe.sc.pa.Qc.Ba=olympe.sc.pa.Qc.N.oa('0171bc1f15da96dfdb90');T(olympe.dm.xc.N,olympe.sc.pa.Qc.C);olympe.sc.pa.oh=class extends olympe.sc.Runnable{F(){return[this.Rb()]}Ba(){return olympe.dc.Lc.from(this.Rb()).lb(olympe.sc.pa.Qc.C).Bd()}};olympe.sc.pa.oh.N=Be(olympe.dc.la.C('0113030000000aca1100',olympe.sc.pa.oh));olympe.sc.pa.oh.prototype.Ba.J=new olympe.D.H(()=>olympe.dm.tb,[]);olympe.sc.pa.bb=class extends olympe.dc.CloudObject{Xr(){return this.fh(olympe.sc.pa.bb.Wg)}Cv(){return this.fh(olympe.sc.pa.bb.qa)}qd(){return this.Ec(olympe.sc.pa.bb.C)}uu(){return this.qb(olympe.sc.pa.bb.K)}Tu(){return this.qb(olympe.sc.pa.bb.ga)}Su(){return this.qb(olympe.sc.pa.bb.Z)}Qd(){return this.qb(olympe.sc.pa.bb.ba)}Iu(){return this.qb(olympe.sc.pa.bb.O)}du(){return this.qb(olympe.sc.pa.bb.F)}Ru(){return this.qb(olympe.sc.pa.bb.T)}Wr(){return this.qb(olympe.sc.pa.bb.G)}};
938
- olympe.sc.pa.bb.N=olympe.dc.la.C('011203300000000adef5',olympe.sc.pa.bb);olympe.sc.pa.bb.Wg=olympe.sc.pa.bb.N.ia('011203300000000adef6');olympe.sc.pa.bb.qa=olympe.sc.pa.bb.N.ia('011203300000000adef7');olympe.sc.pa.bb.C=olympe.sc.pa.bb.N.ia('011203300000000adef8');olympe.sc.pa.bb.K=olympe.sc.pa.bb.N.ia('011203300000000adef9');olympe.sc.pa.bb.ga=olympe.sc.pa.bb.N.ia('011203300000000adefa');olympe.sc.pa.bb.Z=olympe.sc.pa.bb.N.ia('011203300000000adefb');olympe.sc.pa.bb.F=olympe.sc.pa.bb.N.ia('011203300000000adefc');
939
- olympe.sc.pa.bb.ba=olympe.sc.pa.bb.N.ia('011203300000000adefd');olympe.sc.pa.bb.O=olympe.sc.pa.bb.N.ia('011203300000000adefe');olympe.sc.pa.bb.T=olympe.sc.pa.bb.N.ia('011203300000000adeff');olympe.sc.pa.bb.G=olympe.sc.pa.bb.N.ia('011203300000000adee0');olympe.sc.pa.bb.bc={INIT:0,zw:1,pj:2,oj:3,ll:4,hz:5,Fb:9};l=olympe.sc.pa.bb.prototype;l.Xr.J=olympe.D.H.O;l.Cv.J=olympe.D.H.O;l.qd.J=olympe.D.H.G;l.uu.J=olympe.D.H.F;l.Tu.J=olympe.D.H.F;l.Su.J=olympe.D.H.F;l.Qd.J=olympe.D.H.F;l.Iu.J=olympe.D.H.F;
940
- l.du.J=olympe.D.H.F;l.Ru.J=olympe.D.H.F;l.Wr.J=olympe.D.H.F;olympe.sc.pa.Qi=class extends olympe.sc.pa.oh{ga(){return!0}};olympe.sc.pa.Qi.N=olympe.dc.la.C('0113032000000aca1102',olympe.sc.pa.Qi,olympe.sc.R.ya);olympe.sc.pa.se=class extends olympe.sc.pa.Qc{C(){return(new olympe.dc.Vi(this.X(),olympe.sc.pa.bb)).lb(olympe.sc.pa.se.K).Oe().vc()}};olympe.sc.pa.se.N=olympe.dc.la.C('011203300000000adef3',olympe.sc.pa.se);olympe.sc.pa.se.K=olympe.sc.pa.se.N.oa('011203300000000adef4');T(olympe.sc.pa.bb.N,olympe.sc.pa.se.K);
941
- olympe.sc.pa.se.N.C=(a,b,c)=>{b=kj(a,b||'New Service Application model',olympe.sc.pa.se,olympe.sc.pa.Qi);a.Ea(olympe.sc.pa.Qc.C,b,c);c=a.create(olympe.sc.pa.bb).X();a.Ea(olympe.sc.pa.se.K,b,c);return b.X()};olympe.sc.pa.se.prototype.C.J=new olympe.D.H(()=>olympe.sc.pa.bb,[]);olympe.sc.fg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.fg.N=olympe.dc.la.C('011203300000000adf00',olympe.sc.fg);olympe.sc.fg.F=olympe.sc.fg.N.ia('011203300000000adf01');olympe.sc.fg.C=olympe.sc.fg.N.ia('011203300000000adf02');olympe.sc.fg.G='011203300000000adf0f';olympe.sc.Bg=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.td.ue.Dg}};olympe.sc.Bg.N=olympe.dc.la.C('01645fe6873aeea59e64',olympe.sc.Bg);olympe.sc.Bg.C=olympe.sc.Bg.N.oa('017ed8ac775f48d4d589');olympe.sc.Bg.F=olympe.sc.Bg.N.oa('017ed8ac775f48d4d590');olympe.sc.$m=class extends olympe.dm.Ab{Td(){return olympe.sc.td.ue.Dg}};olympe.sc.$m.N=olympe.dc.la.C('0163a68ce44f3d1fa95d',olympe.sc.$m);olympe.sc.uh=class extends olympe.dm.BrickMetadata{};olympe.sc.uh.N=olympe.dc.la.C('016324fde11a836f77d3',olympe.sc.uh);olympe.sc.uh.C=olympe.sc.Gc.N.oa('016324fde11a836088d3');olympe.sc.uh.N.C=(a,b)=>kj(a,null!=b?b:'New config type',olympe.sc.uh).X();olympe.sc.Iw=class{};olympe.sc.Ii=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.td.ue.Dg}};olympe.sc.Ii.N=olympe.dc.la.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Ii);olympe.sc.Ii.N.C=(a,b)=>kj(a,null!=b?b:'New data connector',olympe.sc.Ii,olympe.dm.DataSource).X();olympe.sc.Wd=class extends olympe.sc.Runnable{Va(){return this.fb(olympe.sc.Wd.G,olympe.sc.Runnable)}Ba(){return this.fb(olympe.sc.Wd.F,olympe.dm.Property)}};olympe.sc.Wd.N=Be(olympe.dc.la.C('016c2d996d9ca27fa9d8',olympe.sc.Wd));olympe.sc.Wd.G=olympe.sc.Wd.N.oa('016c3cb7742ec9309e0b');olympe.sc.Wd.F=olympe.sc.Wd.N.oa('016c42d3454636f90533');olympe.sc.Wd.prototype.Va.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.Wd.prototype.Ba.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.tn=class extends olympe.dm.Ab{Td(){return olympe.sc.td.ue.Dg}};olympe.sc.tn.N=olympe.dc.la.C('017a7a9ff057958e5678',olympe.sc.tn);olympe.sc.ho=class extends olympe.dm.Ab{Td(){return olympe.sc.td.ue.gt}};olympe.sc.ho.N=olympe.dc.la.C('01644b6d4543b344b857',olympe.sc.ho);olympe.sc.io=class extends olympe.dc.CloudObject{};olympe.sc.io.N=olympe.dc.la.C('0162f672366be5ca7a86',olympe.sc.io);olympe.sc.dg=class extends olympe.dc.sources.dg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.C}:super.C(a)}F(a){return 20===(null==a?void 0:a.t)?olympe.sc.logic.Error.create(a.m,a.c):super.F(a)}};olympe.sc.jp=class extends olympe.sc.Wd{};olympe.sc.jp.N=olympe.dc.la.C('016d3f37610ae4fc3962',olympe.sc.jp);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.N=olympe.dc.la.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ra=class{constructor(a=!0){this.C=(new olympe.dc.Ra).persist(a);this.F=[];this.source=null}static from(a){const b=olympe.sc.wa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ra}static process(a,b){return a.has(olympe.sc.wa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ib().then(()=>!0)}W(){return this.C.W()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.ie().fromModel(a);d=this.C.create(a,d).jh(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Pa.SERVER){if('string'===
942
- typeof al){var e;let f;b=null!=(f=null==(e=olympe.dc.Lc.from(al).lb(olympe.sc.pa.Qc.C).lb(olympe.sc.Rc.C.Pb()).Bd())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Rc.F,e,d):olympe.ka.ab('sc').warn('No business container for new instance of',olympe.dc.ja(a))}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}fq(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.F.set(vj(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,b,c);
943
- return this}Xb(a,b,c){this.C.Xb(a,b,c);return this}Jl(a,b){this.C.Jl(a,b);return this}persist(a=!0){this.C.persist(a);return this}pi(a,b=!0){this.C.pi(a,b);return this}jh(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){jj(this.C,a.C);return this}Cl(a){this.C.Cl(a);return this}ib(){return new Promise((a,b)=>{this.C.ib((c,d)=>{c?a(new olympe.sc.Xh(this.F)):b(d)})})}Kl(){return new Promise((a,b)=>{this.C.Kl((c,d)=>{c?a(new olympe.sc.Xh(this.F)):b(d)})})}};
944
- olympe.sc.Ra.prototype.executeAsLarge=olympe.sc.Ra.prototype.Kl;olympe.sc.Ra.prototype.execute=olympe.sc.Ra.prototype.ib;olympe.sc.Ra.prototype.afterExecution=olympe.sc.Ra.prototype.Cl;olympe.sc.Ra.prototype.merge=olympe.sc.Ra.prototype.merge;olympe.sc.Ra.prototype.model=olympe.sc.Ra.prototype.model;olympe.sc.Ra.prototype.setSource=olympe.sc.Ra.prototype.jh;olympe.sc.Ra.prototype.persistInstance=olympe.sc.Ra.prototype.pi;olympe.sc.Ra.prototype.persist=olympe.sc.Ra.prototype.persist;
945
- olympe.sc.Ra.prototype.deleteAllRelations=olympe.sc.Ra.prototype.Jl;olympe.sc.Ra.prototype.deleteRelation=olympe.sc.Ra.prototype.Xb;olympe.sc.Ra.prototype.createRelation=olympe.sc.Ra.prototype.Ea;olympe.sc.Ra.prototype['delete']=olympe.sc.Ra.prototype.delete;olympe.sc.Ra.prototype.multiUpdate=olympe.sc.Ra.prototype.fq;olympe.sc.Ra.prototype.update=olympe.sc.Ra.prototype.update;olympe.sc.Ra.prototype.create=olympe.sc.Ra.prototype.create;olympe.sc.Ra.prototype.getId=olympe.sc.Ra.prototype.W;
946
- olympe.sc.Ra.process=olympe.sc.Ra.process;olympe.sc.Ra.from=olympe.sc.Ra.from;olympe.sc.Xh=class{constructor(a){this.C=a}lu(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Xh.prototype.getCreatedObjects=olympe.sc.Xh.prototype.lu;olympe.$b={};olympe.$b.xq=class{run(){}};olympe.$b.Ca=class{constructor(a,b){this.C=a;this.L=b;this.F=null;this.G='';this.L.info('HC Manager will execute application registered as:',this.C)}ri(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.L.log('Application',c,'designated to be launched'):this.L.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.L.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.L.info('Running application:',this.G),
947
- this.F.run()):this.L.error('No app registered under name: '+this.C)}};olympe.$b.ri=function(a,b,c){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.$b.V.Ee+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.nd(olympe.$b.R.Fa).config([b],function(e,f){f.ri(e,c,b)},'olympe.hc.registerApp')};olympe.$b.R={Fa:'hc.Manager',ya:'hc.Logger'};olympe.$b.V={Ee:'hc.app',Ek:'hc.globalToken'};olympe.U.config(function(a){F(a,olympe.$b.V.Ee,'default');F(a,olympe.$b.V.Ek,!1);E(a,olympe.$b.R.ya,[olympe.ka.R.Fa],b=>b.Dc('hc'));E(a,olympe.auth.R.xi,[new olympe.U.ma(olympe.$b.V.Ee),new olympe.U.ma(olympe.$b.V.Ek)],(b,c)=>new olympe.auth.hk(c?'':b));D(a,olympe.$b.R.Fa,olympe.$b.Ca,new olympe.U.ma(olympe.$b.V.Ee),olympe.$b.R.ya)},'olympe.hc');olympe.U.run([olympe.$b.R.Fa],a=>a.run(),'olympe.hc');olympe.sc.Pc={};function kl(a,b){if(a.Z)a.L.debug('Sending getContext request'),Sg(a.ba).then(()=>{a.L.debug('synchronisation request successful');al=a.C;b()}).catch(c=>{a.L.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=yk(a.F);a.L.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.gp(d);e.add((f,g)=>{olympe.dc.ua.Yb(d,a.C,olympe.dc.Jb.Se,olympe.dc.Pa.SERVER,c).subscribe(rxjs.Subscriber.create(()=>{olympe.dc.Aa().sd(a.C,olympe.sc.pa.Qc)?
948
- (a.ga.ba(a.C),d.run(f)):d.run(()=>g(`The specified application tag (${a.C}) is not an application or does not exist`))},h=>g(String(h))))});e.add(f=>{olympe.D.nc([a.G.Ce()],g=>{olympe.dc.ua.from(g).observe(olympe.D.Oa(),olympe.dc.ua.Sc.el).subscribe(()=>d.run(f))})});e.add((f,g)=>{const h=olympe.sc.Rc.bc.Zn,k=olympe.sc.Rc.bc.Wk;bl(a.C,m=>{switch(m){case h:case k:d.run(f);break;default:d.run(()=>g('Error while loading the business container'))}})});oc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
949
- function ll(a){a.L.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.Aa();if(0<a.C.length){const d=ie(c,a.C,a.F.F().G((e,f)=>{e?(e=Tk(f),e instanceof olympe.sc.pa.oh?(a.L.debug('application retrieved: running'),f=wk(a.F,e),e.run(f),'string'===typeof a.qa&&(new olympe.sc.yd).ga(e.X(),f,a.L),e instanceof olympe.sc.pa.Qi&&(e=olympe.U.getParameter(olympe.auth.V.fk),f=a.G.G.Ob,!0===e&&0<f&&Nb(()=>{a.G.nf()},Math.max(1E3,1E4<f?f-1E3:f-100))),b.update(olympe.D.ea.F)):
950
- a.L.error('application retrieved: not an Application with a run() method')):ml(a)}));olympe.D.Oa().onDestroy(()=>{je(c,a.C,d)});Mb(()=>{olympe.D.Sa(b)===olympe.D.ea.C&&a.L.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4)}nl(a);ol(a,b)}function ml(a){a.L.debug('Stop the application');a.F.F().qa();a.K.G(a.O);a.K.O(a.T)}function nl(a){a.T=a.K.F(()=>v(function*(){return ml(a)}))}
951
- function ol(a,b){a.O=a.K.C(()=>olympe.D.Sa(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
952
- olympe.sc.Pc.jl=class{constructor(a,b,c,d,e,f,g){this.G=a;this.ba=b;this.K=c;this.T=this.O='';this.L=d;this.F=e;this.ga=f;this.C=g.get('appTag');this.Z=g.get('getContextMode');let h;this.Ba=null!=(h=g.get('offlineMode'))?h:!1;let k;this.qa=null!=(k=g.get('debuggerName'))?k:null}run(){const a=olympe.auth.Ca.C.INIT,b=olympe.auth.Ca.C.Fe,c=olympe.auth.Ca.C.Ke,d=olympe.auth.Ca.C.wf,e=olympe.auth.Ca.C.yi,f=olympe.auth.Ca.C.Sg,g=olympe.auth.Ca.C.zg;this.L.debug('runtime starting for app #'+this.C);let h=
953
- !1;const k=()=>{h||(h=!0,kl(this,()=>ll(this)))};olympe.D.nc([this.G.getState()],m=>{switch(m){case f:case g:case a:break;case b:case d:this.L.debug('Server session opened, calling once connected callback');k();break;case c:this.L.debug('Disconnected, working offline.');this.Ba&&k();break;case e:this.L.debug('waiting for authentication');break;default:this.L.debug('No server session available, waiting for connection'),h=!1,ml(this)}},'Runtime initial auth state listener')}};olympe.sc.Pc.jl.C='app_instance';
954
- olympe.sc.Pc.jl.sa=[olympe.$b.xq];olympe.sc.Pc.sj=class extends olympe.dc.sources.sj{Z(a){return this.db.sd(a,olympe.sc.Gc)}ba(a){if(!this.O){super.init();var b=olympe.dc.Lc.from(a).lb(olympe.sc.pa.Qc.C).Bd();if(!(b instanceof olympe.dm.tb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);Yi(this,b);olympe.dc.ua.from(a).lb(olympe.sc.pa.Qc.Ba).observe(olympe.D.ef()).subscribe(c=>{const d=new olympe.dc.Ra;pe(c).forEach(e=>{d.Ea(olympe.dm.DataSource.oi,this.C,e)});oe(c).forEach(e=>
955
- {d.Xb(olympe.dm.DataSource.oi,this.C,e)});d.ib()})}}};olympe.sc.Pc.R={Se:'sc.runtime.Main',Ue:'sc.runtime.SourceSolver',So:'sc.runtime.appConfig'};
956
- olympe.U.config(function(a){E(a,olympe.auth.R.xi,[new olympe.U.ma(olympe.$b.V.Ee),new olympe.U.ma(olympe.sc.V.Ee),new olympe.U.ma(olympe.$b.V.Ek)],(b,c,d)=>new olympe.auth.hk(d?'':b+(c?'-'+c:'')));D(a,olympe.sc.Pc.R.Ue,olympe.sc.Pc.sj,olympe.dc.R.Je,new olympe.U.ma(olympe.dc.V.cg),new olympe.U.ma(olympe.dc.V.uk));ua(a,olympe.dc.sources.R.Ue,olympe.sc.Pc.R.Ue);E(a,olympe.sc.Pc.R.So,[new olympe.U.ma(olympe.sc.V.Ee),new olympe.U.ma(olympe.dc.V.Pg),new olympe.U.ma(olympe.sc.V.qo),new olympe.U.ma(olympe.sc.V.gn)],
957
- (b,c,d,e)=>new Map([['appTag',b],['getContextMode',c],['offlineMode',d],['debuggerName',e]]));D(a,olympe.sc.Pc.R.Se,olympe.sc.Pc.jl,olympe.auth.R.Fa,olympe.dc.query.R.hj,olympe.host.R.Qe,olympe.sc.R.ya,olympe.sc.R.il,olympe.sc.Pc.R.Ue,olympe.sc.Pc.R.So);olympe.$b.ri(a,olympe.sc.Pc.R.Se,'sc.runtime');olympe.$b.ri(a,olympe.sc.Pc.R.Se,'sc.headless');olympe.$b.ri(a,olympe.sc.Pc.R.Se)},'olympe.sc.runtime');olympe.public={};function pl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{Kd(olympe.public.Xa.get(),c,b,()=>{d()})})}
958
- olympe.public.Xa=class{static bu(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}static getState(){return Qd(olympe.public.Xa.get())}static nu(){return olympe.D.Sa(olympe.public.Xa.get().Ce())}static Nv(a){const b=new olympe.D.Mb('Observe user tag','function'===typeof a.F?a.F():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.nc([olympe.public.Xa.get().Ce()],d=>{c.next(d);olympe.D.Oa().onDestroy(()=>c.complete())}));return()=>
959
- b.destroy()})}static rd(){var a=olympe.D,b=a.Sa;var c=olympe.public.Xa.get().C.vb().od();return b.call(a,c)}static Bu(){return olympe.D.Sa(olympe.public.Xa.get().dh())||void 0}static fv(){const a=zc(olympe.public.Xa.get());return{user:a.yc(),userTag:a.Ce(),nonce:a.od(),payload:a.pd(),idpName:a.Vf(),protocol:a.Oj()}}static Au(){return Array.from(Rd().keys())}static nf(){olympe.public.Xa.get().nf()}static sg(a){return new Promise((b,c)=>{olympe.public.Xa.get().sg(a,d=>d?c(d):b())})}static vv(a,b){return pl((new Map).set('username',
960
- a).set('password',b),'srp')}static wv(a){const b=Rd();if(0===b.size||a&&!b.has(a)){var c=0===b.size?'There are no available IDPs':`The IDP name ${a} is not valid, the valid names are ${Array.from(b.keys())}`;return Promise.reject(c)}a?(c=a,a=b.get(a)):(a=Array.from(b)[0],c=a[0],a=a[1]);return pl((new Map).set('idpName',c),a)}static uv(){return pl(new Map,'saml')}static xv(a,b){return pl((new Map).set('username',a).set('nonce',b),'localToken')}static tv(){return pl(new Map,'openID')}static Uj(){return olympe.public.Xa.get().Uj()}static get(){return olympe.auth.ge()}};
961
- olympe.public.Xa.logout=olympe.public.Xa.Uj;olympe.public.Xa.loginOpenID=olympe.public.Xa.tv;olympe.public.Xa.loginToken=olympe.public.Xa.xv;olympe.public.Xa.loginSAML=olympe.public.Xa.uv;olympe.public.Xa.loginSSO=olympe.public.Xa.wv;olympe.public.Xa.loginSRP=olympe.public.Xa.vv;olympe.public.Xa.getUserFromToken=olympe.public.Xa.sg;olympe.public.Xa.sendKeepAlive=olympe.public.Xa.nf;olympe.public.Xa.getIDPNames=olympe.public.Xa.Au;olympe.public.Xa.getUserToken=olympe.public.Xa.fv;
962
- olympe.public.Xa.getIDPToken=olympe.public.Xa.Bu;olympe.public.Xa.getToken=olympe.public.Xa.rd;olympe.public.Xa.observeUser=olympe.public.Xa.Nv;olympe.public.Xa.getCurrentUser=olympe.public.Xa.nu;olympe.public.Xa.getState=olympe.public.Xa.getState;olympe.public.Xa.generateSRPData=olympe.public.Xa.bu;olympe.public.Da=class{static create(a){return new class extends olympe.dc.$.Mf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Hb(f)));olympe.D.Oa().Z(()=>e.unsubscribe());return d.vb()}}}};
963
- olympe.public.He=class{static create(a){return new class extends olympe.dc.cc.Mf{K(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.na(f)));olympe.D.Oa().Z(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static Ov(a){const b=olympe.host.Nj(),c=b.C(a);return()=>b.G(c)}static Pv(a){const b=olympe.host.Nj(),c=b.F(a);return()=>b.O(c)}};olympe.public.Process.onShutdown=olympe.public.Process.Pv;olympe.public.Process.onHealthCheck=olympe.public.Process.Ov;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ha.Relation,Direction:olympe.dc.va,generateTag:olympe.Y.$e,tagToString:olympe.dc.ja,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Mp,defineInverseRelation:olympe.dc.Mt,BrickContext:olympe.sc.wa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.wa.C,registerBrick:olympe.sc.logic.la.C,FunctionBrick:olympe.sc.logic.Function,
964
- Context:olympe.sc.wa,Entry:olympe.dc.Ha.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.uf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.wd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.te,WorkflowTransition:olympe.sc.workflow.Transition,
965
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ra,BurstTransaction:olympe.dc.rh,TransactionResult:olympe.sc.Xh,PredefinedDataSource:olympe.dc.Pa,QueryResult:olympe.dc.Ka,Query:olympe.dc.ua,QuerySingle:olympe.dc.Lc,Predicate:olympe.dc.query.Da,Order:olympe.dc.query.bj,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Process:olympe.public.Process,Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.P.Jc,Service:olympe.P.pb,Auth:olympe.public.Xa,
966
- AuthState:{INIT:olympe.auth.Ca.C.INIT,DISCONNECTED:olympe.auth.Ca.C.Ke,GUEST:olympe.auth.Ca.C.wf,AUTHENTICATING:olympe.auth.Ca.C.yi,ERROR:olympe.auth.Ca.C.Fb,AUTHENTICATED:olympe.auth.Ca.C.Fe},Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.Aa()}},
967
- ListDef:olympe.dc.ta,instanceToTag:olympe.dc.ja,registerSync:olympe.dc.la.C,getUniqueTag:olympe.Y.$e,onDestroy:a=>olympe.D.Oa().onDestroy(a),offDestroy:a=>olympe.D.Oa().kf(a),FollowRules:olympe.dc.Jb,transformers:{Related:olympe.dc.da.qe,RecursiveRelated:olympe.dc.da.ce,Distinct:olympe.dc.da.xh,Filter:olympe.dc.da.Le,Limit:olympe.dc.da.Ig,Sort:olympe.dc.da.eg,Union:olympe.dc.da.We},ListDefPredicate:olympe.public.Da,predicates:{And:olympe.dc.$.dd,Or:olympe.dc.$.be,Not:olympe.dc.$.$d,Equals:olympe.dc.$.Xd,
968
- Contains:olympe.dc.$.Ie,Greater:olympe.dc.$.Ni,Smaller:olympe.dc.$.rj,HasRelated:olympe.dc.$.Ch,InstanceOf:olympe.dc.$.Gh,Regex:olympe.dc.$.Te},Comparator:olympe.public.He,comparators:{Number:olympe.dc.cc.Number,String:olympe.dc.cc.String,DateTime:olympe.dc.cc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Ta.Di,StringProperty:olympe.dc.Ta.Th,NumberProperty:olympe.dc.Ta.Kh,DateTimeProperty:olympe.dc.Ta.wh,Constant:olympe.dc.Ta.ke,Tag:olympe.dc.Ta.Wh}});
938
+ olympe.sc.workflow.Transition.prototype.C.J=new olympe.D.H(()=>olympe.sc.workflow.ue,[]);olympe.sc.workflow.Transition.prototype.G.J=new olympe.D.H(()=>olympe.sc.workflow.ue,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ud.ve.Fg}G(){return this.ih(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.Zb(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Jc)}F(){return this.Zb(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.ue)}};olympe.sc.workflow.Workflow.N=olympe.dc.la.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.N.ia('017ffdc010e5bcc9c972');
939
+ olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.N.oa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.J=olympe.D.H.P;olympe.sc.workflow.Workflow.prototype.C.J=new olympe.D.H(()=>olympe.sc.Jc,[]);
940
+ olympe.sc.workflow.Workflow.prototype.F.J=new olympe.D.H(()=>olympe.sc.workflow.ue,[]);olympe.sc.pa={};olympe.sc.pa.Tc=class extends olympe.sc.Xa{Td(){return olympe.sc.ud.ve.Ps}};olympe.sc.pa.Tc.N=Ce(olympe.dc.la.C('01120300000000adef00',olympe.sc.pa.Tc));olympe.sc.pa.Tc.C=olympe.sc.pa.Tc.N.oa('0171bc1f15da96dfdb89');olympe.sc.pa.Tc.Ba=olympe.sc.pa.Tc.N.oa('0171bc1f15da96dfdb90');U(olympe.dm.zc.N,olympe.sc.pa.Tc.C);olympe.sc.pa.th=class extends olympe.sc.Runnable{F(){return[this.Sb()]}Ba(){return olympe.dc.Nc.from(this.Sb()).lb(olympe.sc.pa.Tc.C).Bd()}};olympe.sc.pa.th.N=Ce(olympe.dc.la.C('0113030000000aca1100',olympe.sc.pa.th));olympe.sc.pa.th.prototype.Ba.J=new olympe.D.H(()=>olympe.dm.tb,[]);olympe.sc.pa.bb=class extends olympe.dc.CloudObject{Xr(){return this.ih(olympe.sc.pa.bb.Zg)}Bv(){return this.ih(olympe.sc.pa.bb.qa)}sd(){return this.Hc(olympe.sc.pa.bb.C)}tu(){return this.qb(olympe.sc.pa.bb.L)}Su(){return this.qb(olympe.sc.pa.bb.ga)}Ru(){return this.qb(olympe.sc.pa.bb.Z)}Qd(){return this.qb(olympe.sc.pa.bb.ba)}Hu(){return this.qb(olympe.sc.pa.bb.P)}cu(){return this.qb(olympe.sc.pa.bb.F)}Qu(){return this.qb(olympe.sc.pa.bb.T)}Wr(){return this.qb(olympe.sc.pa.bb.G)}};
941
+ olympe.sc.pa.bb.N=olympe.dc.la.C('011203300000000adef5',olympe.sc.pa.bb);olympe.sc.pa.bb.Zg=olympe.sc.pa.bb.N.ia('011203300000000adef6');olympe.sc.pa.bb.qa=olympe.sc.pa.bb.N.ia('011203300000000adef7');olympe.sc.pa.bb.C=olympe.sc.pa.bb.N.ia('011203300000000adef8');olympe.sc.pa.bb.L=olympe.sc.pa.bb.N.ia('011203300000000adef9');olympe.sc.pa.bb.ga=olympe.sc.pa.bb.N.ia('011203300000000adefa');olympe.sc.pa.bb.Z=olympe.sc.pa.bb.N.ia('011203300000000adefb');olympe.sc.pa.bb.F=olympe.sc.pa.bb.N.ia('011203300000000adefc');
942
+ olympe.sc.pa.bb.ba=olympe.sc.pa.bb.N.ia('011203300000000adefd');olympe.sc.pa.bb.P=olympe.sc.pa.bb.N.ia('011203300000000adefe');olympe.sc.pa.bb.T=olympe.sc.pa.bb.N.ia('011203300000000adeff');olympe.sc.pa.bb.G=olympe.sc.pa.bb.N.ia('011203300000000adee0');olympe.sc.pa.bb.ac={INIT:0,yw:1,tj:2,sj:3,ll:4,gz:5,Fb:9};l=olympe.sc.pa.bb.prototype;l.Xr.J=olympe.D.H.P;l.Bv.J=olympe.D.H.P;l.sd.J=olympe.D.H.G;l.tu.J=olympe.D.H.F;l.Su.J=olympe.D.H.F;l.Ru.J=olympe.D.H.F;l.Qd.J=olympe.D.H.F;l.Hu.J=olympe.D.H.F;
943
+ l.cu.J=olympe.D.H.F;l.Qu.J=olympe.D.H.F;l.Wr.J=olympe.D.H.F;olympe.sc.pa.Ui=class extends olympe.sc.pa.th{ga(){return!0}};olympe.sc.pa.Ui.N=olympe.dc.la.C('0113032000000aca1102',olympe.sc.pa.Ui,olympe.sc.R.za);olympe.sc.pa.te=class extends olympe.sc.pa.Tc{C(){return(new olympe.dc.Yi(this.X(),olympe.sc.pa.bb)).lb(olympe.sc.pa.te.L).Qe().vc()}};olympe.sc.pa.te.N=olympe.dc.la.C('011203300000000adef3',olympe.sc.pa.te);olympe.sc.pa.te.L=olympe.sc.pa.te.N.oa('011203300000000adef4');U(olympe.sc.pa.bb.N,olympe.sc.pa.te.L);
944
+ olympe.sc.pa.te.N.C=(a,b,c)=>{b=mj(a,b||'New Service Application model',olympe.sc.pa.te,olympe.sc.pa.Ui);a.Ea(olympe.sc.pa.Tc.C,b,c);c=a.create(olympe.sc.pa.bb).X();a.Ea(olympe.sc.pa.te.L,b,c);return b.X()};olympe.sc.pa.te.prototype.C.J=new olympe.D.H(()=>olympe.sc.pa.bb,[]);olympe.sc.eg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.eg.N=olympe.dc.la.C('011203300000000adf00',olympe.sc.eg);olympe.sc.eg.F=olympe.sc.eg.N.ia('011203300000000adf01');olympe.sc.eg.C=olympe.sc.eg.N.ia('011203300000000adf02');olympe.sc.eg.G='011203300000000adf0f';olympe.sc.Cg=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ud.ve.Fg}};olympe.sc.Cg.N=olympe.dc.la.C('01645fe6873aeea59e64',olympe.sc.Cg);olympe.sc.Cg.C=olympe.sc.Cg.N.oa('017ed8ac775f48d4d589');olympe.sc.Cg.F=olympe.sc.Cg.N.oa('017ed8ac775f48d4d590');olympe.sc.$m=class extends olympe.dm.Ab{Td(){return olympe.sc.ud.ve.Fg}};olympe.sc.$m.N=olympe.dc.la.C('0163a68ce44f3d1fa95d',olympe.sc.$m);olympe.sc.Dg=class extends olympe.dm.BrickMetadata{};olympe.sc.Dg.N=olympe.dc.la.C('016324fde11a836f77d3',olympe.sc.Dg);olympe.sc.Dg.C=olympe.sc.Jc.N.oa('016324fde11a836088d3');olympe.sc.Dg.N.C=(a,b)=>mj(a,null!=b?b:'New config type',olympe.sc.Dg).X();olympe.sc.Hw=class{};olympe.sc.Mi=class extends olympe.dm.BrickMetadata{Td(){return olympe.sc.ud.ve.Fg}};olympe.sc.Mi.N=olympe.dc.la.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Mi);olympe.sc.Mi.N.C=(a,b)=>mj(a,null!=b?b:'New data connector',olympe.sc.Mi,olympe.dm.DataSource).X();olympe.sc.Wd=class extends olympe.sc.Runnable{Wa(){return this.fb(olympe.sc.Wd.G,olympe.sc.Runnable)}Ba(){return this.fb(olympe.sc.Wd.F,olympe.dm.Property)}};olympe.sc.Wd.N=Ce(olympe.dc.la.C('016c2d996d9ca27fa9d8',olympe.sc.Wd));olympe.sc.Wd.G=olympe.sc.Wd.N.oa('016c3cb7742ec9309e0b');olympe.sc.Wd.F=olympe.sc.Wd.N.oa('016c42d3454636f90533');olympe.sc.Wd.prototype.Wa.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.Wd.prototype.Ba.J=new olympe.D.H(()=>olympe.dc.ta,[]);olympe.sc.tn=class extends olympe.dm.Ab{Td(){return olympe.sc.ud.ve.Fg}};olympe.sc.tn.N=olympe.dc.la.C('017a7a9ff057958e5678',olympe.sc.tn);olympe.sc.ho=class extends olympe.dm.Ab{Td(){return olympe.sc.ud.ve.ft}};olympe.sc.ho.N=olympe.dc.la.C('01644b6d4543b344b857',olympe.sc.ho);olympe.sc.io=class extends olympe.dc.CloudObject{};olympe.sc.io.N=olympe.dc.la.C('0162f672366be5ca7a86',olympe.sc.io);olympe.sc.cg=class extends olympe.dc.sources.cg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.C}:super.C(a)}F(a){return 20===(null==a?void 0:a.t)?olympe.sc.logic.Error.create(a.m,a.c):super.F(a)}};olympe.sc.jp=class extends olympe.sc.Wd{};olympe.sc.jp.N=olympe.dc.la.C('016d3f37610ae4fc3962',olympe.sc.jp);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.N=olympe.dc.la.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Sa=class{constructor(a=!0){this.C=(new olympe.dc.Sa).persist(a);this.F=[];this.source=null}static from(a){const b=olympe.sc.wa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Sa}static process(a,b){return a.has(olympe.sc.wa.C.TRANSACTION,!0)?Promise.resolve(!1):b.jb().then(()=>!0)}W(){return this.C.W()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.ie().fromModel(a);d=this.C.create(a,d).oh(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Ra.SERVER){if('string'===
945
+ typeof cl){var e;let f;b=null!=(f=null==(e=olympe.dc.Nc.from(cl).lb(olympe.sc.pa.Tc.C).lb(olympe.sc.Uc.C.Pb()).Bd())?void 0:e.X())?f:null}else b=null;e=b;null!==e?this.Ea(olympe.sc.Uc.F,e,d):olympe.ka.ab('sc').warn('No business container for new instance of',olympe.dc.ja(a))}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}fq(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.F.set(xj(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,b,c);
946
+ return this}Yb(a,b,c){this.C.Yb(a,b,c);return this}Jl(a,b){this.C.Jl(a,b);return this}persist(a=!0){this.C.persist(a);return this}vi(a,b=!0){this.C.vi(a,b);return this}oh(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){lj(this.C,a.C);return this}Cl(a){this.C.Cl(a);return this}jb(){return new Promise((a,b)=>{this.C.jb((c,d)=>{c?a(new olympe.sc.$h(this.F)):b(d)})})}Kl(){return new Promise((a,b)=>{this.C.Kl((c,d)=>{c?a(new olympe.sc.$h(this.F)):b(d)})})}};
947
+ olympe.sc.Sa.prototype.executeAsLarge=olympe.sc.Sa.prototype.Kl;olympe.sc.Sa.prototype.execute=olympe.sc.Sa.prototype.jb;olympe.sc.Sa.prototype.afterExecution=olympe.sc.Sa.prototype.Cl;olympe.sc.Sa.prototype.merge=olympe.sc.Sa.prototype.merge;olympe.sc.Sa.prototype.model=olympe.sc.Sa.prototype.model;olympe.sc.Sa.prototype.setSource=olympe.sc.Sa.prototype.oh;olympe.sc.Sa.prototype.persistInstance=olympe.sc.Sa.prototype.vi;olympe.sc.Sa.prototype.persist=olympe.sc.Sa.prototype.persist;
948
+ olympe.sc.Sa.prototype.deleteAllRelations=olympe.sc.Sa.prototype.Jl;olympe.sc.Sa.prototype.deleteRelation=olympe.sc.Sa.prototype.Yb;olympe.sc.Sa.prototype.createRelation=olympe.sc.Sa.prototype.Ea;olympe.sc.Sa.prototype['delete']=olympe.sc.Sa.prototype.delete;olympe.sc.Sa.prototype.multiUpdate=olympe.sc.Sa.prototype.fq;olympe.sc.Sa.prototype.update=olympe.sc.Sa.prototype.update;olympe.sc.Sa.prototype.create=olympe.sc.Sa.prototype.create;olympe.sc.Sa.prototype.getId=olympe.sc.Sa.prototype.W;
949
+ olympe.sc.Sa.process=olympe.sc.Sa.process;olympe.sc.Sa.from=olympe.sc.Sa.from;olympe.sc.$h=class{constructor(a){this.C=a}ku(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.$h.prototype.getCreatedObjects=olympe.sc.$h.prototype.ku;olympe.$b={};olympe.$b.xq=class{run(){}};olympe.$b.Ca=class{constructor(a,b){this.C=a;this.K=b;this.F=null;this.G='';this.K.info('HC Manager will execute application registered as:',this.C)}wi(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.K.log('Application',c,'designated to be launched'):this.K.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.K.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.K.info('Running application:',this.G),
950
+ this.F.run()):this.K.error('No app registered under name: '+this.C)}};olympe.$b.wi=function(a,b,c){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.$b.V.Fe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.$b.R.Fa).config([b],function(e,f){f.wi(e,c,b)},'olympe.hc.registerApp')};olympe.$b.R={Fa:'hc.Manager',za:'hc.Logger'};olympe.$b.V={Fe:'hc.app',Gk:'hc.globalToken'};olympe.U.config(function(a){F(a,olympe.$b.V.Fe,'default');F(a,olympe.$b.V.Gk,!1);E(a,olympe.$b.R.za,[olympe.ka.R.Fa],b=>b.Gc('hc'));E(a,olympe.auth.R.Bi,[new olympe.U.ma(olympe.$b.V.Fe),new olympe.U.ma(olympe.$b.V.Gk)],(b,c)=>new olympe.auth.jk(c?'':b));D(a,olympe.$b.R.Fa,olympe.$b.Ca,new olympe.U.ma(olympe.$b.V.Fe),olympe.$b.R.za)},'olympe.hc');olympe.U.run([olympe.$b.R.Fa],a=>a.run(),'olympe.hc');olympe.sc.Sc={};function ml(a,b){if(a.Z)a.K.debug('Sending getContext request'),Ug(a.ba).then(()=>{a.K.debug('synchronisation request successful');cl=a.C;b()}).catch(c=>{a.K.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=Ak(a.F);a.K.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.gp(d);e.add((f,g)=>{const h=olympe.dc.ya();Lg(d,a.C,k=>{k=h.oi(k)?k:h.model(k);return null!==k&&h.Zc(k,olympe.sc.Dg)},c).subscribe(rxjs.Subscriber.create(()=>
951
+ {olympe.dc.ya().Zc(a.C,olympe.sc.pa.Tc)?(a.ga.ba(a.C),d.run(f)):d.run(()=>g(`The specified application tag (${a.C}) is not an application or does not exist`))},k=>g(String(k))))});e.add(f=>{olympe.D.oc([a.G.je()],g=>{olympe.dc.ua.from(g).observe(olympe.D.Oa(),olympe.dc.ua.Dc.el).subscribe(()=>d.run(f))})});e.add((f,g)=>{const h=olympe.sc.Uc.ac.Zn,k=olympe.sc.Uc.ac.Yk;dl(a.C,m=>{switch(m){case h:case k:d.run(f);break;default:d.run(()=>g('Error while loading the business container'))}})});nc(e,(f,g)=>
952
+ {if(g)throw Error(g);b()});e.start()}}
953
+ function nl(a){a.K.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ya();if(0<a.C.length){const d=je(c,a.C,a.F.F().G((e,f)=>{e?(e=Vk(f),e instanceof olympe.sc.pa.th?(a.K.debug('application retrieved: running'),f=yk(a.F,e),e.run(f),'string'===typeof a.qa&&(new olympe.sc.zd).ga(e.X(),f,a.K),e instanceof olympe.sc.pa.Ui&&(e=olympe.U.getParameter(olympe.auth.V.hk),f=a.G.G.Ob,!0===e&&0<f&&Nb(()=>{a.G.De()},Math.max(1E3,1E4<f?f-1E3:f-100))),b.update(olympe.D.ea.F)):
954
+ a.K.error('application retrieved: not an Application with a run() method')):ol(a)}));olympe.D.Oa().onDestroy(()=>{ke(c,a.C,d)});Mb(()=>{olympe.D.Qa(b)===olympe.D.ea.C&&a.K.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4)}pl(a);ql(a,b)}function ol(a){a.K.debug('Stop the application');a.F.F().qa();a.L.G(a.P);a.L.P(a.T)}function pl(a){a.T=a.L.F(()=>v(function*(){return ol(a)}))}
955
+ function ql(a,b){a.P=a.L.C(()=>olympe.D.Qa(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
956
+ olympe.sc.Sc.jl=class{constructor(a,b,c,d,e,f,g){this.G=a;this.ba=b;this.L=c;this.T=this.P='';this.K=d;this.F=e;this.ga=f;this.C=g.get('appTag');this.Z=g.get('getContextMode');let h;this.Ba=null!=(h=g.get('offlineMode'))?h:!1;let k;this.qa=null!=(k=g.get('debuggerName'))?k:null}run(){const a=olympe.auth.Ca.C.INIT,b=olympe.auth.Ca.C.Ge,c=olympe.auth.Ca.C.Le,d=olympe.auth.Ca.C.wf,e=olympe.auth.Ca.C.Ci,f=olympe.auth.Ca.C.Vg,g=olympe.auth.Ca.C.zg;this.K.debug('runtime starting for app #'+this.C);let h=
957
+ !1;const k=()=>{h||(h=!0,ml(this,()=>nl(this)))};olympe.D.oc([this.G.getState()],m=>{switch(m){case f:case g:case a:break;case b:case d:this.K.debug('Server session opened, calling once connected callback');k();break;case c:this.K.debug('Disconnected, working offline.');this.Ba&&k();break;case e:this.K.debug('waiting for authentication');break;default:this.K.debug('No server session available, waiting for connection'),h=!1,ol(this)}},'Runtime initial auth state listener')}};olympe.sc.Sc.jl.C='app_instance';
958
+ olympe.sc.Sc.jl.sa=[olympe.$b.xq];olympe.sc.Sc.wj=class extends olympe.dc.sources.wj{Z(a){return this.db.Zc(a,olympe.sc.Jc)}ba(a){if(!this.P){super.init();var b=olympe.dc.Nc.from(a).lb(olympe.sc.pa.Tc.C).Bd();if(!(b instanceof olympe.dm.tb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);$i(this,b);olympe.dc.ua.from(a).lb(olympe.sc.pa.Tc.Ba).observe(olympe.D.ff()).subscribe(c=>{const d=new olympe.dc.Sa;qe(c).forEach(e=>{d.Ea(olympe.dm.DataSource.ti,this.C,e)});pe(c).forEach(e=>
959
+ {d.Yb(olympe.dm.DataSource.ti,this.C,e)});d.jb()})}}};olympe.sc.Sc.R={Bf:'sc.runtime.Main',Ve:'sc.runtime.SourceSolver',So:'sc.runtime.appConfig'};
960
+ olympe.U.config(function(a){E(a,olympe.auth.R.Bi,[new olympe.U.ma(olympe.$b.V.Fe),new olympe.U.ma(olympe.sc.V.Fe),new olympe.U.ma(olympe.$b.V.Gk)],(b,c,d)=>new olympe.auth.jk(d?'':b+(c?'-'+c:'')));D(a,olympe.sc.Sc.R.Ve,olympe.sc.Sc.wj,olympe.dc.R.Ke,new olympe.U.ma(olympe.dc.V.bg),new olympe.U.ma(olympe.dc.V.wk));ua(a,olympe.dc.sources.R.Ve,olympe.sc.Sc.R.Ve);E(a,olympe.sc.Sc.R.So,[new olympe.U.ma(olympe.sc.V.Fe),new olympe.U.ma(olympe.dc.V.Sg),new olympe.U.ma(olympe.sc.V.qo),new olympe.U.ma(olympe.sc.V.gn)],
961
+ (b,c,d,e)=>new Map([['appTag',b],['getContextMode',c],['offlineMode',d],['debuggerName',e]]));D(a,olympe.sc.Sc.R.Bf,olympe.sc.Sc.jl,olympe.auth.R.Fa,olympe.dc.query.R.lj,olympe.host.R.Se,olympe.sc.R.za,olympe.sc.R.il,olympe.sc.Sc.R.Ve,olympe.sc.Sc.R.So);olympe.$b.wi(a,olympe.sc.Sc.R.Bf,'sc.runtime');olympe.$b.wi(a,olympe.sc.Sc.R.Bf,'sc.headless');olympe.$b.wi(a,olympe.sc.Sc.R.Bf)},'olympe.sc.runtime');olympe.public={};function rl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{Kd(olympe.public.Va.get(),c,b,()=>{d()})})}
962
+ olympe.public.Va=class{static au(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}static getState(){return Qd(olympe.public.Va.get())}static mu(){return olympe.D.Qa(olympe.public.Va.get().je())}static Mv(a){const b=new olympe.D.Nb('Observe user tag','function'===typeof a.F?a.F():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.oc([olympe.public.Va.get().je()],d=>{c.next(d);olympe.D.Oa().onDestroy(()=>c.complete())}));return()=>
963
+ b.destroy()})}static td(){var a=olympe.D,b=a.Qa;var c=olympe.public.Va.get().C.vb().Rc();return b.call(a,c)}static mh(){return new Promise((a,b)=>{olympe.public.Va.get().mh(c=>c?b(c):a())})}static Au(){return olympe.D.Qa(olympe.public.Va.get().gh())||void 0}static ev(){const a=yc(olympe.public.Va.get());return{user:a.wc(),userTag:a.je(),nonce:a.Rc(),payload:a.Yc(),idpName:a.Pe(),protocol:a.ng()}}static zu(){return Array.from(Rd().keys())}static De(){olympe.public.Va.get().De()}static sg(a){return new Promise((b,
964
+ c)=>{olympe.public.Va.get().sg(a,d=>d?c(d):b())})}static uv(a,b){return rl((new Map).set('username',a).set('password',b),'srp')}static vv(a){const b=Rd();if(0===b.size||a&&!b.has(a)){var c=0===b.size?'There are no available IDPs':`The IDP name ${a} is not valid, the valid names are ${Array.from(b.keys())}`;return Promise.reject(c)}a?(c=a,a=b.get(a)):(a=Array.from(b)[0],c=a[0],a=a[1]);return rl((new Map).set('idpName',c),a)}static tv(){return rl(new Map,'saml')}static wv(a,b){return rl((new Map).set('username',
965
+ a).set('nonce',b),'localToken')}static rv(){return rl(new Map,'openID')}static Wj(){return olympe.public.Va.get().Wj()}static get(){return olympe.auth.ge()}};olympe.public.Va.logout=olympe.public.Va.Wj;olympe.public.Va.loginOpenID=olympe.public.Va.rv;olympe.public.Va.loginToken=olympe.public.Va.wv;olympe.public.Va.loginSAML=olympe.public.Va.tv;olympe.public.Va.loginSSO=olympe.public.Va.vv;olympe.public.Va.loginSRP=olympe.public.Va.uv;olympe.public.Va.getUserFromToken=olympe.public.Va.sg;
966
+ olympe.public.Va.sendKeepAlive=olympe.public.Va.De;olympe.public.Va.getIDPNames=olympe.public.Va.zu;olympe.public.Va.getUserToken=olympe.public.Va.ev;olympe.public.Va.getIDPToken=olympe.public.Va.Au;olympe.public.Va.refreshToken=olympe.public.Va.mh;olympe.public.Va.getToken=olympe.public.Va.td;olympe.public.Va.observeUser=olympe.public.Va.Mv;olympe.public.Va.getCurrentUser=olympe.public.Va.mu;olympe.public.Va.getState=olympe.public.Va.getState;olympe.public.Va.generateSRPData=olympe.public.Va.au;olympe.public.Da=class{static create(a){return new class extends olympe.dc.$.Nf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Hb(f)));olympe.D.Oa().Z(()=>e.unsubscribe());return d.vb()}}}};
967
+ olympe.public.Ie=class{static create(a){return new class extends olympe.dc.bc.Nf{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.na(f)));olympe.D.Oa().Z(()=>e.unsubscribe());return d.vb()}}}};olympe.public.Process=class{static Nv(a){const b=olympe.host.Rj(),c=b.C(a);return()=>b.G(c)}static Ov(a){const b=olympe.host.Rj(),c=b.F(a);return()=>b.P(c)}};olympe.public.Process.onShutdown=olympe.public.Process.Ov;olympe.public.Process.onHealthCheck=olympe.public.Process.Nv;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ha.Relation,Direction:olympe.dc.va,generateTag:olympe.Y.af,tagToString:olympe.dc.ja,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Mp,defineInverseRelation:olympe.dc.Lt,BrickContext:olympe.sc.wa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.wa.C,registerBrick:olympe.sc.logic.la.C,FunctionBrick:olympe.sc.logic.Function,
968
+ Context:olympe.sc.wa,Entry:olympe.dc.Ha.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.uf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.xd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.ue,WorkflowTransition:olympe.sc.workflow.Transition,
969
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Sa,BurstTransaction:olympe.dc.wh,TransactionResult:olympe.sc.$h,PredefinedDataSource:olympe.dc.Ra,QueryResult:olympe.dc.Ka,Query:olympe.dc.ua,QuerySingle:olympe.dc.Nc,Predicate:olympe.dc.query.Da,Order:olympe.dc.query.gj,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Process:olympe.public.Process,Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.O.Request.hb,ServiceRequest:olympe.O.yc,
970
+ Service:olympe.O.pb,Auth:olympe.public.Va,AuthState:{INIT:olympe.auth.Ca.C.INIT,DISCONNECTED:olympe.auth.Ca.C.Le,GUEST:olympe.auth.Ca.C.wf,AUTHENTICATING:olympe.auth.Ca.C.Ci,ERROR:olympe.auth.Ca.C.Fb,AUTHENTICATED:olympe.auth.Ca.C.Ge},AuthProtocol:olympe.auth.Ec.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,
971
+ RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.$a{static get(){return olympe.dc.ya()}},ListDef:olympe.dc.ta,instanceToTag:olympe.dc.ja,registerSync:olympe.dc.la.C,getUniqueTag:olympe.Y.af,onDestroy:a=>olympe.D.Oa().onDestroy(a),offDestroy:a=>olympe.D.Oa().lf(a),FollowRules:olympe.dc.Mb,transformers:{Related:olympe.dc.da.re,RecursiveRelated:olympe.dc.da.ce,Distinct:olympe.dc.da.Ah,Filter:olympe.dc.da.Me,Limit:olympe.dc.da.Lg,Sort:olympe.dc.da.dg,Union:olympe.dc.da.Xe},ListDefPredicate:olympe.public.Da,
972
+ predicates:{And:olympe.dc.$.jd,Or:olympe.dc.$.be,Not:olympe.dc.$.$d,Equals:olympe.dc.$.Xd,Contains:olympe.dc.$.Je,Greater:olympe.dc.$.Ri,Smaller:olympe.dc.$.vj,HasRelated:olympe.dc.$.Fh,InstanceOf:olympe.dc.$.Jh,Regex:olympe.dc.$.Ue},Comparator:olympe.public.Ie,comparators:{Number:olympe.dc.bc.Number,String:olympe.dc.bc.String,DateTime:olympe.dc.bc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Ta.Hi,StringProperty:olympe.dc.Ta.Wh,NumberProperty:olympe.dc.Ta.Nh,DateTimeProperty:olympe.dc.Ta.zh,Constant:olympe.dc.Ta.le,
973
+ Tag:olympe.dc.Ta.Zh}});
969
974
 
970
975
 
971
976
  }.bind(this))();