@olympeio/runtime-node 9.10.3 → 9.10.4

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
@@ -240,15 +240,15 @@ v('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.i
240
240
  v('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;})})}});function ua(a){if(null==a)throw new TypeError("The 'this' value for String.prototype.padStart must not be null or undefined");return a+''}function va(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}
241
241
  v('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ua(this);return va(c,b-d.length)+d}});v('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ua(this);return d+va(c,b-d.length)}});v('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)}});
242
242
  v('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}});v('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}});
243
- v('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 wa=this||self;function B(a,b){a=a.split('.');let c=wa;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={$d:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.$d())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.$d().olympe=olympe;olympe.rE=(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 ya=require('util');function za(a){return'string'===typeof a?a:ya.inspect(a,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));
244
- console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Jf={};olympe.W.Jf.oo=class{process(a){for(const b of Object.keys(a.xe))if(a.qd(b).pn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Jf.oo.xa=[olympe.W.Jf.Bq];olympe.W.Jf.po=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.qd(e);c(e.pj(),f);for(const g of Ha(e))c(g.pj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.xe));for(const e of d)b(e,[])}};olympe.W.Jf.po.xa=[olympe.W.Jf.Bq];olympe.W.Jf.Bq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.$a();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.$a();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.pj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
243
+ v('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 wa=this||self;function B(a,b){a=a.split('.');let c=wa;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={$d:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.$d())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.$d().olympe=olympe;olympe.rE=(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 ya=require('util');function za(a){if('string'===typeof a)return a;let b=a;'function'===typeof(null==a?void 0:a.toJSON)&&(b=a.toJSON());let c,d;return'function'===typeof(null==(c=b)?void 0:c.toString)&&(null==(d=b)?void 0:d.toString)!==Object.prototype.toString?b.toString():ya.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}
244
+ const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Jf={};olympe.W.Jf.oo=class{process(a){for(const b of Object.keys(a.xe))if(a.rd(b).pn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Jf.oo.xa=[olympe.W.Jf.Bq];olympe.W.Jf.po=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.rd(e);c(e.pj(),f);for(const g of Ha(e))c(g.pj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.xe));for(const e of d)b(e,[])}};olympe.W.Jf.po.xa=[olympe.W.Jf.Bq];olympe.W.Jf.Bq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.$a();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.$a();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.pj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
245
245
  olympe.W.vo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.zl(a,b))}static D(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');});Ja.push(new olympe.W.zl(b,c,a))}};olympe.W.config=olympe.W.vo.j;olympe.W.run=olympe.W.vo.D;olympe.W.ms=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.Ij=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.zl=class{constructor(a,b,c){this.D=a;this.H=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}pj(){return this.H}};function Qa(a,b){var c=olympe.W.P.xg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.W.qh.j.hm)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.G.error('Error during instantiation of service '+b),f;}!e.H&&(a.j[b]=d)}return d}
246
246
  function Sa(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.D.get(b))?d:[];e.push(c);a.D.set(b,e)}function Na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.G.j++,f=b[e],d[e]=f instanceof olympe.W.Ij?f.getValue(a):f,La(a.G);return d}
247
247
  olympe.W.qh=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.Up(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.Ej.bind(this,f)))}$a(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ej(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
248
248
  (d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.W.qh.j={Jt:'exception',hm:'null'};function Ta(a,b){b=olympe.W.ms(b);for(const [c,d]of b)Ua(a,c,d)}function D(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){C(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){C(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){C(a.G,'Defining abstract service '+b);a.j(b).F=!0}function Ua(a,b,c){a.parameters[b.toLowerCase()]=c}
249
249
  function Ya(a,b,c,d){a.F.push(b);Ua(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.th(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.D[b.toLowerCase()]=c}
250
250
  olympe.W.zt=class{constructor(a,b){this.xe=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Jf.oo,new olympe.W.Jf.po];this.H=[];a=this.getParameter(olympe.W.U.Pu);this.N=void 0!==a?a:3;this.G=new olympe.W.Up(this.N)}$a(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.xe[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
251
- var g=this.xe[f];g.id=g.id+'!!'+ ++olympe.W.Jl.j;g.H=!0;g=g.id;c[h]=g;this.xe[g]=this.xe[f]}}this.xe[f]=new olympe.W.Jl(b,c,d||!1,f);return this.xe[f]}qd(a){const b=this.xe[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
251
+ var g=this.xe[f];g.id=g.id+'!!'+ ++olympe.W.Jl.j;g.H=!0;g=g.id;c[h]=g;this.xe[g]=this.xe[f]}}this.xe[f]=new olympe.W.Jl(b,c,d||!1,f);return this.xe[f]}rd(a){const b=this.xe[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
252
252
  La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.xe).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.qh(this.xe,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
253
253
  olympe.W.Jl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.H=!1}T(){return this.id}instantiate(a){const b=a.$a();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.ah().run(()=>e()):e();let g;if(0<(null==
254
254
  (g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.pj()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}pj(){return this.D}pn(){return this.F}config(a,b,c,d,e){null===this.j&&
@@ -297,9 +297,9 @@ olympe.ja.yb.j={hw:0,Xf:1,Ou:2,ak:3,Gr:4,Ab:5,Mt:6,IB:7};olympe.ja.yb.D={0:'TRAC
297
297
  olympe.ja.re.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ja.yb.j.ak:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ha=console}la(){return this.name}H(){return this.D}F(){return this.D<=olympe.ja.yb.j.hw}j(){return this.D<=olympe.ja.yb.j.Xf}N(){return this.D<=olympe.ja.yb.j.Ou}ha(){return this.D<=olympe.ja.yb.j.ak}wa(){return this.D<=olympe.ja.yb.j.Gr}$(){return this.D<=olympe.ja.yb.j.Ab}da(){return this.D<=olympe.ja.yb.j.Mt}trace(...a){this.F()&&
298
298
  Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.ha()&&Db(this,'info',a)}warn(...a){this.wa()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.da()&&Db(this,'error',a)}};olympe.ja.re.yb.xa=[olympe.ja.yb];olympe.ja.re.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.log('Logging initialized, global log level is '+olympe.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.nt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Uv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
299
299
  b=new olympe.ja.re.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.re.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={ip:'logging',jp:'logging.showLogLevel',nt:'logging',Uv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.ip,olympe.ja.yb.j.ak);F(a,olympe.ja.U.jp,!0);Va(a,olympe.ja.P.Da,olympe.ja.re.Ta,olympe.W.P.xg,new olympe.W.pa(olympe.ja.U.ip),new olympe.W.pa(olympe.ja.U.jp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.$a=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={$p:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Gb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};olympe.C.J.Y=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.$=new olympe.C.J(Gb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
300
- olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ea);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.uh=class{T(){return''}fn(){return''}destroy(){}gb(){return!1}td(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}Ps(){}je(){}detach(){}Mk(){}lg(){}onDestroy(){return''}Tf(){}Td(){return''}Gs(){}};olympe.C.uh.prototype.offDestroy=olympe.C.uh.prototype.Tf;olympe.C.uh.prototype.onDestroy=olympe.C.uh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.$p)],()=>{});
300
+ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ea);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.uh=class{T(){return''}fn(){return''}destroy(){}gb(){return!1}gd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}Ps(){}je(){}detach(){}Mk(){}lg(){}onDestroy(){return''}Tf(){}Td(){return''}Gs(){}};olympe.C.uh.prototype.offDestroy=olympe.C.uh.prototype.Tf;olympe.C.uh.prototype.onDestroy=olympe.C.uh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.$p)],()=>{});
301
301
  olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.ha=new Map;this.da=new Map;this.$=new Map;this.cb=0;this.name=a;this.id=String(Hb);this.F=this.wa=!1;(this.N=void 0===b?olympe.C.Xa():b)&&this.N.je(this);this.debug=!1}T(){return this.id}fn(){return this.name}run(a,...b){if(!this.wa){var c=olympe.C.Os(this);a=a(...b);c&&olympe.C.Os(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.wa&&!this.F){this.F=!0;this.lg();for(const a of this.da.keys())this.da.has(a)&&this.da.get(a)();
302
- this.da.clear();this.$.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.wa=!0;this.F=!1;this.lg()}}gb(){return this.wa}td(){return this.F}je(a){if(!this.wa){var b;olympe.C.hb(a)?b=a.Ba:olympe.C.sn(a)&&(b=a);b&&this.ha.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.sn(a)&&(c=a);c&&this.ha.has(c.T())&&(b&&c.Mk(this),this.ha.delete(c.T()))}Mk(){this.N=null;this.destroy()}lg(){const a=this.ha;for(const b of a.keys())a.has(b)&&a.get(b).Mk(this);this.ha.clear();for(const b of this.$.keys())this.$.has(b)&&
302
+ this.da.clear();this.$.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.wa=!0;this.F=!1;this.lg()}}gb(){return this.wa}gd(){return this.F}je(a){if(!this.wa){var b;olympe.C.hb(a)?b=a.Ba:olympe.C.sn(a)&&(b=a);b&&this.ha.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.sn(a)&&(c=a);c&&this.ha.has(c.T())&&(b&&c.Mk(this),this.ha.delete(c.T()))}Mk(){this.N=null;this.destroy()}lg(){const a=this.ha;for(const b of a.keys())a.has(b)&&a.get(b).Mk(this);this.ha.clear();for(const b of this.$.keys())this.$.has(b)&&
303
303
  this.$.get(b)();this.$.clear()}onDestroy(a,b){void 0===b&&(++this.cb,b=String(this.cb));this.da.set(b,a);return b}Tf(a){this.da.delete(a)}Td(a){if(void 0===b){++this.cb;var b=String(this.cb)}this.$.set(b,a);return b}Gs(a){this.$.delete(a)}Ps(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.je(this)}getParent(){return this.N}};olympe.C.Zq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Tf(){}};olympe.C.uh.xa=[olympe.C.uh];let Ib=0;
304
304
  function Jb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Hc()){case olympe.C.Node.j.Dh:break;case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.ek:case olympe.C.Node.j.Zf:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.vh:Kb(a,olympe.C.Node.j.vh);break;case olympe.C.Node.j.OBSOLETE:a.zb=!0;a.j!==olympe.C.Node.j.vh&&Kb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Vd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
305
305
  default:olympe.C.G.warn('Unknown state, investigate: ',b.Hc())}Lb(b,a)}
@@ -313,7 +313,7 @@ function Xb(a,b){if(a.j!==olympe.C.Node.j.Zf&&a.j!==olympe.C.Node.j.Vd&&(a.j!==o
313
313
  function Ob(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Rb(a),Lb(b,a),Nb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):Xb(a),a.D=b)}function Yb(a,b){a.Jc&&(a.Jc=void 0);a.ad='Repeater';Ob(a,b)}function Ub(a){a.D?Tb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Nb(b)).length&&(a.zb&&(a.zb=!1,Mb(a)),Tb(a))}
314
314
  function Lb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.Vd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Sb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),Zb(a)))}function Zb(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
315
315
  olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,sz:c=!0,Uf:d,nn:e,debug:f=!1,kg:g=null,ad:h='Node',gj:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Y=e&&0<e.length?e:null;this.kg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Ha=!1;this.j=olympe.C.Node.j.Dh;this.zb=!1;this.H=this.R=null;this.Jc=b;this.Uf=d||null;this.defaultValue=this.jb=this.D=void 0;this.gj=k;d&&d instanceof olympe.C.Node&&
316
- Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}nh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Dh&&L(this,a,!0);return this}ij(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.j}gb(){return this.j===olympe.C.Node.j.Vd}td(){return this.j===
316
+ Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}nh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Dh&&L(this,a,!0);return this}ij(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.j}gb(){return this.j===olympe.C.Node.j.Vd}gd(){return this.j===
317
317
  olympe.C.Node.j.Zf}Mb(...a){if(this.gj instanceof Function)return this.gj(...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.Hc();a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd||olympe.C.G.warn('Calling a function on a destroyed node!!!',this);a=d.F();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.C.hb(g)&&b.push(g.Ba);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.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
318
318
  Jc:c,Uf:this,nn:e,debug:!1,kg:b,ad:'Proxy.'+c+'()'}))}Mk(a){if(null===this.getParent())olympe.C.G.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.C.G.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.Ps(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd){Kb(this,olympe.C.Node.j.Zf);if(a=this.H){for(const c of a.values())if(a.has(c.T())){var b=c;b.R&&b.R.delete(this.T());
319
319
  b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Sb(c,this);this.R.clear()}this.R=null;this.D&&(Sb(this.D,this),this.D=void 0);this.Fb=void 0;this.Y&&(this.Y.length=0,this.Y=null);this.kg&&(this.kg.length=0,this.kg=null);this.gj=this.Jc=void 0;this.defaultValue=this.Uf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Vd)}}fn(){return this.ad}print(){const a=this.Jc?this.Jc instanceof Function?
@@ -372,7 +372,7 @@ m.qx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ss.K=new olympe.C.J(()=>String,[]
372
372
  olympe.C.Zb,'Vector2.plus')}lh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.lh(c.x),b.y.lh(c.y)),olympe.C.Zb,'Vector2.minus')}Yy(a){return new olympe.C.Zb(this.x.$k(a),this.y.$k(a))}lx(a){return new olympe.C.Zb(this.x.lj(a),this.y.lj(a))}$y(){return new olympe.C.Zb(this.x.Dj(),this.y.Dj())}mx(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
373
373
  a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}Gw(a){return new olympe.C.Zb(this.x.ce(a),
374
374
  this.y.ce(a))}Hw(a,b){return new olympe.C.Zb(this.x.ce(a),this.y.ce(b))}Uc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.ou.K=olympe.C.J.F;m.Bz.K=olympe.C.J.j;m.pu.K=olympe.C.J.F;m.Cz.K=olympe.C.J.j;m.ty.K=olympe.C.J.F;m.ce.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
375
- m.lh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.Yy.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.$y.K=olympe.C.J.R;m.mx.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.Gw.K=olympe.C.J.R;m.Hw.K=olympe.C.J.R;m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Bg=class{constructor(){}Nb(){}Md(){}get(){}fi(){}has(){}ih(){}Gc(){}Of(){}wf(){}og(){}forEach(){}ke(){}};olympe.C.Bg.prototype.forEachCurrentValue=olympe.C.Bg.prototype.ke;olympe.C.Bg.prototype.forEach=olympe.C.Bg.prototype.forEach;m=olympe.C.Bg.prototype;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;olympe.C.pd=class extends olympe.C.Bg{Dd(){}Nf(){}gf(){}Mf(){}le(){}ff(){}mj(){}hi(){}};olympe.C.pd.prototype.getCurrentAt=olympe.C.pd.prototype.ff;olympe.C.pd.prototype.getAt=olympe.C.pd.prototype.le;olympe.C.pd.prototype.getCurrentKeyAt=olympe.C.pd.prototype.Mf;olympe.C.pd.prototype.getKeyAt=olympe.C.pd.prototype.gf;olympe.C.pd.prototype.getCurrentRank=olympe.C.pd.prototype.Nf;olympe.C.pd.prototype.getRank=olympe.C.pd.prototype.Dd;m=olympe.C.pd.prototype;m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
375
+ m.lh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.Yy.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.$y.K=olympe.C.J.R;m.mx.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.Gw.K=olympe.C.J.R;m.Hw.K=olympe.C.J.R;m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Bg=class{constructor(){}Nb(){}Md(){}get(){}fi(){}has(){}ih(){}Gc(){}Of(){}wf(){}og(){}forEach(){}ke(){}};olympe.C.Bg.prototype.forEachCurrentValue=olympe.C.Bg.prototype.ke;olympe.C.Bg.prototype.forEach=olympe.C.Bg.prototype.forEach;m=olympe.C.Bg.prototype;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;olympe.C.qd=class extends olympe.C.Bg{Dd(){}Nf(){}gf(){}Mf(){}le(){}ff(){}mj(){}hi(){}};olympe.C.qd.prototype.getCurrentAt=olympe.C.qd.prototype.ff;olympe.C.qd.prototype.getAt=olympe.C.qd.prototype.le;olympe.C.qd.prototype.getCurrentKeyAt=olympe.C.qd.prototype.Mf;olympe.C.qd.prototype.getKeyAt=olympe.C.qd.prototype.gf;olympe.C.qd.prototype.getCurrentRank=olympe.C.qd.prototype.Nf;olympe.C.qd.prototype.getRank=olympe.C.qd.prototype.Dd;m=olympe.C.qd.prototype;m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
376
376
  m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.ff.K=olympe.C.J.j;m.mj.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);olympe.C.oi=class{constructor(a,b){this.N=b||olympe.C.Xa();this.valueType=a||Object;this.values={};this.jb=this.wa=null;this.af=0;this.Y=Object.create(null);this.zb=Object.create(null);this.size=0;this.H=null;this.N.onDestroy(()=>{const c=this.Y;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,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.N}Nb(){return this.valueType}Md(a){this.valueType=a;const b=this.wa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
377
377
  c)&&bc(b[c],a)}get(a){const b=c=>{null===this.wa&&(this.wa={});return this.qj(this.wa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}fi(a){a=this.values[a];return olympe.C.hb(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.jb&&(this.jb={});return this.qj(this.jb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}ih(a){return a in this.values}qj(a,b,c,d,e){let f=a[b];
378
378
  f||this.N.run(()=>{f=olympe.C.Sd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.hb(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Of(){throw Error('Abstract method getFirstKey needs to be overridden');}wf(){null===this.H&&this.N.run(()=>{this.H=olympe.C.Sd(olympe.C.aa,olympe.C.ra(this.size));this.H.Ba.onDestroy(()=>{this.H=null})});return this.H}og(){return this.size}forEach(a,b){const c=this.Lm();a=this.Mr(c,a,b);this.Km(c,a)}Lm(){return String(++this.af)}Km(a,
@@ -385,7 +385,7 @@ m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.
385
385
  b||this.N.run(()=>{b=this.get(this.gf(a));this.ha.set(a,b);b.Ba.onDestroy(()=>this.ha.delete(a))});return b}ff(a){return this.fi(this.Mf(a))}mj(a,b,c,d){let e=this.Lm();a=this.Ds(e,a,b,c,d);this.Km(e,a)}Ds(a,b,c,d,e){return olympe.C.Xa().rc((f,g)=>{let h=!1,k=olympe.C.mi([b,c,this.Dd(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Om(a,g,k)})}hi(){null===this.da&&this.N.run(()=>{this.da=olympe.C.Sd(Array,this.j.filter(a=>void 0!==a));
386
386
  this.da.Ba.onDestroy(()=>{this.H=null})});return this.da}ke(a){if(this.j.length!==this.size)super.ke(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Nm(a,b){const c=this.cb,d=this.Ha,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&dc(c[g]),void 0!==
387
387
  c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Mm(a){var b=this.Ha,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.cb;null!==c&&void 0!==c[a]&&dc(c[a])}Nr(){if(null!==this.da){const a=this.j,b=this.da.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.da,a)}}If(){this.Nr();super.If()}Uh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.cb;if(null!==
388
- a)for(b in a)dc(a[b]);a=this.Ha;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.da;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.oi.prototype.Uh.call(this)}Eg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Hj.xa=[olympe.C.pd];m=olympe.C.Hj.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
388
+ a)for(b in a)dc(a[b]);a=this.Ha;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.da;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.oi.prototype.Uh.call(this)}Eg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Hj.xa=[olympe.C.qd];m=olympe.C.Hj.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
389
389
  m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.ff.K=olympe.C.J.j;m.mj.K=new olympe.C.J(()=>{},[]);m.Ds.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);m.ke.K=olympe.C.J.j;m.Nm.K=olympe.C.J.j;m.Mm.K=olympe.C.J.j;m.Nr.K=olympe.C.J.j;m.If.K=olympe.C.J.j;m.Uh.K=olympe.C.J.j;m.Eg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.oi{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Md(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&bc(this.D,a);super.Md(a)}Gc(){null===this.D&&this.Ym();return this.D}Of(){null===this.j&&this.Ym();return this.j}Ym(){this.getContext().run(()=>{this.D=olympe.C.Sd(this.Nb());this.j=olympe.C.Sd(String);this.Bj(this.an())})}an(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bj(a){if(void 0!==
390
390
  a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Ik(a,b);1===this.size&&null!==this.j&&this.Bj(a);this.If()}remove(a){const b=this.fj(a);null!==this.j&&this.j.Ba.Fb===a&&this.Bj(this.an());return b}clear(){this.Uh();null!==this.j&&this.Bj()}};m=olympe.C.Map.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Ym.K=olympe.C.J.j;
391
391
  m.an.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;m.set.K=olympe.C.J.j;m.remove.K=new olympe.C.J(()=>Object,[]);m.clear.K=olympe.C.J.j;olympe.C.Hg=class extends olympe.C.Hj{constructor(a){super(a)}set(a,b,c){this.Ik(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Nm(a,d)});this.If()}remove(a){this.Mm(a);return this.fj(a)}clear(){this.Uh()}};olympe.C.Hg.prototype.remove.K=olympe.C.J.j;olympe.C.Hg.prototype.clear.K=olympe.C.J.j;olympe.C.at=class extends olympe.C.Yj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.Mo.Sp}rb(){return olympe.C.bz(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.xn=void 0;olympe.C.Zh=void 0;olympe.C.Th=new Map;olympe.C.Th.set(0,olympe.C.aa.ZERO);olympe.C.Th.set(1,olympe.C.aa.ONE);olympe.C.Th.set(2,olympe.C.aa.kw);olympe.C.Hk=new Map;olympe.C.Hk.set('',olympe.C.Sa.EMPTY);olympe.C.Hk.set(' ',olympe.C.Sa.Xv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Uf:c,nn:d,debug:g,kg:e,ad:f,gj:h})};olympe.C.Rf=function(a){return a instanceof olympe.C.Node};
@@ -409,7 +409,7 @@ olympe.C.GC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');t
409
409
  class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.bc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.aa);this.F=this.j.rb().ce(e.rb())});this.next=null}T(){return this.id}xy(){return this.j.rb()}gn(){return this.F}Dd(){return this.H}Hy(){return this.N}Nz(a){this.H=a}Az(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.gn()),a.next=this)}qu(){this.j.clear();
410
410
  this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.J.j;m.xy.K=new olympe.C.J(()=>olympe.C.aa);m.gn.K=new olympe.C.J(()=>olympe.C.aa);m.Dd.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.Nz.K=olympe.C.J.j;m.Az.K=olympe.C.J.j;m.qu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.$p,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.bx(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.eq=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.eq.create(c,b,a.G,a.H))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ja.yb.j.Xf&&a.G.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.C.hb(f))b.push(a.j.get(f.Aw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Xa();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
411
411
  function vc(a){var b=olympe.host.Je.Ad,c=olympe.host.Je.cq.Dr;++a.F;const d=a.F;tc(a,d,c);const e=olympe.C.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],l=d+'_'+k;this.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.hb(p)?(h.push(n),p=p.Ba):olympe.C.Rf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
412
- {uc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Td(a.N.bind(a,d));a=M(e);a.Aw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}$a(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Od=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}td(){return this.j.Ba.td()||this.D.td()}gb(){return this.j.Ba.gb()}};olympe.host.Od.prototype.F.K=new olympe.C.J(()=>olympe.host.Je.Od,[]);olympe.host.Ck=class{j(){}D(){}};olympe.host.Xt=class{};function wc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.td()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.td()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Vf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
412
+ {uc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Td(a.N.bind(a,d));a=M(e);a.Aw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}$a(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Od=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}gd(){return this.j.Ba.gd()||this.D.gd()}gb(){return this.j.Ba.gb()}};olympe.host.Od.prototype.F.K=new olympe.C.J(()=>olympe.host.Je.Od,[]);olympe.host.Ck=class{j(){}D(){}};olympe.host.Xt=class{};function wc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.gd()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.gd()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Vf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
413
413
  olympe.host.Ad.H=class extends olympe.host.Ad.j{cancel(){this.Vf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.D=class extends olympe.host.Ad.j{cancel(){this.Vf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.F=class extends olympe.host.Ad.j{cancel(){this.Vf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ee=class{D(a,b){return null!=b?b:''}ha(a,b){return null!=b?b:''}N(){}j(a,b){return null!=b?b:''}F(){}};olympe.host.Ee.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Je={};olympe.host.Je.Od=class{destroy(){}};olympe.host.Je.Od.prototype.destroy=olympe.host.Je.Od.prototype.destroy;olympe.host.Je.cq={Uz:100,Wz:101,Vz:102,Yz:103,Xz:104,Tz:105,xC:201,vC:202,sC:204,AC:205,rC:206,uC:207,yC:208,BC:209,CC:210,DC:211,tC:212,zC:218,wC:219,EC:220,qC:221,pC:222,LC:300,MC:301,NC:302,RC:303,SC:304,TC:305,OC:310,PC:311,QC:312,SB:400,TB:401,UB:402,HB:450,AB:500,yB:501,DB:502,CB:503,zB:504,BB:505,lD:600,cD:601,gD:602,ZC:603,$C:604,XC:605,bD:606,rD:607,jD:608,UC:609,YC:610,aD:611,iD:612,nD:613,VC:614,mD:615,hD:616,qD:617,dD:618,eD:619,fD:620,kD:630,WC:631,oD:632,pD:633,XD:700,AD:701,BD:702,
414
414
  CD:703,ED:704,FD:705,GD:706,DD:707,ID:708,HD:709,JD:710,ND:711,VD:712,KD:713,LD:714,OD:715,PD:716,RD:717,SD:718,UD:719,QD:720,TD:721,WD:722,MD:723,YD:724,ZD:725,Dr:800};olympe.host.Je.Ad=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={yk:'host.System',qp:'host.HistoryManager',ar:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Ue:'host.ProcessManager'};olympe.host.U={sk:'role',rp:'host.currentHost',yq:'host.processProbe',gr:'host.gracefulShutdownTimeout'};olympe.host.Pg={il:'active',Hh:'preview'};olympe.host.Vf=null;
415
415
  olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ua(a,olympe.host.U.rp,d);b=olympe.host.Pg.il;c=olympe.host.Pg.Hh;F(a,olympe.host.U.sk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.yk);Xa(a,olympe.host.P.qp);D(a,olympe.host.P.Ue,olympe.host.Ee);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.xg);E(a,olympe.host.P.ar,[olympe.host.P.Da],
@@ -417,7 +417,7 @@ e=>{null===olympe.host.Vf&&(olympe.host.Vf=new olympe.host.Ad(e));return olympe.
417
417
  olympe.net.va.Al={jB:'text/html',JSON:'application/json',zw:'application/zip',ge:'application/octet-stream'};olympe.net.va.Vb={lo:0,Eh:200,no:201,Fj:202,nl:400,nw:401,Yo:403,gm:404,EB:405,Wi:500,Pv:503};function yc(a){return a.host&&encodeURI(a.host)}function zc(a){return encodeURI(a.path).replace(olympe.net.ej.j,(b,c)=>'%'+c)}olympe.net.ej=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.D=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.D=d)}j(){return`${(void 0===this.D?443===this.port:this.D)?'wss':'ws'}://${yc(this)}:${this.port}/${zc(this)}`}toString(){return`${yc(this)}:${this.port}/${zc(this)}`}};
418
418
  olympe.net.ej.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.nz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Gi(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ts&&(c=a.Ts.split(':'),2===c.length&&(c=bb(olympe.V.df(),`${c[0]}:${c[1]}`),Ac(b,{Authorization:`Basic ${c}`})));return b}function Bc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Cc(a,b){a.F=b;return a}function Ac(a,b){Object.assign(a.headers,b)}
419
419
  olympe.net.Gi=class extends olympe.net.ej{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.va.Nd.GET;this.query=h;this.headers={};this.body=f;this.F=null!=g?g:olympe.net.va.ResponseType.ur}rj(){return this.headers}j(){let a=Bc(this);a=a?`?${a}`:'';if(!yc(this))return`${zc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.D?443===this.port:this.D)?'https':'http'}://${yc(this)}${b}/${zc(this)}${a}`}toString(){return this.j()}};
420
- olympe.net.Gi.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS'};olympe.net.kd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Hc(){return this.status}rj(){return this.headers}};function Dc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Tf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.re.Yt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}H(){}Sf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.H}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
420
+ olympe.net.Gi.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS'};olympe.net.ld=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Hc(){return this.status}rj(){return this.headers}};function Dc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Tf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.re.Yt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}H(){}Sf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.H}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
421
421
  function Hc(a,b){if(!Fc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.G.j()&&a.G.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.j.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function Ic(a,b){a.R.push(b)}function Jc(a,b){a.N.push(b)}function Kc(a,b){a.Y.push(b)}
422
422
  olympe.net.yf=class{constructor(a){this.G=olympe.ja.$a('MQTT');this.H=!1;this.j=this.D=null;this.N=[];this.Y=[];this.da=[];this.$=[];this.R=[];this.F=new Map;const b=olympe.V.Promise.kj(()=>this.connect(),0);a.subscribe(c=>{this.G.j()&&this.G.debug('New MQTT configuration received',c);this.D=c;null!==c&&this.H&&(Fc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(Fc(this))return null==a||a(),this;a&&this.N.push(a);this.H=!0;null===this.j&&null!==this.D&&(this.j=mqtt.connect(this.D.url,
423
423
  Gc(this)),this.j.on(olympe.net.yf.j.Yu,(b,c)=>{this.G.j()&&this.G.debug(`MQTT < ${c}`);this.F.has(b)?this.F.get(b)(JSON.parse(c.toString())):this.G.warn('There is no subscriber for topic '+b)}),this.j.on(olympe.net.yf.j.st,()=>{this.G.info('Mqtt client is connected to bus');this.N.forEach(b=>b())}),this.j.on(olympe.net.yf.j.Dv,()=>{this.G.info('Mqtt client is reconnecting to bus ... ');null===this.D&&this.end(!1);this.Y.forEach(b=>b())}),this.j.on(olympe.net.yf.j.Ab,b=>{this.G.error('Mqtt client error ',
@@ -428,19 +428,19 @@ olympe.net.Rh.ALL='*';olympe.net.aw=class{register(){return w(function*(){throw
428
428
  olympe.W.config(function(a){F(a,olympe.net.U.vf,3141);F(a,olympe.net.U.up,100);F(a,olympe.net.U.Cr,!1);F(a,olympe.net.U.tp,null);F(a,olympe.net.U.am,'frontend');F(a,olympe.net.U.Ri,!1);F(a,olympe.net.U.im,!1);F(a,olympe.net.U.nq,20);Xa(a,olympe.net.P.Da);E(a,olympe.net.P.Ca,[olympe.ja.P.Da],b=>b.cd('net'));D(a,olympe.net.P.dj,olympe.net.Rh,olympe.net.P.Ca);D(a,olympe.net.P.Tv,olympe.net.aw);E(a,olympe.net.P.jm,[new olympe.W.pa(olympe.net.U.Ri),new olympe.W.pa(olympe.net.U.im)],(b,c)=>new Map([['offlineEnabled',
429
429
  b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Od=function(a,b){this.G=b};olympe.Va.node.host.Od.prototype.constructor=olympe.Va.node.host.Od;olympe.Va.node.host.Od.prototype.destroy=function(){};olympe.Va.node.host.Od.prototype.destroy=olympe.Va.node.host.Od.prototype.destroy;olympe.Va.node.host.Od.prototype.$a=function(){return this.G};olympe.Va.node.host.Od.xa=[olympe.host.Je.Od];olympe.Va.node.host.fq=class{constructor(a){this.G=a}};olympe.Va.node.host.fq.xa=[olympe.host.Xt];olympe.Va.node.host.Ad=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.H[b]=setInterval(c,a)}D(a){clearInterval(this.H[a]);delete this.H[a]}};olympe.host.eq.register(olympe.host.Je.cq.Dr,olympe.Va.node.host.Ad);olympe.Va.node.host.Ad.xa=[olympe.host.Je.Ad];olympe.Va.node.host.Ck=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Va.node.host.Ck.xa=[olympe.host.Ck];function Lc(a){a.da.F('readinessProbe','/readiness',[olympe.net.va.Nd.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.da.F('livenessProbe','/liveness',[olympe.net.va.Nd.GET],()=>Mc(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.D(()=>a.da.stop())}
430
430
  function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.In(d(),a.wa,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function Oc(a){return w(function*(){try{const b=yield Nc(a,a.H),c=yield Nc(a,a.R);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.H.clear(),a.R.clear()}})}
431
- function Mc(a,b){const c=olympe.net.va.Vb.Eh,d=olympe.net.va.Vb.Wi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.kd('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).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.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.kd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
431
+ function Mc(a,b){const c=olympe.net.va.Vb.Eh,d=olympe.net.va.Vb.Wi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.ld('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).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.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.ld(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
432
432
  olympe.Va.node.host.Ee=class extends olympe.host.Ee{constructor(a,b,c,d=!0){super();this.G=a;this.da=b;this.wa=c;this.Y=new Map;this.$=new Map;this.H=new Map;this.R=new Map;d&&Lc(this)}j(a,b=olympe.V.Kf(),c=olympe.host.Ee.j.ALL){switch(c){case olympe.host.Ee.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Ee.j.READINESS:this.$.set(b,a);break;default:this.Y.set(b,a),this.$.set(b,a)}return b}F(a){this.$.delete(a);this.Y.delete(a)}D(a,b=olympe.V.Kf()){this.H.set(b,a);return b}ha(a,b=olympe.V.Kf()){this.R.set(b,
433
- a);return b}N(a){this.H.has(a)?this.H.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.yq,!0);F(a,olympe.host.U.gr,1E4);Va(a,olympe.host.P.qp,olympe.Va.node.host.fq,olympe.host.P.Ca);Va(a,olympe.host.P.yk,olympe.Va.node.host.Ck,olympe.host.P.Ca);D(a,olympe.host.P.Ue,olympe.Va.node.host.Ee,olympe.host.P.Ca,olympe.net.P.dj,new olympe.W.pa(olympe.host.U.gr),new olympe.W.pa(olympe.host.U.yq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.Va.node.host.Tk=()=>a});olympe.net.re={};function Ec(a,b,c){const d=olympe.net.va.Vb.lo,e=olympe.net.va.Vb.Wi,f=new AbortController;a.j.set(b,()=>f.abort());const g=c.j(),h=c.method;let k;return fetch(g,{method:h,headers:c.rj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.kd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.kd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
434
- l.name?new olympe.net.kd('',d,'Request canceled'):new olympe.net.kd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
435
- function Pc(a,b){return w(function*(){switch(b){case olympe.net.va.ResponseType.pl:var c=yield a.blob();break;case olympe.net.va.ResponseType.Oh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.va.ResponseType.JSON:c=yield a.json();break;case olympe.net.va.ResponseType.ge:c=a.body;break;default:c=yield a.text()}return new olympe.net.kd(c,a.status,a.statusText,a.headers)})}olympe.net.re.Yt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.re.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.H=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.ha(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
433
+ a);return b}N(a){this.H.has(a)?this.H.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.yq,!0);F(a,olympe.host.U.gr,1E4);Va(a,olympe.host.P.qp,olympe.Va.node.host.fq,olympe.host.P.Ca);Va(a,olympe.host.P.yk,olympe.Va.node.host.Ck,olympe.host.P.Ca);D(a,olympe.host.P.Ue,olympe.Va.node.host.Ee,olympe.host.P.Ca,olympe.net.P.dj,new olympe.W.pa(olympe.host.U.gr),new olympe.W.pa(olympe.host.U.yq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.Va.node.host.Tk=()=>a});olympe.net.re={};function Ec(a,b,c){const d=olympe.net.va.Vb.lo,e=olympe.net.va.Vb.Wi,f=new AbortController;a.j.set(b,()=>f.abort());const g=c.j(),h=c.method;let k;return fetch(g,{method:h,headers:c.rj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.ld(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.ld(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
434
+ l.name?new olympe.net.ld('',d,'Request canceled'):new olympe.net.ld(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
435
+ function Pc(a,b){return w(function*(){switch(b){case olympe.net.va.ResponseType.pl:var c=yield a.blob();break;case olympe.net.va.ResponseType.Oh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.va.ResponseType.JSON:c=yield a.json();break;case olympe.net.va.ResponseType.ge:c=a.body;break;default:c=yield a.text()}return new olympe.net.ld(c,a.status,a.statusText,a.headers)})}olympe.net.re.Yt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.re.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.H=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.ha(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
436
436
  this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):cb(d.data);(this.G.F()||this.G.j()&&!d.startsWith('pong'))&&this.G.debug(b,'<',d);this.F&&this.F(d)});c.addEventListener('close',()=>{this.G.info(`WebSocket ${b} CLOSED`);this.H&&this.H()});c.addEventListener('error',()=>{this.G.debug(`WebSocket ${b} ERROR`);this.N&&this.N()});this.j=c}send(a){const b=`#${this.id}`;if(null!==this.j){const c=this.j.constructor;switch(this.j.readyState){case c.OPEN:(this.G.F()||
437
437
  this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);this.j.send(a);break;case c.CONNECTING:this.G.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.G.debug(b,'- Closed','>',a),!1}}else this.G.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.j){const a=this.j.constructor,b=this.j.readyState;if(b===a.OPEN||b===a.CONNECTING){this.G.debug(`Force closing native websocket ${`#${this.id}`}`);this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=
438
438
  a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.H=a||null}ha(){}};olympe.net.re.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.ev=class extends olympe.net.Ta{N(){return'NodeJS'}Sf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.fv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.fv=class extends olympe.net.re.WebSocket{ha(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={zD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Ri)&&Ua(a,olympe.net.U.Ri,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.ev,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={xk:0,wk:1,zm:2},Tc=olympe.net.va.Nd.oq,Uc=olympe.net.va.Headers.$s,Vc=olympe.net.va.Headers.Ys,Wc=olympe.net.va.Headers.Zs,Xc=olympe.net.va.Vb.Eh;
439
439
  function Yc(a,b){const c=b.methods,d=b.Cy,e=b.headers,f=b.origin;a.D.route({bodyLimit:a.$<<20,url:b.path,method:[...c,Tc],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[Uc]:f,[Wc]:c,[Vc]:e};if(k===Tc)return a.G.debug('< HTTP: OPTIONS'),h.code(Xc).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=
440
440
  new olympe.net.Gi(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;a.G.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.Hc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Rc)&&h.type(olympe.net.va.Al.ge);if(u>=olympe.net.va.Vb.Wi)throw Error(x);u>=olympe.net.va.Vb.nl?a.G.warn('> HTTP: client bad request: reply with error:',
441
441
  x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.rj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.va.Vb.Wi).headers(Object.assign(l,{[olympe.net.va.Headers.xi]:'text/plain'})).send('Internal server error')})}})}
442
- olympe.Va.node.net.http.Rh=class extends olympe.net.Rh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.da=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.xk;this.gd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Rh.ALL;this.N.set(a,{path:b,methods:c,Cy:d,headers:e,origin:e});return this.H()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.H():b.stop()})}start(){if(this.j===Sc.xk)return this.H();if(this.j===Sc.wk){for(const a of this.N.values())Yc(this,
443
- a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.zm;this.G.debug('Web server listening on '+a);this.gd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.gd.forEach(b=>b(a))}).finally(()=>this.gd.clear())}return Promise.reject('Try to start a webservice already started')}H(){return this.j===Sc.wk?(new Promise((a,b)=>{this.gd.add(c=>c?b(c):a())})).then(()=>this.H()):new Promise((a,b)=>{this.gd.add(c=>c?b(c):a());this.kj(()=>{const c=this;return w(function*(){c.j=Sc.wk;
442
+ olympe.Va.node.net.http.Rh=class extends olympe.net.Rh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.da=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.xk;this.hd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Rh.ALL;this.N.set(a,{path:b,methods:c,Cy:d,headers:e,origin:e});return this.H()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.H():b.stop()})}start(){if(this.j===Sc.xk)return this.H();if(this.j===Sc.wk){for(const a of this.N.values())Yc(this,
443
+ a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.zm;this.G.debug('Web server listening on '+a);this.hd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.hd.forEach(b=>b(a))}).finally(()=>this.hd.clear())}return Promise.reject('Try to start a webservice already started')}H(){return this.j===Sc.wk?(new Promise((a,b)=>{this.hd.add(c=>c?b(c):a())})).then(()=>this.H()):new Promise((a,b)=>{this.hd.add(c=>c?b(c):a());this.kj(()=>{const c=this;return w(function*(){c.j=Sc.wk;
444
444
  yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.zm?this.D.close().then(()=>{this.j=Sc.xk}):Promise.resolve()}createServer(){var a=olympe.ja.yb.j.Gr,b=this.G.H();a={logger:{level:olympe.ja.yb.D[b===olympe.ja.yb.j.ak?a:b].toLowerCase()},http2:this.da};if('string'===typeof this.R){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.R,'key.pem')),cert:b.readFileSync(c.join(this.R,'cert.pem'))}})}a=Qc(a);a.addContentTypeParser('*',
445
445
  {parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}kj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.dj,olympe.Va.node.net.http.Rh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.vf),new olympe.W.pa(olympe.net.U.up),new olympe.W.pa(olympe.net.U.Cr),new olympe.W.pa(olympe.net.U.tp))},'olympe.native.node.net.http');olympe.Va.node.V={};const $c=require('stream').Readable,ad=require('buffer');
446
446
  olympe.Va.node.V.sl=class extends olympe.V.sl{D(a){return new Uint8Array(Buffer.from(a,'base64'))}j(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}H(a){const b=this,c=()=>super.H;return w(function*(){if(a instanceof $c){const d=[];for(const e=fa(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>ad.resolveObjectURL(a)).catch(b=>
@@ -449,7 +449,7 @@ olympe.async.To=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||
449
449
  this.$),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.Y=[];this.env.clear();this.ha&&this.F.destroy()}complete(a){this.F.Tf(this.$);if(!this.H){this.H=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.Y)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
450
450
  function cd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.$v=class extends olympe.async.To{static create(){return new olympe.async.$v(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),cd(this))}};
451
451
  olympe.async.mk=class extends olympe.async.To{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.mk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.da=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.da)}start(){if(!this.N)if(super.start(),
452
- 0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.Lu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}$(){}clear(){}H(){}};olympe.Db.Mu=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Vu=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={bk:'localStorage.KeyValueDatabaseManager',Xi:'localStorage.Storage',lA:'localStorage.DatacloudStorage',bm:'localStorage.LocalStorage',Ca:'localStorage.Logger',Sg:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Db.P.bk);E(a,olympe.Db.P.Sg,[],()=>'olympe');E(a,olympe.Db.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Db.P.bm,olympe.Db.Vu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Lo=class extends Error{};olympe.L.errors.tq=class extends Error{};olympe.L.errors.jq=class extends Error{};olympe.L.errors.Dk=class extends Error{};olympe.L.errors.uo=class extends Error{};olympe.L.errors.Wq=class extends Error{};olympe.L.errors.wq=class extends Error{};olympe.L.errors.uw=class extends Error{};olympe.L.errors.Cm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Pi=class extends olympe.L.errors.Cm{};
452
+ 0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Eb={};olympe.Eb.Lu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}$(){}clear(){}H(){}};olympe.Eb.Mu=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Vu=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={bk:'localStorage.KeyValueDatabaseManager',Xi:'localStorage.Storage',lA:'localStorage.DatacloudStorage',bm:'localStorage.LocalStorage',Ca:'localStorage.Logger',Sg:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Eb.P.bk);E(a,olympe.Eb.P.Sg,[],()=>'olympe');E(a,olympe.Eb.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Eb.P.bm,olympe.Eb.Vu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Lo=class extends Error{};olympe.L.errors.tq=class extends Error{};olympe.L.errors.jq=class extends Error{};olympe.L.errors.Dk=class extends Error{};olympe.L.errors.uo=class extends Error{};olympe.L.errors.Wq=class extends Error{};olympe.L.errors.wq=class extends Error{};olympe.L.errors.uw=class extends Error{};olympe.L.errors.Cm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Pi=class extends olympe.L.errors.Cm{};
453
453
  olympe.L.errors.eo=class extends olympe.L.errors.Cm{};olympe.L.errors.pp=class extends olympe.L.errors.Cm{};olympe.L.Yb={Wj:'urls.FileSvc',Wn:'urls.BackupSvc',Nq:'urls.RestoreBackupSvc',Cg:'urls.GetContext',lp:'urls.GraphDef',ho:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Br:'urls.UserTagFromToken',tw:'urls.UserNameFromTag',sw:'urls.UserRoles',Iv:'urls.RoleMembers',fk:'urls.OpenIDSvc'};
454
454
  olympe.W.config(a=>{F(a,olympe.L.Yb.Wj,'rest/filesvc');F(a,olympe.L.Yb.Wn,'rest/backupsvc');F(a,olympe.L.Yb.Nq,'rest/backupsvc/restore');F(a,olympe.L.Yb.fk,'rest/openid');F(a,olympe.L.Yb.Cg,'rest/initialData');F(a,olympe.L.Yb.lp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.ho,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.Br,'rest/token');F(a,olympe.L.Yb.tw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.sw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.Iv,
455
455
  'rest/authorization/roleMembers')});function dd(a){Ic(a.D,()=>{ed(a)});Kc(a.D,()=>{a.$=!0});Jc(a.D,()=>{fd(a).then(()=>{a.$=!1;gd(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.D.end()})})}function hd(a){return id(a.Mb)&&Fc(a.D)}
@@ -508,7 +508,7 @@ olympe.V.stream.Cf:if(!this.Y)throw Error('No stream handler has been set, so ca
508
508
  typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.Lo(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Cl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.cc.j.Wp:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Rg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.V.df().D(c).buffer;
509
509
  case olympe.L.cc.j.Oh:return olympe.V.df().D(c);case olympe.L.cc.j.ge:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.lq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Lo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Cl:1,COLOR:2,Wp:3,Rg:4,ARRAY_BUFFER:5,Oh:6,ge:7,lq:8};const qe=olympe.L.bb.j.SEND,re=olympe.L.bb.j.GET,se=olympe.L.bb.j.PUBLISH,te=olympe.L.bb.j.SUBSCRIBE,ue=olympe.L.bb.j.ye,ve=olympe.L.bb.j.Hm,we=olympe.L.bb.j.br,xe=olympe.L.bb.j.hl,ye=olympe.L.bb.j.Ab,ze=olympe.L.bb.j.Er,Ae=olympe.L.bb.j.Em;function oe(a,b){a.j||(a.j=gb(new olympe.V.Gm(a.D.Rd+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
510
510
  function Be(a,b){const c=olympe.L.bb.j.Em,d=olympe.L.bb.j.wr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.Dk(a):Error(a)}
511
- olympe.L.ub=class{constructor(a,b){this.D=olympe.L.ei();this.H=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.Eb?b.Eb():b);this.G=olympe.ja.$a(`Service ${this.H}`)}static observe(a,b,c,d={}){const e='function'===typeof b.Eb?b.Eb():b,f=olympe.L.ei();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.$a('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Td(l);f.request(a,te,c,d.timeout).then(n=>
511
+ olympe.L.ub=class{constructor(a,b){this.D=olympe.L.ei();this.H=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ja.$a(`Service ${this.H}`)}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ei();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.$a('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Td(l);f.request(a,te,c,d.timeout).then(n=>
512
512
  {switch(n.getType()){case Ae:const p=n.j;h=p.topic;jd(f,h,q=>{q.getType()===se?g.next(q.j):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;wd(f,a,k,p.refresh,q=>g.error(q));Be(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case ye:g.error(Ce(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
513
513
  return l})).pipe(nb(olympe.L.errors.Pi,(g,h)=>{olympe.ja.$a(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Qs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.H).catch(b=>this.G.error('Failed to unsubscribe from '+this.H+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
514
514
  b){return w(function*(){yield olympe.L.ei().request(a,se,b)})}static send(a,b,c={}){return olympe.L.ei().request(a,qe,b,c.timeout).then(d=>{switch(d.getType()){case we:break;case ye:throw Ce(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ei().request(a,re,b,c.timeout).then(d=>{switch(d.getType()){case ze:d=d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case ye:throw Ce(d);default:throw Error('Unsupported response type for a GET request');
@@ -527,13 +527,13 @@ An:h,Bn:k,Ms:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Gi(g,h,`${l}${
527
527
  new olympe.W.pa(olympe.dc.U.Mh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.vk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Ue,olympe.host.P.yk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.eg,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.sk,olympe.L.U.xr],(e,f)=>e===olympe.host.Pg.Hh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
528
528
  [new olympe.W.th('com.hostConfig'),new olympe.W.th('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.bo),new olympe.W.pa(olympe.L.U.rl),new olympe.W.pa(olympe.L.U.co),new olympe.W.pa(olympe.L.U.ye),new olympe.W.pa(olympe.L.U.Hv),new olympe.W.pa(olympe.L.U.qt),new olympe.W.pa(olympe.L.U.ot),new olympe.W.pa(olympe.L.U.vm),new olympe.W.pa(olympe.L.U.tt),new olympe.W.pa(olympe.L.U.Av)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Qw:p,Rw:q,Sw:r,Uw:t,Tw:u})=>{p=`${u?
529
529
  'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.ao,olympe.L.fo,olympe.L.P.Ca,olympe.net.P.Da,olympe.L.P.pf,olympe.auth.P.Da,
530
- olympe.host.P.Ue,olympe.L.P.Ge,olympe.V.P.eg,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.jm,olympe.Db.P.Sg,new olympe.W.pa(olympe.L.U.vm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.pf,olympe.L.tc,olympe.L.P.Ca,olympe.L.P.vk,olympe.net.P.Da,olympe.host.P.Ue,olympe.Db.P.bm,'com.connectivity.ManagerConfig')},'olympe.communication');
531
- olympe.W.run([olympe.L.P.ao,olympe.L.P.pf],(a,b)=>{olympe.L.ei=()=>a;olympe.L.cn=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.ze.Gg,c=>{const d=c.c;d===olympe.auth.od.j.Qu?(a.j.$e(),b(olympe.auth.Ta.D.Fj,c)):d===olympe.auth.od.j.Mv&&b(olympe.auth.Ta.D.xp,c)},'logoutHandler')}
530
+ olympe.host.P.Ue,olympe.L.P.Ge,olympe.V.P.eg,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.jm,olympe.Eb.P.Sg,new olympe.W.pa(olympe.L.U.vm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.pf,olympe.L.tc,olympe.L.P.Ca,olympe.L.P.vk,olympe.net.P.Da,olympe.host.P.Ue,olympe.Eb.P.bm,'com.connectivity.ManagerConfig')},'olympe.communication');
531
+ olympe.W.run([olympe.L.P.ao,olympe.L.P.pf],(a,b)=>{olympe.L.ei=()=>a;olympe.L.cn=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.ze.Gg,c=>{const d=c.c;d===olympe.auth.pd.j.Qu?(a.j.$e(),b(olympe.auth.Ta.D.Fj,c)):d===olympe.auth.pd.j.Mv&&b(olympe.auth.Ta.D.xp,c)},'logoutHandler')}
532
532
  function Ee(a,b,c){const d=null==b?void 0:b.xf();if(b instanceof olympe.auth.ik){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Cd();h.access_token=Fe(b);g=`${Ld(a.Ah,olympe.L.Yb.fk)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Wd(a.j,
533
- olympe.L.ze.Gg,Object.assign({},{c:olympe.auth.od.j.Ru},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.H.getState())===olympe.L.tc.j.Ae?d(new olympe.L.errors.tq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.ze.Gg,c,d))}
533
+ olympe.L.ze.Gg,Object.assign({},{c:olympe.auth.pd.j.Ru},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.H.getState())===olympe.L.tc.j.Ae?d(new olympe.L.errors.tq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.ze.Gg,c,d))}
534
534
  function He(a,b,c){if(b.Fg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.xf()}&access_token=${Fe(b)}`;d=`${Ld(a.Ah,olympe.L.Yb.fk)}/refresh${d}`;d=Cc(N(d),olympe.net.va.ResponseType.JSON);Nd(a.Ah,d,b.Cd()).then(e=>{(e=e.getData())?(e=new olympe.auth.ik(b.Cc(),b.pe(),b.Cd(),e,b.xf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
535
- olympe.auth.od=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Ah=c;this.H=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.uk.j.GET)}).catch(h=>{this.G.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.G.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}kf(a){Wd(this.j,olympe.L.ze.Gg,{c:olympe.auth.od.j.ye},b=>a(b))}hh(a,b,c){const d=Ld(this.Ah,olympe.L.Yb.Br);
536
- a=N(`${d}/${a}`);Nd(this.Ah,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.od.j={Gg:1,Ru:2,Ab:3,ye:5,Yi:6,Zt:10,Zv:11,Xs:12,SAML:13,Mv:14,Qu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.di());a.da.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
535
+ olympe.auth.pd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Ah=c;this.H=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.uk.j.GET)}).catch(h=>{this.G.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.G.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}kf(a){Wd(this.j,olympe.L.ze.Gg,{c:olympe.auth.pd.j.ye},b=>a(b))}hh(a,b,c){const d=Ld(this.Ah,olympe.L.Yb.Br);
536
+ a=N(`${d}/${a}`);Nd(this.Ah,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.pd.j={Gg:1,Ru:2,Ab:3,ye:5,Yi:6,Zt:10,Zv:11,Xs:12,SAML:13,Mv:14,Qu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.di());a.da.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
537
537
  function ee(){var a=olympe.auth.me();const b=olympe.auth.Ta.j.Gj,c=olympe.auth.Ta.j.INIT;Je(a,b);a.Ha?(a.F=olympe.auth.Ta.F.Ws,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ke(a)):(a.F=olympe.auth.Ta.F.$i,a.G.log('Connector online, attempting to log with token'),Le(a));return rxjs.firstValueFrom(a.D.rb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
538
538
  function Me(a){a.G.log('Initializing AUTH layer');let b=a.vc;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&Ne(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Sc([a.cb.getState()],c=>{switch(c){case olympe.L.tc.j.Ae:a.F=olympe.auth.Ta.F.$i;a.G.log('Connector offline, attempting to recover sessions from current token');
539
539
  Le(a);break;case olympe.L.tc.j.Wd:switch(olympe.C.Pa(a.D)){case olympe.auth.Ta.j.lf:c=olympe.C.Pa(a.j).Cc();Oe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Di:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Gj:Oe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:Oe(a,'Cannot open auth session - no server connection');break;default:Oe(a,'Should not get there, investigate',!0)}}});De(a.H,
@@ -552,18 +552,18 @@ this.H.kf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:
552
552
  null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',Gj:'authenticating',Di:'guest',lf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Xu:'manual',Ws:'auto',$i:'tokenOnFirstConnection'};olympe.auth.Ta.D={Fj:'accepted',xp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}oe(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.kf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Bd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}qg(a,b){this.D.kf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',km:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Xg&&(a=a.Ba.Fb);return a?a.valueOf():a}Cc(){return this.get('username')}Cd(){return this.get('nonce')}toString(){return this.Cc()+(this.Cd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Wg=class{constructor(a,b,c,d={},e=null){this.H=a;this.ni=b;this.D=c;this.j=e;this.F=d}Cc(){return this.H}pe(){return this.ni}Cd(){return this.D}Ji(){return this.F}gi(){return null}xf(){return this.j}ga(){const a=olympe.V.df(),b=Object.assign({},{user:this.H,userTag:this.ni,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Qr(bb(a,JSON.stringify(b)))}Fg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.Wg.prototype;m.Cc.K=new olympe.C.J(()=>String,[]);
553
553
  m.pe.K=new olympe.C.J(()=>String,[]);m.Cd.K=new olympe.C.J(()=>String,[]);m.Ji.K=new olympe.C.J(()=>Object,[]);m.gi.K=new olympe.C.J(()=>String,[]);m.xf.K=new olympe.C.J(()=>String,[]);m.ga.K=new olympe.C.J(()=>String,[]);m.Fg.K=new olympe.C.J(()=>String,[]);function Fe(a){return a.Ji().access_token||null}function $e(a){return 1E3*parseInt(a.Ji().access_token_exp||'0',10)}olympe.auth.ik=class extends olympe.auth.Wg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}gi(){return Fe(this)}Fg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.$q=class extends olympe.auth.Wg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}gi(){return this.N}Fg(){return olympe.auth.Ec.j.SAML}ga(){const a=olympe.V.df(),b=Object.assign({},{user:this.Cc(),userTag:this.pe(),nonce:this.Cd()},this.xf()&&{idpName:this.xf()},{payload:this.Ji(),fullToken:this.N});return olympe.V.Qr(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function Pe(a){return qb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
554
554
  olympe.auth.dt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.Bm;this.db=this.F.D('AUTH')}oe(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return qb(this.D,()=>{const a=this;return w(function*(){let b;try{b=yield a.db.get('main',a.j)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.G.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
555
- d.parse;var f=cb(olympe.V.df().D(olympe.V.Ow(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.$q(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.ik(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Wg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.uk=class{redirect(){}D(){}j(){}};olympe.auth.uk.j={GET:'GET',Gh:'POST'};olympe.auth.Tn=class{constructor(a){this.j=a||'default'}};olympe.auth.Ud={};function af(a,b,c){Ge(a.D,olympe.auth.od.j.Gg,{token:b.Cd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.od.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.od.j.Yi:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.$q(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.ik(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
555
+ d.parse;var f=cb(olympe.V.df().D(olympe.V.Ow(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.$q(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.ik(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Wg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.uk=class{redirect(){}D(){}j(){}};olympe.auth.uk.j={GET:'GET',Gh:'POST'};olympe.auth.Tn=class{constructor(a){this.j=a||'default'}};olympe.auth.Ud={};function af(a,b,c){Ge(a.D,olympe.auth.pd.j.Gg,{token:b.Cd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.pd.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.pd.j.Yi:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.$q(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.ik(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
556
556
  olympe.auth.Ud.Wu=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.km}oe(a,b){this.storage.oe().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.vr);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.qg(b,c)},d);a.qg(b,c);return null}
557
- olympe.auth.Ud.nv=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Ec.j.OAUTH2}oe(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.uk.j.GET)}H(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}qg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.od.j.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.Ud.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}oe(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.od.j.Zt,e=olympe.auth.od.j.Ab,f=olympe.auth.od.j.Zv,g={I:b.Cc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Cc()}' 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'))}})}
558
- function ef(a,b,c){const d=olympe.auth.od.j.Xs,e=olympe.auth.od.j.Ab,f=olympe.auth.od.j.Yi;b={A:b.get('a'),M:b.get('m1'),I:b.Cc()};Ge(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Wg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
557
+ olympe.auth.Ud.nv=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Ec.j.OAUTH2}oe(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.uk.j.GET)}H(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}qg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.pd.j.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.Ud.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}oe(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.pd.j.Zt,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Zv,g={I:b.Cc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Cc()}' 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'))}})}
558
+ function ef(a,b,c){const d=olympe.auth.pd.j.Xs,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Yi;b={A:b.get('a'),M:b.get('m1'),I:b.Cc()};Ge(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Wg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
559
559
  null)}})}olympe.auth.Ud.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}oe(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Cc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Xi:'auth.Storage',kl:'auth.appNameToken',qk:'auth.Redirector',dr:'auth.ServerConnector'};olympe.auth.U={Fl:'auth.defaultProvider',Nn:'auth.autoLogin',Pn:'auth.autoUser',On:'auth.autoPassword',$i:'auth.token',io:'auth.cacheTokenTimeout',vr:'auth.tokenDurationPercentage'};
560
- olympe.W.config(function(a){F(a,olympe.auth.U.Fl,olympe.auth.Ec.j.SRP);F(a,olympe.auth.U.Nn,!1);F(a,olympe.auth.U.Pn,'');F(a,olympe.auth.U.On,'');F(a,olympe.auth.U.$i,'');F(a,olympe.auth.U.vr,50);F(a,olympe.auth.U.io,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.kl,olympe.auth.Tn,olympe.Db.P.Sg);D(a,olympe.auth.P.Xi,olympe.auth.dt,olympe.Db.P.bk,olympe.auth.P.Ca,olympe.auth.P.kl);D(a,olympe.auth.P.dr,olympe.auth.od,olympe.auth.P.Ca,olympe.L.P.vk,olympe.L.P.Ql,olympe.L.P.pf,
560
+ olympe.W.config(function(a){F(a,olympe.auth.U.Fl,olympe.auth.Ec.j.SRP);F(a,olympe.auth.U.Nn,!1);F(a,olympe.auth.U.Pn,'');F(a,olympe.auth.U.On,'');F(a,olympe.auth.U.$i,'');F(a,olympe.auth.U.vr,50);F(a,olympe.auth.U.io,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.kl,olympe.auth.Tn,olympe.Eb.P.Sg);D(a,olympe.auth.P.Xi,olympe.auth.dt,olympe.Eb.P.bk,olympe.auth.P.Ca,olympe.auth.P.kl);D(a,olympe.auth.P.dr,olympe.auth.pd,olympe.auth.P.Ca,olympe.L.P.vk,olympe.L.P.Ql,olympe.L.P.pf,
561
561
  olympe.auth.P.qk,olympe.auth.P.Xi);Xa(a,olympe.auth.P.qk);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.pf,olympe.auth.P.dr,olympe.host.P.Ue,olympe.host.P.yk,new olympe.W.ub(olympe.auth.P.Xi,olympe.W.qh.j.hm),new olympe.W.ub(olympe.auth.P.qk,olympe.W.qh.j.hm),new olympe.W.pa(olympe.auth.U.Fl),new olympe.W.pa(olympe.auth.U.Nn),new olympe.W.pa(olympe.auth.U.Pn),new olympe.W.pa(olympe.auth.U.On),new olympe.W.pa(olympe.auth.U.$i),new olympe.W.pa(olympe.auth.U.io)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
562
562
  [new olympe.auth.Ud.Wu(b,d,g),new olympe.auth.Ud.SRP(b,d),new olympe.auth.Ud.SAML(b,d,h),new olympe.auth.Ud.nv(b,d,h,Ld(d.Ah,olympe.L.Yb.fk))];if(!t.map(u=>u.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.Fl} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
563
- olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.me=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.iq=class{redirect(){console.warn('Redirection n/a in Node.JS')}D(){console.warn('Redirection n/a in Node.JS')}j(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Va.node.auth.iq.xa=[olympe.auth.uk];olympe.W.config(a=>{D(a,olympe.auth.P.qk,olympe.Va.node.auth.iq)},'olympe.native.node.auth');olympe.Va.node.Db={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
- olympe.Va.node.Db.gq=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
563
+ olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.me=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.iq=class{redirect(){console.warn('Redirection n/a in Node.JS')}D(){console.warn('Redirection n/a in Node.JS')}j(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Va.node.auth.iq.xa=[olympe.auth.uk];olympe.W.config(a=>{D(a,olympe.auth.P.qk,olympe.Va.node.auth.iq)},'olympe.native.node.auth');olympe.Va.node.Eb={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
+ olympe.Va.node.Eb.gq=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
565
565
  return w(function*(){let d,e;return null!=(e=null==(d=c.j.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return w(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return w(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return w(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}da(){ff();return Promise.resolve()}$(){ff();return Promise.resolve()}clear(a){const b=this;return w(function*(){let c;
566
- null==(c=b.j.get(a))||c.clear()})}H(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Db.gq.xa=[olympe.Db.Lu];olympe.Va.node.Db.hq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Db.gq(this.G));return this.j.get(a)}};olympe.Va.node.Db.hq.xa=[olympe.Db.Mu];olympe.W.config(function(a){D(a,olympe.Db.P.bk,olympe.Va.node.Db.hq,olympe.Db.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Db.Storage];olympe.W.config(function(a){Va(a,olympe.Db.P.Xi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.pg={};olympe.pg.U={VERSION:'version.version',gt:'version.branch',nf:'version.commit',fw:'version.tag',Zo:'version.olympe-framework',ht:'version.build'};olympe.W.config(function(a){F(a,olympe.pg.U.VERSION,'');F(a,olympe.pg.U.gt,'');F(a,olympe.pg.U.nf,'');F(a,olympe.pg.U.fw,'');F(a,olympe.pg.U.Zo,'');F(a,olympe.pg.U.ht,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
566
+ null==(c=b.j.get(a))||c.clear()})}H(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Eb.gq.xa=[olympe.Eb.Lu];olympe.Va.node.Eb.hq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Eb.gq(this.G));return this.j.get(a)}};olympe.Va.node.Eb.hq.xa=[olympe.Eb.Mu];olympe.W.config(function(a){D(a,olympe.Eb.P.bk,olympe.Va.node.Eb.hq,olympe.Eb.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Eb.Storage];olympe.W.config(function(a){Va(a,olympe.Eb.P.Xi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.pg={};olympe.pg.U={VERSION:'version.version',gt:'version.branch',nf:'version.commit',fw:'version.tag',Zo:'version.olympe-framework',ht:'version.build'};olympe.W.config(function(a){F(a,olympe.pg.U.VERSION,'');F(a,olympe.pg.U.gt,'');F(a,olympe.pg.U.nf,'');F(a,olympe.pg.U.fw,'');F(a,olympe.pg.U.Zo,'');F(a,olympe.pg.U.ht,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
567
567
  function mf(a){var b=nf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{hf.access(c,gf.constants.F_OK).then(()=>{gf.watch(c,d=>w(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.Cs([c]),f=olympe.W.ms(e);for(const [g,h]of f)a.Ej(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
568
568
  function of(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Va.node.host).Tk)?void 0:null==(c=b.call(a))?void 0:Oc(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
569
569
  process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);of()});const nf=['oConfig.json','conf.d/oConfig.json','version.json'];kf&&nf.push(kf);
@@ -585,16 +585,16 @@ function Lf(a,b,c){const d=a+'@'+(b===Df?Cf:Df);if(Ff.has(d))throw Error(`Try to
585
585
  olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Ef.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Ef.get(a).D.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.W.ub(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Ef.set(a,b);return b.D.entry=b}static ac(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Nf(a,b){a.j=b}function R(a,b){b=b.$b();Lf(b.X(),b.Ka(),a.D);return b}function Of(a){a.F=!0;return a}
586
586
  olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.En=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.pn()&&b.getParameter(olympe.dc.U.Qo)){var d=olympe.dc.ia();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.ja.$a('dc').error(d)}return this.En?(a=[void 0,a].concat(Na(b,this.En)),new c(...a)):new c(void 0,
587
587
  a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.ua.DESTINATION){Lf(a,b,this.D);return new olympe.dc.ba.Ve(a,b)}pn(){return this.F}};B('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.sa;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ka;olympe.dc.Ra.Entry.xa=[olympe.dc.Te];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.X;olympe.dc.Ra.Property.xa=[olympe.dc.Te];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.H=d}X(){return this.tag}Ka(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION,this.H,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.X()===this.X()&&a.Ka()===this.Ka():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
588
- olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ka;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Te];olympe.dc.db={};function Pf(a,b){const c=a.H,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Ui,f=olympe.dc.db.Database.D.Se,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Ed())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.sd())for(const r of Qf(d,n,l.H())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
- y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Oc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Ed())x?k.hc(t,n,u):k.Oa(t,n,u)}}});return k}
588
+ olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ka;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Te];olympe.dc.db={};function Pf(a,b){const c=a.H,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Ui,f=olympe.dc.db.Database.D.Se,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Ed())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.td())for(const r of Qf(d,n,l.H())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
+ y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Oc(r,l,t)}else{const r=new Map;for(const t of l.Db().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Ed())x?k.hc(t,n,u):k.Oa(t,n,u)}}});return k}
590
590
  function Sf(a,b,c){const d=b.T();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 Tf(b,Pf(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Bs(c);a.write(b,!1,!1)}
591
591
  function Uf(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.Tc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Vf(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
592
592
  function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.Jm(a.G,a.H,a.ia,c);e.open(d);for(const f=fa(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
593
593
  function Yf(a,b,c,d){b=b.pipeThrough(olympe.V.stream.tap(e=>{0<a.D.length&&Uf(a,Wf(a,e.jc(),a.D.length),e.Lk)}));return Xf(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
594
594
  olympe.dc.db.xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ia=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.ep,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}Tc(a,b,c){const d=a.T(),e=a.Lk;this.F.has(d)?this.push(d,e):(a=Uf(this,Wf(this,a.jc(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
595
- 1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Jm(this.G,this.H,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Qc(c);b.Cb().forEach((g,h)=>{f.ka(h,g);b.da(h)});for(const [g,h,k,l]of b.ha()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
596
- function ag(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Qc(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.da(k))});for(const [h,k,l]of b.Ed()){const n=c.zb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
- class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.sd()?b.D()?a.j(d,b.H()):(this.D.j(d,c.H()),this.j.j(d,c.H())):b.sd()?($f(this,c,b,a),a.j(d,b.H())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
595
+ 1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Jm(this.G,this.H,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Qc(c);b.Db().forEach((g,h)=>{f.ka(h,g);b.da(h)});for(const [g,h,k,l]of b.ha()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
596
+ function ag(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Qc(f);b.Db().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.da(k))});for(const [h,k,l]of b.Ed()){const n=c.zb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
+ class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.td()?b.D()?a.j(d,b.H()):(this.D.j(d,c.H()),this.j.j(d,c.H())):b.td()?($f(this,c,b,a),a.j(d,b.H())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
598
598
  class Vf extends Zf{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;bg(this)}T(){return this.j.T()}Tc(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);bg(this);return this}};const cg=olympe.dc.fc.Yc,dg=olympe.dc.fc.Ai,eg=olympe.dc.ua.ORIGIN,fg=olympe.dc.ua.DESTINATION;let gg=0;
599
599
  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.Ja.SELF;this.G=b;this.Bd=olympe.C.Xa();this.R=olympe.dc.db.Database.F.IDLE;this.wa=new Map;this.zc=[];this.$=new Map;this.H=null;this.ha=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.uf.j.Hl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Id=new olympe.dc.db.uf(c,this,b,f);d.get('debug')&&this.xs()}T(){return this.id}getState(){return this.R}$a(){return this.G}create(b,
600
600
  c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.da(f,!0)}e&&f.persist();this.R===a.F.ol&&hg(f,!0);d&&this.$c(f,d);this.D(a.j.Cp,b)}update(b,c){c&&(b=this.N(b,!0),this.$c(b,c))}Ha(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.D(a.j.Dp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(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 cg:kg(c,
@@ -614,27 +614,27 @@ function Vg(a,b,c,d,e){const f=a.j.N(Ig(b));e=null!=e?e:Jg();const g=Qg(f,Cg+c,e
614
614
  function Ug(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.de.dg;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Yg(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===xg||c===yg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
615
615
  function Zg(a,b,c){if(!a.Ga(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.fa(b)];for(const f of e){const g=a.ab(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.G.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.fa(b)}`);return d}function $g(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ga()).length:0}
616
616
  olympe.dc.kb=class{constructor(a,b){this.G=a;this.j=b}T(){return this.j.T()}D(a,b,c,d=!1){a=S(this,a);if(null!==a){b=b.Ka()+b.X();const e=Hg(a,b,c);void 0!==e&&(this.j.getState()!==Fg.nf||a.F()&&!d||this.j.Y(c),d||!a.Ga()&&!a.F()||Pg(a,b,!1,e,!1))}}Ga(a){a=this.j.get(olympe.dc.fa(a));return!(null==a||!a.Ga())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}bf(a){return(a=(a=S(this,
617
- a,!0))&&a.bf())?a.tag():null}ji(a){a=S(this,a,!0);return!(!a||!a.bf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Qf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Le(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Qa(b,c))?d:null}Cb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===zg||!b&&c===Bg)&&a.set(d.substring(1),e);return a}Qk(a,b){return Tg(this,a,b).filter(([c])=>c.Ga()).map(([c,
617
+ a,!0))&&a.bf())?a.tag():null}ji(a){a=S(this,a,!0);return!(!a||!a.bf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Qf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Le(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Qa(b,c))?d:null}Db(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===zg||!b&&c===Bg)&&a.set(d.substring(1),e);return a}Qk(a,b){return Tg(this,a,b).filter(([c])=>c.Ga()).map(([c,
618
618
  ...d])=>[c.tag(),...d])}ab(a,b){a=S(this,a,!0);b=b.Ka()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ga()&&a.push(c.tag());return a}As(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ka()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ga())}kn(a,b){a=S(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=S(this,d,!0).get(c.Ka()+c.X()),void 0!==a)for(const e of a.values())e.Ga()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
619
619
  S(this,a,!0);const d=b.Ka()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ga())?a.tag():null}eh(a,b,c){a=olympe.dc.fa(a);const d=Zg(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Zg(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}bs(a,b,c){if(!this.Ga(a))return null;b=Zg(this,
620
620
  a,b);const d=[olympe.dc.fa(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}bn(a,b,c){return this.kn(a,b).find(c)||null}sx(a,b,c){return this.kn(a,b).filter(c)}ks(a,b=olympe.dc.CloudObject){var c=S(this,a,!0);const d=b&&S(this,b,!0),e=[c];for(;c&&c!==d;){c=c.bf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ga())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,
621
621
  Error(a);null!==c&&e.push(c)}c=S(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}).`);return e.map(f=>f.tag())}Qf(a,b){const c=olympe.dc.fa(b);return!!this.bs(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Rc(a){return this.ab(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Rc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Qf;
622
622
  olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.ks;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.sx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.bn;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.bs;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.eh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.kn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.As;
623
- olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.ab;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Cb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Le;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Ob;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ji;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.bf;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
623
+ olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.ab;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Db;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Le;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Ob;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ji;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.bf;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
624
624
  olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ga;const ah=olympe.dc.db.Database.D.ORIGIN,pg=olympe.dc.db.Database.D.DESTINATION,og=olympe.dc.db.Database.D.jl,bh=olympe.dc.db.Database.D.Ui,ch=olympe.dc.db.Database.D.zp,dh=olympe.dc.db.Database.D.wi,eh=ah+pg,fh=bh+bh,gh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function mg(a,b,c){let d=a.j.get(b);void 0===d&&(d=[],a.j.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
625
625
  function qg(a){for(const [b,c]of a.H)a.D.vc(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?ng(a,d).create():ng(a,d).delete()})}
626
- function rg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.sd()){var f=e.get(dh);f&&hh(a,f,c.D(),d);c.sd()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===og,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(dh+bh+h);q&&hh(f,q,l,g);(k=k.get(dh+fh))&&hh(f,k,h,l,g)}for(const n of c.ha())ih(a,e,...n);(e=c.$)&&jh(a,e,d,c.zc,!c.sd())});a.H.clear();a.F.clear();a.N.clear();kh(a)}function ng(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yh(b),a.F.set(b,c));return c}
626
+ function rg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.td()){var f=e.get(dh);f&&hh(a,f,c.D(),d);c.td()&&a.R.add(d)}for(const [n,p]of c.Db()){var g=n[0]===og,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(dh+bh+h);q&&hh(f,q,l,g);(k=k.get(dh+fh))&&hh(f,k,h,l,g)}for(const n of c.ha())ih(a,e,...n);(e=c.$)&&jh(a,e,d,c.zc,!c.td())});a.H.clear();a.F.clear();a.N.clear();kh(a)}function ng(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yh(b),a.F.set(b,c));return c}
627
627
  function hh(a,b,...c){b.forEach((d,e)=>{mg(a,e,d.bind(null,...c))})}function ih(a,b,c,d,e,f){var g=b.get(dh+d+c);g&&hh(a,g,f,e);(g=b.get(dh+eh))&&hh(a,g,c,d,f,e);lh(a,c,d).forEach((h,k)=>{(k=b.get(dh+ch+k))&&hh(a,k,c,d,h,f,e)})}function jh(a,b,c,d,e){gh.forEach(f=>{const g=f[0]===olympe.dc.de.dg;(f=a.D.get(g?c:b).get(dh+ch+f))&&hh(a,f,d,null,!0,e,g?b:c)})}
628
628
  function kh(a){a.Y.run(()=>{const b=a.j;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.j.clear();a.buffer.length=0}function lh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;gh.forEach(g=>{const h=g[0]===olympe.dc.de.dg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(bh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ah?12:3)&k&&e.set(g,!!((c===ah?8:2)&k))});a.N.set(d,e)}return e}
629
629
  olympe.dc.db.Lt=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function sg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.uf.j.Ln:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.uf.j.Yv:a.F=!0,a.run()}}
630
630
  olympe.dc.db.uf=class{constructor(a,b,c,d){this.G=a;this.j=b;this.D=new Set;this.mode=c;this.delay=d;this.F=!1;c!==olympe.dc.db.uf.j.Hl&&this.init()}run(){const a=this.j;this.G.debug('Start garbage collector with',this.D.size,'instances to check');const b=[];for(const c of this.D){const d=a.get(c);!d||0<d.c||(this.G.debug('Remove unused instance',c,'from database'),a.Rd(c),b.push(c))}this.D.clear();this.j.cb(olympe.dc.db.Database.j.ep,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.Ar,b=olympe.dc.db.Database.j.Dp,
631
- c=olympe.dc.db.Database.j.Jq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&sg(this)};this.j.j(olympe.dc.db.Database.j.Im,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.jw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.uf.j={Hl:0,Yv:1,Ln:2};olympe.dc.db.uf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.V.Kf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.yh.j.em,c=olympe.dc.db.yh.j.Dc,d=olympe.dc.db.yh.j.Ek;this.Bb.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Cb():void 0;a.Oc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Cb(),g);break;case c:a.D(f,e.H(),g)}for(const [h,k,l]of e.Ed())e=this.Bb.get(k),
632
- l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}hf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.Bd()});return a}Oc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Yc,a,d,d,null);c&&b.Qm(c)}Wc(a,b,c=null){b&&this.F(a,c).Qm(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.Qk(a,b,!1))this.Bb.get(e).Cb().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
633
- c);this.F(c,e).Mb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).vc(a,b)}$(a){var b=olympe.dc.ia();if(b.Ga(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Xg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.de.Se}${g}`,f)});this.Oc(a,d,e,c);(b=b.bf(a))&&this.Oa(olympe.dc.fc.Ai,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.$(f.X())})}}Rc(){return function*(a){for(const b of a.values())if(b.D()||b.sd()||b.R())yield b}(this.Bb)}Qc(a){let b;return null!=(b=this.Bb.get(olympe.dc.fa(a)))?
631
+ c=olympe.dc.db.Database.j.Jq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&sg(this)};this.j.j(olympe.dc.db.Database.j.Im,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.jw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.uf.j={Hl:0,Yv:1,Ln:2};olympe.dc.db.uf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.V.Kf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.yh.j.em,c=olympe.dc.db.yh.j.Dc,d=olympe.dc.db.yh.j.Ek;this.Bb.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Db():void 0;a.Oc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Db(),g);break;case c:a.D(f,e.H(),g)}for(const [h,k,l]of e.Ed())e=this.Bb.get(k),
632
+ l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}hf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.Bd()});return a}Oc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Yc,a,d,d,null);c&&b.Qm(c)}Wc(a,b,c=null){b&&this.F(a,c).Qm(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.Qk(a,b,!1))this.Bb.get(e).Db().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
633
+ c);this.F(c,e).Mb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).vc(a,b)}$(a){var b=olympe.dc.ia();if(b.Ga(a)){const c=b.model(a),d=b.source(a),e=b.Db(a,!0);Xg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.de.Se}${g}`,f)});this.Oc(a,d,e,c);(b=b.bf(a))&&this.Oa(olympe.dc.fc.Ai,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.$(f.X())})}}Rc(){return function*(a){for(const b of a.values())if(b.D()||b.td()||b.R())yield b}(this.Bb)}Qc(a){let b;return null!=(b=this.Bb.get(olympe.dc.fa(a)))?
634
634
  b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Qk(a,b);for(const c of a)this.Y(c,!1),this.Bb.delete(c)}Ed(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Ed((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}eh(a,b,c=(d,e)=>[d,e]){return this.ha(a,b,c)}*ha(a,b,c,d=[]){d.push(a);a=this.Qc(a);for(const [e,f]of a.ab(b))d.includes(e)||(yield*this.ha(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Bb.get(b),e=this.Bb.get(c);d&&d.N(a,olympe.dc.ua.DESTINATION,c);e&&e.N(a,olympe.dc.ua.ORIGIN,
635
- b)}Y(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Ed())if(k||!b){e.N(g,d,h);var f=this.Bb.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.jb())if(k||!b)e.N(g,c,h),(f=this.Bb.get(h))&&f.N(g,d,a)}*ps(a){let b;for(const [c,d]of(null==(b=this.Qc(a))?void 0:b.ab(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.sd()||(yield a))}Qk(a,b,c=!0){const d=olympe.dm.Relation.j.Qq,e=olympe.dm.Relation.j.yr,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
635
+ b)}Y(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Ed())if(k||!b){e.N(g,d,h);var f=this.Bb.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.jb())if(k||!b)e.N(g,c,h),(f=this.Bb.get(h))&&f.N(g,d,a)}*ps(a){let b;for(const [c,d]of(null==(b=this.Qc(a))?void 0:b.ab(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.td()||(yield a))}Qk(a,b,c=!0){const d=olympe.dm.Relation.j.Qq,e=olympe.dm.Relation.j.yr,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
636
636
  const h=new Set;for(const l of a){var k=this.Bb.get(l);if(void 0!==k){for(const [n,p,q]of k.Ed())q&&Ug(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.jb())q&&Ug(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Yg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Ug(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Bb.has(l))}F(a,b){let c=this.Bb.get(a);void 0===c&&(c=new olympe.dc.db.yh(a),this.Bb.set(a,c));return b?c.Ha(b):c}R(a){const b=
637
- olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.sd())this.j(a,d.H());else if(c.sd())d.D()&&this.j(a,c.H());else{c.Cb().forEach((e,f)=>{void 0!==d.Qa(f)&&c.da(f)});for(const [e,f,g]of c.Ed()){const h=d.zb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.xa=[olympe.dc.Writable,olympe.dc.Cq];const mh=olympe.dc.db.Database.j,nh=olympe.dc.db.Database.D.Ui,oh=olympe.dc.db.Database.D.du,ph=olympe.dc.db.Database.D.Se,qh=olympe.dc.db.Database.D.jl,rh=olympe.dc.db.Database.D.wi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,sh=olympe.dc.fc.Yc,th=olympe.dc.fc.Ai;function Rf(a,b,c=!1){const d=a.get(ph+b);return c||void 0!==d?d:a.get(oh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,uh(a)):(vh(a),a.e=b),a.db.D(b?mh.Kl:mh.Dc,a.j));return c}
637
+ olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.td())this.j(a,d.H());else if(c.td())d.D()&&this.j(a,c.H());else{c.Db().forEach((e,f)=>{void 0!==d.Qa(f)&&c.da(f)});for(const [e,f,g]of c.Ed()){const h=d.zb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.xa=[olympe.dc.Writable,olympe.dc.Cq];const mh=olympe.dc.db.Database.j,nh=olympe.dc.db.Database.D.Ui,oh=olympe.dc.db.Database.D.du,ph=olympe.dc.db.Database.D.Se,qh=olympe.dc.db.Database.D.jl,rh=olympe.dc.db.Database.D.wi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,sh=olympe.dc.fc.Yc,th=olympe.dc.fc.Ai;function Rf(a,b,c=!1){const d=a.get(ph+b);return c||void 0!==d?d:a.get(oh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,uh(a)):(vh(a),a.e=b),a.db.D(b?mh.Kl:mh.Dc,a.j));return c}
638
638
  function ig(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(sh,c)}a.link(sh,b);b.forEach((d,e)=>{if(e[0]===ph||e[0]===oh)e=e.substring(1),wh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.da(a,!0)}function jg(a,b){const c=a.bf();if(null!==c){if(c===b)return;a.unlink(th,c)}a.link(th,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ph||f[0]===oh)f=f.substring(1),a.has(ph+f)||(a.set(oh+f,e),d.set(f,e))});xh(a,d)}
639
639
  function kg(a,b){a.unlink(sh,b);a.forEach((c,d)=>{c=d.substring(1);wh(a,c,null)});a.db.da(a,!1)}function lg(a,b){a.unlink(th,b);const c=new Map;a.forEach((d,e)=>{e[0]===oh&&(a.delete(e),d=e.substring(1),c.set(d,null))});xh(a,c)}
640
640
  function tg(a,b,c){const d=ph+b;var e=a.get(d);e=void 0===e?null:e;if(!yh(e,c))if(zh(a,b,e,c,!0),e=oh+b,null===c){a.delete(d);let f;c=null==(f=a.bf())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);xh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),xh(a,(new Map).set(b,c))}function Kg(a,b,c,d){const e=Ah(a,rh+b);return e.has(c)?!1:(e.set(c,d),a.je(olympe.dc.db.Instance.j.wi+b),a.db.D(mh.jo,a.j,b,c),!0)}
@@ -651,7 +651,7 @@ a,V,b.j),this.db.D(mh.wm,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!1),Eh(b,a,
651
651
  this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===U||c===V){const d=b.substring(1),e=c===U?V:U;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===nh&&a instanceof olympe.dc.uc&&Ch(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(nh+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Bp:'instance',Gv:'rel',wi:'cb',Vi:'ref',TRANSACTION:'tx'};olympe.dc.db.yh=class a{constructor(b){this.$c=b;this.Y=this.cb=null;this.Pb=olympe.dc.Lb.NONE;this.F=a.j.Ek;this.j=this.ob=this.zc=this.$=this.properties=null}tag(){return this.$c}Wb(){return this.Y}sb(){return this.cb}getState(){return this.F}Ha(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}H(){return this.F===a.j.Dc?this.Pb:olympe.dc.Lb.NONE}create(b){this.F=a.j.em;this.cb=null!=
652
652
  b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Qm(b){this.F!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Rd(b,c){if(null!==this.$&&this.$!==b)throw Error('An instance should never be set as complex property of multiple instances');this.$=b;this.zc=c}da(b){let c;null==
653
653
  (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ha(c);this.sa(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ha(c);this.sa(this.ob,b,c,!1);return this}Mb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}vc(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}zb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)return(b=c.get(b))&&
654
- b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.em}sd(){return this.F===a.j.Dc}Bd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Id(){return null!==this.ob||null!==this.j}Cb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ab(b,c=(d,e)=>[d,e]){return function*(d){if(d=
654
+ b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.em}td(){return this.F===a.j.Dc}Bd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Id(){return null!==this.ob||null!==this.j}Db(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ab(b,c=(d,e)=>[d,e]){return function*(d){if(d=
655
655
  d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Ed(b=(c,d,e)=>[c,d,e]){return this.wa(this.ob,b)}jb(b=(c,d,e)=>[c,d,e]){return this.wa(this.j,b)}ha(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.wa.bind(this),
656
656
  this.ob,this.j)}sa(b,c,d,e){if(this.F!==a.j.Dc||!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)}}*wa(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.yh.j={em:0,Ek:1,Dc:2};olympe.dc.db.bv=class{constructor(a,b,c,d){this.G=a;this.view=b;this.j=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.fa(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ga()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.j.get(d[d.length-1]);const e=olympe.dc.db.Database.D.Ui+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
657
657
  ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.Oo,b=olympe.dc.db.Database.j.Kl,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.rk,e=olympe.dc.db.Database.j.wm,f=olympe.dc.db.Database.j.jo,g=olympe.dc.db.Database.j.ko,h=()=>{};this.j.j(olympe.dc.db.Database.j.No,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.Mb(()=>{Rg(this.view,
@@ -676,23 +676,23 @@ olympe.dc.query.Aq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.
676
676
  this.j.get(b);if(null==b?0:b.remove(a,c))if(Qh(this),!b.has(a)){let d;null==(d=this.Me)||d.stop(a);return!0}return!1}Nc(a){const b=a.D,c=olympe.V.tb(b);a=Nh(a);const d=[];for(const [f,g]of this.j){if(g.H(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.j))?g:[]).flatMap(k=>f.$(k,this.oa.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.oa.get(k))?void 0:l.Nc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function Yh(a){if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
677
677
  function Zh(a){var b=olympe.dc.query.Aa.j.tr;const c=olympe.dc.query.Aa.j.Po,d=olympe.dc.query.Aa.j.Nj,e=olympe.dc.query.Aa.j.Ap,f=olympe.dc.query.Aa.j.aq,g=olympe.dc.query.Aa.j.Kq,h=olympe.dc.query.Aa.j.Jn,k=olympe.dc.query.Aa.j.pq;switch(a.pr){case b:return new olympe.dc.query.Z.Fm(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.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Z.ve(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.sf(a.p,
678
678
  a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Hi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.fe(Zh(a.v));case g:return new olympe.dc.query.Z.Df(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.Be(...a.p.map(l=>Zh(l)));case h:return new olympe.dc.query.Z.Jd(...a.p.map(l=>Zh(l)));default:return null}}
679
- olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.fe(this)}Cb(){}Nc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static Ey(...a){return new olympe.dc.query.Z.Fm(a)}static Ea(a,b){Yh(a);return new olympe.dc.query.Z.ve(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.sf(a,b,olympe.dc.ia(),c)}static vz(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Df(a,b,olympe.dc.ia(),c)}static Vk(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Hi(olympe.dc.ia(),
679
+ olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.fe(this)}Db(){}Nc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static Ey(...a){return new olympe.dc.query.Z.Fm(a)}static Ea(a,b){Yh(a);return new olympe.dc.query.Z.ve(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.sf(a,b,olympe.dc.ia(),c)}static vz(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Df(a,b,olympe.dc.ia(),c)}static Vk(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Hi(olympe.dc.ia(),
680
680
  a,b,!1,c)}static Cj(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Hi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
681
681
  return new olympe.dc.query.Z.Be(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.fe(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.Cj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Vk;
682
682
  olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,Po:1,Nj:2,Ap:3,aq:4,Kq:5,pq:6,Jn:7};function Nh(a){return Array.from(a.oa)}
683
683
  function $h(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ka()===olympe.dc.ua.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ne;else if(e=a.oa[a.cursor],null!==e.wa)e=e.wa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ka()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ga(olympe.dc.CloudObject)&&(null===d||!a.db.Qf(d,e)&&!a.db.Qf(e,d)))throw new olympe.dc.query.yd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
684
684
  b.T();for(c=a.cursor+1;c<a.oa.length&&a.oa[c].T()!==d;)c++;b=c<a.oa.length?a.oa:a.oa.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function ai(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.tb(a.D)}
685
- function bi(a,b,c,d={}){var e=olympe.dc.Lb.fg;const f=(null==d?0:d.hd)?d.hd:olympe.dc.ma.nc.qf,g=(null==d?0:d.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.ae().Ke(b);b=(new olympe.dc.ma(b,h)).ie();b.oa=[f===olympe.dc.ma.nc.Jg?new olympe.dc.query.oa.$o(ai(b),e,c):new olympe.dc.query.oa.Kd(ai(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.zs)?k:!1;return b.observe(a,{hd:f,Kk:g})}
685
+ function bi(a,b,c,d={}){var e=olympe.dc.Lb.fg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.nc.qf,g=(null==d?0:d.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.ae().Ke(b);b=(new olympe.dc.ma(b,h)).ie();b.oa=[f===olympe.dc.ma.nc.Jg?new olympe.dc.query.oa.$o(ai(b),e,c):new olympe.dc.query.oa.Kd(ai(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.zs)?k:!1;return b.observe(a,{jd:f,Kk:g})}
686
686
  function ci(a){const b=0===a.F.size?a.ie():a;if(null!==b.j.Hd&&!b.F.has(ai(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function di(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
687
687
  olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ne:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('The root of the query cannot be empty.');this.D=a;this.source=b;this.oa=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.H=!1}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
688
688
  b=null!=b?b:olympe.dc.ae().Ke(a);b=new olympe.dc.ma(a,b);b.j.Ne=olympe.dc.ia().model(a);return b}static Ke(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.ae().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ne=olympe.dc.fa(b);return c}static Yk(a,b=!0,c){const d=olympe.dc.fa(a);var e=olympe.dc.ia();if(!e.ji(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
689
- a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a=$h(a,new olympe.dc.query.oa.we(ai(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.wh(ai(a),olympe.dc.CloudObject.instancesRel,!1);e.wa=d;return $h(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.hd)?f:olympe.dc.ma.nc.qf;f=(null==e?0:e.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.ae().Ke(b);d=(new olympe.dc.ma(b,d)).ie();b=g===olympe.dc.ma.nc.Jg;
690
- d.oa=[b?new olympe.dc.query.oa.$o(ai(d),c):new olympe.dc.query.oa.Kd(ai(d),c)];let h;d.H=null!=(h=null==e?void 0:e.zs)?h:!1;let k;return d.observe(a,{hd:g,Kk:f,hj:null!=(k=null==e?void 0:e.hj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return $h(this,new olympe.dc.query.oa.wh(ai(this),a,b))}mg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
689
+ a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a=$h(a,new olympe.dc.query.oa.we(ai(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.wh(ai(a),olympe.dc.CloudObject.instancesRel,!1);e.wa=d;return $h(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.nc.qf;f=(null==e?0:e.Dn)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.ae().Ke(b);d=(new olympe.dc.ma(b,d)).ie();b=g===olympe.dc.ma.nc.Jg;
690
+ d.oa=[b?new olympe.dc.query.oa.$o(ai(d),c):new olympe.dc.query.oa.Kd(ai(d),c)];let h;d.H=null!=(h=null==e?void 0:e.zs)?h:!1;let k;return d.observe(a,{jd:g,Kk:f,hj:null!=(k=null==e?void 0:e.hj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return $h(this,new olympe.dc.query.oa.wh(ai(this),a,b))}mg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
691
691
  return $h(this,new olympe.dc.query.oa.we(ai(this),a,b,c))}ie(){const a=(new Set(this.F)).add(ai(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}ij(){return this}wj(a,b=0){return new olympe.dc.ma(this.D,
692
692
  this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ne:this.j.Ne})}fl(a,b=olympe.dc.query.kk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ne:this.j.Ne},
693
693
  e=Array.from(this.oa);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}$g(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.$g():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.oa[b].j;for(b--;-1<b&&ai(this,b)!==d;)b--}return new olympe.dc.ma(this.D,this.source,Array.from(this.oa),b,this.F,this.j)}parse(){const a=new Map,b=ai(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
694
694
  filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ji(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Ne);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.wh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.we&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
695
- g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.hd)?a.hd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(ci(this),b,{Xh:null!=(c=null==a?void 0:a.Kk)?c:null==a?void 0:a.cacheId,Ac:null==a?void 0:a.Ac}).then(d=>{let e;return null!=(e=null==d?void 0:Oh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Oh(ei(olympe.dc.query.Uk(),ci(this)))}observe(a,b){const c=(null==b?0:b.hd)?b.hd:olympe.dc.ma.nc.qf;a='function'===typeof a.Eb?a.Eb():
695
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(ci(this),b,{Xh:null!=(c=null==a?void 0:a.Kk)?c:null==a?void 0:a.cacheId,Ac:null==a?void 0:a.Ac}).then(d=>{let e;return null!=(e=null==d?void 0:Oh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Oh(ei(olympe.dc.query.Uk(),ci(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.nc.qf;a='function'===typeof a.Cb?a.Cb():
696
696
  a;let d;return fi(olympe.dc.query.Uk(),ci(this),a,olympe.dc.Ja.SELF,c,{Xh:null!=(d=null==b?void 0:b.Kk)?d:null==b?void 0:b.cacheId,Ac:null==b?void 0:b.Ac,hj:null==b?void 0:b.hj}).pipe(rxjs.operators.map(e=>Oh(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Nh(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
697
697
  r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ne)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ga(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.oa.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
698
698
  olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.fl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.wj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.ij;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ie;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.mg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
@@ -702,7 +702,7 @@ b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.q
702
702
  function fi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Ac||a.H&&k===olympe.dc.Ja.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Iq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);hi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Xh)&&ii(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
703
703
  {const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&Wh(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),u.destroy())}},p=c.Td(n),q=ji(h,d,l);return n})}
704
704
  function ki(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||li(c)});a.F.clear()}function mi(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.nc.Jg;if(b instanceof ReadableStream)yield vg(a.D,b,{Sm:e});else{var f;if(f=b instanceof olympe.dc.Ag)f=b.T(),f=!a.N.H.has(f);f&&a.D.Tc(b,{Sm:e})}})}function ni(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Cg,olympe.dc.Ja.SERVER);return a.Tb.request(b).then(c=>{a.D.Tc(c)})}
705
- function oi(a,b){const c=b.sb();if(c===olympe.dc.Ja.SELF||a.H&&c===olympe.dc.Ja.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Nc(b)).map(d=>new Promise(e=>d.gd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ii(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Lg,e,b),olympe.dc.ma.j.Gp,c===olympe.dc.ma.nc.Jg),olympe.dc.ma.j.ul,null==d?void 0:d.Xh);return a.Tb.request(e)})}
705
+ function oi(a,b){const c=b.sb();if(c===olympe.dc.Ja.SELF||a.H&&c===olympe.dc.Ja.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Nc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ii(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Lg,e,b),olympe.dc.ma.j.Gp,c===olympe.dc.ma.nc.Jg),olympe.dc.ma.j.ul,null==d?void 0:d.Xh);return a.Tb.request(e)})}
706
706
  function pi(a,b,c){const d=[];for(const e of a.j.values())qi(e,b,c)&&d.push(ii(a,e.query,olympe.dc.ma.nc.lk,{}).then(f=>mi(a,f,olympe.dc.ma.nc.lk)));return Promise.all(d).then(()=>{})}
707
707
  olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>ki(this));zf(d,olympe.dc.Request.j.zo,f=>{mi(this,f.content,olympe.dc.ma.nc.qf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.Ac?c.Ac:yield oi(d,a);if(!e||(null==c?0:c.Xh))try{const f=yield ii(d,a,b,c);e||(yield mi(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
708
708
  null}return ei(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ja.SELF||b.Ac||this.H&&g===olympe.dc.Ja.SERVER)return e(),null;if(a!==olympe.dc.ma.nc.qf)return ii(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return mi(this,t,a,b.hj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);ii(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
@@ -715,31 +715,31 @@ this.D.get(this.j[a]))}tj(){return this.H.map(a=>{a=a.split('.');return 1===a.le
715
715
  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()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
716
716
  return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.tj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.oj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
717
717
  olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.le;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
718
- olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function si(a){return 1<a.size()?(olympe.ja.$a('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.md=class{constructor(a){this.query=a}static from(a){return new olympe.dc.md(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.md(this.query.fb(a))}ij(){return this}nb(a){return this.query.nb(a).then(b=>si(b))}Fc(){return si(this.query.Fc())}};olympe.dc.md.prototype.executeFromCache=olympe.dc.md.prototype.Fc;
719
- olympe.dc.md.prototype.execute=olympe.dc.md.prototype.nb;olympe.dc.md.prototype.cast=olympe.dc.md.prototype.ij;olympe.dc.md.prototype.follow=olympe.dc.md.prototype.fb;const ti=olympe.dc.ua.ORIGIN,ui=olympe.dc.ua.DESTINATION;function hi(a,b){Ph(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function ji(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ja.SELF?a.gd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.gd(()=>Vh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
718
+ olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function si(a){return 1<a.size()?(olympe.ja.$a('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.nd(this.query.fb(a))}ij(){return this}nb(a){return this.query.nb(a).then(b=>si(b))}Fc(){return si(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
719
+ olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.ij;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const ti=olympe.dc.ua.ORIGIN,ui=olympe.dc.ua.DESTINATION;function hi(a,b){Ph(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function ji(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ja.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Vh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
720
720
  function qi(a,b,c){if(a.query.sb()!==b)return!1;c.qc(a.ha);(b=a.ha.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function li(a){Xh(a.j);a.H.forEach(b=>{b.next(a.j)})}
721
- function vi(a,b,c){const d=[];let e=!1;const f=new olympe.async.mk(olympe.C.ah());for(const g of b)if(g.Nc(a.query)&&(e||(e=!0),f.add(h=>g.gd(k=>{!k&&d.push(g);h()}))),null!==g.D&&di(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
721
+ function vi(a,b,c){const d=[];let e=!1;const f=new olympe.async.mk(olympe.C.ah());for(const g of b)if(g.Nc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&di(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
722
722
  function wi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Nh(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Th(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});xi(a)}
723
723
  function yi(a){const b=a.Ha(a.query,a.cb.bind(a),()=>{null===a.D||a.gb()||wi(a)},d=>{a.gb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),xi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function zi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&yi(a)}))}function xi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
724
- olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.wa=b;this.db=b.view;this.query=c;this.hd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>Xh(this.j)];this.Ha=e;this.ha=new Ai(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return vi(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),wi(this)):yi(this)})}Nc(a){return!this.gb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
- (null===this.D||this.query.D===a.D)&&this.j.Nc(a))}gd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>zi(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.Y}cb(){const a=
726
- olympe.dc.ma.nc.Jg;if(this.hd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(d=>d.o===olympe.dc.Lc.j).map(d=>d.t);this.wa.je(c,'Batch mode')});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.hd===a).map(e=>new Promise(f=>e.gd(f))),d=this.R.filter(e=>e.hd!==a).map(e=>new Promise(f=>e.gd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Bi(a,b){return a.F.has(ui+b)||a.F.has(ti+b)}
724
+ olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.wa=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>Xh(this.j)];this.Ha=e;this.ha=new Ai(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return vi(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),wi(this)):yi(this)})}Nc(a){return!this.gb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
+ (null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>zi(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.Y}cb(){const a=
726
+ olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(d=>d.o===olympe.dc.Lc.j).map(d=>d.t);this.wa.je(c,'Batch mode')});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Bi(a,b){return a.F.has(ui+b)||a.F.has(ti+b)}
727
727
  class Ai{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of Nh(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Kh){a=f.relation;a=`${a.Ka()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Ci(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Oc(){}Wc(a,b){if(!(this.j||
728
728
  !this.N&&this.db.Ga(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Sh(this.H,a,e)))}}D(a){this.j||this.db.Ga(a)&&!this.N||this.j||(this.j=this.R.some(b=>Sh(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Bi(this,a)){var d=this.db.Ga(b),e=this.db.Ga(c);if(d&&!e||!d&&e){const f=this.F.get(ui+a);a=this.F.get(ti+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Sh(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>Sh(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Bi(this,a)&&this.db.As(b,
729
729
  new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(ui+a);a=this.F.get(ti+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>Sh(e,b,f.j)&&Sh(e,c,f.T())))||(null==a?void 0:a.some(f=>Sh(e,c,f.j)&&Sh(e,b,f.T()))))}}}olympe.dc.query.Iq.xa=[olympe.dc.Writable];function Di(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
730
730
  olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ka())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Qb(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.Ka(),null!=b?b:a instanceof olympe.dc.ba.Fe)}$b(){const a=
731
- olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}ud(){return new olympe.dc.query.Z.Be(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
732
- Array(this.Z.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.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Jn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.sf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.sf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
731
+ olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}ud(){return new olympe.dc.query.Z.Be(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
732
+ Array(this.Z.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.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Jn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.sf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Db(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.sf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
733
733
  this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.j}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Nj,
734
- p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.ve=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.fa(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Cb(){return[this.La]}Nc(a){if(a instanceof olympe.dc.query.Z.ve&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
734
+ p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.ve=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.fa(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Db(){return[this.La]}Nc(a){if(a instanceof olympe.dc.query.Z.ve&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
735
735
  a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
736
736
  this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Po,p:this.La,t:a,v:b}}};function Ei(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
737
- olympe.dc.query.Z.Hi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}ud(){return new olympe.dc.query.Z.Hi(this.db,this.La,this.j,!this.D,!this.H)}Cb(){return[this.La]}Nc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Hi&&this.La===a.La?
737
+ olympe.dc.query.Z.Hi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}ud(){return new olympe.dc.query.Z.Hi(this.db,this.La,this.j,!this.D,!this.H)}Db(){return[this.La]}Nc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Hi&&this.La===a.La?
738
738
  typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Ei(this,a,b));Lg(this.db,a,this.La,d=>{const e=this.F?this.db.Qa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},Ei(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
739
- this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,Ei(this,a,b));this.F&&Mg(this.db,a,this.j,Ei(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Ap,p:this.La,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.fe=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Cb(){return this.j.Cb()}Nc(a,b){return a instanceof olympe.dc.query.Z.fe?this.j.Nc(a.j,b):this.j.Nc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
- b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.fe?this.j.Ea(a.j):!1}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Jd(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
741
- k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'And-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.Df=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.fa(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}Cb(){return[this.La]}Nc(a){return a instanceof olympe.dc.query.Z.Df&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
742
- return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Fm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Cb(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Fm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Ci(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Cb())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Fi(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function Gi(a,b){for(const c of b)if(a.some(d=>d.Nc(c,!1)))return!0;return!1}
739
+ this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,Ei(this,a,b));this.F&&Mg(this.db,a,this.j,Ei(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Ap,p:this.La,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.fe=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Db(){return this.j.Db()}Nc(a,b){return a instanceof olympe.dc.query.Z.fe?this.j.Nc(a.j,b):this.j.Nc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
+ b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.fe?this.j.Ea(a.j):!1}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Jd(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
741
+ k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'And-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.Df=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.fa(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}Db(){return[this.La]}Nc(a){return a instanceof olympe.dc.query.Z.Df&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
742
+ return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Fm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Db(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Fm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Ci(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Db())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Fi(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function Gi(a,b){for(const c of b)if(a.some(d=>d.Nc(c,!1)))return!0;return!1}
743
743
  function Hi(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function Ii(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Lg(a.db,f,k,()=>{Qh(b)},h):Mg(a.db,f,k,h);c(e,f,g,h)}}
744
744
  olympe.dc.query.oa.tm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.da=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Kd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.we(b,d,a.s,c):new olympe.dc.query.oa.wh(b,d,c);void 0!==a.p&&(b.D=Zh(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.rf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
745
745
  b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ha(){return new olympe.dc.query.oa.Am}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Nc(a){const b=Fi(this);if(0===b.length)return!0;a=Fi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
@@ -756,10 +756,10 @@ relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.
756
756
  b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ga(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.oa.Hp.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Uq=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.keys())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
757
757
  (e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.oa.Uq.xa=[olympe.dc.query.oa.um];olympe.dc.query.oa.Am=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(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)}H(){return!1}D(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);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
758
758
  return b}};olympe.dc.query.oa.Am.xa=[olympe.dc.query.oa.um];olympe.dc.sources={};olympe.dc.sources.Yq=class extends Error{};olympe.dc.sources.Tj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Ji=olympe.net.va.Nd.GET,Ki=olympe.net.va.Nd.Gh,Li=olympe.net.va.Nd.Dc,Mi=olympe.net.va.Nd.zq,Ni=olympe.net.va.Headers.xi,Oi=olympe.net.va.Headers.Vn,Pi=olympe.net.va.Vb.Eh,Qi=olympe.net.va.Vb.no,Ri=olympe.net.va.Vb.Yo,Si=olympe.net.va.Vb.Wi,Ti=olympe.net.va.Vb.gm;
759
- function Ui(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Pl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Ji,Ki,Li,Mi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.kd(`No handler found for datasource ${f} called '${g}'`,Ti,'Invalid source id'))}h=c.method;const k=c.rj();try{var l=yield Vi(a,
760
- k[Oi])}catch(r){return new olympe.net.kd(`Invalid token ${r}`,Ri,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Lg,u=olympe.dc.Request.j.Ze,x=olympe.dc.Request.j.Vg,y=olympe.dc.Request.j.oh,z=olympe.dc.Request.j.Yf,A=olympe.dc.Request.j.$f,K=olympe.dc.Request.j.hg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Ni]};p instanceof Uint8Array&&
761
- (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Af;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.kd(Zc,h===Mi?Qi:Pi)}catch(r){return r instanceof olympe.dc.sources.Yq?new olympe.net.kd(`Authorization error: ${r}`,
762
- Ri,'Forbidden'):new olympe.net.kd(`Internal server error: ${r}`,Si,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function Wi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Xi(a,b,c){0===a.F.size&&Ui(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Wi(a)}}
759
+ function Ui(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Pl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Ji,Ki,Li,Mi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Ti,'Invalid source id'))}h=c.method;const k=c.rj();try{var l=yield Vi(a,
760
+ k[Oi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Ri,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Lg,u=olympe.dc.Request.j.Ze,x=olympe.dc.Request.j.Vg,y=olympe.dc.Request.j.oh,z=olympe.dc.Request.j.Yf,A=olympe.dc.Request.j.$f,K=olympe.dc.Request.j.hg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Ni]};p instanceof Uint8Array&&
761
+ (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Af;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===Mi?Qi:Pi)}catch(r){return r instanceof olympe.dc.sources.Yq?new olympe.net.ld(`Authorization error: ${r}`,
762
+ Ri,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Si,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function Wi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Xi(a,b,c){0===a.F.size&&Ui(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Wi(a)}}
763
763
  function Yi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Lf(c):Zi(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
764
764
  function $i(a,b,c){if(b===olympe.dc.Ja.SERVER){var d;return null!=(d=Ld(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.xh;const f=olympe.dc.sources.U.vf,g=olympe.dc.sources.U.Ei,h=olympe.dc.sources.U.Pl;let k;e=`${Yi(a,null!=d?d:b,g)?'https':'http'}://${Yi(a,null!=d?d:b,e)}:${null!=(k=Yi(a,null!=d?d:b,f))?k:Yi(a,null!=d?d:b,g)?443:80}`+`/${Yi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
765
765
  function aj(a,b){return b instanceof olympe.net.Gi?Nd(a.H,b,rd(a.Y).Cd()):Promise.reject('No http request to send')}function bj(a,b){var c=$i(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Ki,e,olympe.net.va.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Ni]:'application/json'});return aj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.nj(d))}
@@ -775,7 +775,7 @@ olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.
775
775
  for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case dj:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Jh;
776
776
  return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case ej:return this.j.executeQuery(b);case jj:return c=b.jc(),nj(this,c),this.H.Tc(rf(c)),Promise.resolve();case lj:case mj:const f=b.jc();return this.applyTransaction(f,c===mj).finally(()=>{if(a.origin===olympe.dc.Ja.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:g,finalize:olympe.dc.transaction.Ef.j.Oi,error:null}),this.T());let h;null==(h=this.Tb)||h.vd(g)}});case kj:return oj(this,
777
777
  b.jc());case gj:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case hj:return this.j.downloadFileContent(b.tag,b.model);case ij:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===fj){const b=a.content;a=a.origin;return a===olympe.dc.Ja.SELF?pj(this,b):fi(this.N,
778
- b,this.F,a,olympe.dc.ma.nc.qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=rj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield pi(c.N,c.T(),a);c.H.Tc(rf(a,d));return d})}};olympe.dc.sources.Tp.xa=[olympe.dc.sources.Tj];function rj(a){const b=olympe.dc.sources.gg.j.ut,c=olympe.dc.sources.gg.j.qw,d=olympe.dc.sources.gg.j.At,e=olympe.dc.sources.gg.j.vt,f=olympe.dc.sources.gg.j.Bt,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(sj(b,q,r,p.R()?p.Cb():null)):p.sd()?k.push(sj(d,q,r,null,p.H())):p.R()&&h.push(sj(c,q,r,p.Cb()));for(const [t,u,x]of p.Ed())p=a.Qc(u),x?l.push(new tj(e,t,q,u,r,p.Wb())):n.push(new tj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
778
+ b,this.F,a,olympe.dc.ma.nc.qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=rj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield pi(c.N,c.T(),a);c.H.Tc(rf(a,d));return d})}};olympe.dc.sources.Tp.xa=[olympe.dc.sources.Tj];function rj(a){const b=olympe.dc.sources.gg.j.ut,c=olympe.dc.sources.gg.j.qw,d=olympe.dc.sources.gg.j.At,e=olympe.dc.sources.gg.j.vt,f=olympe.dc.sources.gg.j.Bt,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(sj(b,q,r,p.R()?p.Db():null)):p.td()?k.push(sj(d,q,r,null,p.H())):p.R()&&h.push(sj(c,q,r,p.Db()));for(const [t,u,x]of p.Ed())p=a.Qc(u),x?l.push(new tj(e,t,q,u,r,p.Wb())):n.push(new tj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
779
779
  function sj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new uj(a,b,c,d,e)}olympe.dc.sources.gg=class{constructor(a){this.type=a}};class uj extends olympe.dc.sources.gg{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.Lb.NONE}}
780
780
  class tj extends olympe.dc.sources.gg{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.gg.j={ut:'CREATE',qw:'UPDATE',At:'DELETE',vt:'CREATE_RELATION',Bt:'DELETE_RELATION'};function vj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:b,finalize:olympe.dc.transaction.Ef.j.Oi,error:null}),a.T());let c;null==(c=a.Tb)||c.vd(b)}
781
781
  olympe.dc.sources.yl=class{constructor(a,b){this.G=a;this.D=b;this.Tb=null}T(){}R(){}Y(){}init(a){this.Tb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Lg;const e=olympe.dc.Request.j.Ze,f=olympe.dc.Request.j.Vg;var g=olympe.dc.Request.j.ti;const h=olympe.dc.Request.j.oh,k=olympe.dc.Request.j.hg;var l=olympe.dc.Request.j.$f;const n=olympe.dc.Request.j.Yf,p=olympe.dc.sources.Zd(),
@@ -799,7 +799,7 @@ olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.$=a;t
799
799
  a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.ls().Ha(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.mo,this.H(a.X()));case a instanceof olympe.dc.ma:return this.format(W.Fq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.Ce,
800
800
  a.qc(b),this.format(W.np,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.Do,{r:a.getType(),o:a.origin,d:a.ic(),u:a.Cc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.bj:return this.format(W.Ze,{r:a.kh(),p:this.D(a.jc())});case a instanceof olympe.dc.query.zd:return this.format(W.Gq,a.ga());case a instanceof olympe.dc.Ag:return this.format(W.Co,a.ga());case a instanceof olympe.dc.uc:return this.format(W.Vi,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
801
801
  a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Uo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.ls().zb(d,a));return olympe.dc.CloudObject.get(d);case W.mo:return olympe.dc.CloudObject.get(c);case W.Fq:return d=c.p.map(olympe.dc.query.oa.tm.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ne:a.rm});case W.QUERY_RESULT:return ri(c);case W.np:return(new olympe.dc.transaction.Ti).j(c.p,c.i);case W.Do:return a=null!=(d=this.j(c.c))?d:void 0,
802
- vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.bj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.Co:return olympe.dc.Ag.j(c);case W.Vi:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ga(a))throw new olympe.dc.rq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of Yg(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
802
+ vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.bj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.Co:return olympe.dc.Ag.j(c);case W.Vi:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ga(a))throw new olympe.dc.rq(a);const b={};this.db.Db(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of Yg(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
803
803
  d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const Rj=olympe.dc.Request.j.Cg,Sj=olympe.dc.Request.j.Ze,Tj=olympe.dc.Request.j.Vg,Uj=olympe.dc.Request.j.ti,Vj=olympe.dc.Request.j.Xn,Wj=olympe.dc.Request.j.Oq,Xj=olympe.dc.Request.j.Lg,Yj=olympe.dc.Request.j.pk,Zj=olympe.dc.Request.j.mp,ak=olympe.dc.Request.j.Rt,bk=olympe.dc.Request.j.St,ck=olympe.dc.Request.j.Tt,dk=olympe.dc.Request.j.Yf,ek=olympe.dc.Request.j.$f,fk=olympe.dc.Request.j.hg,gk=olympe.dc.Request.j.Xj,hk=olympe.dc.Request.j.ow,ik=olympe.dc.Request.j.Ev,jk=olympe.dc.Request.j.hp,kk=
804
804
  olympe.dc.Request.j.oh,lk=olympe.dc.Request.j.pt,mk=olympe.dc.Request.j.oc;function nk(a){return ok(a,olympe.dc.Request.j.Cg).then(b=>{b=b.getData().p;const c=Af(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function pk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc(),e=b.j;d.qc(c);return qk(a,Sj,{i:d.T(),r:b.kh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
805
805
  function rk(a,b){const c=b.jc(),d=new olympe.dc.transaction.Ce({el:!0,he:!1,Wh:!1});c.qc(d);b=b.j?'bd=true':'';return ok(a,Tj,Bf(d),b,olympe.net.va.ResponseType.ur).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{sk(a,gk,{id:c.T(),finalize:olympe.dc.transaction.Ef.j.Oi})})}
@@ -817,7 +817,7 @@ olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,
817
817
  olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Rj:return nk(this);case Sj:return pk(this,c);case Tj:return rk(this,c);case Uj:return tk(this,c);case kk:return uk(this,c);case Xj:return d.get(olympe.dc.ma.j.Gp)?vk(this,c):yk(this,c);case Vj:return zk(this,c);case Wj:return Ak(this,c.VE,c.debug,c.optional);case hk:case ik:case jk:case lk:return qk(this,b,{});case ek:return this.j.downloadFileContent(a);case dk:return this.j.deleteFileContent(a);
818
818
  case fk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===Yj){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=wk(this,c);this.N.delete(d);this.H.set(d,e);qk(this,ak,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Pi,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);qk(this,bk,{i:d}).catch(e=>
819
819
  {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j.Zn,d=olympe.dc.Request.j.fm,e=a.c;if(e===olympe.dc.Request.j.zo)Bk(this,a,b).then(f=>{sk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
820
- b=rf(b,a.ct),sk(this,e,{rollback:b,error:a.error});else if(e===ck){const f=a.i;Bk(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&sk(this,gk,{id:a.i,finalize:olympe.dc.transaction.Ef.j.fm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.oa.Kh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ka()===olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.lr.xa=[olympe.dc.sources.Tj];function Ck(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.D).ie().back().fb(olympe.dm.wd.j).ie().observe(d,{hd:c,Ac:!0}).subscribe(e=>{e.oj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.tj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{hd:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
820
+ b=rf(b,a.ct),sk(this,e,{rollback:b,error:a.error});else if(e===ck){const f=a.i;Bk(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&sk(this,gk,{id:a.i,finalize:olympe.dc.transaction.Ef.j.fm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.oa.Kh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ka()===olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.lr.xa=[olympe.dc.sources.Tj];function Ck(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.D).ie().back().fb(olympe.dm.wd.j).ie().observe(d,{jd:c,Ac:!0}).subscribe(e=>{e.oj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.tj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{jd:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
821
821
  olympe.dc.sources.Bk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.fa(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Ke(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ja.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ga(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
822
822
  !0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).li(this.j),olympe.dm.DataSource.Vh,!0);a.Oa(olympe.dm.DataSource.zj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.ah()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Rl:'dc.sources.HTTPService',hu:'dc.sources.IOService',Mq:'dc.sources.RemoteProvider',er:'dc.sources.ServerProvider',KB:'dc.sources.OfflineProvider',We:'dc.sources.SourceSolver',Ge:'dc.sources.Serializer',Ao:'dc.sources.cache.Cache',Bo:'dc.sources.cache.DATABASE',vl:'dc.sources.cache.Logger'};
823
823
  olympe.dc.sources.U={xh:'data.httpHost',vf:'data.httpPort',Ei:'data.httpSSL',Pl:'data.httpBasePath',qm:'data.pollingFrequency',Qe:'data.communicationMode',xm:'data.restrictedUse',VERSION:'version.version',jr:'data.streamWorker',qq:'data.queryConcurrencyLimit'};olympe.dc.sources.zh={rv:'olympe.internal.data.',xh:'olympe.internal.data.httpHost',vf:'olympe.internal.data.httpPort',Ei:'olympe.internal.data.httpSSL'};
@@ -825,10 +825,10 @@ olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(o
825
825
  [olympe.dc.sources.zh.xh,olympe.dc.sources.U.vf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.zh.Ei,[olympe.dc.sources.zh.vf,olympe.dc.sources.U.Ei],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.qm,null);F(a,olympe.dc.sources.U.Qe,null);F(a,olympe.dc.sources.U.xm,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ge,olympe.dc.sources.cc,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ge,
826
826
  olympe.dc.sources.P.Ge);D(a,olympe.dc.sources.P.Rl,olympe.dc.sources.Wt,olympe.dc.sources.P.Ca,olympe.net.P.dj,olympe.L.P.Ql,olympe.auth.P.Da,olympe.dc.sources.P.We,olympe.L.P.Ge,new olympe.W.pa(olympe.L.U.ql));D(a,olympe.dc.sources.P.hu,olympe.dc.sources.Fp,olympe.dc.sources.P.Ca,olympe.dc.P.Ng,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Mq,olympe.dc.sources.Xq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Qg),olympe.dc.sources.P.Rl,olympe.L.P.pf,olympe.dc.P.sh,olympe.dc.sources.P.We);
827
827
  D(a,olympe.dc.sources.P.er,olympe.dc.sources.lr,olympe.dc.sources.P.Ca,olympe.L.P.vk,olympe.L.P.pf,olympe.dc.sources.P.Rl,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.qq),new olympe.W.pa(olympe.dc.sources.U.jr));D(a,olympe.dc.sources.P.We,olympe.dc.sources.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));E(a,olympe.dc.sources.P.vl,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.Ao,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.vl,
828
- olympe.dc.P.Ng,olympe.dc.sources.P.Bo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.pf,olympe.Db.P.bm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.hk,olympe.Db.P.Sg,olympe.dc.sources.P.vl,olympe.Db.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Ao],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Dm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Dm{};function Dk(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}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Qb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.Ti).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
828
+ olympe.dc.P.Ng,olympe.dc.sources.P.Bo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.pf,olympe.Eb.P.bm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.hk,olympe.Eb.P.Sg,olympe.dc.sources.P.vl,olympe.Eb.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Ao],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Dm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Dm{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Dm{};function Dk(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}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Qb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.Ti).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
829
829
  olympe.dc.sources.cache.wp=class{ga(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.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.Ce;a.qc(b);
830
830
  return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function wj(a,b,c){return w(function*(){Ek(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(Fk(a)));return Gk(a.j,b,c)})}function xj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
831
- function yj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Rc()).filter(h=>!h.sd()).map(h=>h.tag()),yield Hk(a.j)),yield Ik(a.j,d,0<f.length?b:null),Jk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
831
+ function yj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Rc()).filter(h=>!h.td()).map(h=>h.tag()),yield Hk(a.j)),yield Ik(a.j,d,0<f.length?b:null),Jk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
832
832
  a.$c.next(f)}finally{b&&Kk(a,'queries',b)}}))().then(()=>{})}function zj(a,b,c,d,e=!1){return w(function*(){yield xj(a,d);yj(a,b,c,d,e)})}function Lk(){var a=olympe.dc.sources.Zd();a.$=!0;a.zb=!0}function Ek(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
833
833
  function Kk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function Mk(a){return w(function*(){a.F=new olympe.dc.db.ec;const b=yield Nk(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
834
834
  function Jk(a,b,c){return w(function*(){const d=Ok(b),e=[];for(const g of d){const h=g.tag();if(!(yield Pk(a.j,h)))if(Ek(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.va.ResponseType.pl);e.push(Dc(a.Bd,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Kk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
@@ -836,7 +836,7 @@ function Jk(a,b,c){return w(function*(){const d=Ok(b),e=[];for(const g of d){con
836
836
  function Ok(a){const b=[olympe.dc.fa(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).mg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Qc(c))?void 0:d.ab(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Qc(d))?void 0:e.ab(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Qc(g));return c.concat(d)},[])}
837
837
  function Rk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Fk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Sk(a,b){return w(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Tk(a.j,b);a.N.next(Fk(a));d.filter(f=>!e.has(f));yield Hk(a.j)}else yield Promise.all(Fk(a).map(f=>Sk(a,f)))})}
838
838
  function Uk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
839
- function Vk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.Ze;const e=olympe.dc.Request.j.Yf,f=olympe.dc.Request.j.hg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Ok(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Wb();if(h.sd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Wk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.jb))throw Error('Lost connection, stop syncing');
839
+ function Vk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.Ze;const e=olympe.dc.Request.j.Yf,f=olympe.dc.Request.j.hg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Ok(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Wb();if(h.td())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Wk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.jb))throw Error('Lost connection, stop syncing');
840
840
  l=yield a.Tb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.bj(b,!1));if(!id(a.jb))throw Error('Lost connection, stop syncing');yield a.Tb.request(d)})}
841
841
  function Xk(a,b,c){return c instanceof olympe.L.errors.Dk||c instanceof olympe.L.errors.uo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.yt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.L.errors.Wq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.lw('The transaction has been rejected by the datasource',
842
842
  c.message)):new olympe.dc.sources.cache.errors.vw('Synchronisation error',c.message)}
@@ -874,7 +874,7 @@ b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');le
874
874
  c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ja.$a('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.vn([d],g=>{this.R=!0;if(g instanceof olympe.dc.uc)olympe.ja.$a('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Td(()=>{this.N()}))}stop(){this.D.destroy();
875
875
  this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));ol(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.vi.prototype.complete=olympe.dc.vi.prototype.complete;olympe.dc.vi.prototype.push=olympe.dc.vi.prototype.push;olympe.dc.Lc=class{j(){}toString(){}};olympe.dc.Lc.j=1;olympe.dc.Lc.D=2;olympe.dc.Lc.H=3;olympe.dc.Lc.F=4;olympe.dc.Lc.N=5;olympe.dc.transaction.Ti=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ja.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.de.Se+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':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
876
876
  e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;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.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Lc.j:b=a.j(d.p||{});let e;c.Oc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Lc.D:c.Wc(d.t,
877
- a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function pl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Ke(b)}function ql(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Qc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Le(b)||!a.db.Ga(b)}function rl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function sl(a){return Array.from(a.j.Rc()).filter(b=>!b.sd()).map(b=>b.tag())}function tl(a){return Array.from(a.j.Rc()).filter(b=>b.sd()).map(b=>b.tag())}
877
+ a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function pl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Ke(b)}function ql(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Qc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Le(b)||!a.db.Ga(b)}function rl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function sl(a){return Array.from(a.j.Rc()).filter(b=>!b.td()).map(b=>b.tag())}function tl(a){return Array.from(a.j.Rc()).filter(b=>b.td()).map(b=>b.tag())}
878
878
  function ul(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ja.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function vl(a,b,c){const d=pl(a,b),e=Z(a,b),f=ql(a,b);ul(a,d,e,g=>{g.D(b,c,f)})}
879
879
  olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}hf(){return 0===this.j.Bb.size}Oc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);ul(this,f,c,g=>{g.Oc(a,f,d,b)})}Wc(a,b){const c=pl(this,a),d=Z(this,a),e=ql(this,a);ul(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=pl(this,b),e=
880
880
  pl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.$a('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);ul(this,d,f,g=>{g.Oa(a,b,c,ql(this,b),ql(this,c))})}hc(a,b,c){const d=pl(this,b),e=pl(this,c);let f=Z(this,b)&&
@@ -910,21 +910,21 @@ olympe.dc.transaction.Fa.xo.xa=[olympe.dc.Te];olympe.dc.transaction.Fa.Bl=class
910
910
  if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ka()===olympe.dc.ua.DESTINATION?a.Oa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Oa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Fa.vA=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ia.Rc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Fa.Ko(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Fa.Jo=class extends olympe.dc.transaction.Fa.Rn{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ka(),e=this.ia.ab(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
911
911
  a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.Ko=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ia.Ga(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ga(b)&&vl(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Fa.It=class extends olympe.dc.transaction.Fa.Bl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
912
912
  this.relation.Ka()===olympe.dc.ua.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ga(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Qc(b))&&c.D()||this.ia.Ga(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Ml(this,this.Gd);
913
- for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&vl(a,d.X(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ml(this,this.Gd)+')'}};olympe.dc.transaction.Fa.xv=class a extends olympe.dc.transaction.Fa.ug{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ga(this.tag)&&!c.Le(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Qc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ga(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Oc(this.tag,d,this.source,e);for(const [g,h,k]of Yg(c,this.tag))Z(b,
913
+ for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&vl(a,d.X(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Ml(this,this.Gd)+')'}};olympe.dc.transaction.Fa.xv=class a extends olympe.dc.transaction.Fa.ug{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ga(this.tag)&&!c.Le(this.tag)){const e=c.Db(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Qc(this.tag))?void 0:d.Db())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ga(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Oc(this.tag,d,this.source,e);for(const [g,h,k]of Yg(c,this.tag))Z(b,
914
914
  k)&&(h===olympe.dc.ua.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Xg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.jf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ia=function(){return olympe.dc.gs().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
915
915
  olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Xr=function(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ua.DESTINATION){const e=olympe.dc.ua.DESTINATION;return b===olympe.dc.ua.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.gx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.Xm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Um=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Wm=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
916
916
  olympe.dc.mb.Vm=a=>'number'===typeof a||a instanceof Number?ic(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.mb.Sr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Tr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
917
917
  olympe.dc.mb.jj=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Bc=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Bc():a)?b:null};
918
918
  olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Um;case olympe.C.Sa:return olympe.dc.mb.Xm;case olympe.C.aa:return olympe.dc.mb.Wm;case olympe.C.eb:return olympe.dc.mb.Vm;case olympe.C.Color:return olympe.dc.mb.Sr;case olympe.dc.CloudObject:return olympe.dc.mb.Tr;default:return olympe.dc.mb.jj}};olympe.dc.kc={};olympe.dc.rf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function Nl(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function Ol(a,b){a.R()||(a=`Calling "${b}" on subscription with id ${a.T()} 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.ja.$a('dc').warn(a))}
919
919
  olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.$a('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Nl(this),this.j=null,this.Ac=void 0)}me(){return olympe.dc.me()}nb(){if(null===this.j){const a=olympe.dc.kc.Zx();this.j=Pl(a,this,this.Ac);null!==this.valueType&&this.j.Md(this.valueType);olympe.C.Xa().Td(()=>
920
- {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}Xl(){return this.ba}gd(a,b){return this.mc().gd(a,b)}bl(a){this.mc().bl(a)}tu(){return this.mc().Id()}su(){return this.mc().R()}get(a){return this.mc().get(a)}hi(){return this.mc().hi()}fi(a){const b=
920
+ {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}Xl(){return this.ba}hd(a,b){return this.mc().hd(a,b)}bl(a){this.mc().bl(a)}tu(){return this.mc().Id()}su(){return this.mc().R()}get(a){return this.mc().get(a)}hi(){return this.mc().hi()}fi(a){const b=
921
921
  this.mc();Ol(b,'getCurrent');return b.fi(a)}has(a){return this.mc().has(a)}ih(a){const b=this.mc();Ol(b,'hasCurrent');return b.ih(a)}le(a){return this.mc().le(a)}cz(a){return this.le(a).asObservable()}ff(a){const b=this.mc();Ol(b,'getCurrentAt');return b.ff(a)}gf(a){return this.mc().gf(a)}Mf(a){const b=this.mc();Ol(b,'getCurrentKeyAt');return b.Mf(a)}Dd(a){return this.mc().Dd(a)}hz(a){return this.Dd(a).asObservable()}Nf(a){const b=this.mc();Ol(b,'getCurrentRank');return b.Nf(a)}Gc(){return this.mc().Gc()}dz(){return this.Gc().asObservable()}Of(){return this.mc().Of()}wf(){return this.mc().wf()}iz(){return this.wf().asObservable()}og(){const a=
922
922
  this.mc();Ol(a,'getCurrentSize');return a.og()}forEach(a,b){this.mc().forEach(a,b)}ke(a){const b=this.mc();Ol(b,'forEachCurrentValue');return b.ke(a)}mj(a,b,c,d){a=new olympe.dc.ba.Bh(a,b);(new olympe.dc.za(this.D,[...this.ba,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.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
923
923
  if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(Nl(b)||this.valueType||Object);return b}gl(a){return this.transform(new olympe.dc.ba.Gf(a))}filter(a){return this.transform(new olympe.dc.ba.tf(a))}Jk(){const a=new olympe.dc.ck(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);
924
924
  let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}ru(){return this.mc().Eg()}Uc(){return olympe.C.ta([this.wf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.ff(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.gl;
925
925
  olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ke;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.og;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.iz;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.dz;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Nf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.hz;
926
- olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.ff;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.cz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.bl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.gd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Yd;olympe.dc.za.xa=[olympe.C.pd];m=olympe.dc.za.prototype;m.me.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Md.K=new olympe.C.J(()=>{},[]);
927
- m.Yd.K=new olympe.C.J(()=>String,[]);m.Xl.K=new olympe.C.J(()=>Array,[]);m.gd.K=new olympe.C.J(()=>String,[]);m.bl.K=new olympe.C.J(()=>{},[]);m.tu.K=olympe.C.J.N;m.su.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.hi.K=new olympe.C.J(()=>Array,[]);m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ff.K=olympe.C.J.j;m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.Dd.K=olympe.C.J.F;
926
+ olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.ff;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.cz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.bl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Yd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.me.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Md.K=new olympe.C.J(()=>{},[]);
927
+ m.Yd.K=new olympe.C.J(()=>String,[]);m.Xl.K=new olympe.C.J(()=>Array,[]);m.hd.K=new olympe.C.J(()=>String,[]);m.bl.K=new olympe.C.J(()=>{},[]);m.tu.K=olympe.C.J.N;m.su.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.hi.K=new olympe.C.J(()=>Array,[]);m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ff.K=olympe.C.J.j;m.gf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.Dd.K=olympe.C.J.F;
928
928
  m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.wf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.mj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const Ql={Oz:'append',Ml:'filter_not',Wo:'filter_and',Xo:'filter_or'};function Rl(a,b){a=Sl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Sn(a,b)).D}
929
929
  olympe.dc.ck=class{constructor(a,b){this.j=Sl(a);this.G=olympe.ja.$a('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Fa=[];this.Ac=void 0}Li(){const a=new olympe.dc.za(this.j,this.ba,this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Tl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Tl('transform','Properties cannot be used as transformer, unlike relations '+
930
930
  d);if(!d||'function'!==typeof d.j)throw new Tl('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}gl(a){this.ba.push(new olympe.dc.ba.Gf(a));return this}Mz(a){this.ba.push(new olympe.dc.ba.Gf(Sl(a)));return this}vu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}vx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}ux(a,
@@ -939,13 +939,13 @@ m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=o
939
939
  function Ul(a,b){if(b.R())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.lc.sr(a.db,a.G),d=b.T();olympe.C.Sc([b.Yd()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.ai()||b.Wk();sf(a.db,f,Vl(a,b,c),d);olympe.C.Xa().Td(()=>qf(a.db,f,d));a.db.Ga(f.valueOf())||Wl(c);b.R()||(Wl(c),b.$c([]))})}}
940
940
  function Xl(a,b,c,d,e){const f=[b.Yd()],g=l=>l instanceof olympe.dc.ba.Gf;let h;const k=(null!=(h=b.gh())?h:[]).filter(g);for(const l of k){f.push(l.Yd());let n;k.push(...(null!=(n=l.gh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.$e(c);Yl(a,l,b.T(),d,e)})}
941
941
  function Yl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.mk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;fi(a.H,h,f,olympe.dc.Ja.SELF,olympe.dc.ma.nc.qf,{Ac:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});bd(g,(h,k)=>d(k));g.start()}
942
- function Vl(a,b,c){const d=new olympe.dc.lc.Jj;let e=!1;const f=olympe.C.Xa(),g=b.gh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.td()||f.gb()||(k?b.ih(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Rd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ci(n)),e||(Zl(c,()=>{p.ig();Wl(c)}),f.run(()=>p.me().rg(b.$c.bind(b))),
942
+ function Vl(a,b,c){const d=new olympe.dc.lc.Jj;let e=!1;const f=olympe.C.Xa(),g=b.gh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.gd()||f.gb()||(k?b.ih(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Rd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ci(n)),e||(Zl(c,()=>{p.ig();Wl(c)}),f.run(()=>p.me().rg(b.$c.bind(b))),
943
943
  e=!0),$l(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,am(p,k,l,n))}}
944
944
  olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;bm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.$h(),b||this.D&&d===olympe.dc.Ja.SERVER||d===olympe.dc.Ja.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
945
945
  Ul(this,a)):Xl(this,a,d,e=>{e?this.G.error(e):Ul(this,a)},b))}};function cm(a){return olympe.C.hb(a)?'Node#'+a.Ba.T():String(a)}function dm(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
946
946
  olympe.dc.query.vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ba.T():'p'+ ++this.j;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.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Hj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Bd=c;this.ba=d||null;this.F=this.N.run(()=>olympe.C.be(olympe.dc.kc.Subscription.j.INIT));this.vc=!1;this.$=this.zc=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ga(d);else e+='|null';e=olympe.V.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Yd(){return this.Bd}gh(){return this.ba}$h(){const b=
947
947
  olympe.dc.ae(),c=olympe.C.Pa(this.Yd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ke(c)}ai(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.kr}Wk(){if(this.F.Ba.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.zc;this.zc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.be(olympe.dc.kc.Subscription.j.kr))}Id(){return olympe.C.ta([this.F],
948
- ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Jh}gd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().rc(b)));return c||''}bl(b){null!==this.$&&b&&this.$.delete(b)}Mb(){const b=olympe.dc.kc.Subscription.j.Jh;if(!this.F.Ba.gb()&&olympe.C.Pa(this.F)!==b&&(this.If(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}$c(b){if(!this.F.Ba.gb()){for(let c=
948
+ ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Jh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().rc(b)));return c||''}bl(b){null!==this.$&&b&&this.$.delete(b)}Mb(){const b=olympe.dc.kc.Subscription.j.Jh;if(!this.F.Ba.gb()&&olympe.C.Pa(this.F)!==b&&(this.If(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}$c(b){if(!this.F.Ba.gb()){for(let c=
949
949
  0,d=b.length;c<d;c++)this.Nm(b[c],c);if(this.R())this.If();else{this.vc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Mb()}}}Rd(b,c){if(!this.F.Ba.gb()&&(this.Ik(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.vc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Mb()}}ci(b){this.F.Ba.gb()||(this.Mm(b),
950
950
  this.fj(b,!this.R()))}Eg(){return this.R()?super.Eg():'Subscription is not ready!'}$e(b){const c=olympe.C.Pa(this.Yd());return olympe.dc.kc.Subscription.D(c,b,this.gh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ie();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.ba.Ve){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Fe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.mg(h,!0,!0))}else if(e instanceof
951
951
  olympe.dc.ba.Gf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.tf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function bm(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.dw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Ff=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.Dq=class{F(){}};olympe.dc.Fk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let em=0;olympe.dc.wc.tg=class{constructor(){this.id=em++}la(){return'CustomLocalComparator#'+em}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.wc.tg.xa=[olympe.dc.rf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(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}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.rf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.rf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.rf];olympe.dc.Z={};let fm=0;olympe.dc.Z.tg=class{constructor(){this.id=fm++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.tg.xa=[olympe.dc.Aa];olympe.dc.Z.ml=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
@@ -954,9 +954,9 @@ a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Jd);olymp
954
954
  return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.sf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.sf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=dm(a,this.F);
955
955
  return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=cm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.sf);olympe.dc.Z.sf.xa=[olympe.dc.Aa];olympe.dc.Z.ve=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.ve)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
956
956
  ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Fi=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new gm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new gm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Fi)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
957
- c.getContext().gb()||c.getContext().td()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=hm(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Fi);
957
+ c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=hm(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Fi);
958
958
  function hm(a,b,c,d){const e=Object.create(null);d+=olympe.V.di();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class gm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Fi.xa=[olympe.dc.Aa];olympe.dc.Z.Sl=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new im(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new im(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Sl)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.di();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
959
- const g=this.ob;for(let k=g.length-1;0<=k;k--)f=jm(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().td()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Sl);
959
+ const g=this.ob;for(let k=g.length-1;0<=k;k--)f=jm(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().gd()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Sl);
960
960
  function jm(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.di();if(q){const u=p+r,x=y=>{const z=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!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
961
961
  {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class im extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Sl.xa=[olympe.dc.Aa];olympe.dc.Z.Ii=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.fa(b))}):this.F.add(olympe.dc.fa(a))}la(){return Q(olympe.dc.Z.Ii)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.C.Sb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
962
962
  this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new km(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new km(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class km{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.di()}}
@@ -975,7 +975,7 @@ this.H+')');this.H=a;tm(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.
975
975
  c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function Wl(a){if(!a.D){for(let b in a.F)um(a.F[b]);a.D=!0}a.H=null;a.N=null}function Zl(a,b,c){a.F[c||'root'].R=b}function $l(a,b,c){a.F[c||'root'].ig(b)}function vm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=$g(a.db,b,c,d),e[f]=g);return g}function wm(a,b){a.D||a.j.ig(b)}function xm(a,b,c,d,e){if(!a.D){let f=vm(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=vm(a,c,d,olympe.dc.ua.ORIGIN));0===f&&wm(a,b)}}
976
976
  function ym(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function zm(a){const b=String(++a.R),c=a.j;a.F[b]=new Am(b,c);Bm(c,b);c.H||(c.H=()=>ym(a,c.T()));return b}function Cm(a,b){const c=a.j;a.j.H=()=>{ym(a,c.T());b()}}function Dm(a,b){um(b?a.F[b]:a.j)}
977
977
  olympe.dc.lc.sr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Am('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=vm(this,c,d,e),d=this.H[b]||0,this.H[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Bm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function um(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
978
- class Am{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}ig(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&um(this)}notify(a){const b=this.H,c=this.D;if(this.N)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.Za={};function Em(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.Jj,g=new olympe.dc.lc.sr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.td()||a.gb()||(h||(Zl(g,()=>{u.ig();Wl(g)}),u.me().rg(l),h=!0),q?k[t]=r:delete k[t],$l(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,am(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ga(b)||Wl(g)}
978
+ class Am{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}ig(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&um(this)}notify(a){const b=this.H,c=this.D;if(this.N)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.Za={};function Em(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.Jj,g=new olympe.dc.lc.sr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.gd()||a.gb()||(h||(Zl(g,()=>{u.ig();Wl(g)}),u.me().rg(l),h=!0),q?k[t]=r:delete k[t],$l(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,am(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ga(b)||Wl(g)}
979
979
  function Fm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Lg(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Mg(e,b,a.H,g))}
980
980
  olympe.dc.Za.ri=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.Ve||d instanceof olympe.dc.ba.Fe)||null;this.D=c||null;this.defaultValue=null}la(){}Nb(){}F(){}j(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}nh(a){this.defaultValue=a;return this}gh(){return this.ba}Yd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
981
981
  b=this.D||b;null!==this.ba?Em(a,b,this.ba,d=>{Fm(this,d,c)}):Fm(this,b,c);return c.rb()}ga(a){const b=dm(a,this.H),c=dm(a,this.D);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=cm(this.H),b=this.D?','+cm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.ri.xa=[olympe.dc.Fk];olympe.dc.Za.Sn=class{constructor(a,b){if(olympe.C.jf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.eh(e,olympe.dc.CloudObject.extendRel,olympe.dm.De);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Zi(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Qi(c,
@@ -990,28 +990,28 @@ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,
990
990
  P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Ff];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{xm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=am(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
991
991
  this.la()+'","a":["'+this.X()+'","'+this.Ka()+'"]}'}toString(){return'Related('+this.Ka()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.Ve);olympe.dc.ba.Ve.xa=[olympe.dc.Ff];olympe.dc.ba.Tg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.Tg)}$g(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.qr(a.rc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
992
992
  ')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Ff,olympe.dc.Dq];function Hm(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,am(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.ba;b.run(()=>olympe.C.Sc([a.D],n=>{Im(k,n,g,h);void 0===k.model(n)&&Wl(e)}))}function Im(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Td(()=>qf(a,e,d)))}
993
- olympe.dc.ba.Gf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Xl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Gf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.cm,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=zm(b),n=zm(b);Cm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Dm(b);om(d,p,0,p.length,c)});ym(b,n);Hm(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.td()||
993
+ olympe.dc.ba.Gf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Xl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Gf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.cm,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=zm(b),n=zm(b);Cm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Dm(b);om(d,p,0,p.length,c)});ym(b,n);Hm(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.gd()||
994
994
  u.gb()||(k||(t.me().rg(x=>{g=x;Dm(b,n)}),Zl(b,()=>t.ig(),n),k=!0),d.j(p,q,r),$l(b,r,n))});ym(b,l);return(p,q,r,t)=>{h||(t.me().rg(u=>{f=u;Dm(b,l)}),Zl(b,()=>t.ig(),l),h=!0);d.j(p,q,r,l);$l(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+dm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
995
995
  P('olympe.dc.transformers.Union',olympe.dc.ba.Gf);olympe.dc.ba.Gf.xa=[olympe.dc.Ff];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function Jm(a){const b=olympe.dc.ia(),c=new Map;b.ks(a).forEach(d=>{b.ab(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
996
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static Oc(a,b,c,...d){b=olympe.dc.fa(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.ns();a=olympe.dc.fa(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.rq(a);c=c.instantiate(a,b.D);b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,
997
- a);b=c}return b}static exists(a){return olympe.dc.ia().Ga(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Jm(b||this));return e.has(k)?e.get(k):null},g=zl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.li(c);a.forEach((k,l)=>{d.Ga(olympe.dc.fa(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.$a('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Nw(){return this.get(this)}static Yk(a){return olympe.dc.ma.Yk(a)}static Cb(){return olympe.dc.ia().ab(this,
996
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();Object.defineProperty(this,'db',{enumerable:!1});this.model=null}static Oc(a,b,c,...d){b=olympe.dc.fa(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.ns();a=olympe.dc.fa(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.rq(a);c=c.instantiate(a,b.D);
997
+ b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ga(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Jm(b||this));return e.has(k)?e.get(k):null},g=zl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.li(c);a.forEach((k,l)=>{d.Ga(olympe.dc.fa(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.$a('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Nw(){return this.get(this)}static Yk(a){return olympe.dc.ma.Yk(a)}static Db(){return olympe.dc.ia().ab(this,
998
998
  olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Ed(){const a=olympe.dc.ia();return a.ab(this,olympe.dc.CloudObject.yj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.ab(this,olympe.dc.CloudObject.Zr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ua.ORIGIN)))}static Qc(a){return olympe.dc.CloudObject.get(a)}static ps(a){var b=tf(olympe.dc.ns(),olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||
999
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Le(){return this.db.Le(this)}sb(){return this.db.source(this)}Wx(){return this.db.ji(this)?olympe.dc.ae().fromModel(this):null}js(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Eb?a.Eb():a;return new rxjs.Observable(e=>
1000
- {const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Lg(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Td(()=>{e.complete();Mg(this.db,this.tag,b,g)});return()=>Mg(this.db,this.tag,b,g)})}fz(a){const b='function'===typeof a.Eb?a.Eb():a;return new rxjs.Observable(c=>{const d=Ng(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Td(()=>{c.complete();Og(this.db,this.tag,d)});return()=>
1001
- Og(this.db,this.tag,d)})}gz(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}ng(a){return olympe.dc.md.from(this).fb(a)}Bc(){return this}Gx(){return this.Pc(olympe.dc.CloudObject.Zw,olympe.dc.CloudObject)}en(){return this.ab(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Pf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=Lg(this.db,this.tag,a,olympe.C.Xa().rc(f=>{b&&null!==f&&
1002
- void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Mg(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Pf(a,olympe.dc.mb.Xm,olympe.C.Sa))}rd(a){return M(this.Pf(a,olympe.dc.mb.Wm,olympe.C.aa))}dh(a){return M(this.Pf(a,olympe.dc.mb.Um,olympe.C.ea))}sj(a){return M(this.Pf(a,olympe.dc.mb.Vm,olympe.C.eb))}us(){return M(this.Pf(olympe.dm.Color.valueProp,olympe.dc.mb.Sr,olympe.C.Color))}vs(){return M(this.Pf(olympe.sc.workflow.Transition.processRefProp,
999
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Le(){return this.db.Le(this)}sb(){return this.db.source(this)}Wx(){return this.db.ji(this)?olympe.dc.ae().fromModel(this):null}js(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>
1000
+ {const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Lg(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Td(()=>{e.complete();Mg(this.db,this.tag,b,g)});return()=>Mg(this.db,this.tag,b,g)})}fz(a){const b='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(c=>{const d=Ng(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Td(()=>{c.complete();Og(this.db,this.tag,d)});return()=>
1001
+ Og(this.db,this.tag,d)})}gz(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}ng(a){return olympe.dc.nd.from(this).fb(a)}Bc(){return this}Gx(){return this.Pc(olympe.dc.CloudObject.Zw,olympe.dc.CloudObject)}en(){return this.ab(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Pf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=Lg(this.db,this.tag,a,olympe.C.Xa().rc(f=>{b&&null!==f&&
1002
+ void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Mg(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Pf(a,olympe.dc.mb.Xm,olympe.C.Sa))}sd(a){return M(this.Pf(a,olympe.dc.mb.Wm,olympe.C.aa))}dh(a){return M(this.Pf(a,olympe.dc.mb.Um,olympe.C.ea))}sj(a){return M(this.Pf(a,olympe.dc.mb.Vm,olympe.C.eb))}us(){return M(this.Pf(olympe.dm.Color.valueProp,olympe.dc.mb.Sr,olympe.C.Color))}vs(){return M(this.Pf(olympe.sc.workflow.Transition.processRefProp,
1003
1003
  olympe.dc.mb.Tr,olympe.dc.CloudObject))}ab(a,b){a=a instanceof olympe.dc.ba.Ve?a:new olympe.dc.ba.Ve(a.X(),a.Ka());return new olympe.dc.za(this.X(),a,b)}Pc(a,b){return this.ab(a,b).Gc()}cs(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Xa(),f=new Map;T(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.D(this.tag,a,d)})}Iz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
1004
- [],this.constructor)).transform(...a)}Uc(){return this.js()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ga(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ga(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Bc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
1004
+ [],this.constructor)).transform(...a)}Uc(){return this.js()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ga(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Db(this,b).forEach((d,e)=>{this.db.Ga(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Bc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
1005
1005
  'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Fd(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.Ea(b)),olympe.C.ea)}ix(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of Yg(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
1006
1006
  olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ng;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.gz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.fz;
1007
1007
  olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ac;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Le;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Wb;
1008
- 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.ps;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Qc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Ed;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Nw;
1008
+ 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.ps;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Qc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Ed;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Db;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Nw;
1009
1009
  olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.ex;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.na.j('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.TE=olympe.dc.CloudObject.O.ka(olympe.dc.Jp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
1010
1010
  olympe.dc.CloudObject.EE=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.yj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Zr=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.nE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.dE=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');
1011
1011
  B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Yc);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
1012
1012
  olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Ai);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Nj);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
1013
1013
  olympe.dc.CloudObject.Zw=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.hx=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.hx);olympe.dc.JC=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Te];m=olympe.dc.CloudObject.prototype;m.X.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.la.K=olympe.C.J.D;m.Wb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1014
- m.sb.K=new olympe.C.J(()=>String,[]);m.Wx.K=new olympe.C.J(()=>String,[]);m.js.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.Gx.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.en.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.rd.K=olympe.C.J.F;m.dh.K=olympe.C.J.N;m.sj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.us.K=new olympe.C.J(()=>olympe.C.Color,[]);m.vs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1014
+ m.sb.K=new olympe.C.J(()=>String,[]);m.Wx.K=new olympe.C.J(()=>String,[]);m.js.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.Gx.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.en.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.sd.K=olympe.C.J.F;m.dh.K=olympe.C.J.N;m.sj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.us.K=new olympe.C.J(()=>olympe.C.Color,[]);m.vs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1015
1015
  m.ab.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cs.K=new olympe.C.J(()=>Function,[]);m.Iz.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=olympe.C.J.N;m.ix.K=new olympe.C.J(()=>{},[]);olympe.dc.P={sh:'dc.DBView',Ep:'dc.InstanceManager',Ca:'dc.Logger',iw:'dc.TransactionLogger',Vj:'dc.FileServiceManager',Ng:'dc.Router'};olympe.dc.U={Qg:'dc.tag',Xf:'dc.debug',Mh:'dc.subscribeAll',Gl:'dc.defaultSource',Vo:'dc.fileCache',yo:'dc.dataConsumerOnly',Qo:'dc.errorOnAbstractInstantiation'};
1016
1016
  olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Xf,!1);F(a,olympe.dc.U.Mh,!1);F(a,olympe.dc.U.Gl,olympe.dc.Ja.SERVER);F(a,olympe.dc.U.yo,b);F(a,olympe.dc.U.Vo,b);F(a,olympe.dc.U.Qo,!0);F(a,olympe.dc.U.Qg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.iw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.sh,olympe.dc.db.P.Dl);D(a,olympe.dc.P.Vj,olympe.dc.Pt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Ng,olympe.V.P.vg,new olympe.W.pa(olympe.dc.U.Vo));
1017
1017
  D(a,olympe.dc.P.Ng,olympe.dc.Kv,olympe.dc.P.Ca,olympe.dc.sources.P.Mq,olympe.dc.sources.P.er,olympe.dc.P.sh,olympe.host.P.Ue,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.yo));D(a,olympe.dc.P.Ep,olympe.dc.iu,olympe.dc.db.P.Ol,olympe.dc.db.P.Da,olympe.W.P.xg)},'olympe.dc');
@@ -1019,7 +1019,7 @@ olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ep,olympe
1019
1019
  olympe.dm.Qd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Qd.prototype.la.K=olympe.C.J.D;olympe.dm.Qd.prototype.j.K=olympe.C.J.D;olympe.dm.Qd.prototype.D.K=olympe.C.J.N;olympe.dm.ll={NONE:0,sA:1,Ct:2,tA:4,pA:8,rA:16,qA:31,PB:32,MB:64,QB:128,NB:256,kv:512,OB:992,gB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Tx(){return this.jn()}la(){return this.jn()}jn(){return this.wb(olympe.dm.User.loginProp)}xu(){return this.wb(olympe.dm.User.D)}wu(){return olympe.C.Sa.EMPTY}qy(){return this.wb(olympe.dm.User.saltProp)}Ay(){return this.wb(olympe.dm.User.verifierProp)}oy(){return this.ab(olympe.dm.User.F,olympe.dm.Qd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
1020
1020
  B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ka('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ka('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ka('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ka('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ka('ff023000000000000020');
1021
1021
  olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Qd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tx.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.jn.K=olympe.C.J.D;m.xu.K=olympe.C.J.D;m.wu.K=olympe.C.J.D;m.qy.K=olympe.C.J.D;
1022
- m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.en()}Ha(){return this.wb(olympe.dm.ag.wa)}};olympe.dm.ag.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.ag);olympe.dm.ag.wa=olympe.dm.ag.O.ka('01609de3f292e3c2c6ff');olympe.dm.ag.prototype.Y.K=new olympe.C.J(()=>olympe.C.pd,[]);olympe.dm.ag.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.ag{By(){return this.wb(olympe.dm.BrickMetadata.zc)}Hc(){return this.wb(olympe.dm.BrickMetadata.da)}getType(){return this.wb(olympe.dm.BrickMetadata.Mb)}My(){return this.dh(olympe.dm.BrickMetadata.zb)}qe(){return null}Dx(){return this.ab(olympe.sc.ui.Yw.Comment.gE.$b(),olympe.sc.ui.Yw.Comment)}Sk(){return this.ng(olympe.dm.BrickMetadata.Ha).Fc().Sk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1022
+ m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.en()}Ha(){return this.wb(olympe.dm.ag.wa)}};olympe.dm.ag.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.ag);olympe.dm.ag.wa=olympe.dm.ag.O.ka('01609de3f292e3c2c6ff');olympe.dm.ag.prototype.Y.K=new olympe.C.J(()=>olympe.C.qd,[]);olympe.dm.ag.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.ag{By(){return this.wb(olympe.dm.BrickMetadata.zc)}Hc(){return this.wb(olympe.dm.BrickMetadata.da)}getType(){return this.wb(olympe.dm.BrickMetadata.Mb)}My(){return this.dh(olympe.dm.BrickMetadata.zb)}qe(){return null}Dx(){return this.ab(olympe.sc.ui.Yw.Comment.gE.$b(),olympe.sc.ui.Yw.Comment)}Sk(){return this.ng(olympe.dm.BrickMetadata.Ha).Fc().Sk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1023
1023
  olympe.dm.BrickMetadata.zc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Mb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.zb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Rd={YB:'private',$B:'public'};
1024
1024
  olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function Zi(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.zh.rv}${b}`)}
1025
1025
  function qj(a,b){const c=a.query().fb(olympe.dm.wd.j.$b()).fb(olympe.dm.wd.D);a=a.query().fb(olympe.dm.ib.D.$b()).mg(olympe.dm.ib.F,!0).fb(olympe.sc.yc.j.$b());const d=e=>e.ie().mg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.yj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
@@ -1032,7 +1032,7 @@ olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.health
1032
1032
  olympe.dm.DataSource.Vh=olympe.dm.DataSource.O.ka('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Vh);olympe.dm.DataSource.jE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.rz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.Ur=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.$r=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.wz=olympe.dm.DataSource.O.ka('ff023000000000000065');
1033
1033
  olympe.dm.DataSource.zj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Qe={kB:'hybrid',$n:'bus',sp:'http'};olympe.dm.DataSource.oc={Jh:'ready',Ab:'error',Ft:'down',Ae:'offline'};olympe.dm.wd=class extends olympe.dc.CloudObject{};olympe.dm.wd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.wd);olympe.dm.wd.j=olympe.dm.wd.O.sa('ff023000000000000071');olympe.dm.wd.D=olympe.dm.wd.O.sa('ff023000000000000072');olympe.dm.wd.F=olympe.dm.wd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.za(this.X(),[new olympe.dc.ba.Fe(olympe.dm.Kb.j.X(),olympe.dc.ua.DESTINATION,olympe.dc.ba.Vq.au,olympe.dc.ba.Vq.bu),olympe.dm.Kb.H])}qe(){return olympe.sc.se.Ie.Ot}j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.ab(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.ha=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1034
1034
  olympe.dm.Kb.H=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Mc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Mc.$?this.ab(olympe.dm.Mc.N,olympe.dm.Kb):this.ab(olympe.dm.Mc.R,olympe.dm.Kb)}};olympe.dm.Mc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Mc);olympe.dm.Mc.R=olympe.dm.Mc.O.sa('017e9c34cf48bd6965c1');olympe.dm.Mc.N=olympe.dm.Mc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Mc.ci=olympe.dm.Mc.O.sa('01811f12ad77673770d4');olympe.dm.Mc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Mc.$c=Jf('10000000000000000001','OLYMPE_FOLDER');
1035
- olympe.dm.Mc.vc=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Mc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sx(){return this.wb(olympe.dm.Module.N)}ey(){return this.rd(olympe.dm.Module.R)}yu(){return this.wb(olympe.dm.Module.D)}jy(){return this.wb(olympe.dm.Module.Y)}Ex(){return this.wb(olympe.dm.Module.F)}gy(){return this.ab(olympe.dm.Module.H,olympe.dm.Module)}sy(){return this.ab(olympe.dm.Module.j,olympe.dm.Ld)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1035
+ olympe.dm.Mc.vc=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Mc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sx(){return this.wb(olympe.dm.Module.N)}ey(){return this.sd(olympe.dm.Module.R)}yu(){return this.wb(olympe.dm.Module.D)}jy(){return this.wb(olympe.dm.Module.Y)}Ex(){return this.wb(olympe.dm.Module.F)}gy(){return this.ab(olympe.dm.Module.H,olympe.dm.Module)}sy(){return this.ab(olympe.dm.Module.j,olympe.dm.Ld)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1036
1036
  olympe.dm.Module.R=olympe.dm.Module.O.ka('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ka('ff023000000000000044');olympe.dm.Module.Y=olympe.dm.Module.O.ka('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ka('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ka('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.sa('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.sa('ff022000000000000014');
1037
1037
  olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Sx.K=olympe.C.J.D;m.ey.K=olympe.C.J.F;m.yu.K=olympe.C.J.D;m.jy.K=olympe.C.J.D;m.Ex.K=olympe.C.J.D;m.gy.K=new olympe.C.J(()=>olympe.dc.za,[]);m.sy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static D(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ae().fromModel(a);a=b.create(a,f).li(g);b=olympe.C.eb.now();Y(Y(Y(Y(Y(Y(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.j,!1);return a.X()}constructor(a,b,c,d,e){super(a,
1038
1038
  b);this.j=c;this.F=d;this.D=e}qs(){return this.wb(olympe.dm.File.mimeTypeProp)}Ok(a,b){void 0===a&&void 0===b||olympe.ja.$a('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}dn(a,b){void 0===a&&
@@ -1042,44 +1042,44 @@ null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Xa
1042
1042
  olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ls;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.dn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Vj,olympe.net.P.Da,olympe.V.P.vg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1043
1043
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
1044
1044
  B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.qs.K=olympe.C.J.D;m.Ok.K=olympe.C.J.j;m.dn.K=olympe.C.J.j;m.Pk.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1045
- m.Mp.K=olympe.C.J.D;m.Lp.K=olympe.C.J.D;m.Ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.by.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ly.K=olympe.C.J.N;olympe.dm.Ld=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Ld.D)}F(){return this.rd(olympe.dm.Ld.F)}D(){return this.ab(olympe.dm.Ld.j,olympe.dm.Module)}};olympe.dm.Ld.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Ld);olympe.dm.Ld.D=olympe.dm.Ld.O.ka('ff023000000000000047');olympe.dm.Ld.F=olympe.dm.Ld.O.ka('ff023000000000000048');olympe.dm.Ld.j=olympe.dm.Module.j.$b();olympe.dm.Ld.prototype.j.K=olympe.C.J.D;olympe.dm.Ld.prototype.F.K=olympe.C.J.F;
1045
+ m.Mp.K=olympe.C.J.D;m.Lp.K=olympe.C.J.D;m.Ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.by.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ly.K=olympe.C.J.N;olympe.dm.Ld=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Ld.D)}F(){return this.sd(olympe.dm.Ld.F)}D(){return this.ab(olympe.dm.Ld.j,olympe.dm.Module)}};olympe.dm.Ld.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Ld);olympe.dm.Ld.D=olympe.dm.Ld.O.ka('ff023000000000000047');olympe.dm.Ld.F=olympe.dm.Ld.O.ka('ff023000000000000048');olympe.dm.Ld.j=olympe.dm.Module.j.$b();olympe.dm.Ld.prototype.j.K=olympe.C.J.D;olympe.dm.Ld.prototype.F.K=olympe.C.J.F;
1046
1046
  olympe.dm.Ld.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib=class extends olympe.dm.Mc{j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.ib.Y)}R(){return this.wb(olympe.dm.ib.jb)}D(){return this.ab(olympe.dm.ib.F,olympe.dm.ib)}};olympe.dm.ib.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.ib);olympe.dm.ib.Y=olympe.dm.ib.O.ka('017869c7d2833c9492c1');olympe.dm.ib.Bs=olympe.dm.ib.O.ka('017869c7d2833c9492c2');olympe.dm.ib.$e=olympe.dm.ib.O.ka('017869c7d2833c9492c3');olympe.dm.ib.jb=olympe.dm.ib.O.ka('017869c80bb9929c76d0');
1047
1047
  olympe.dm.ib.cb=olympe.dm.ib.O.sa('ff02200000000000002a');olympe.dm.ib.F=olympe.dm.ib.O.sa('ff02200000000000002b');olympe.dm.ib.$h=R(olympe.dm.ib.O,olympe.dm.ib.F);olympe.dm.ib.D=olympe.dm.ib.O.sa('ff02200000000000002c');olympe.dm.ib.ai=olympe.dm.ib.O.sa('017e9c412e2b944bc48f');olympe.dm.ib.af=olympe.dm.ib.O.sa('017e9c412e2b944bd590');olympe.dm.ib.xs=olympe.dm.ib.O.sa('017e9c416872a89d3415');olympe.dm.ib.Wk=olympe.dm.ib.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.ib.cb);
1048
1048
  olympe.dm.ib.Bd=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib.prototype.F.K=olympe.C.J.D;olympe.dm.ib.prototype.R.K=olympe.C.J.D;olympe.dm.ib.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ng(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Vr(this.la())}};olympe.dm.Property.O=olympe.dc.na.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
1049
- B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.rd(olympe.dm.Relation.D)}ky(){return this.rd(olympe.dm.Relation.F)}hs(){return this.ab(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.ab(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1049
+ B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.sd(olympe.dm.Relation.D)}ky(){return this.sd(olympe.dm.Relation.F)}hs(){return this.ab(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.ab(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1050
1050
  olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ka(olympe.dc.Lb.Ho);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Dc);olympe.dm.Relation.ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.fg);olympe.dm.Relation.wa=olympe.dm.Relation.O.ka(olympe.dc.Lb.Wv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.Gt);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.rw);
1051
1051
  olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.yj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Zr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={yp:0,ft:5,Fv:1,iC:4,yr:2,Qq:8,zA:10,fC:6,gC:9,Se:6,hC:9};
1052
1052
  olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function Km(a){a=olympe.dc.fa(a);if(olympe.dc.ia().Qf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.De=class extends olympe.dc.CloudObject{getValue(){}};
1053
1053
  olympe.dm.De.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.De);olympe.dm.String=class extends olympe.dm.De{getValue(){return this.wb(olympe.dm.String.valueProp)}Bc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.na.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ka('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1054
- olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.De{getValue(){return this.us()}Bc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.De{getValue(){return this.sj(olympe.dm.DateTime.valueProp)}Bc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Dd(){return this.rd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Dd.K=olympe.C.J.F;olympe.dm.cg=class extends olympe.dm.BrickMetadata{zy(){return this.fb(olympe.dc.CloudObject.instancesRel).fl(olympe.dm.Enum.rankProp,olympe.dc.query.kk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.cg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.cg.create=olympe.dm.cg.create;olympe.dm.cg.prototype.getValues=olympe.dm.cg.prototype.zy;olympe.dm.cg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.cg);olympe.dm.Number=class extends olympe.dm.De{getValue(){return this.rd(olympe.dm.Number.valueProp)}Bc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',tk:'sc.RootContext',Ge:'sc.Serializer'};olympe.sc.U={Pe:'sc.app',Xf:'sc.debug',Mn:'sc.autostartProfiler',Eo:'sc.debugger',Dt:'sc.disableTheme',PRODUCTION:'sc.production',jv:'sc.onstartTimeout',Lq:'sc.remoteActionTimeout'};
1054
+ olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.De{getValue(){return this.us()}Bc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.De{getValue(){return this.sj(olympe.dm.DateTime.valueProp)}Bc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Dd(){return this.sd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Dd.K=olympe.C.J.F;olympe.dm.cg=class extends olympe.dm.BrickMetadata{zy(){return this.fb(olympe.dc.CloudObject.instancesRel).fl(olympe.dm.Enum.rankProp,olympe.dc.query.kk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.cg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.cg.create=olympe.dm.cg.create;olympe.dm.cg.prototype.getValues=olympe.dm.cg.prototype.zy;olympe.dm.cg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.cg);olympe.dm.Number=class extends olympe.dm.De{getValue(){return this.sd(olympe.dm.Number.valueProp)}Bc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',tk:'sc.RootContext',Ge:'sc.Serializer'};olympe.sc.U={Pe:'sc.app',Xf:'sc.debug',Mn:'sc.autostartProfiler',Eo:'sc.debugger',Dt:'sc.disableTheme',PRODUCTION:'sc.production',jv:'sc.onstartTimeout',Lq:'sc.remoteActionTimeout'};
1055
1055
  olympe.W.config(a=>{F(a,olympe.sc.U.Pe,'');F(a,olympe.sc.U.Xf,!1);F(a,olympe.sc.U.Dt,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.jv,2E4);F(a,olympe.sc.U.Lq,3E4);F(a,olympe.sc.U.Mn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ge,olympe.sc.cc,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ge,olympe.sc.P.Ge);E(a,olympe.sc.P.tk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.yg('root','root',null);olympe.sc.wn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1056
1056
  'olympe.sc');olympe.W.run([olympe.sc.P.tk,new olympe.W.pa(olympe.L.U.wl)],(a,b)=>{olympe.$d().ctx=a;olympe.$d().oVersion=()=>b});olympe.sc.qn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.hE=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.ed),olympe.sc.ed.j,c||null),olympe.sc.ed.F,d||null);a.Oa(olympe.sc.ed.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.jj=(a,b)=>{a=olympe.dc.mb.Bx(b)(a);return a instanceof olympe.sc.Pd?a.j():a};
1057
1057
  olympe.sc.zE=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.$a('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.$b())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.eh(e[0],
1058
1058
  olympe.dm.Kb.ha));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.R.$b()));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.N.$b()));return[...d,...e].reverse()};olympe.sc.AE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Dg:a.startsWith('video/')?olympe.sc.Qh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Kc:olympe.dm.File};
1059
- olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Lm(a,b){var c=olympe.sc.ya,d=a.j;a=a.Eb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.Yh(a,void 0,b);for(d=f.getParent();d&&d.ha&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Mm(g,b,f)}return new c(f)}function Nm(a,b){let c,d;return(a=null!=(d=null==(c=a.j.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function Om(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
- olympe.sc.ya=class{constructor(a=olympe.sc.wn){this.j=a;this.G=olympe.ja.$a('sc');this.D=null}T(){return this.j.T()}getParent(){if(null===this.D){const a=this.j.getParent();this.D=null===a?null:new olympe.sc.ya(a)}return this.D}Cx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.ef();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}ef(){return this.j.ef()}Eb(){return this.j.Eb()}set(a,
1059
+ olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Lm(a,b){var c=olympe.sc.ya,d=a.j;a=a.Cb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.Yh(a,void 0,b);for(d=f.getParent();d&&d.ha&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Mm(g,b,f)}return new c(f)}function Nm(a,b){let c,d;return(a=null!=(d=null==(c=a.j.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function Om(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
+ olympe.sc.ya=class{constructor(a=olympe.sc.wn){this.j=a;this.G=olympe.ja.$a('sc');this.D=null}T(){return this.j.T()}getParent(){if(null===this.D){const a=this.j.getParent();this.D=null===a?null:new olympe.sc.ya(a)}return this.D}Cx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.ef();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}ef(){return this.j.ef()}Cb(){return this.j.Cb()}set(a,
1061
1061
  b){this.j.set(a,b);return this}Gn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.bc(null!=b?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.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.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,
1062
1062
  d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Pm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.mh(a.unsubscribe.bind(a));return this}yz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${a.name()}`);a.run(b);return b}Us(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+
1063
1063
  `on the context ${this.T()}:\nStack: ${this.ne()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=Qm(b,c,d);b.stack=a.stack}else b=
1064
- Qm(b,0,this.ne());Rm(this.j,b);return this}zz(a){this.set(olympe.sc.ya.j.xg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Yh(a){return new olympe.sc.ya(this.j.Yh(this.Eb(),a))}cl(a,b){return this.j.cl(a,c=>{b(new olympe.sc.ya(c))})}iy(a){a=Sm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}mh(a,b){return this.j.mh(a,b)}al(a){this.j.al(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Eb().onDestroy(a)}Tf(a){this.gb()||
1065
- this.Eb().Tf(a)}clear(){this.j.clear()}gb(){return this.Eb().gb()}Qa(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.gA(a,this):null}Rx(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.fA(a,this):null}ez(...a){return rxjs.combineLatest(a.map(b=>{b=Tm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}ne(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==olympe.sc.wn;)c.push(d),
1066
- d=d.getParent();b='> '+c.map(e=>{const f=e.ef();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.ez;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Rx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;
1067
- olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Tf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.al;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.mh;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.iy;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.cl;olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Yh;
1068
- olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.zz;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Us;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.yz;olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;
1069
- olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.Gn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Kn:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Eb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Eb(){return this.F}mh(a,b){return this.Eb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Um=0;function Pm(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Rm(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da){var c=Vm(olympe.dc.CloudObject.get(a.da));null!==c&&Wm(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):Rm(a.H,b)}else Rm(a.H,b)}
1064
+ Qm(b,0,this.ne());Rm(this.j,b);return this}zz(a){this.set(olympe.sc.ya.j.xg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Yh(a){return new olympe.sc.ya(this.j.Yh(this.Cb(),a))}cl(a,b){return this.j.cl(a,c=>{b(new olympe.sc.ya(c))})}iy(a){a=Sm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}mh(a,b){return this.j.mh(a,b)}al(a){this.j.al(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Cb().onDestroy(a)}Tf(a){this.gb()||
1065
+ this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.gA(a,this):null}Rx(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.fA(a,this):null}ez(...a){return rxjs.combineLatest(a.map(b=>{b=Tm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}ne(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==
1066
+ olympe.sc.wn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ef();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.ez;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Rx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;
1067
+ olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Tf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.al;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.mh;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.iy;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.cl;
1068
+ olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Yh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.zz;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Us;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.yz;olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;
1069
+ olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.Gn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Kn:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Cb(){return this.F}mh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Um=0;function Pm(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Rm(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da){var c=Vm(olympe.dc.CloudObject.get(a.da));null!==c&&Wm(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):Rm(a.H,b)}else Rm(a.H,b)}
1070
1070
  function Sm(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.H;a;){if(b===a.T()||a.R.has(b))return a;const c=Xm(a.j,b);if(c)return c;a=a.getParent()}return null}function Ym(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{dl:b,depth:c}),Zm(a,d=>{(-1===b.F||c<b.F)&&Ym(d,b,c+1)}),a.onDestroy(()=>{$m(a,b.T())}));return b.T()}
1071
1071
  function $m(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {dl:c,depth:d}=a.Ya.get(b);Zm(a,f=>{$m(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Tm(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1072
1072
  function an(a){a.D.Td(()=>{Zm(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Pa(olympe.sc.ya.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.H)){let d;null==(d=c.j)||d.delete(a.T());let e;0===(null==(e=c.j)?void 0:e.size)&&(c.j=null)}a.R.clear()});let b;null==(b=a.H)||bn(b,a)}
1073
- function Xm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ha&&!c.id.startsWith('_')&&(a=Xm(c.j,b)))return a;return null}function cn(a,b,...c){if(null!==a.Ya)for(const {dl:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function dn(a,b){a.da=olympe.dc.fa(b);a.ha=b.qd().qn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Mm(a,c,a))});a.$=b.j();cn(a,olympe.sc.Ya.pc.j.INIT)}function en(a){a.wa=!0;let b;null==(b=a.j)||b.forEach(c=>{en(c)})}
1073
+ function Xm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ha&&!c.id.startsWith('_')&&(a=Xm(c.j,b)))return a;return null}function cn(a,b,...c){if(null!==a.Ya)for(const {dl:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function dn(a,b){a.da=olympe.dc.fa(b);a.ha=b.rd().qn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Mm(a,c,a))});a.$=b.j();cn(a,olympe.sc.Ya.pc.j.INIT)}function en(a){a.wa=!0;let b;null==(b=a.j)||b.forEach(c=>{en(c)})}
1074
1074
  function fn(a){a.wa=!1;let b;null==(b=a.j)||b.forEach(c=>{fn(c)})}function Wm(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function gn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.wa&&f.data.has(b)||gn(f,b,c,d)})}function hn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));Um++;const e=Um;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1075
1075
  function Mm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Zm(a,f=>{f.N.has(b)||Mm(f,b,c)});a.N.delete(b)}function Zm(a,b){let c;null==(c=a.j)||c.forEach(b)}function jn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function kn(a){var b=olympe.sc.Ya.pc.D.Af;const c=[];if(null!==a.Ya)for(const {dl:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),$m(a,d.T()))}function bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1076
- olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.wn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.wa=!1;this.$=null;this.G=olympe.ja.$a('sc');this.Ya=null;an(this)}T(){return this.id}getParent(){return this.H}ef(){return this.da}set(a,b){if(!this.D.td()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1077
- (d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&cn(this,olympe.sc.Ya.pc.j.Rg,a,b),f=Wm(this,a),this.N.add(c),gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.gb()||this.D.td())return()=>{};const e=Pm(this,a),f=c?olympe.dc.fa(c):
1078
- '*';a=hn(this,'@'+f+'.'+e,b);c=c?(c=Sm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Pm(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}Yh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.gb()||a.td())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.yg(d,
1079
- b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&Ym(e,f,g+1)});return e}cl(a,b){const c=Sm(this,a);if(c)return b(c),()=>{};const d=hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Pm(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.D.td()||this.D.gb()||(cn(this,olympe.sc.Ya.pc.j.Rj),this.D.destroy(),cn(this,olympe.sc.Ya.pc.j.Vd))}mh(a,b){if(this.D.gb())a();
1080
- else return Um++,b=null!=b?b:String(Um),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}al(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){cn(this,olympe.sc.Ya.pc.j.Lj);let a;null==(a=this.Y)||a.forEach(b=>b());cn(this,olympe.sc.Ya.pc.j.Mj)}}gb(){return this.D.gb()}Eb(){return this.D}};olympe.sc.yg.prototype.getParent=olympe.sc.yg.prototype.getParent;olympe.sc.yg.j={Ul:'I#',mm:'O#',nB:'IO#'};function ln(a,b,c){return(c=c.ef())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.pc=class{constructor(a=-1){this.id=olympe.V.Kf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.pc.j={INIT:'INIT',Rg:'SET',Lj:'CLEAR',Mj:'CLEARED',Rj:'DESTROY',Vd:'DESTROYED'};olympe.sc.Ya.pc.D={Af:'REMOTE',Nu:'LOCAL',eg:'PROFILER'};olympe.sc.Xd=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Gm(1E4);gb(this.j,b=>{kn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Xd.j.ov:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Xd.j.pv:const h=f+c,k=(l,n,p=0)=>{jn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.ef())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1076
+ olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.wn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.wa=!1;this.$=null;this.G=olympe.ja.$a('sc');this.Ya=null;an(this)}T(){return this.id}getParent(){return this.H}ef(){return this.da}set(a,b){if(!this.D.gd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1077
+ (d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&cn(this,olympe.sc.Ya.pc.j.Rg,a,b),f=Wm(this,a),this.N.add(c),gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.gb()||this.D.gd())return()=>{};const e=Pm(this,a),f=c?olympe.dc.fa(c):
1078
+ '*';a=hn(this,'@'+f+'.'+e,b);c=c?(c=Sm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Pm(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}Yh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.gb()||a.gd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.yg(d,
1079
+ b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&Ym(e,f,g+1)});return e}cl(a,b){const c=Sm(this,a);if(c)return b(c),()=>{};const d=hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Pm(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.D.gd()||this.D.gb()||(cn(this,olympe.sc.Ya.pc.j.Rj),this.D.destroy(),cn(this,olympe.sc.Ya.pc.j.Vd))}mh(a,b){if(this.D.gb())a();
1080
+ else return Um++,b=null!=b?b:String(Um),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}al(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){cn(this,olympe.sc.Ya.pc.j.Lj);let a;null==(a=this.Y)||a.forEach(b=>b());cn(this,olympe.sc.Ya.pc.j.Mj)}}gb(){return this.D.gb()}Cb(){return this.D}};olympe.sc.yg.prototype.getParent=olympe.sc.yg.prototype.getParent;olympe.sc.yg.j={Ul:'I#',mm:'O#',nB:'IO#'};function ln(a,b,c){return(c=c.ef())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.pc=class{constructor(a=-1){this.id=olympe.V.Kf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.pc.j={INIT:'INIT',Rg:'SET',Lj:'CLEAR',Mj:'CLEARED',Rj:'DESTROY',Vd:'DESTROYED'};olympe.sc.Ya.pc.D={Af:'REMOTE',Nu:'LOCAL',eg:'PROFILER'};olympe.sc.Xd=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Gm(1E4);gb(this.j,b=>{kn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Xd.j.ov:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Xd.j.pv:const h=f+c,k=(l,n,p=0)=>{jn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.ef())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1081
1081
  t])})};b.tn(h).then(()=>{const l=[];k(g,l,0);Zm(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Xd.j.eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Jv(h);Ym(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Xd.j.qv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Xd.j.bg:void 0!==g&&(this.j.delete(g),kn(g))}}da(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
1082
- c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.Kf(),f=new olympe.C.Xb(this.D,c.Eb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.Eo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
1082
+ c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.Kf(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.Eo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
1083
1083
  d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Zm(h,l=>{if(null!==l.ef()){const n=olympe.dc.CloudObject.get(l.ef()).ng(olympe.sc.Runnable.H).Fc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Xd.j.Ek,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.$a('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1084
1084
  b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.yc))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.propertyRel).ie().Fc();e=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.yj).ie().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1085
1085
  '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=ln(c,Pm(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function mn(a,b,c,d=new Map){for(var e=[];b;){const n=b.ef();if(!n)break;e.push(n);b=b.getParent()}mb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.H.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
@@ -1087,51 +1087,51 @@ q)}}
1087
1087
  olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=nn.Ul,f=nn.mm,g=nn.uv;const h=nn.INIT,k=nn.Lj,l=nn.Mj,n=nn.Rj,p=nn.Vd;c=nn.lv;if(b===olympe.sc.Ya.pc.j.Rg){const [q,r]=d;b=(d=a.ef())?olympe.dc.ia().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Ob(d,olympe.sc.ui.kC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Ob(q,olympe.sc.logic.vb),d=this.ia.Ob(q,olympe.sc.logic.Gb),
1088
1088
  mn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Ob(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),mn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.pc.j.INIT?mn(this,a,h):b===olympe.sc.Ya.pc.j.Lj?mn(this,a,k):b===olympe.sc.Ya.pc.j.Mj?mn(this,a,l):b===olympe.sc.Ya.pc.j.Rj?mn(this,a,n):b===olympe.sc.Ya.pc.j.Vd&&mn(this,a,p)}};
1089
1089
  const nn={Ul:'input',mm:'output',uv:'prop',INIT:'init',Lj:'clear',Mj:'cleared',Rj:'destroy',Vd:'destroyed',lv:'other'};olympe.sc.Ya.Jv=class extends olympe.sc.Ya.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.pc.D.Af}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg&&void 0!==d[0]&&null!==d[0]){const e=ln(c,Pm(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Wb()instanceof olympe.sc.yc){const h=Ng(this.db,f,()=>{olympe.sc.Xd.D(this.H,
1090
- e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.rd(this.ln())}Au(){return this.rd(this.mn())}Sk(){return new olympe.C.Zb(this.rd(this.ln()),this.rd(this.mn()))}ln(){}mn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.ln.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Bf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.rd(olympe.sc.Bf.D)}};olympe.sc.Bf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Bf);olympe.sc.Bf.D=olympe.sc.Bf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Bf.j=olympe.sc.Bf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Bf.j);olympe.sc.Bf.prototype.Dd.K=olympe.C.J.F;olympe.sc.nd=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.ab(olympe.sc.nd.j,olympe.sc.logic.Ih)}D(){return this.ab(olympe.sc.nd.D,olympe.sc.logic.Kg)}};olympe.sc.nd.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.nd);olympe.sc.nd.j=olympe.sc.nd.O.sa('016ac4f59a2917fdef01');olympe.sc.nd.D=olympe.sc.nd.O.sa('016ac4f59a2917fdef02');olympe.sc.nd.O.j=(a,b)=>Bl(a,b||'New function signature',olympe.sc.nd,olympe.sc.logic.xd).X();
1091
- olympe.sc.nd.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.nd.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function on(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function pn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Ub));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Ub.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Ub.j,!0))?f:0;return c-d});return b}function qn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.F))}function rn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.D))}
1090
+ e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.ln())}Au(){return this.sd(this.mn())}Sk(){return new olympe.C.Zb(this.sd(this.ln()),this.sd(this.mn()))}ln(){}mn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.ln.K=olympe.C.J.j;m.mn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Bf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.sd(olympe.sc.Bf.D)}};olympe.sc.Bf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Bf);olympe.sc.Bf.D=olympe.sc.Bf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Bf.j=olympe.sc.Bf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Bf.j);olympe.sc.Bf.prototype.Dd.K=olympe.C.J.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.ab(olympe.sc.od.j,olympe.sc.logic.Ih)}D(){return this.ab(olympe.sc.od.D,olympe.sc.logic.Kg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Bl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
1091
+ olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function on(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function pn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Ub));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Ub.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Ub.j,!0))?f:0;return c-d});return b}function qn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.F))}function rn(a){return pn(a,a.db.ab(a.tag,olympe.sc.Ua.D))}
1092
1092
  olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Cu(a,b,c,d,e=!0){e||olympe.ja.$a('sc').error('parameter own= false ignored, investigate');return olympe.C.nh(M(this.Pf(a,olympe.dc.mb.jj,c)),d)}H(){return[]}F(){return rxjs.of([])}py(){return this.ab(olympe.sc.Ua.N,olympe.sc.Runnable)}Fx(){return this.ab(olympe.sc.Ua.R,olympe.sc.Runnable)}ii(){return this.db.Qa(this,olympe.sc.Ua.$)}qn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}Bu(){return this.ab(olympe.sc.Ua.F,olympe.sc.logic.vb)}Np(){return this.ab(olympe.sc.Ua.D,
1093
1093
  olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.cb]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.jb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.cb=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
1094
- olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.qn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function Vm(a){let b;return null!=(b=a.qd().N().map(olympe.dc.fa)[0])?b:null}function sn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.$a('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
1095
- function tn(a,b){dn(b.j,a);on(a.qd(),b);const c=a.N(),d=un(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(vn(a,b,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])})}
1096
- function wn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=xn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.ww(b.j);l.Eb().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
- function yn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=Lm(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.dd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=Nm(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Eb().onDestroy(a.db.D.bind(a.db,b,c,f))}function xn(a,b){return a.qd().H(b)}
1098
- function un(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)}})}function vn(a,b,c,d){b=b.Eb();const e=Ng(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Bc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Og(a.db,a.tag,e)})}
1099
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Eb().run(()=>{tn(this,a);this.init(a);a.mh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));wn(this,a);this.D(a)})}qd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.qd();if(d.ii())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),yn(this,d,olympe.sc.Ua.N,a),this.da()&&yn(this,
1100
- d,olympe.sc.Ua.Y,a)}D(a){a.Gn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.qd().F(a)}onInit(){}onUpdate(){const a=this.ac(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return qn(this.qd())}getOutputs(){return rn(this.qd())}F(){return[]}j(){return null}da(){return!1}H(a,
1094
+ olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.qn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function Vm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.fa)[0])?b:null}function sn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.$a('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
1095
+ function tn(a,b){dn(b.j,a);on(a.rd(),b);const c=a.N(),d=un(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(vn(a,b,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])})}
1096
+ function wn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=xn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.ww(b.j);l.Cb().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
+ function yn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=Lm(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.dd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=Nm(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function xn(a,b){return a.rd().H(b)}
1098
+ function un(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)}})}function vn(a,b,c,d){b=b.Cb();const e=Ng(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Bc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Og(a.db,a.tag,e)})}
1099
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{tn(this,a);this.init(a);a.mh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));wn(this,a);this.D(a)})}rd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.ii())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),yn(this,d,olympe.sc.Ua.N,a),this.da()&&yn(this,
1100
+ d,olympe.sc.Ua.Y,a)}D(a){a.Gn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.ac(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return qn(this.rd())}getOutputs(){return rn(this.rd())}F(){return[]}j(){return null}da(){return!1}H(a,
1101
1101
  b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}cb(a,b,c,d,e){olympe.C.vn([d],f=>{b.set(a,olympe.C.ys(f)?f.valueOf():f)});return this.H(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){vn(this,a,b,null)}R(a,b){vn(this,a,null,b)}jb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.cs(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return zn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1102
- olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.H);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.qd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
1102
+ olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.H);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
1103
1103
  olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.cb.K=olympe.C.J.j;function An(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Pd)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Pd=class extends olympe.dc.CloudObject{D(){return this.db.ab(this,olympe.sc.Pd.j)[0]}j(){const a=An(this);return olympe.dc.CloudObject.get(a)}Bc(){return this.j().Bc()}toString(){const a=An(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Pd.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Pd);
1104
1104
  olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Io=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Io.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Io);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Bl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Bn=null,Cn=null,Dn=[];
1105
- function En(a,b){Bn=a;const c=olympe.C.Xa();return olympe.dc.md.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).nb({Xh:'__code-as-data__'}).then(d=>{let e;null==(e=Dn)||e.forEach(f=>f());Dn=null;Cn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{bi(c,d,h=>{h=f.ji(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.yc)},{Dn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.$a('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1105
+ function En(a,b){Bn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).nb({Xh:'__code-as-data__'}).then(d=>{let e;null==(e=Dn)||e.forEach(f=>f());Dn=null;Cn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{bi(c,d,h=>{h=f.ji(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.yc)},{Dn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.$a('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1106
1106
  g()}))})}olympe.ja.$a('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.$a('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{Dn=null;throw d;})}function pf(){return null===Dn?Promise.resolve():new Promise(a=>{Dn.push(()=>a())})}olympe.sc.mf=class extends olympe.dc.CloudObject{};olympe.sc.mf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.mf);olympe.sc.mf.j=olympe.sc.mf.O.sa('017b3aa8fd1659291b92');
1107
1107
  olympe.sc.mf.D=olympe.sc.mf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Hg=class extends olympe.sc.Map{};olympe.sc.Hg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Hg);olympe.sc.File=class extends olympe.dm.File{static $w(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Ns(a,e,b,c,d);return e}static ax(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Cn(a,e,b,c,d);return e}static Ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Cn(a,b,c,d,e)}static Cn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ga(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Qf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1108
1108
  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.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.Fs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Cn;olympe.sc.File.setContent=olympe.sc.File.Ns;olympe.sc.File.createFromURL=olympe.sc.File.ax;olympe.sc.File.createFromContent=olympe.sc.File.$w;
1109
- olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Dg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.Pk(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.Dg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Dg);olympe.sc.Dg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Dg);olympe.sc.Dg.prototype.H.K=olympe.C.J.D;olympe.sc.Kc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Kc.fontFamilyProp)}N(){return this.wb(olympe.sc.Kc.F)}R(){return this.rd(olympe.sc.Kc.H)}};olympe.sc.Kc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Kc);olympe.sc.Kc.fontFamilyProp=olympe.sc.Kc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Kc.F=olympe.sc.Kc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Kc.H=olympe.sc.Kc.O.ka('01647e6780999bf8bd25');
1109
+ olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Dg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.Pk(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.Dg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Dg);olympe.sc.Dg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Dg);olympe.sc.Dg.prototype.H.K=olympe.C.J.D;olympe.sc.Kc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Kc.fontFamilyProp)}N(){return this.wb(olympe.sc.Kc.F)}R(){return this.sd(olympe.sc.Kc.H)}};olympe.sc.Kc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Kc);olympe.sc.Kc.fontFamilyProp=olympe.sc.Kc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Kc.F=olympe.sc.Kc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Kc.H=olympe.sc.Kc.O.ka('01647e6780999bf8bd25');
1110
1110
  olympe.sc.Kc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Kc,a,b,c,d);a.update(c,olympe.sc.Kc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Kc.prototype.H.K=olympe.C.J.D;olympe.sc.Kc.prototype.N.K=olympe.C.J.D;olympe.sc.Kc.prototype.R.K=olympe.C.J.F;olympe.sc.Qh=class extends olympe.sc.File{};olympe.sc.Qh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Qh);olympe.sc.Qh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Qh);olympe.sc.Fr=class extends olympe.dc.CloudObject{};olympe.sc.Fr.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.Fr);olympe.sc.logic={};olympe.sc.logic.op=(a,b)=>a===b?0:a>b?1:-1;
1111
- olympe.sc.logic.uB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.rd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.sj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1111
+ olympe.sc.logic.uB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.sd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.sj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1112
1112
  return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.op(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.op(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Jk().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.ea,'FilterList ListDefBuilder Filter TransformFlows')).Li())};
1113
1113
  olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Zp};olympe.sc.logic.Ra={};function Fn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.cp=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Fn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.cp.xa=[olympe.dc.Te];const Gn=Object.create(null),Hn=new Map;function In(a){if(void 0===Gn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Jn(a,b,c=olympe.sc.logic.Function){if(Hn.has(a))throw c=In(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);Hn.set(a,{O:d,wE:b,cE:c});return d}
1114
1114
  olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(Gn[a])throw c=In(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.cp(a,b,[olympe.sc.P.Ca].concat(c));return Gn[a]=b}};olympe.sc.logic.jA=class{};olympe.sc.logic.Pj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Pj.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Pj);function Qm(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}ay(){return this.message}es(){return this.code}ne(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.ne()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ne;
1115
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ci=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Ci.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ci);olympe.sc.logic.ld=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.ld.j,olympe.dc.CloudObject)}};olympe.sc.logic.ld.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.ld);olympe.sc.logic.ld.D=olympe.sc.logic.ld.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.ld.j=olympe.sc.logic.ld.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.ld.j);olympe.sc.logic.ld.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.ld{};olympe.sc.logic.Ih.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.nd.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Input',olympe.sc.logic.Ih,olympe.sc.logic.vb);Y(b,olympe.sc.logic.ld.D,e);a.Oa(olympe.sc.logic.ld.j,b,c);a.Oa(olympe.sc.nd.j,d,b);return b.X()};olympe.sc.logic.Kg=class extends olympe.sc.logic.ld{};olympe.sc.logic.Kg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Kg);olympe.sc.logic.Kg.F=R(olympe.sc.logic.Kg.O,olympe.sc.nd.D);olympe.sc.logic.Kg.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Output',olympe.sc.logic.Kg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.ld.D,e);a.Oa(olympe.sc.logic.ld.j,b,c);a.Oa(olympe.sc.nd.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.hr}Y(){return this.en().Jk().Ob([olympe.sc.logic.Function]).and().ud().Ob([olympe.sc.logic.jd,olympe.sc.logic.dd]).Li()}N(){const a=olympe.dc.fa(olympe.sc.logic.Ci);return this.db.ab(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Ub.typeRel)===a)}j(a){const b=this.db.bn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.bn(this,[olympe.sc.Ua.D],
1115
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ci=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Ci.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ci);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.md{};olympe.sc.logic.Ih.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.od.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Input',olympe.sc.logic.Ih,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Kg=class extends olympe.sc.logic.md{};olympe.sc.logic.Kg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Kg);olympe.sc.logic.Kg.F=R(olympe.sc.logic.Kg.O,olympe.sc.od.D);olympe.sc.logic.Kg.O.j=(a,b,c,d,e)=>{b=Bl(a,b||'New Predefined Output',olympe.sc.logic.Kg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.hr}Y(){return this.en().Jk().Ob([olympe.sc.logic.Function]).and().ud().Ob([olympe.sc.logic.kd,olympe.sc.logic.dd]).Li()}N(){const a=olympe.dc.fa(olympe.sc.logic.Ci);return this.db.ab(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Ub.typeRel)===a)}j(a){const b=this.db.bn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.bn(this,[olympe.sc.Ua.D],
1116
1116
  c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Ci);return rn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Ub.typeRel)){case b:return a.Gn.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ii())return super.F(a);const b=qn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1117
1117
  c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Jn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let Kn=null;function Ln(){if(null===Kn){let a;Kn=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Kn}
1118
1118
  olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Ci).Li().wf().rn(olympe.C.aa.ZERO)}F(a){if(this.ii()||Ln()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:qn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Wf.j='016ac63229782039429f';olympe.sc.logic.Wf.H='016ac6322acf67eebfe7';
1119
- olympe.sc.logic.Wf.O=Jn('01621fb84e320000a000',olympe.sc.logic.Wf,olympe.sc.logic.Action);olympe.sc.logic.Wf.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Wf.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Wf.prototype.da.K=olympe.C.J.N;olympe.sc.logic.ro=class extends olympe.sc.logic.xd{};olympe.sc.logic.ro.O=Jn('01621fb84e320000f011',olympe.sc.logic.ro);olympe.sc.logic.qo=class extends olympe.sc.logic.Wf{};olympe.sc.logic.qo.O=Jn('01621fb84e320000f012',olympe.sc.logic.qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.jb]}j(){if(!this.qd().ii())return super.j();const a=olympe.sc.yg.j.Ul,b=olympe.sc.yg.j.mm,c=this.db,d=new Map,e=this.ac();c.ab(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.ab(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Ub=class extends olympe.dc.CloudObject{getType(){return this.Pc(olympe.sc.logic.Ub.typeRel,olympe.dc.CloudObject)}j(){return this.rd(olympe.sc.logic.Ub.j)}};olympe.sc.logic.Ub.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Ub);olympe.sc.logic.Ub.j=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Ub.typeRel=olympe.sc.logic.Ub.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Ub.typeRel);
1119
+ olympe.sc.logic.Wf.O=Jn('01621fb84e320000a000',olympe.sc.logic.Wf,olympe.sc.logic.Action);olympe.sc.logic.Wf.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Wf.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Wf.prototype.da.K=olympe.C.J.N;olympe.sc.logic.ro=class extends olympe.sc.logic.xd{};olympe.sc.logic.ro.O=Jn('01621fb84e320000f011',olympe.sc.logic.ro);olympe.sc.logic.qo=class extends olympe.sc.logic.Wf{};olympe.sc.logic.qo.O=Jn('01621fb84e320000f012',olympe.sc.logic.qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.jb]}j(){if(!this.rd().ii())return super.j();const a=olympe.sc.yg.j.Ul,b=olympe.sc.yg.j.mm,c=this.db,d=new Map,e=this.ac();c.ab(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.ab(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Ub=class extends olympe.dc.CloudObject{getType(){return this.Pc(olympe.sc.logic.Ub.typeRel,olympe.dc.CloudObject)}j(){return this.sd(olympe.sc.logic.Ub.j)}};olympe.sc.logic.Ub.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Ub);olympe.sc.logic.Ub.j=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Ub.typeRel=olympe.sc.logic.Ub.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Ub.typeRel);
1120
1120
  olympe.sc.logic.Ub.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ub.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.ua.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.ua.ORIGIN);
1121
1121
  olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.ua.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.Gb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.ua.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.ua.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.ua.ORIGIN);
1122
- olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.jd=class extends olympe.sc.logic.Function{run(a){tn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.jd.F),d=this.db.Jb(this,olympe.sc.logic.jd.D);a.on(c,e=>b.set(d,e),this.tag)}ha(){return this.ng(olympe.sc.logic.jd.F).Fc()}wa(){return this.ng(olympe.sc.logic.jd.D).Fc()}};olympe.sc.logic.jd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.jd,olympe.sc.P.Ca);olympe.sc.logic.jd.F=R(olympe.sc.logic.jd.O,olympe.sc.logic.vb.F);
1123
- olympe.sc.logic.jd.D=R(olympe.sc.logic.jd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.jd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.jd);a.Oa(olympe.sc.logic.jd.D,b,c);return b.X()};olympe.sc.logic.jd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.jd.prototype.wa.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}wa(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.P.Ca);olympe.sc.logic.dd.D=R(olympe.sc.logic.dd.O,olympe.sc.logic.vb.H);olympe.sc.logic.dd.F=R(olympe.sc.logic.dd.O,olympe.sc.logic.Gb.F);
1122
+ olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){tn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}ha(){return this.ng(olympe.sc.logic.kd.F).Fc()}wa(){return this.ng(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
1123
+ olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.wa.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}wa(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.P.Ca);olympe.sc.logic.dd.D=R(olympe.sc.logic.dd.O,olympe.sc.logic.vb.H);olympe.sc.logic.dd.F=R(olympe.sc.logic.dd.O,olympe.sc.logic.Gb.F);
1124
1124
  olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.wa.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function zn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.H),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Qf(Mn(a),olympe.dm.De)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.cl(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.mb.Bc(k)),h=Lg(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Mg(a.db,a,olympe.sc.logic.pb.valueProp,
1125
1125
  h)}}function Mn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Ub.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
1126
1126
  olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.jj(c);null==b||b.lg();b&&d instanceof olympe.dm.De?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Pf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.jj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Ub.typeRel);a.Md(olympe.dc.CloudObject);return a.Gc()}wy(){return this.Pc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}uy(){return this.Pc(olympe.sc.logic.pb.R,
1127
1127
  olympe.sc.logic.Gb)}vy(){return this.Pc(olympe.sc.logic.pb.H,olympe.dm.Property)}Ox(){return this.Pc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Mx(){return this.Pc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Nx(){return this.Pc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
1128
1128
  olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
1129
- R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function Nn(a,b){const c=a.qd(),d=c.Yl().X(),e=c.Zl().X(),f=c.$l().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.ac(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Qm(k.message,k.code,k.ne()+'\n===== Remote Call =====\n'+b.ne()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1129
+ R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function Nn(a,b){const c=a.rd(),d=c.Yl().X(),e=c.Zl().X(),f=c.$l().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.ac(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Qm(k.message,k.code,k.ne()+'\n===== Remote Call =====\n'+b.ne()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1130
1130
  400))})}},b.T())}
1131
1131
  function On(a,b,c,d,e,f){const g=n=>w(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ac()}): ${r}`);f.bi(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ac()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1132
- olympe.sc.logic.Lh=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.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(dn(a.j,this),this.ha(a)):(tn(this,a),Nn(this,a)))}ha(a){const b=this.ac(),c=this.qd(),d=c.Op().X(),e=c.Yl().X(),f=c.Zl().X(),g=c.$l().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=h.body(),n=wc(()=>{h.bi(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1132
+ olympe.sc.logic.Lh=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.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(dn(a.j,this),this.ha(a)):(tn(this,a),Nn(this,a)))}ha(a){const b=this.ac(),c=this.rd(),d=c.Op().X(),e=c.Yl().X(),f=c.Zl().X(),g=c.$l().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=h.body(),n=wc(()=>{h.bi(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1133
1133
  k.destroy()},this.timeout);On(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ni().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.ac(),this.G.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,l.get(e))}).catch(p=>{const q=this.ac();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1134
- 1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Vl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Vl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.ld.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Lb.fg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){tn(this,a);const [b,c,d]=xn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.ff(f)),f++,c(Date.now())):(fn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.og();f=0;en(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1134
+ 1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Vl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Vl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Vl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Lb.fg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.j('0174bf4b7e006e4b788a',olympe.sc.logic.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){tn(this,a);const [b,c,d]=xn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.ff(f)),f++,c(Date.now())):(fn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.og();f=0;en(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1135
1135
  olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Nk.Uu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ll=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.Ll.O=Jn('0169b6876a03f14ae61b',olympe.sc.logic.Rb.Ll);olympe.sc.logic.Rb.Ll.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let Pn=null;olympe.sc.logic.Rb.Wl=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Pn){let b;Pn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Pn?a.observe(qn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.Wl.O=Jn('0169b6876a03f139d50a',olympe.sc.logic.Rb.Wl);olympe.sc.logic.Rb.Wl.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Jn('01646ad602f933b8caaf',olympe.sc.logic.Rb.nm);olympe.sc.logic.Rb.nm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.nm.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Jn('0168ec42fc01747a98b6',olympe.sc.logic.Rb.gk);olympe.sc.logic.Rb.gk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.gk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Og=class extends olympe.sc.logic.xd{Yl(){return this.j('017a7b07b09e3b22c8b4')}Op(){return this.j('017a7b07ba05807a74b0')}Zl(){return this.D('017a7b0818c12388d731')}$l(){return this.D('017a7b085146d5e69aec')}Du(){return olympe.C.ea.D}};olympe.sc.logic.Rb.Og.H='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Og.vc='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Og.ha='017a7b0818c12388d731';olympe.sc.logic.Rb.Og.j='017a7b085146d5e69aec';
1136
1136
  olympe.sc.logic.Rb.Og.O=Jn('017a7b07a948e30508fa',olympe.sc.logic.Rb.Og,olympe.sc.logic.Lh);m=olympe.sc.logic.Rb.Og.prototype;m.Yl.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Op.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Zl.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.$l.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Du.K=olympe.C.J.N;olympe.sc.logic.Rb.mr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Jn('016a9766c230916ea5ec',olympe.sc.logic.Rb.mr);olympe.sc.logic.Rb.mr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.Un=class extends olympe.sc.Hg{};olympe.sc.query.Un.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.Un);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.uq);olympe.sc.query.Eq=class extends olympe.dm.Enum{};olympe.sc.query.Eq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.Eq);olympe.sc.query.Hq=class extends olympe.sc.Hg{};olympe.sc.query.Hq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Hq);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.wo=class extends olympe.dc.CloudObject{};olympe.sc.wo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.wo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
1137
1137
  olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.zf=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.zf.O=Jn('017ffde21f5fe0f704ce',olympe.sc.workflow.zf);olympe.sc.workflow.zf.j='017ffe02381f9fac5060';olympe.sc.workflow.zf.$e='017ffe02381f9fac5061';
@@ -1139,13 +1139,13 @@ olympe.sc.workflow.zf.af='017ffe02381f9fac5062';olympe.sc.workflow.zf.ha='017ffe
1139
1139
  olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ka('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1140
1140
  olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}F(){return this.dh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ye)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ka('017ffdc010e5bcc9c972');
1141
1141
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.F.K=olympe.C.J.N;olympe.sc.workflow.Workflow.prototype.j.K=new olympe.C.J(()=>olympe.sc.yc,[]);
1142
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.Nv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.ha=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Mc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.si=class extends olympe.sc.Runnable{F(){return[this.ac()]}ha(){return olympe.dc.md.from(this.ac()).fb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.si.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.si));olympe.sc.qa.si.prototype.ha.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Ku(){return this.dh(olympe.sc.qa.lb.Vh)}Zy(){return this.dh(olympe.sc.qa.lb.ha)}Hc(){return this.rd(olympe.sc.qa.lb.j)}Qx(){return this.wb(olympe.sc.qa.lb.H)}ny(){return this.wb(olympe.sc.qa.lb.da)}my(){return this.wb(olympe.sc.qa.lb.Y)}Lf(){return this.wb(olympe.sc.qa.lb.$)}$x(){return this.wb(olympe.sc.qa.lb.N)}zx(){return this.wb(olympe.sc.qa.lb.D)}ly(){return this.wb(olympe.sc.qa.lb.R)}Ju(){return this.wb(olympe.sc.qa.lb.F)}};
1142
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.Nv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.ha=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Mc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.si=class extends olympe.sc.Runnable{F(){return[this.ac()]}ha(){return olympe.dc.nd.from(this.ac()).fb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.si.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.si));olympe.sc.qa.si.prototype.ha.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Ku(){return this.dh(olympe.sc.qa.lb.Vh)}Zy(){return this.dh(olympe.sc.qa.lb.ha)}Hc(){return this.sd(olympe.sc.qa.lb.j)}Qx(){return this.wb(olympe.sc.qa.lb.H)}ny(){return this.wb(olympe.sc.qa.lb.da)}my(){return this.wb(olympe.sc.qa.lb.Y)}Lf(){return this.wb(olympe.sc.qa.lb.$)}$x(){return this.wb(olympe.sc.qa.lb.N)}zx(){return this.wb(olympe.sc.qa.lb.D)}ly(){return this.wb(olympe.sc.qa.lb.R)}Ju(){return this.wb(olympe.sc.qa.lb.F)}};
1143
1143
  olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Vh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.ha=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.H=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.da=olympe.sc.qa.lb.O.ka('011203300000000adefa');olympe.sc.qa.lb.Y=olympe.sc.qa.lb.O.ka('011203300000000adefb');olympe.sc.qa.lb.D=olympe.sc.qa.lb.O.ka('011203300000000adefc');
1144
1144
  olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.oc={INIT:0,$z:1,xk:2,wk:3,zm:4,FC:5,Ab:9};m=olympe.sc.qa.lb.prototype;m.Ku.K=olympe.C.J.N;m.Zy.K=olympe.C.J.N;m.Hc.K=olympe.C.J.F;m.Qx.K=olympe.C.J.D;m.ny.K=olympe.C.J.D;m.my.K=olympe.C.J.D;m.Lf.K=olympe.C.J.D;m.$x.K=olympe.C.J.D;
1145
1145
  m.zx.K=olympe.C.J.D;m.ly.K=olympe.C.J.D;m.Ju.K=olympe.C.J.D;olympe.sc.qa.Tl=class extends olympe.sc.qa.si{D(a){a.set(olympe.sc.ya.j.Kn,!0);super.D(a)}da(){return!0}};olympe.sc.qa.Tl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Tl,olympe.sc.P.Ca);olympe.sc.qa.Xe=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.ck(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.Xe.H).Li().Gc()}};olympe.sc.qa.Xe.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Xe);olympe.sc.qa.Xe.H=olympe.sc.qa.Xe.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Xe.H);
1146
- olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=Bl(a,b||'New Service Application model',olympe.sc.qa.Xe,olympe.sc.qa.Tl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Xe.H,b,c);return b.X()};olympe.sc.qa.Xe.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.Ug=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Ug.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Ug);olympe.sc.Ug.D=olympe.sc.Ug.O.ka('011203300000000adf01');olympe.sc.Ug.j=olympe.sc.Ug.O.ka('011203300000000adf02');olympe.sc.Ug.F='011203300000000adf0f';olympe.sc.sg={};olympe.sc.sg.Py=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Dn;for(const f of b.Rc())if((b=f.Wb())&&f.D()&&f.sb()===olympe.dc.Ja.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.yc)){if(!e)throw new olympe.dc.kq;let g,h;null==d&&(d=null,null!==Cn?d=Cn:'string'===typeof Bn&&(d=olympe.dc.md.from(Bn).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Oa(olympe.sc.mf.D.X(),
1146
+ olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=Bl(a,b||'New Service Application model',olympe.sc.qa.Xe,olympe.sc.qa.Tl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Xe.H,b,c);return b.X()};olympe.sc.qa.Xe.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.Ug=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Ug.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Ug);olympe.sc.Ug.D=olympe.sc.Ug.O.ka('011203300000000adf01');olympe.sc.Ug.j=olympe.sc.Ug.O.ka('011203300000000adf02');olympe.sc.Ug.F='011203300000000adf0f';olympe.sc.sg={};olympe.sc.sg.Py=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Dn;for(const f of b.Rc())if((b=f.Wb())&&f.D()&&f.sb()===olympe.dc.Ja.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.yc)){if(!e)throw new olympe.dc.kq;let g,h;null==d&&(d=null,null!==Cn?d=Cn:'string'===typeof Bn&&(d=olympe.dc.nd.from(Bn).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.mf.j.$b()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Oa(olympe.sc.mf.D.X(),
1147
1147
  d,f.tag())}};
1148
- olympe.sc.sg.az=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.Rc()){const e=d.Wb();e&&!d.sd()&&c.Ob(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Qc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Pd)){h=l.Jb(olympe.sc.Pd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1148
+ olympe.sc.sg.az=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.Rc()){const e=d.Wb();e&&!d.td()&&c.Ob(e,olympe.sc.yc)&&d.Db().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Qc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Pd)){h=l.Jb(olympe.sc.Pd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1149
1149
  let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=Km(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Wc(d.tag(),new Map([[g,n]]));vl(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1150
1150
  olympe.sc.sg.Vw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Id()&&(d.has(g)||c.Ob(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ha()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Qc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Qc(h))?void 0:k.Wb())?l:c.model(h))?
1151
1151
  n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.sg.pz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.Rc()){b=d.tag();const e=d.Wb();if(e&&!c.Ob(e,olympe.sc.yc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
@@ -1155,34 +1155,34 @@ return this.persist(a,b)}li(a){this.source=a;return this}model(a){return this.j.
1155
1155
  olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.li;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.oz;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Zm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.hc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
1156
1156
  olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.cj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.cj.prototype.getCreatedObjects=olympe.sc.cj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function Rn(a,b='default'){return a.j===b}
1157
1157
  olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Aj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
1158
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.$a();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.qd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>Rn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Pe:'hc.app',kp:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Pe,'default');F(a,olympe.xc.U.kp,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Db.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe)],b=>b);E(a,olympe.auth.P.kl,[olympe.Db.P.Sg,new olympe.W.pa(olympe.xc.U.kp)],(b,c)=>new olympe.auth.Tn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Pe),olympe.xc.P.Ca)},'olympe.hc');
1158
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.$a();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>Rn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Pe:'hc.app',kp:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Pe,'default');F(a,olympe.xc.U.kp,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe)],b=>b);E(a,olympe.auth.P.kl,[olympe.Eb.P.Sg,new olympe.W.pa(olympe.xc.U.kp)],(b,c)=>new olympe.auth.Tn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Pe),olympe.xc.P.Ca)},'olympe.hc');
1159
1159
  olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Sn(a){a.Y=a.F.D(()=>w(function*(){return Tn(a)}),'Stop application')}function Un(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ee.j.READINESS)}
1160
- function Vn(a){if(a.wa)return a.G.debug('Sending getContext request'),ni(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Dn=null;Bn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Om(a.D);!b&&Lk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Eb(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);bi(k,a.j,l=>{l=h.ji(l)?l:h.model(l);return null!==l&&
1161
- h.Ob(l,olympe.sc.ph)},{hd:Wn(b),Dn:!0,zs:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Ob(a.j,olympe.sc.qa.Xc)?(a.cb.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.ha.pe()],g=>{const h=Wn(b,!1);olympe.dc.ma.Ke(g,olympe.dm.User,olympe.dc.Ja.SERVER).observe(c,
1162
- {hd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return Xn(a);Xn(a).then(()=>{})})}
1163
- function Yn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.Eb().rc((f,g)=>{if(f)if(f=sn(g),f instanceof olympe.sc.qa.si){a.G.debug('application retrieved: running');g=Lm(a.D,f);const h=new olympe.sc.Ya.zv(a.H);jb(a.H,()=>Ym(a.D.j,h));kb(a.H,()=>{var k=h.T();return $m(a.D.j,k)});a.jb&&a.H.start();f.run(g);'string'===typeof a.zb&&(new olympe.sc.Xd).da(f.X(),g,a.G);g.Us(olympe.sc.ya.j.Kn).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1160
+ function Vn(a){if(a.wa)return a.G.debug('Sending getContext request'),ni(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Dn=null;Bn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Om(a.D);!b&&Lk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);bi(k,a.j,l=>{l=h.ji(l)?l:h.model(l);return null!==l&&
1161
+ h.Ob(l,olympe.sc.ph)},{jd:Wn(b),Dn:!0,zs:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Ob(a.j,olympe.sc.qa.Xc)?(a.cb.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.ha.pe()],g=>{const h=Wn(b,!1);olympe.dc.ma.Ke(g,olympe.dm.User,olympe.dc.Ja.SERVER).observe(c,
1162
+ {jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return Xn(a);Xn(a).then(()=>{})})}
1163
+ function Yn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=sn(g),f instanceof olympe.sc.qa.si){a.G.debug('application retrieved: running');g=Lm(a.D,f);const h=new olympe.sc.Ya.zv(a.H);jb(a.H,()=>Ym(a.D.j,h));kb(a.H,()=>{var k=h.T();return $m(a.D.j,k)});a.jb&&a.H.start();f.run(g);'string'===typeof a.zb&&(new olympe.sc.Xd).da(f.X(),g,a.G);g.Us(olympe.sc.ya.j.Kn).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1164
1164
  a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.cb.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Tn(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1165
- 3E4);let e;null==(e=a.Mb)||e.start()}}function Wn(a,b=!0){return a?olympe.dc.ma.nc.Jg:b?olympe.dc.ma.nc.qf:olympe.dc.ma.nc.lk}function Xn(a){return w(function*(){Zn(a.j)&&(yield En(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Tn(a){a.G.info('Stop the application');a.D.Eb().lg();a.F.F(a.R);a.F.N(a.Y)}
1165
+ 3E4);let e;null==(e=a.Mb)||e.start()}}function Wn(a,b=!0){return a?olympe.dc.ma.nc.Jg:b?olympe.dc.ma.nc.qf:olympe.dc.ma.nc.lk}function Xn(a){return w(function*(){Zn(a.j)&&(yield En(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Tn(a){a.G.info('Stop the application');a.D.Cb().lg();a.F.F(a.R);a.F.N(a.Y)}
1166
1166
  olympe.sc.Ib.ym=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ha=b;this.N=c;this.Ha=d;this.F=e;this.Y=this.R='';this.D=f;this.cb=g;this.H=h;this.Mb=l;this.j=k.get('appTag');this.wa=k.get('getContextMode');let n;this.zb=null!=(n=k.get('debuggerName'))?n:null;this.jb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.$=olympe.C.bc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Sn(this);Un(this);const b=olympe.L.tc.j.Si,
1167
1167
  c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,Vn(this).then(olympe.C.Xa().rc(()=>Yn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.ym.j='app_instance';olympe.sc.Ib.ym.xa=[olympe.xc.bt];olympe.sc.Ib.Lv=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.rj();this.G.debug('Request headers',b);return b.origin?b.origin:b.uz?(new URL(b.uz)).origin:b[olympe.net.va.Headers.ap]&&
1168
- b[olympe.net.va.Headers.bp]?b[olympe.net.va.Headers.bp]+'://'+b[olympe.net.va.Headers.ap]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Nd.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.kd('Invalid appTag',olympe.net.va.Vb.nl);try{var f=yield olympe.dc.ma.Ke(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.kd(`Something went wrong: ${'string'===typeof h?
1169
- h:h.message}`,olympe.net.va.Vb.nl)}if(0===f.size())return new olympe.net.kd('App not found',olympe.net.va.Vb.gm);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1170
- typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.kd(JSON.stringify(e),olympe.net.va.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.ib.D).Fc();return c.concat(a).has(b)}
1171
- olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.md.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.qf;Ck(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.ha).observe(c,{hd:b}).subscribe(d=>{const e=
1168
+ b[olympe.net.va.Headers.bp]?b[olympe.net.va.Headers.bp]+'://'+b[olympe.net.va.Headers.ap]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Nd.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ld('Invalid appTag',olympe.net.va.Vb.nl);try{var f=yield olympe.dc.ma.Ke(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
1169
+ h:h.message}`,olympe.net.va.Vb.nl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.va.Vb.gm);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1170
+ typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.va.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.ib.D).Fc();return c.concat(a).has(b)}
1171
+ olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.qf;Ck(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.ha).observe(c,{jd:b}).subscribe(d=>{const e=
1172
1172
  new olympe.dc.Wa;d.oj().forEach(f=>{e.Oa(olympe.dm.DataSource.zj,this.j,f)});d.tj().forEach(f=>{e.hc(olympe.dm.DataSource.zj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={fg:'sc.runtime.Main',We:'sc.runtime.SourceSolver',Rq:'sc.runtime.appConfig',Tq:'sc.runtime.runtimeHTTPServiceConfig',Sq:'sc.runtime.RuntimeHTTPService',mq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={vp:'app.httpManifestPath',Vp:'app.manifest.common',Rp:'sc.loadBusinessContainer'};
1173
- olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Db.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Ri),new olympe.W.pa(olympe.net.U.im)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1173
+ olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Ri),new olympe.W.pa(olympe.net.U.im)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1174
1174
  g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.jm,olympe.sc.Ib.P.mq);D(a,olympe.sc.Ib.P.We,olympe.sc.Ib.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));Wa(a,olympe.dc.sources.P.We,olympe.sc.Ib.P.We);E(a,olympe.sc.Ib.P.Rq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.sc.U.Eo),new olympe.W.pa(olympe.sc.U.Mn),new olympe.W.pa(olympe.sc.Ib.U.Rp)],(b,c,d,e,f)=>new Map([['appTag',
1175
1175
  b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.fg,olympe.sc.Ib.ym,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.pf,olympe.dc.query.P.nk,olympe.host.P.Ue,olympe.sc.P.tk,olympe.sc.Ib.P.We,olympe.V.P.eg,olympe.sc.Ib.P.Rq,olympe.sc.Ib.P.Sq);E(a,olympe.sc.Ib.P.Tq,[new olympe.W.pa(olympe.sc.Ib.U.vp),new olympe.W.pa(olympe.sc.Ib.U.Vp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Sq,olympe.sc.Ib.Lv,
1176
1176
  olympe.sc.P.Ca,olympe.net.P.dj,olympe.sc.P.tk,olympe.sc.Ib.P.Tq);olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.runtime');olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.headless');olympe.xc.Aj(a,olympe.sc.Ib.P.fg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static xx(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ve(olympe.public.Ma.get())}static Zk(b){return a.D(olympe.public.Ma.get().Zk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Jx(){return olympe.C.Pa(olympe.public.Ma.get().pe())}static jz(b){return a.D(olympe.public.Ma.get().pe(),b)}static oe(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Cd();return c.call(b,
1177
1177
  d)}static qg(){return new Promise((b,c)=>{olympe.public.Ma.get().qg(d=>d?c(d):b())})}static Vx(){return olympe.C.Pa(olympe.public.Ma.get().gi())||void 0}static yy(){const b=rd(olympe.public.Ma.get());return{user:b.Cc(),userTag:b.pe(),nonce:b.Cd(),payload:b.Ji(),idpName:b.xf(),protocol:b.Fg()}}static Ux(){return Array.from(We().keys())}static kf(){olympe.public.Ma.get().kf()}static hh(b){return new Promise((c,d)=>{olympe.public.Ma.get().hh(b,e=>e?d(e):c())})}static Sy(b,c){return olympe.public.Ma.j((new Map).set('username',
1178
1178
  b).set('password',c),olympe.auth.Ec.j.SRP)}static Ty(b){const c=We();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static Ry(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static Uy(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1179
- c),olympe.auth.Ec.j.km)}static Qy(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static ki(){return olympe.public.Ma.get().ki()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.me()}static D(b,c){return b.asObservable('function'===typeof c.Eb?c.Eb():c)}};olympe.public.Ma.logout=olympe.public.Ma.ki;olympe.public.Ma.loginOpenID=olympe.public.Ma.Qy;
1179
+ c),olympe.auth.Ec.j.km)}static Qy(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static ki(){return olympe.public.Ma.get().ki()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.me()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.ki;olympe.public.Ma.loginOpenID=olympe.public.Ma.Qy;
1180
1180
  olympe.public.Ma.loginToken=olympe.public.Ma.Uy;olympe.public.Ma.loginSAML=olympe.public.Ma.Ry;olympe.public.Ma.loginSSO=olympe.public.Ma.Ty;olympe.public.Ma.loginSRP=olympe.public.Ma.Sy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.hh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.kf;olympe.public.Ma.getIDPNames=olympe.public.Ma.Ux;olympe.public.Ma.getUserToken=olympe.public.Ma.yy;olympe.public.Ma.getIDPToken=olympe.public.Ma.Vx;olympe.public.Ma.refreshToken=olympe.public.Ma.qg;
1181
1181
  olympe.public.Ma.getToken=olympe.public.Ma.oe;olympe.public.Ma.observeUser=olympe.public.Ma.jz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.Jx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Zk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.xx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.tg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};
1182
- olympe.public.rf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.cn().connect()}static disconnect(){return olympe.L.cn().disconnect()}static Sf(a){a='function'===typeof a.Eb?a.Eb():a;return olympe.L.cn().Sf().asObservable(a).pipe(rxjs.operators.map(b=>
1182
+ olympe.public.rf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.cn().connect()}static disconnect(){return olympe.L.cn().disconnect()}static Sf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.cn().Sf().asObservable(a).pipe(rxjs.operators.map(b=>
1183
1183
  b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Sf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.lz;olympe.public.Process.onHealthCheck=olympe.public.Process.kz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.ua,generateTag:olympe.V.Kf,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Xr,defineInverseRelation:olympe.dc.gx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1184
1184
  Context:olympe.sc.ya,Entry:olympe.dc.Ra.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.cg,EnumValue:olympe.sc.Bi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ye,WorkflowTransition:olympe.sc.workflow.Transition,
1185
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.vi,TransactionResult:olympe.sc.cj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.md,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>Sk(olympe.dc.sources.Zd(),
1185
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.vi,TransactionResult:olympe.sc.cj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>Sk(olympe.dc.sources.Zd(),
1186
1186
  a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>Yk(),getPendingChanges:()=>al(),clearPendingChanges:()=>el(),loadPendingChanges:a=>cl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.bb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Gj,
1187
1187
  GUEST:olympe.auth.Ta.j.Di,AUTHENTICATED:olympe.auth.Ta.j.lf,ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,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.kb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
1188
1188
  instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Kf,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Tf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.ba.Ve,RecursiveRelated:olympe.dc.ba.Fe,Distinct:olympe.dc.ba.zi,Filter:olympe.dc.ba.tf,Limit:olympe.dc.ba.Bh,Sort:olympe.dc.ba.Tg,Union:olympe.dc.ba.Gf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Jd,Or:olympe.dc.Z.Be,Not:olympe.dc.Z.fe,Equals:olympe.dc.Z.ve,Contains:olympe.dc.Z.sf,