@olympeio/runtime-node 9.11.7 → 9.11.8

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
@@ -251,31 +251,31 @@ ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.
251
251
  function wa(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=va(this);return wa(c,b-d.length)+d}});ea('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=va(this);return d+wa(c,b-d.length)}});
252
252
  ea('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)}});ea('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}});
253
253
  ea('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}});ea('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 xa=this||self;
254
- function w(a,b){a=a.split('.');let c=xa;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={de:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.de())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.de().olympe=olympe;olympe.WE=(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 za=require('util');function Aa(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():za.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Ba(a,b){return JSON.stringify({level:a,message:b.map(Aa).join(' ')})}
255
- const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.V={};olympe.V.Nf={};olympe.V.Nf.Oo=class{process(a){for(const b of Object.keys(a.De))if(a.wd(b).Mn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.V.Nf.Oo.ya=[olympe.V.Nf.dr];olympe.V.Nf.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.wd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.V.qb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.V.Nf.Po.ya=[olympe.V.Nf.dr];olympe.V.Nf.dr=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Xa();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Xa();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.zj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
256
- olympe.V.Uo=class{constructor(){}static j(a,b){Ja.push(new olympe.V.Rl(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');});Ka.push(new olympe.V.Rl(b,c,a))}};olympe.V.config=olympe.V.Uo.j;olympe.V.run=olympe.V.Uo.D;olympe.V.Ns=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.V.Tj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.V.Rl=class{constructor(a,b,c){this.D=a;this.Vd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.V.qb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Vd}};function Ra(a,b){var c=olympe.V.P.Eg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.V.Ah.j.Cm)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.F&&(a.j[b]=d)}return d}
257
- function Ta(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 Oa(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.V.Tj?f.getValue(a):f,Ma(a.G);return d}
258
- olympe.V.Ah=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.V.sq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Ai.bind(this,f)))}Xa(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ai(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
259
- (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.V.Ah.j={iu:'exception',Cm:'null'};function Ua(a,b){b=olympe.V.Ns(b);for(const [c,d]of b)a.setParameter(c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}
254
+ function w(a,b){a=a.split('.');let c=xa;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={de:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.de())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.de().olympe=olympe;olympe.$E=(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 za=require('util');function Aa(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():za.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Ba(a,b){return JSON.stringify({level:a,message:b.map(Aa).join(' ')})}
255
+ const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.V={};olympe.V.Nf={};olympe.V.Nf.Po=class{process(a){for(const b of Object.keys(a.De))if(a.wd(b).Nn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.V.Nf.Po.ya=[olympe.V.Nf.gr];olympe.V.Nf.Qo=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.wd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.V.qb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.V.Nf.Qo.ya=[olympe.V.Nf.gr];olympe.V.Nf.gr=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Xa();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Xa();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.zj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
256
+ olympe.V.Vo=class{constructor(){}static j(a,b){Ja.push(new olympe.V.Sl(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');});Ka.push(new olympe.V.Sl(b,c,a))}};olympe.V.config=olympe.V.Vo.j;olympe.V.run=olympe.V.Vo.D;olympe.V.Rs=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.V.Uj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.V.Sl=class{constructor(a,b,c){this.D=a;this.Vd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.V.qb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Vd}};function Ra(a,b){var c=olympe.V.P.Eg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.V.Ah.j.Dm)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.F&&(a.j[b]=d)}return d}
257
+ function Ta(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 Oa(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.V.Uj?f.getValue(a):f,Ma(a.G);return d}
258
+ olympe.V.Ah=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.V.vq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Ai.bind(this,f)))}Xa(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ai(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
259
+ (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.V.Ah.j={mu:'exception',Dm:'null'};function Ua(a,b){b=olympe.V.Rs(b);for(const [c,d]of b)a.setParameter(c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}
260
260
  function Ya(a,b,c,d){a.F.push(b);a.setParameter(b,d(...c.map(e=>a.getParameter(e))));D(a,b,c.map(e=>new olympe.V.Dh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function E(a,b,c){a.D[b.toLowerCase()]=c}
261
- olympe.V.Zt=class{constructor(a,b){this.De=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.V.Nf.Oo,new olympe.V.Nf.Po];this.H=[];a=this.getParameter(olympe.V.Config.pv);this.N=void 0!==a?a:3;this.G=new olympe.V.sq(this.N)}Xa(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.De[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
262
- var g=this.De[f];g.id=g.id+'!!'+ ++olympe.V.bm.j;g.F=!0;g=g.id;c[h]=g;this.De[g]=this.De[f]}}this.De[f]=new olympe.V.bm(b,c,d||!1,f);return this.De[f]}setParameter(a,b){this.parameters[a.toLowerCase()]=b}wd(a){const b=this.De[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=>
261
+ olympe.V.cu=class{constructor(a,b){this.De=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.V.Nf.Po,new olympe.V.Nf.Qo];this.H=[];a=this.getParameter(olympe.V.Config.uv);this.N=void 0!==a?a:3;this.G=new olympe.V.vq(this.N)}Xa(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.V.qb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.De[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
262
+ var g=this.De[f];g.id=g.id+'!!'+ ++olympe.V.cm.j;g.F=!0;g=g.id;c[h]=g;this.De[g]=this.De[f]}}this.De[f]=new olympe.V.cm(b,c,d||!1,f);return this.De[f]}setParameter(a,b){this.parameters[a.toLowerCase()]=b}wd(a){const b=this.De[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=>
263
263
  {B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});Ma(this.G);this.G.debug('Configuration summary: '+Object.keys(this.De).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)});Ma(this.G);this.G.debug('Compilation done, returning container');return new olympe.V.Ah(this.De,this.D,this.parameters,this.F,this.N)}};function Ia(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
264
- olympe.V.bm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Vd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.V.qb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Vd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.kh().run(()=>e()):e();let g;if(0<
265
- (null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.zj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}zj(){return this.Vd}Mn(){return this.D}config(a,b,c,d,e){null===
266
- this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.Rl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.bm.j=0;olympe.V.Dh=class extends olympe.V.Tj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.V.sq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.V.oa=class extends olympe.V.Tj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.Tj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Ah.j.iu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Eg:'di.Container',EC:'di.PublicContainer'};olympe.V.Config={pv:'logging.di'};olympe.V.run([olympe.V.P.Eg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.Ai=(b,c)=>a.Ai(b,c);olympe.de().getConfig=b=>a.getParameter(b);olympe.de().getConfigNames=()=>Array.from(new Set([...Object.keys(a.parameters),...Object.keys(a.F)]));olympe.de().updateConfig=(b,c)=>a.Ai(b,c)});olympe.U={};olympe.U.gq=class{constructor(a){this.id=a||olympe.U.gq.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.U.gq.j=0;olympe.U.hC=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.U.Nh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.U.Nh.D=function(a){return new olympe.U.Nh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.U.Nh.j=function(){return new olympe.U.Nh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.U.Nh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.U.Nh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function ab(a,b){return a.j($a(b))}function bb(a){return(new TextDecoder('utf8')).decode(a)}function cb(a){const b=new olympe.U.stream.lg;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
267
- olympe.U.Il=class{D(){}j(){}H(a){return u(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.U.stream.lg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}F(){}};
268
- olympe.U.vs=a=>a.replace('+','-').replace('/','_');olympe.U.ox=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
269
- olympe.U.bn=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
270
- olympe.U.Zh=class{constructor(a){this.j=gb(new olympe.U.bn(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.D)||d.call(this,b,c)});this.values=new Map;this.D=null}set(a,b){this.values.set(a,b);this.j.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.j.delete(a)}clear(){this.j.clear();this.values.clear();return this}};function F(a,b,...c){if(!a.N)throw Error('Cannot update state before starting the state machine');if(!a.R.has(b))throw Error(`State ${b} not found`);var d;let e;var f=null!=(e=null==(d=a.D[a.D.length-1])?void 0:d.state)?e:a.F.getValue();if(null!==f){if(f===b){a.G.debug(`Move request is a no-op, state ${b} is already active or queued`);return}d=a.X.get(b);if(null!==d&&!d.has(f)){F(a,a.j,Error(`Cannot move to state ${b} from state ${f}`));return}}a.G.debug(`Plan moving to state ${b}, from state ${f}`);
264
+ olympe.V.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Vd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.V.qb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Vd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.kh().run(()=>e()):e();let g;if(0<
265
+ (null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.zj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}zj(){return this.Vd}Nn(){return this.D}config(a,b,c,d,e){null===
266
+ this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.Sl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.cm.j=0;olympe.V.Dh=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.V.vq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.V.oa=class extends olympe.V.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.qb=class extends olympe.V.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Ah.j.mu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Eg:'di.Container',IC:'di.PublicContainer'};olympe.V.Config={uv:'logging.di'};olympe.V.run([olympe.V.P.Eg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.Ai=(b,c)=>a.Ai(b,c);olympe.de().getConfig=b=>a.getParameter(b);olympe.de().getConfigNames=()=>Array.from(new Set([...Object.keys(a.parameters),...Object.keys(a.F)]));olympe.de().updateConfig=(b,c)=>a.Ai(b,c)});olympe.U={};olympe.U.jq=class{constructor(a){this.id=a||olympe.U.jq.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.U.jq.j=0;olympe.U.lC=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.U.Nh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.U.Nh.D=function(a){return new olympe.U.Nh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.U.Nh.j=function(){return new olympe.U.Nh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.U.Nh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.U.Nh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function ab(a,b){return a.j($a(b))}function bb(a){return(new TextDecoder('utf8')).decode(a)}function cb(a){const b=new olympe.U.stream.lg;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
267
+ olympe.U.Jl=class{D(){}j(){}H(a){return u(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.U.stream.lg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}F(){}};
268
+ olympe.U.ys=a=>a.replace('+','-').replace('/','_');olympe.U.tx=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
269
+ olympe.U.cn=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
270
+ olympe.U.Zh=class{constructor(a){this.j=gb(new olympe.U.cn(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.D)||d.call(this,b,c)});this.values=new Map;this.D=null}set(a,b){this.values.set(a,b);this.j.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.j.delete(a)}clear(){this.j.clear();this.values.clear();return this}};function F(a,b,...c){if(!a.N)throw Error('Cannot update state before starting the state machine');if(!a.R.has(b))throw Error(`State ${b} not found`);var d;let e;var f=null!=(e=null==(d=a.D[a.D.length-1])?void 0:d.state)?e:a.F.getValue();if(null!==f){if(f===b){a.G.debug(`Move request is a no-op, state ${b} is already active or queued`);return}d=a.X.get(b);if(null!==d&&!d.has(f)){F(a,a.j,Error(`Cannot move to state ${b} from state ${f}`));return}}a.G.debug(`Plan moving to state ${b}, from state ${f}`);
271
271
  b===a.j&&(a.G.debug("Clear transition's queue to move to error state"),a.D=[]);a.D.push({state:b,Vd:c});1===a.D.length&&jb(a).then()}function kb(a,b,c){a.H.has(b)||a.H.set(b,new Set);a.H.get(b).add(c)}
272
272
  function lb(a,b){let c=null;return(new Promise((d,e)=>{if(a.F.getValue()===b)d();else if(a.F.getValue()===a.j)e(Error(`Error state reached: ${a.j}`));else{c=()=>{let h;null==(h=a.H.get(b))||h.delete(f);let k;null==(k=a.H.get(a.j))||k.delete(g)};const f=()=>d(),g=()=>e(Error('Reached error state'));kb(a,b,f);kb(a,a.j,g)}})).finally(()=>{let d;return null==(d=c)?void 0:d()})}
273
273
  function mb(a,b,c=()=>{},d=null){if(a.N)throw Error('Cannot add state after starting the state machine');if(a.R.has(b))throw Error(`State ${b} already exists`);a.R.set(b,c);a.X.set(b,d?new Set(d):null)}function nb(a,b,c){mb(a,b,(d,e)=>u(function*(){try{yield c(d,e)}catch(f){a.G.error(`Error while processing error state ${b}: ${f}`)}}),null);a.j=b}
274
274
  function jb(a){return u(function*(){if(0!==a.D.length){var {state:b,Vd:c}=a.D[0],d=a.F.getValue();try{a.G.debug(`Start processing transition ${d} -> ${b}`);yield a.R.get(b)(d,...c);a.F.next(b);a.D.shift();a.G.debug(`New state reached: ${b}`);let e;null==(e=a.H.get(b))||e.forEach(f=>f());jb(a).then()}catch(e){a.G.debug(`Error while processing transition ${d} -> ${b}: ${e}`),F(a,a.j,e)}}})}
275
- olympe.U.Aw=class{constructor(a){this.G=a;this.N=!1;this.F=new rxjs.BehaviorSubject(null);this.R=new Map;this.X=new Map;this.j=null;this.D=[];this.H=new Map}start(a,...b){if(this.N)throw Error('State machine already started');if(null===this.j)throw Error('Error state not defined: all state machines should have an error state');this.N=!0;F(this,a,...b)}getState(){if(!this.N)throw Error('State machine not started');return this.F.getValue()}};function ob(a,b){a.R.push(b)}function pb(a,b){a.X.push(b)}function qb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>qb(a,d)):c='N/A';return c}function rb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.D};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=qb(a,g);a.F.push(b)}
276
- olympe.U.Yv=class{constructor(){this.F=[];this.R=[];this.X=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.X.forEach(a=>a()),this.j=!1)}};function sb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.U.operators={vF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.U.Promise={};olympe.U.Promise.uj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>u(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.U.Promise.Zf=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};
277
- olympe.U.Promise.nt=function(a,b,c=null){return u(function*(){for(let d=0;3>d;d++)try{return yield a(d)}catch(e){let f;if(2<=d||null!==c&&(null==(f=c)||!f.some(g=>e instanceof g)))throw e;yield new Promise(g=>setTimeout(g,b))}})};olympe.U.promise={};function tb(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=ub(a);b&&b.D.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.j(c)}).finally(()=>{a.j--;0===a.size()&&a.D.next(!1);tb(a)})}}function vb(a,b){return new Promise((c,d)=>{a.Fa.push(new olympe.U.promise.zw(c,d,b));tb(a)})}function ub(a){a.D.next(!0);let b;return null!=(b=a.Fa.shift())?b:null}
278
- olympe.U.promise.Sk=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Fa.length;)this.Fa.shift().j(Error('Canceled by a clearStack'));tb(this)}size(){return this.Fa.length}};olympe.U.promise.zw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.U.promise.Tr=class extends olympe.U.promise.Sk{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.Hj=a}F(){return this.j<this.Hj}};olympe.U.promise.ZD=class{constructor(a,...b){this.F=a;this.parameters=b;this.j=this.D=null;this.promise=new Promise((c,d)=>{this.D=c;this.j=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
275
+ olympe.U.Ew=class{constructor(a){this.G=a;this.N=!1;this.F=new rxjs.BehaviorSubject(null);this.R=new Map;this.X=new Map;this.j=null;this.D=[];this.H=new Map}start(a,...b){if(this.N)throw Error('State machine already started');if(null===this.j)throw Error('Error state not defined: all state machines should have an error state');this.N=!0;F(this,a,...b)}getState(){if(!this.N)throw Error('State machine not started');return this.F.getValue()}};function ob(a,b){a.R.push(b)}function pb(a,b){a.X.push(b)}function qb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>qb(a,d)):c='N/A';return c}function rb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.D};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=qb(a,g);a.F.push(b)}
276
+ olympe.U.bw=class{constructor(){this.F=[];this.R=[];this.X=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.X.forEach(a=>a()),this.j=!1)}};function sb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.U.operators={zF(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.U.Promise={};olympe.U.Promise.uj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>u(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.U.Promise.Zf=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};
277
+ olympe.U.Promise.rt=function(a,b,c=null){return u(function*(){for(let d=0;3>d;d++)try{return yield a(d)}catch(e){let f;if(2<=d||null!==c&&(null==(f=c)||!f.some(g=>e instanceof g)))throw e;yield new Promise(g=>setTimeout(g,b))}})};olympe.U.promise={};function tb(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=ub(a);b&&b.D.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.j(c)}).finally(()=>{a.j--;0===a.size()&&a.D.next(!1);tb(a)})}}function vb(a,b){return new Promise((c,d)=>{a.Ga.push(new olympe.U.promise.Dw(c,d,b));tb(a)})}function ub(a){a.D.next(!0);let b;return null!=(b=a.Ga.shift())?b:null}
278
+ olympe.U.promise.Tk=class{constructor(){this.Ga=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Ga.length;)this.Ga.shift().j(Error('Canceled by a clearStack'));tb(this)}size(){return this.Ga.length}};olympe.U.promise.Dw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.U.promise.Wr=class extends olympe.U.promise.Tk{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.Hj=a}F(){return this.j<this.Hj}};olympe.U.promise.cE=class{constructor(a,...b){this.F=a;this.parameters=b;this.j=this.D=null;this.promise=new Promise((c,d)=>{this.D=c;this.j=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
279
279
  function onFullfilledCallback(data) {
280
280
  self.postMessage({ type: "done", data, });
281
281
  self.close();
@@ -288,956 +288,959 @@ olympe.U.promise.Sk=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubje
288
288
  (${this.F.toString()})(onFullfilledCallback, onRejectedCallback, ...(params ?? []));
289
289
  };`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);b.terminate();if('done'===e){let f;null==(f=this.D)||f.call(this,d)}else{let f;null==(f=this.j)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.F(this.D,this.j,...this.parameters)}};olympe.U.stream={};olympe.U.stream.lg=class{constructor(){this.buffer=[];this.F=this.j=!1;this.error=this.D=null}[Symbol.asyncIterator](){const a=this;return new oa(function*(){if(a.F)throw Error('This stream is already being read');for(a.F=!0;!a.error&&(!a.j||0<a.buffer.length);)0===a.buffer.length&&(yield new ja(2,new Promise(b=>{a.D=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ja(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return u(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
290
290
  if(b.j)throw Error('Cannot write to a completed stream');b.buffer.push(a);let c;null==(c=b.D)||c.call(b)})}pipeTo(a){return new Promise(b=>{const c=this;return u(function*(){try{for(const d=ha(c);;){const e=yield d.next();if(e.done)break;yield a.write(e.value)}a.complete()}catch(d){a.throw(d)}finally{b()}})})}map(a){const b=new olympe.U.stream.lg;this.pipeTo({write:c=>u(function*(){yield b.write(a(c))}),complete:()=>{b.complete()},throw:c=>{b.throw(c)}}).catch(()=>{});return b}concat(a){const b=new olympe.U.stream.lg;
291
- this.pipeTo({write:c=>u(function*(){yield b.write(c)}),complete:()=>{a.pipeTo(b).then(()=>{b.complete()})},throw:c=>{b.throw(c)}}).catch(()=>{});return b}throw(a){this.j||(this.error=a,this.complete())}complete(){if(!this.j){this.j=!0;let a;null==(a=this.D)||a.call(this)}}};olympe.U.stream.lg.ya=[olympe.U.stream.ReadableStream,olympe.U.stream.WritableStream];olympe.U.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function wb(a,b){const c=new Worker(a.j),d=new TransformStream;c.addEventListener('message',({data:e})=>{e.pipeTo(d.writable).finally(()=>{c.terminate()})},{once:!0});c.postMessage(b,[b]);return d.readable}olympe.U.stream.Ww=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
292
- const transformedStream = (${olympe.U.stream.zk.toString()}).transform(stream);
291
+ this.pipeTo({write:c=>u(function*(){yield b.write(c)}),complete:()=>{a.pipeTo(b).then(()=>{b.complete()})},throw:c=>{b.throw(c)}}).catch(()=>{});return b}throw(a){this.j||(this.error=a,this.complete())}complete(){if(!this.j){this.j=!0;let a;null==(a=this.D)||a.call(this)}}};olympe.U.stream.lg.ya=[olympe.U.stream.ReadableStream,olympe.U.stream.WritableStream];olympe.U.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}pipeTo(){}map(){}concat(){}};function wb(a,b){const c=new Worker(a.j),d=new TransformStream;c.addEventListener('message',({data:e})=>{e.pipeTo(d.writable).finally(()=>{c.terminate()})},{once:!0});c.postMessage(b,[b]);return d.readable}olympe.U.stream.$w=class{constructor(){this.j=URL.createObjectURL(new Blob([`self.onmessage = ({ data: stream }) => {
292
+ const transformedStream = (${olympe.U.stream.Ak.toString()}).transform(stream);
293
293
  self.postMessage(transformedStream, [transformedStream]);
294
- };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.U.stream.WritableStream=class{write(){return u(function*(){})}throw(){}complete(){}};olympe.U.stream.Is=(...a)=>new ReadableStream({start(){this.cursor=0},pull(b){this.cursor<a.length?b.enqueue(a[this.cursor++]):b.close()}});olympe.U.stream.tap=a=>new TransformStream({transform(b,c){a(b);c.enqueue(b)}});
295
- olympe.U.stream.zk=class a{static transform(b){return b.pipeThrough(new TextDecoderStream).pipeThrough(a.j()).pipeThrough(a.D())}static j(){return new TransformStream({start(){this.buffer=''},transform(b,c){this.buffer+=b;for(var d=0;-1!==(b=this.buffer.indexOf('\n',d));){if(d=this.buffer.slice(d,b).trim())try{c.enqueue(JSON.parse(d))}catch(e){c.error(e);return}d=b+1}this.buffer=this.buffer.slice(d)},flush(b){if(this.buffer.trim())try{b.enqueue(JSON.parse(this.buffer))}catch(c){b.error(c)}}})}static D(){return new TransformStream({start(){this.buffer=
296
- [];this.yx=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.yx&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.U.stream.zk.transform=olympe.U.stream.zk.transform;function xb(a,b){return a+b&4294967295}
294
+ };`],{type:'application/javascript'}))}destroy(){URL.revokeObjectURL(this.j)}};olympe.U.stream.WritableStream=class{write(){return u(function*(){})}throw(){}complete(){}};olympe.U.stream.Ls=(...a)=>new ReadableStream({start(){this.cursor=0},pull(b){this.cursor<a.length?b.enqueue(a[this.cursor++]):b.close()}});olympe.U.stream.tap=a=>new TransformStream({transform(b,c){a(b);c.enqueue(b)}});
295
+ olympe.U.stream.Ak=class a{static transform(b){return b.pipeThrough(new TextDecoderStream).pipeThrough(a.j()).pipeThrough(a.D())}static j(){return new TransformStream({start(){this.buffer=''},transform(b,c){this.buffer+=b;for(var d=0;-1!==(b=this.buffer.indexOf('\n',d));){if(d=this.buffer.slice(d,b).trim())try{c.enqueue(JSON.parse(d))}catch(e){c.error(e);return}d=b+1}this.buffer=this.buffer.slice(d)},flush(b){if(this.buffer.trim())try{b.enqueue(JSON.parse(this.buffer))}catch(c){b.error(c)}}})}static D(){return new TransformStream({start(){this.buffer=
296
+ [];this.Cx=50},transform(b,c){this.buffer.push(b);this.buffer.length>=this.Cx&&(c.enqueue(this.buffer),this.buffer=[])},flush(b){0<this.buffer.length&&b.enqueue(this.buffer)}})}};olympe.U.stream.Ak.transform=olympe.U.stream.Ak.transform;function xb(a,b){return a+b&4294967295}
297
297
  function yb(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
298
298
  c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
299
299
  e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,b[5],4,-378558);f=I(c^d^e,f,c,b[8],11,-2022574463);e=I(f^c^d,e,f,b[11],16,1839030562);d=I(e^f^c,d,e,b[14],23,-35309556);c=I(d^e^f,c,d,b[1],4,-1530992060);f=I(c^d^e,f,c,b[4],11,1272893353);e=I(f^c^d,e,f,b[7],16,-155497632);d=I(e^f^c,d,e,b[10],23,-1094730640);c=I(d^e^f,c,d,b[13],4,681279174);f=I(c^d^e,f,c,b[0],11,-358537222);e=I(f^c^d,e,f,b[3],16,-722521979);d=I(e^f^c,d,e,b[6],23,76029189);c=I(d^e^f,c,d,b[9],4,-640364487);
300
300
  f=I(c^d^e,f,c,b[12],11,-421815835);e=I(f^c^d,e,f,b[15],16,530742520);d=I(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
301
301
  b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=xb(c,a[0]);a[1]=xb(d,a[1]);a[2]=xb(e,a[2]);a[3]=xb(f,a[3])}function I(a,b,c,d,e,f){b=xb(xb(b,a),xb(d,f));return xb(b<<e|b>>>32-e,c)}function G(a,b,c,d,e,f,g){return I(b&c|~b&d,a,b,e,f,g)}function H(a,b,c,d,e,f,g){return I(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return I(c^(b|~d),a,b,e,f,g)}
302
302
  function zb(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);yb(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(yb(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
303
- yb(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==zb('hello')&&(xb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.U.tb=zb;function Ab(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Bb(){var a=Math.random();return Ab((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Cb=Math.pow(2,32)-1;olympe.U.Jc=function(){return Bb()};olympe.U.hf=function(){return Bb()};olympe.U.hF=function(a,b=1){const c=a.substr(12,a.length-12);return Ab(parseInt(a.substr(0,12),16)+b)+c};
304
- olympe.U.gF=function(a){return Ab(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Db=0,Eb=0;olympe.U.Ux=function(){var a=(new Date).getTime();a<=Db?4294967295===Eb?(Eb=Math.floor(Math.random()/4*Cb),Db+=1):Eb=Math.floor(Eb+(4294967295-Eb)/2):(Eb=Math.floor(Math.random()/4*Cb),Db=a);a='00000000'+Eb.toString(16);return Ab(Db)+a.substr(a.length-8,8)};olympe.U.wF=function(){for(let a=0;1E4>a;a++)console.log(olympe.U.Ux())};
305
- olympe.U.ni=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.U.bF=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.U.YE=function(a,b){return(b?b:'UI')+'-'+a};
306
- olympe.U.Nz=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
307
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,FE:g||null,yt:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,ZE:f||null,parameters:b}};olympe.U.qF=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
308
- olympe.U.tF=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.U.fF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
309
- olympe.U.et=a=>{var b=Fb,c=Gb;return u(function*(){return(yield Promise.all(a.map(b))).map((d,e)=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(f){if(a[e].endsWith('.json'))throw Error(`Failed to parse JSON Config file: ${a[e]}: ${f}`);const g=null!=c?c:'';return d.split('\n').filter(h=>h.startsWith(g)).reduce((h,k)=>{const [l,n]=k.split('=');h['host.'+l.slice(g.length)]=olympe.U.ws(n);return h},{})}}).reduce((d,e,f)=>{olympe.U.gt(d,e,'version.json'===a[f]?'version.':
310
- '');return d},Object.create(null))})};olympe.U.ws=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.U.gt=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.U.gt(a[e],f,''):a[e]=f}};olympe.U.EE=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Fn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.U.tv=class{constructor(a,b){this.start=a;this.end=b}};olympe.U.tv.j={WB:'left',OC:'right',AA:'bottom',XD:'top'};function Hb(a){return`${a.j}.${a.D}.${a.F}`}
311
- olympe.U.Lf=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.H=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.U.Lf.j;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.U.Lf.j:new olympe.U.Lf(b,c,d,a[4])}ml(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Oj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
- a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.U.Lf.j=new olympe.U.Lf(Number.NaN,Number.NaN,Number.NaN);olympe.U.P={Dg:'utils.binaryConverter',Jt:'utils.base64Converter',ig:'utils.Profiler'};olympe.V.config(a=>{Xa(a,olympe.U.P.Dg);Wa(a,olympe.U.P.Jt,olympe.U.P.Dg,!0);C(a,olympe.U.P.ig,olympe.U.Yv)},'Utils services');olympe.V.run([olympe.U.P.Dg,olympe.U.P.ig],(a,b)=>{olympe.U.jf=()=>a;olympe.de().isProfilerEnabled=()=>b.j;olympe.de().startProfiler=()=>b.start();olympe.de().stopProfiler=()=>b.stop();olympe.de().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ha={};olympe.ha.xb=class{ka(){}H(){}F(){}j(){}ia(){}N(){}sa(){}Z(){}da(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ha.xb.prototype.fatal=olympe.ha.xb.prototype.fatal;olympe.ha.xb.prototype.error=olympe.ha.xb.prototype.error;olympe.ha.xb.prototype.warn=olympe.ha.xb.prototype.warn;olympe.ha.xb.prototype.info=olympe.ha.xb.prototype.info;olympe.ha.xb.prototype.log=olympe.ha.xb.prototype.log;olympe.ha.xb.prototype.debug=olympe.ha.xb.prototype.debug;olympe.ha.xb.prototype.trace=olympe.ha.xb.prototype.trace;
313
- olympe.ha.xb.j={Gw:0,ag:1,ov:2,nk:3,ls:4,zb:5,lu:6,kC:7};olympe.ha.xb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ha.Ta=class{ad(){}};olympe.ha.ve={};function Ib(a,b,c){a.Ga[b](`[OLYMPE.${a.X}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.X,b,...c)}}
314
- olympe.ha.ve.xb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ha.xb.j.nk:b;c&&b.subscribe(d=>{this.D=d});this.X=a.toUpperCase();this.R=new Map;this.Ga=console}ka(){return this.name}H(){return this.D}F(){return this.D<=olympe.ha.xb.j.Gw}j(){return this.D<=olympe.ha.xb.j.ag}N(){return this.D<=olympe.ha.xb.j.ov}ia(){return this.D<=olympe.ha.xb.j.nk}sa(){return this.D<=olympe.ha.xb.j.ls}Z(){return this.D<=olympe.ha.xb.j.zb}da(){return this.D<=olympe.ha.xb.j.lu}trace(...a){this.F()&&
315
- Ib(this,'trace',a)}debug(...a){this.j()&&Ib(this,'debug',a)}log(...a){this.N()&&Ib(this,'log',a)}info(...a){this.ia()&&Ib(this,'info',a)}warn(...a){this.sa()&&Ib(this,'warn',a)}error(...a){this.Z()&&Ib(this,'error',a)}fatal(...a){this.da()&&Ib(this,'error',a)}};olympe.ha.ve.xb.ya=[olympe.ha.xb];olympe.ha.ve.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.ad('logging');this.G.log('Logging initialized, global log level is '+olympe.ha.xb.D[b])}ad(a){var b=this.channels.get(a);if(!b){b=`${olympe.ha.Config.St}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Ta(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ha.Config.rw}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=
316
- !0===this.j.getParameter(b));b=new olympe.ha.ve.xb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ha.ve.Ta.ya=[olympe.ha.Ta];olympe.ha.P={Da:'logging.Manager'};olympe.ha.Config={Fp:'logging',Gp:'logging.showLogLevel',St:'logging',rw:'showLogLevel'};olympe.V.config(function(a){E(a,olympe.ha.Config.Fp,olympe.ha.xb.j.nk);E(a,olympe.ha.Config.Gp,!0);Va(a,olympe.ha.P.Da,olympe.ha.ve.Ta,olympe.V.P.Eg,new olympe.V.oa(olympe.ha.Config.Fp),new olympe.V.oa(olympe.ha.Config.Gp))},'olympe.logging');olympe.V.run([olympe.ha.P.Da],a=>{olympe.ha.Xa=b=>a.ad(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.Config={yq:'df.nodeCreationThreshold'};const Jb=[];function Kb(){}function Lb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Kb:b;this.D=void 0===c?Jb:c;this.X=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.Z:new a(Lb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Jb}N(){return null===this.j&&null===this.D}R(){return this.j===Lb}};olympe.C.J.X=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.Z=new olympe.C.J(Lb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.$);
317
- olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ba);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Fh=class{T(){return''}Dn(){return''}destroy(){}fb(){return!1}hd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}tt(){}ne(){}detach(){}dl(){}rg(){}onDestroy(){return''}Wf(){}Xd(){return''}it(){}};olympe.C.Fh.prototype.offDestroy=olympe.C.Fh.prototype.Wf;olympe.C.Fh.prototype.onDestroy=olympe.C.Fh.prototype.onDestroy;let Mb=0;olympe.V.run([new olympe.V.oa(olympe.C.Config.yq)],()=>{});
318
- olympe.C.Wb=class{constructor(a='SimpleContext',b){++Mb;this.da=new Map;this.Z=new Map;this.X=new Map;this.Ga=0;this.name=a;this.id=String(Mb);this.F=this.ia=!1;(this.N=void 0===b?olympe.C.Za():b)&&this.N.ne(this);this.debug=!1}T(){return this.id}Dn(){return this.name}run(a,...b){if(!this.ia){var c=olympe.C.st(this);a=a(...b);c&&olympe.C.st(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ia&&!this.F){this.F=!0;this.rg();for(const a of this.Z.keys())this.Z.has(a)&&this.Z.get(a)();
319
- this.Z.clear();this.X.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ia=!0;this.F=!1;this.rg()}}fb(){return this.ia}hd(){return this.F}ne(a){if(!this.ia){var b;olympe.C.gb(a)?b=a.Ba:olympe.C.Pn(a)&&(b=a);b&&this.da.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Pn(a)&&(c=a);c&&this.da.has(c.T())&&(b&&c.dl(this),this.da.delete(c.T()))}dl(){this.N=null;this.destroy()}rg(){const a=this.da;for(const b of a.keys())a.has(b)&&a.get(b).dl(this);this.da.clear();for(const b of this.X.keys())this.X.has(b)&&
320
- this.X.get(b)();this.X.clear()}onDestroy(a,b){void 0===b&&(++this.Ga,b=String(this.Ga));this.Z.set(b,a);return b}Wf(a){this.Z.delete(a)}Xd(a){if(void 0===b){++this.Ga;var b=String(this.Ga)}this.X.set(b,a);return b}it(a){this.X.delete(a)}tt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.ne(this)}getParent(){return this.N}};olympe.C.Cr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Wf(){}};olympe.C.Fh.ya=[olympe.C.Fh];let Nb=0;
321
- function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Ic()){case olympe.C.Node.j.Oh:break;case olympe.C.Node.j.ai:break;case olympe.C.Node.j.uk:case olympe.C.Node.j.cg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Gh:Pb(a,olympe.C.Node.j.Gh);break;case olympe.C.Node.j.OBSOLETE:a.lb=!0;a.j!==olympe.C.Node.j.Gh&&Pb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Zd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
322
- default:olympe.C.G.warn('Unknown state, investigate: ',b.Ic())}Qb(b,a)}
323
- function Rb(a){if(a.Kc){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.C.Node)if(Sb(a.Xf))b=a.Xf.Eb;else return;else b=a.Xf;else b=null;if(null!==a.Vd){const e=a.qg;for(let f=0,g=a.Vd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Vd[f];if(Sb(h))c.push(h.Eb);else return}else c.push(a.Vd[f])}if(a.Kc instanceof Function)var d=a.Kc;else b&&(b[a.Kc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Kc),d=b[a.Kc]);a.run(()=>{a.rg();if(void 0!==d){const e=d.apply(b,c);e&&e.qs?
303
+ yb(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==zb('hello')&&(xb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.U.rb=zb;function Ab(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Bb(){var a=Math.random();return Ab((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Cb=Math.pow(2,32)-1;olympe.U.Kc=function(){return Bb()};olympe.U.hf=function(){return Bb()};olympe.U.lF=function(a,b=1){const c=a.substr(12,a.length-12);return Ab(parseInt(a.substr(0,12),16)+b)+c};
304
+ olympe.U.kF=function(a){return Ab(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Db=0,Eb=0;olympe.U.Yx=function(){var a=(new Date).getTime();a<=Db?4294967295===Eb?(Eb=Math.floor(Math.random()/4*Cb),Db+=1):Eb=Math.floor(Eb+(4294967295-Eb)/2):(Eb=Math.floor(Math.random()/4*Cb),Db=a);a='00000000'+Eb.toString(16);return Ab(Db)+a.substr(a.length-8,8)};olympe.U.AF=function(){for(let a=0;1E4>a;a++)console.log(olympe.U.Yx())};
305
+ olympe.U.ni=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.U.fF=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.U.bF=function(a,b){return(b?b:'UI')+'-'+a};
306
+ olympe.U.Qz=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
307
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,JE:g||null,Ct:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,cF:f||null,parameters:b}};olympe.U.uF=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
308
+ olympe.U.xF=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.U.jF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
309
+ olympe.U.it=a=>{var b=Fb,c=Gb;return u(function*(){return(yield Promise.all(a.map(b))).map((d,e)=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(f){if(a[e].endsWith('.json'))throw Error(`Failed to parse JSON Config file: ${a[e]}: ${f}`);const g=null!=c?c:'';return d.split('\n').filter(h=>h.startsWith(g)).reduce((h,k)=>{const [l,n]=k.split('=');h['host.'+l.slice(g.length)]=olympe.U.zs(n);return h},{})}}).reduce((d,e,f)=>{olympe.U.kt(d,e,'version.json'===a[f]?'version.':
310
+ '');return d},Object.create(null))})};olympe.U.zs=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.U.kt=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.U.kt(a[e],f,''):a[e]=f}};olympe.U.IE=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Gn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.U.xv=class{constructor(a,b){this.start=a;this.end=b}};olympe.U.xv.j={$B:'left',SC:'right',EA:'bottom',aE:'top'};function Hb(a){return`${a.j}.${a.D}.${a.F}`}
311
+ olympe.U.Lf=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.H=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.U.Lf.j;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.U.Lf.j:new olympe.U.Lf(b,c,d,a[4])}nl(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Pj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
312
+ a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.U.Lf.j=new olympe.U.Lf(Number.NaN,Number.NaN,Number.NaN);olympe.U.P={Dg:'utils.binaryConverter',Nt:'utils.base64Converter',ig:'utils.Profiler'};olympe.V.config(a=>{Xa(a,olympe.U.P.Dg);Wa(a,olympe.U.P.Nt,olympe.U.P.Dg,!0);C(a,olympe.U.P.ig,olympe.U.bw)},'Utils services');olympe.V.run([olympe.U.P.Dg,olympe.U.P.ig],(a,b)=>{olympe.U.jf=()=>a;olympe.de().isProfilerEnabled=()=>b.j;olympe.de().startProfiler=()=>b.start();olympe.de().stopProfiler=()=>b.stop();olympe.de().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ha={};olympe.ha.xb=class{ka(){}H(){}F(){}j(){}ia(){}N(){}sa(){}Z(){}da(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ha.xb.prototype.fatal=olympe.ha.xb.prototype.fatal;olympe.ha.xb.prototype.error=olympe.ha.xb.prototype.error;olympe.ha.xb.prototype.warn=olympe.ha.xb.prototype.warn;olympe.ha.xb.prototype.info=olympe.ha.xb.prototype.info;olympe.ha.xb.prototype.log=olympe.ha.xb.prototype.log;olympe.ha.xb.prototype.debug=olympe.ha.xb.prototype.debug;olympe.ha.xb.prototype.trace=olympe.ha.xb.prototype.trace;
313
+ olympe.ha.xb.j={Kw:0,ag:1,tv:2,pk:3,ps:4,Ab:5,pu:6,oC:7};olympe.ha.xb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ha.Ta=class{ad(){}};olympe.ha.ve={};function Ib(a,b,c){a.Ha[b](`[OLYMPE.${a.X}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.X,b,...c)}}
314
+ olympe.ha.ve.xb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ha.xb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.X=a.toUpperCase();this.R=new Map;this.Ha=console}ka(){return this.name}H(){return this.D}F(){return this.D<=olympe.ha.xb.j.Kw}j(){return this.D<=olympe.ha.xb.j.ag}N(){return this.D<=olympe.ha.xb.j.tv}ia(){return this.D<=olympe.ha.xb.j.pk}sa(){return this.D<=olympe.ha.xb.j.ps}Z(){return this.D<=olympe.ha.xb.j.Ab}da(){return this.D<=olympe.ha.xb.j.pu}trace(...a){this.F()&&
315
+ Ib(this,'trace',a)}debug(...a){this.j()&&Ib(this,'debug',a)}log(...a){this.N()&&Ib(this,'log',a)}info(...a){this.ia()&&Ib(this,'info',a)}warn(...a){this.sa()&&Ib(this,'warn',a)}error(...a){this.Z()&&Ib(this,'error',a)}fatal(...a){this.da()&&Ib(this,'error',a)}};olympe.ha.ve.xb.ya=[olympe.ha.xb];olympe.ha.ve.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.ad('logging');this.G.log('Logging initialized, global log level is '+olympe.ha.xb.D[b])}ad(a){var b=this.channels.get(a);if(!b){b=`${olympe.ha.Config.Wt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Ta(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ha.Config.vw}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=
316
+ !0===this.j.getParameter(b));b=new olympe.ha.ve.xb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ha.ve.Ta.ya=[olympe.ha.Ta];olympe.ha.P={Fa:'logging.Manager'};olympe.ha.Config={Gp:'logging',Hp:'logging.showLogLevel',Wt:'logging',vw:'showLogLevel'};olympe.V.config(function(a){E(a,olympe.ha.Config.Gp,olympe.ha.xb.j.pk);E(a,olympe.ha.Config.Hp,!0);Va(a,olympe.ha.P.Fa,olympe.ha.ve.Ta,olympe.V.P.Eg,new olympe.V.oa(olympe.ha.Config.Gp),new olympe.V.oa(olympe.ha.Config.Hp))},'olympe.logging');olympe.V.run([olympe.ha.P.Fa],a=>{olympe.ha.Xa=b=>a.ad(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.Config={Bq:'df.nodeCreationThreshold'};const Jb=[];function Kb(){}function Lb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Kb:b;this.D=void 0===c?Jb:c;this.X=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.Z:new a(Lb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Jb}N(){return null===this.j&&null===this.D}R(){return this.j===Lb}};olympe.C.J.X=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.Z=new olympe.C.J(Lb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.$);
317
+ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ba);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Fh=class{T(){return''}En(){return''}destroy(){}fb(){return!1}hd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}xt(){}ne(){}detach(){}el(){}rg(){}onDestroy(){return''}Wf(){}Xd(){return''}mt(){}};olympe.C.Fh.prototype.offDestroy=olympe.C.Fh.prototype.Wf;olympe.C.Fh.prototype.onDestroy=olympe.C.Fh.prototype.onDestroy;let Mb=0;olympe.V.run([new olympe.V.oa(olympe.C.Config.Bq)],()=>{});
318
+ olympe.C.Wb=class{constructor(a='SimpleContext',b){++Mb;this.da=new Map;this.Z=new Map;this.X=new Map;this.Ha=0;this.name=a;this.id=String(Mb);this.F=this.ia=!1;(this.N=void 0===b?olympe.C.Za():b)&&this.N.ne(this);this.debug=!1}T(){return this.id}En(){return this.name}run(a,...b){if(!this.ia){var c=olympe.C.wt(this);a=a(...b);c&&olympe.C.wt(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ia&&!this.F){this.F=!0;this.rg();for(const a of this.Z.keys())this.Z.has(a)&&this.Z.get(a)();
319
+ this.Z.clear();this.X.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ia=!0;this.F=!1;this.rg()}}fb(){return this.ia}hd(){return this.F}ne(a){if(!this.ia){var b;olympe.C.gb(a)?b=a.Ba:olympe.C.Qn(a)&&(b=a);b&&this.da.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Qn(a)&&(c=a);c&&this.da.has(c.T())&&(b&&c.el(this),this.da.delete(c.T()))}el(){this.N=null;this.destroy()}rg(){const a=this.da;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.da.clear();for(const b of this.X.keys())this.X.has(b)&&
320
+ this.X.get(b)();this.X.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.Z.set(b,a);return b}Wf(a){this.Z.delete(a)}Xd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.X.set(b,a);return b}mt(a){this.X.delete(a)}xt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.ne(this)}getParent(){return this.N}};olympe.C.Fr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Wf(){}};olympe.C.Fh.ya=[olympe.C.Fh];let Nb=0;
321
+ function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Jc()){case olympe.C.Node.j.Oh:break;case olympe.C.Node.j.ai:break;case olympe.C.Node.j.vk:case olympe.C.Node.j.cg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Gh:Pb(a,olympe.C.Node.j.Gh);break;case olympe.C.Node.j.OBSOLETE:a.nb=!0;a.j!==olympe.C.Node.j.Gh&&Pb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Zd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
322
+ default:olympe.C.G.warn('Unknown state, investigate: ',b.Jc())}Qb(b,a)}
323
+ function Rb(a){if(a.Lc){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.C.Node)if(Sb(a.Xf))b=a.Xf.Eb;else return;else b=a.Xf;else b=null;if(null!==a.Vd){const e=a.qg;for(let f=0,g=a.Vd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Vd[f];if(Sb(h))c.push(h.Eb);else return}else c.push(a.Vd[f])}if(a.Lc instanceof Function)var d=a.Lc;else b&&(b[a.Lc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Lc),d=b[a.Lc]);a.run(()=>{a.rg();if(void 0!==d){const e=d.apply(b,c);e&&e.us?
324
324
  Tb(a,e.Ba):e instanceof olympe.C.Node?Tb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Pb(a,olympe.C.Node.j.ai))}else Ub(a)})}}function M(a){void 0===a.Wa&&(a.Wa=a.valueType===olympe.C.Proxy?Vb(void 0,a.yb):Vb(a.valueType,a.yb),a.Wa.Ba=a);return a.Wa}function Wb(a){void 0!==a.D&&(Xb(a.D,a),a.D=void 0)}function Yb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.ai,null!==a.H))for(const b of a.H.values())Zb(b)}function Pb(a,b){b!==a.j&&(a.j=b)}
325
- function $b(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.uk&&a.j!==olympe.C.Node.j.Oh&&a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.uk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&$b(c);Pb(a,olympe.C.Node.j.OBSOLETE)}}function ac(a,b,c){if(a.j!==olympe.C.Node.j.cg)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.uk)a.lb=!0;Rb(a)}}
325
+ function $b(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.vk&&a.j!==olympe.C.Node.j.Oh&&a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.vk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&$b(c);Pb(a,olympe.C.Node.j.OBSOLETE)}}function ac(a,b,c){if(a.j!==olympe.C.Node.j.cg)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.vk)a.nb=!0;Rb(a)}}
326
326
  function L(a,b,c){b instanceof olympe.C.Node&&(olympe.C.G.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Eb);a.sa||c||void 0===a.D||Wb(a);if(void 0!==b){if((a.sa||a.j===olympe.C.Node.j.ai||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.gb(b)&&void 0!==a.Eb){if(null===b&&null===a.Eb){Yb(a);return}if(null!==b&&null!==a.Eb&&(b.valueOf()===a.Eb.valueOf()||a.Eb.Ea&&a.Eb.Ea(b))){Yb(a);return}}if(!0===a.sa)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
327
327
  a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.Zd&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.$c?', '+a.$c:''})`);a.j===olympe.C.Node.j.cg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.$c?', '+a.$c:''})`);a.sa=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
328
328
  Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.wb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.$?(c=olympe.C.qa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.ba&&(c=olympe.C.Rb(c),d=!1)));a.Eb=c;Pb(a,olympe.C.Node.j.ai);if(b=a.H){d=0;for(const f of b.values())0<d&&$b(f),d++;for(const f of b.values())ac(f,a,c)}a.sa=!1}}}
329
- function bc(a,b){if(a.j!==olympe.C.Node.j.cg&&a.j!==olympe.C.Node.j.Zd&&(a.j!==olympe.C.Node.j.Oh||a.Kc)){var c=void 0!==a.defaultValue;a.Kc&&b!==a.D&&a.rg();if(c)L(a,a.defaultValue,!0);else if(a.Eb=void 0,Pb(a,olympe.C.Node.j.Oh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.Gh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.rg();void 0!==a.D&&Wb(a);a.Eb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.ai}
330
- function Tb(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Wb(a),Qb(b,a),Sb(b)?L(a,b.Eb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):bc(a),a.D=b)}function cc(a,b){a.Kc&&(a.Kc=void 0);a.$c='Repeater';Tb(a,b)}function Zb(a){a.D?Yb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Sb(b)).length&&(a.lb&&(a.lb=!1,Rb(a)),Yb(a))}
329
+ function bc(a,b){if(a.j!==olympe.C.Node.j.cg&&a.j!==olympe.C.Node.j.Zd&&(a.j!==olympe.C.Node.j.Oh||a.Lc)){var c=void 0!==a.defaultValue;a.Lc&&b!==a.D&&a.rg();if(c)L(a,a.defaultValue,!0);else if(a.Eb=void 0,Pb(a,olympe.C.Node.j.Oh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Gh){Pb(a,olympe.C.Node.j.Gh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.rg();void 0!==a.D&&Wb(a);a.Eb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.ai}
330
+ function Tb(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Wb(a),Qb(b,a),Sb(b)?L(a,b.Eb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):bc(a),a.D=b)}function cc(a,b){a.Lc&&(a.Lc=void 0);a.$c='Repeater';Tb(a,b)}function Zb(a){a.D?Yb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Sb(b)).length&&(a.nb&&(a.nb=!1,Rb(a)),Yb(a))}
331
331
  function Qb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.Zd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Xb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),dc(a)))}function dc(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
332
- olympe.C.Node=class extends olympe.C.Wb{constructor({valueType:a,Kc:b,Sz:c=!0,Xf:d,Ln:e,debug:f=!1,qg:g=null,$c:h='Node',qj:k}={}){++Nb;super(String(Nb));this.debug=!!f;this.$c=h;h&&'string'===typeof h||(b?this.$c=b.name?b.name:'anon()':this.$c='Node');this.Vd=e&&0<e.length?e:null;this.qg=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.sa=!1;this.j=olympe.C.Node.j.Oh;this.lb=!1;this.H=this.R=null;this.Kc=b;this.Xf=d||null;this.defaultValue=this.Wa=this.D=void 0;this.qj=k;d&&d instanceof
333
- olympe.C.Node&&Ob(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ob(this,a);c&&Rb(this)}wh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Oh&&L(this,a,!0);return this}sj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Za()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.$c}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Ic(){return this.j}fb(){return this.j===olympe.C.Node.j.Zd}hd(){return this.j===
334
- olympe.C.Node.j.cg}yb(...a){if(this.qj instanceof Function)return this.qj(...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.Ic();a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd||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.gb(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.fh&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
- Kc:c,Xf:this,Ln:e,debug:!1,qg:b,$c:'Proxy.'+c+'()'}))}dl(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.tt(null);dc(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd){Pb(this,olympe.C.Node.j.cg);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());
336
- 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())&&Xb(c,this);this.R.clear()}this.R=null;this.D&&(Xb(this.D,this),this.D=void 0);this.Eb=void 0;this.Vd&&(this.Vd.length=0,this.Vd=null);this.qg&&(this.qg.length=0,this.qg=null);this.qj=this.Kc=void 0;this.defaultValue=this.Xf=null;this.$c=`** Destroyed ** ${this.$c}`;Pb(this,olympe.C.Node.j.Zd)}}Dn(){return this.$c}print(){const a=this.Kc?this.Kc instanceof
337
- Function?this.Kc.name?this.Kc.name:'()':this.Kc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.$c?' '+this.$c:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Oh:0,ai:1,Gh:3,uk:4,OBSOLETE:5,cg:6,Zd:7};function Vb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create(ec(c,a.prototype));c.di=a;c.rs=b;return c}function ec(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Nm)||Object.defineProperty(b,olympe.C.Proxy.Nm,{enumerable:!1,configurable:!1,writable:!1,value:fc(a,b)});return b[olympe.C.Proxy.Nm]}
332
+ olympe.C.Node=class extends olympe.C.Wb{constructor({valueType:a,Lc:b,Vz:c=!0,Xf:d,Mn:e,debug:f=!1,qg:g=null,$c:h='Node',qj:k}={}){++Nb;super(String(Nb));this.debug=!!f;this.$c=h;h&&'string'===typeof h||(b?this.$c=b.name?b.name:'anon()':this.$c='Node');this.Vd=e&&0<e.length?e:null;this.qg=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.sa=!1;this.j=olympe.C.Node.j.Oh;this.nb=!1;this.H=this.R=null;this.Lc=b;this.Xf=d||null;this.defaultValue=this.Wa=this.D=void 0;this.qj=k;d&&d instanceof
333
+ olympe.C.Node&&Ob(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ob(this,a);c&&Rb(this)}wh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Oh&&L(this,a,!0);return this}sj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Za()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.$c}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Jc(){return this.j}fb(){return this.j===olympe.C.Node.j.Zd}hd(){return this.j===
334
+ olympe.C.Node.j.cg}yb(...a){if(this.qj instanceof Function)return this.qj(...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.Jc();a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd||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.gb(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.fh&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
335
+ Lc:c,Xf:this,Mn:e,debug:!1,qg:b,$c:'Proxy.'+c+'()'}))}el(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.xt(null);dc(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.cg&&a!==olympe.C.Node.j.Zd){Pb(this,olympe.C.Node.j.cg);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());
336
+ 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())&&Xb(c,this);this.R.clear()}this.R=null;this.D&&(Xb(this.D,this),this.D=void 0);this.Eb=void 0;this.Vd&&(this.Vd.length=0,this.Vd=null);this.qg&&(this.qg.length=0,this.qg=null);this.qj=this.Lc=void 0;this.defaultValue=this.Xf=null;this.$c=`** Destroyed ** ${this.$c}`;Pb(this,olympe.C.Node.j.Zd)}}En(){return this.$c}print(){const a=this.Lc?this.Lc instanceof
337
+ Function?this.Lc.name?this.Lc.name:'()':this.Lc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.$c?' '+this.$c:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Oh:0,ai:1,Gh:3,vk:4,OBSOLETE:5,cg:6,Zd:7};function Vb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create(ec(c,a.prototype));c.di=a;c.vs=b;return c}function ec(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Om)||Object.defineProperty(b,olympe.C.Proxy.Om,{enumerable:!1,configurable:!1,writable:!1,value:fc(a,b)});return b[olympe.C.Proxy.Om]}
338
338
  function gc(a,b){if(a.di!==b){a.di=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=ec(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.sj(b)}}
339
- function fc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ec(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Sb(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.X,c[d]=function(...f){f=this.rs.call(this.Ba,
339
+ function fc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ec(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Sb(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.X,c[d]=function(...f){f=this.vs.call(this.Ba,
340
340
  ...f,e,d);const g=e.X;if(g){const h=this.Ba.Eb;h&&h[g]&&gc(f,h[g])}return e.R()?this:f})}});return c}function hc(a,b){L(a.Ba,b)}function ic(a){bc(a.Ba)}function jc(a,b){cc(a.Ba,olympe.C.Uf(b)?b:b.Ba)}function kc(a,b){olympe.C.gb(b)||olympe.C.Uf(b)?jc(a,b):hc(a,b)}
341
- olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.di=a;this.rs=b}static gb(a){return!(!a||!a.fh)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Jd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ba.D:olympe.C.ba.j:b.valueOf()===c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba)}asObservable(a){return this.Ba.asObservable(a)}qs(){return this.Ba}};olympe.C.Proxy.Nm='__opp__';olympe.C.Proxy.prototype.fh=!0;function lc(a,b){a.node.wh(b);return a}olympe.C.kk=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.gb(a)?L(this.node,olympe.C.Pa(a)):L(this.node,a);return this}repeat(a){cc(this.node,olympe.C.gb(a)?a.Ba:a);return this}clear(){bc(this.node);return this}sb(){return M(this.node)}getContext(){return this.node}};function mc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.$),g=d||olympe.C.$.kp.qq;let h,k,l,n;f.update(olympe.C.qa(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.C.qa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.sb()}
342
- olympe.C.$=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.qa(b.value)}eo(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.eo())}Vc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.wb(''):olympe.C.wb(this.value.toString())}toString(a,b){return void 0!==
343
- this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.eo()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.$,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.qa(c))};a.forEach((f,g)=>{olympe.C.Uc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
344
- g===c&&e()}});return d.sb()}ge(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()+c.valueOf()),olympe.C.$,'ONumber.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()-c.valueOf()),olympe.C.$,'ONumber.minus')}round(){return olympe.C.qa(Math.round(this.valueOf()))}Pj(){return olympe.C.qa(-this.valueOf())}ql(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()*c.valueOf()),olympe.C.$,'ONumber.mul')}vj(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()/
345
- c.valueOf()),olympe.C.$,'ONumber.div')}uz(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()%c.valueOf()),olympe.C.$,'ONumber.div')}floor(){return olympe.C.qa(Math.floor(this.valueOf()))}ceil(){return olympe.C.qa(Math.ceil(this.valueOf()))}trunc(){return olympe.C.qa(Math.trunc(this.valueOf()))}log(){return olympe.C.qa(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(Math.pow(b.valueOf(),c.valueOf())),olympe.C.$,'ONumber.pow')}exp(){return olympe.C.qa(Math.exp(this.valueOf()))}Jd(a){return olympe.C.ta([this,
346
- a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.ba,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Hy(){return this.valueOf()}On(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isBiggerThan')}Yz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsBiggest')}ot(a){return olympe.C.ta([this,
347
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsSmallest')}kz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isSmallerThan')}sin(){return olympe.C.qa(Math.sin(this.valueOf()))}cos(){return olympe.C.qa(Math.cos(this.valueOf()))}atan2(a){return olympe.C.gb(a)?olympe.C.xe([a],b=>olympe.C.qa(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.$):olympe.C.qa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.qa(Math.abs(this.valueOf()))}Ij(a,
348
- b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.$):olympe.C.qa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Zw(a,b,c,d){'number'===typeof a&&(a=olympe.C.fe(a));'number'===typeof b&&(b=olympe.C.fe(b));'number'===typeof c&&(c=olympe.C.fe(c));let e=0;const f=olympe.C.fe(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.On(c),()=>{olympe.ha.Xa('df').warn('You have a min bigger than max, cap your inputs')});
349
- const k=(l,n)=>{n=olympe.C.fe(n);const p=olympe.C.$.animate(n,500);jc(f,p);hc(n,olympe.C.qa(l));e=l};olympe.C.xe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):jc(f,olympe.C.fe(e))},olympe.C.$);void 0!==b&&olympe.C.Rn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(g);L(n.Ba,l);e=g;jc(f,p)}});void 0!==c&&olympe.C.Rn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(h);L(n.Ba,l);e=h;jc(f,p)}});
350
- return f}static offset(a){let b;return olympe.C.xe([a],c=>{void 0===b&&(b=c);return olympe.C.qa(c-b)},olympe.C.$,'offset')}static Ds(a){let b,c,d;return olympe.C.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.qa(0);d=window.performance.now();const f=olympe.C.qa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.$,'derivative')}static cz(a){let b=olympe.C.qa(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.qa(0);e=window.performance.now();
351
- b=b.ge((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.$,'integrate')}static Ix(a){let b;return olympe.C.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.qa(c.valueOf()-b.valueOf());b=c;return d},olympe.C.$,'diff')}static xx(a,b,c){return olympe.C.xe([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.C.qa(d>=e?d<=f?d:f:e)},olympe.C.$)}static animate(a,b,c,d){let e;return e=olympe.C.ta([a],
352
- f=>{const g=olympe.C.Pa(b,1E3),h=olympe.C.Pa(e);return void 0===h?olympe.C.qa(f):mc(h,f,g,c,k=>{d&&d(k)})},olympe.C.$)}static mx(a,b,c){let d,e,f,g,h,k,l=olympe.C.fe(),n;olympe.C.Uc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);hc(l,olympe.C.qa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Vc(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.wb(b.valueOf().toString()),
353
- olympe.C.Sa):olympe.C.wb(a)}static Pj(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.qa(-b.valueOf()),olympe.C.$):olympe.C.qa(-a.valueOf())}static ge(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ta([a,b],(c,d)=>olympe.C.qa(c.valueOf()+d.valueOf()),olympe.C.$,'plus'):olympe.C.qa(a.valueOf()+b.valueOf())}static uh(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()-d.valueOf()),olympe.C.$,'minus'):olympe.C.qa(a.valueOf()-b.valueOf())}static vj(a,
354
- b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()/d.valueOf()),olympe.C.$,'div'):olympe.C.qa(a.valueOf()/b.valueOf())}static Qz(a,b){if(void 0===b)return a;olympe.C.Uc([b],c=>{c=olympe.C.qa(a.Ba.Eb.valueOf()+c.valueOf());L(a.Ba,c)},'plusEqual');return a}};olympe.C.$.ZERO=new olympe.C.$(0);olympe.C.$.ONE=new olympe.C.$(1);olympe.C.$.Jw=new olympe.C.$(2);olympe.C.$.PI=new olympe.C.$(Math.PI);olympe.C.$.Cu=new olympe.C.$(Infinity);olympe.C.$.zv=new olympe.C.$(-Infinity);
355
- olympe.C.$.xq=new olympe.C.$(NaN);olympe.C.$.GC=olympe.C.$.Qz;olympe.C.$.rA=olympe.C.$.Zw;olympe.C.$.uC=olympe.C.$.offset;olympe.C.$.ZA=olympe.C.$.Ds;olympe.C.$.RE=olympe.C.$.Ds;olympe.C.$.VB=olympe.C.$.cz;olympe.C.$.$A=olympe.C.$.Ix;olympe.C.$.HA=olympe.C.$.xx;olympe.C.$.sA=olympe.C.$.animate;olympe.C.$.tA=olympe.C.$.mx;olympe.C.$.$D=olympe.C.$.Vc;olympe.C.$.aE=olympe.C.$.Pj;olympe.C.$.FC=olympe.C.$.ge;olympe.C.$.iC=olympe.C.$.uh;olympe.C.$.aB=olympe.C.$.vj;
356
- olympe.C.$.kp={qq:function(a,b,c,d){return c*a/d+b},uB:function(a,b,c,d){a/=d;return c*a*a+b},EB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},qB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},jB:function(a,b,c,d){a/=d;return c*a*a*a+b},AB:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},oB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},vB:function(a,b,c,d){a/=d;return c*a*a*a*a+b},FB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
357
- rB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},wB:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},GB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},sB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},xB:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},HB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},tB:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},mB:function(a,b,c,d){return c*Math.pow(2,
358
- 10*(a/d-1))+b},DB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},pB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},iB:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},zB:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},nB:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},dB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},eB:function(a,b,c,d){d=(a/=d)*a;return b+
359
- c*(2*d*d+2*d*a+-3*d)},fB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},gB:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},CB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},BB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},lB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},kB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},yB:function(a,
360
- b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},hB:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.C.$.prototype;m.toJSON.K=olympe.C.J.j;m.eo.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Vc.K=olympe.C.J.D;
361
- m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ge.K=new olympe.C.J(()=>olympe.C.$,[0]);m.uh.K=new olympe.C.J(()=>olympe.C.$,[0]);m.round.K=olympe.C.J.F;m.Pj.K=olympe.C.J.F;m.ql.K=new olympe.C.J(()=>olympe.C.$,[0]);m.vj.K=new olympe.C.J(()=>olympe.C.$,[0]);m.uz.K=new olympe.C.J(()=>olympe.C.$,[0]);m.floor.K=olympe.C.J.F;m.ceil.K=olympe.C.J.F;m.trunc.K=olympe.C.J.F;m.log.K=olympe.C.J.F;m.pow.K=new olympe.C.J(()=>olympe.C.$,[0]);m.exp.K=olympe.C.J.F;
362
- m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.On.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Yz.K=new olympe.C.J(()=>olympe.C.$,[0]);m.ot.K=new olympe.C.J(()=>olympe.C.$,[0]);m.kz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.sin.K=olympe.C.J.F;m.cos.K=olympe.C.J.F;m.atan2.K=new olympe.C.J(()=>olympe.C.$,[0]);m.abs.K=olympe.C.J.F;m.Ij.K=new olympe.C.J(()=>olympe.C.$,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.wb(b.value)}As(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.wb(d)},olympe.C.Sa,'OString.concat')}Vc(){return this}kA(a){return olympe.C.qa(parseInt(this.value,
363
- a))}vt(){return olympe.C.qa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Jd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ba,'OString.oEquals')}nf(){return olympe.C.Rb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
364
- olympe.C.ba,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Rb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ba,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Fn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ba,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.qa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
365
- olympe.C.$,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.qa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.$,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}Fn(){return olympe.C.qa(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.wb(this.value.toLowerCase())}toUpperCase(){return olympe.C.wb(this.value.toUpperCase())}trim(){return olympe.C.wb(this.value.trim())}padStart(a,
366
- b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}gA(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().substr(d.valueOf(),
367
- e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.wb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.uw=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.As.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Vc.K=olympe.C.J.D;m.kA.K=olympe.C.J.F;m.vt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.nf.K=olympe.C.J.N;
368
- m.contains.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.Fn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
369
- m.replace.K=olympe.C.J.D;m.gA.K=olympe.C.J.D;olympe.C.ba=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ba.D:olympe.C.ba.j}and(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()&&b.valueOf()),olympe.C.ba,'and'):this.value&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Jd(a){if(void 0!==a)return olympe.C.gb(a)?
370
- olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()===b.valueOf()),olympe.C.ba,'oEquals'):this.Ea(a)?olympe.C.ba.D:olympe.C.ba.j}zd(){return this.value?olympe.C.ba.j:olympe.C.ba.D}lx(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(!(this.valueOf()&&b.valueOf())),olympe.C.ba,'andNot'):this.value&&!a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}or(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()||b.valueOf()),olympe.C.ba,'or'):this.value||a.valueOf()?
371
- olympe.C.ba.D:olympe.C.ba.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Rb(b&&!c||!b&&c)},olympe.C.ba,'OBoolean.xor')}Wx(){return this.value}Rs(){return!0===this.value?olympe.C.$.ONE:olympe.C.$.ZERO}Vc(){return olympe.C.wb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ba.D=new olympe.C.ba(!0);olympe.C.ba.j=new olympe.C.ba(!1);m=olympe.C.ba.prototype;m.toJSON.K=olympe.C.J.j;
372
- m.and.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.zd.K=olympe.C.J.N;m.lx.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.or.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.xor.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Wx.K=new olympe.C.J(()=>Boolean,[]);m.Rs.K=olympe.C.J.F;m.Vc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;function nc(a){return new olympe.C.eb(new Date(a))}
373
- olympe.C.eb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.eb(new Date(b.value.valueOf()))}static now(){return new olympe.C.eb(new Date)}iq(){return this.rb&&!isNaN(this.rb.getTime())?olympe.C.ba.D:olympe.C.ba.j}Ju(){return olympe.C.qa(this.rb.getMilliseconds())}Lu(){return olympe.C.qa(this.rb.getSeconds())}Ku(){return olympe.C.qa(this.rb.getMinutes())}Iu(){return olympe.C.qa(this.rb.getHours())}my(){return olympe.C.qa(this.rb.getDate())}getMonth(){return olympe.C.qa(this.rb.getMonth()+1)}Mu(){return olympe.C.qa(this.rb.getFullYear())}getTime(){return this.rb.getTime()}dA(){var a=
374
- olympe.C,b=a.wb;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.rb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.rb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.rb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.rb.toLocaleDateString(c.valueOf())),
375
- olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.rb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.rb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Vc(){return olympe.C.wb(this.rb.toISOString())}hA(){return new Date(this.getTime())}jA(){return this}lA(){return this}pg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.C.eb)}ax(a){return this.pg('Milliseconds',
376
- a)}ix(a){return this.pg('Seconds',a)}bx(a){return this.pg('Minutes',a)}$w(a){return this.pg('Hours',a)}kn(a){return this.pg('Date',a)}jx(a){return'number'===typeof a?this.kn(7*a):this.kn(a.ql(7))}ex(a){return this.pg('Month',a)}kx(a){return this.pg('FullYear',a)}eA(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}fA(){return new olympe.C.eb(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Jd(a){return olympe.C.ta([a],
377
- b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}zy(){let a=this.rb.getDay();0===a&&(a=7);return olympe.C.qa(a)}qy(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
378
- void 0===d&&(olympe.ha.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.C.qa(c)},olympe.C.$)}fz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ba)}dz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ba)}gz(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ba)}valueOf(){return this.iq().valueOf()?
379
- new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=nc(0);olympe.C.eb.D=nc(Number.NaN);m=olympe.C.eb.prototype;m.iq.K=olympe.C.J.N;m.Ju.K=olympe.C.J.F;m.Lu.K=olympe.C.J.F;m.Ku.K=olympe.C.J.F;m.Iu.K=olympe.C.J.F;m.my.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Mu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.dA.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Vc.K=olympe.C.J.D;m.hA.K=olympe.C.J.j;
380
- m.jA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.lA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ax.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.bx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.$w.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kn.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ex.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kx.K=new olympe.C.J(()=>olympe.C.eb,[0]);
381
- m.eA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.fA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Jd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.zy.K=olympe.C.J.F;m.qy.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.fz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.dz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.gz.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.valueOf.K=olympe.C.J.j;const oc=new Map,pc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,qc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function rc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=qc.exec(c)):(d=1,c=pc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.pf(a)?olympe.C.xe([a],b,olympe.C.Color):b(a)}
341
+ olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.di=a;this.vs=b}static gb(a){return!(!a||!a.fh)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Jd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ba.D:olympe.C.ba.j:b.valueOf()===c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba)}asObservable(a){return this.Ba.asObservable(a)}us(){return this.Ba}};olympe.C.Proxy.Om='__opp__';olympe.C.Proxy.prototype.fh=!0;function lc(a,b){a.node.wh(b);return a}olympe.C.lk=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.gb(a)?L(this.node,olympe.C.Qa(a)):L(this.node,a);return this}repeat(a){cc(this.node,olympe.C.gb(a)?a.Ba:a);return this}clear(){bc(this.node);return this}tb(){return M(this.node)}getContext(){return this.node}};function mc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.$),g=d||olympe.C.$.lp.tq;let h,k,l,n;f.update(olympe.C.qa(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.C.qa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
342
+ olympe.C.$=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.qa(b.value)}fo(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.fo())}Wc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.wb(''):olympe.C.wb(this.value.toString())}toString(a,b){return void 0!==
343
+ this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.fo()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.$,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.qa(c))};a.forEach((f,g)=>{olympe.C.Vc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
344
+ g===c&&e()}});return d.tb()}ge(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()+c.valueOf()),olympe.C.$,'ONumber.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()-c.valueOf()),olympe.C.$,'ONumber.minus')}round(){return olympe.C.qa(Math.round(this.valueOf()))}Qj(){return olympe.C.qa(-this.valueOf())}rl(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()*c.valueOf()),olympe.C.$,'ONumber.mul')}vj(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()/
345
+ c.valueOf()),olympe.C.$,'ONumber.div')}xz(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(b.valueOf()%c.valueOf()),olympe.C.$,'ONumber.div')}floor(){return olympe.C.qa(Math.floor(this.valueOf()))}ceil(){return olympe.C.qa(Math.ceil(this.valueOf()))}trunc(){return olympe.C.qa(Math.trunc(this.valueOf()))}log(){return olympe.C.qa(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.qa(Math.pow(b.valueOf(),c.valueOf())),olympe.C.$,'ONumber.pow')}exp(){return olympe.C.qa(Math.exp(this.valueOf()))}Jd(a){return olympe.C.ta([this,
346
+ a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.ba,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Ky(){return this.valueOf()}Pn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isBiggerThan')}bA(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsBiggest')}st(a){return olympe.C.ta([this,
347
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.qa(c),olympe.C.$,'ONumber.returnsSmallest')}nz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'ONumber.isSmallerThan')}sin(){return olympe.C.qa(Math.sin(this.valueOf()))}cos(){return olympe.C.qa(Math.cos(this.valueOf()))}atan2(a){return olympe.C.gb(a)?olympe.C.xe([a],b=>olympe.C.qa(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.$):olympe.C.qa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.qa(Math.abs(this.valueOf()))}Ij(a,
348
+ b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.$):olympe.C.qa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static ex(a,b,c,d){'number'===typeof a&&(a=olympe.C.fe(a));'number'===typeof b&&(b=olympe.C.fe(b));'number'===typeof c&&(c=olympe.C.fe(c));let e=0;const f=olympe.C.fe(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.Pn(c),()=>{olympe.ha.Xa('df').warn('You have a min bigger than max, cap your inputs')});
349
+ const k=(l,n)=>{n=olympe.C.fe(n);const p=olympe.C.$.animate(n,500);jc(f,p);hc(n,olympe.C.qa(l));e=l};olympe.C.xe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):jc(f,olympe.C.fe(e))},olympe.C.$);void 0!==b&&olympe.C.Sn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(g);L(n.Ba,l);e=g;jc(f,p)}});void 0!==c&&olympe.C.Sn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.fe(e),p=olympe.C.$.animate(n,400,d);l=olympe.C.qa(h);L(n.Ba,l);e=h;jc(f,p)}});
350
+ return f}static offset(a){let b;return olympe.C.xe([a],c=>{void 0===b&&(b=c);return olympe.C.qa(c-b)},olympe.C.$,'offset')}static Gs(a){let b,c,d;return olympe.C.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.qa(0);d=window.performance.now();const f=olympe.C.qa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.$,'derivative')}static fz(a){let b=olympe.C.qa(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.qa(0);e=window.performance.now();
351
+ b=b.ge((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.$,'integrate')}static Mx(a){let b;return olympe.C.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.qa(c.valueOf()-b.valueOf());b=c;return d},olympe.C.$,'diff')}static Bx(a,b,c){return olympe.C.xe([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.C.qa(d>=e?d<=f?d:f:e)},olympe.C.$)}static animate(a,b,c,d){let e;return e=olympe.C.ta([a],
352
+ f=>{const g=olympe.C.Qa(b,1E3),h=olympe.C.Qa(e);return void 0===h?olympe.C.qa(f):mc(h,f,g,c,k=>{d&&d(k)})},olympe.C.$)}static qx(a,b,c){let d,e,f,g,h,k,l=olympe.C.fe(),n;olympe.C.Vc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);hc(l,olympe.C.qa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Wc(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.wb(b.valueOf().toString()),
353
+ olympe.C.Sa):olympe.C.wb(a)}static Qj(a){return olympe.C.gb(a)?olympe.C.ta([a],b=>olympe.C.qa(-b.valueOf()),olympe.C.$):olympe.C.qa(-a.valueOf())}static ge(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.ta([a,b],(c,d)=>olympe.C.qa(c.valueOf()+d.valueOf()),olympe.C.$,'plus'):olympe.C.qa(a.valueOf()+b.valueOf())}static uh(a,b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()-d.valueOf()),olympe.C.$,'minus'):olympe.C.qa(a.valueOf()-b.valueOf())}static vj(a,
354
+ b){return olympe.C.gb(a)||olympe.C.gb(b)?olympe.C.xe([a,b],(c,d)=>olympe.C.qa(c.valueOf()/d.valueOf()),olympe.C.$,'div'):olympe.C.qa(a.valueOf()/b.valueOf())}static Tz(a,b){if(void 0===b)return a;olympe.C.Vc([b],c=>{c=olympe.C.qa(a.Ba.Eb.valueOf()+c.valueOf());L(a.Ba,c)},'plusEqual');return a}};olympe.C.$.ZERO=new olympe.C.$(0);olympe.C.$.ONE=new olympe.C.$(1);olympe.C.$.Nw=new olympe.C.$(2);olympe.C.$.PI=new olympe.C.$(Math.PI);olympe.C.$.Gu=new olympe.C.$(Infinity);olympe.C.$.Dv=new olympe.C.$(-Infinity);
355
+ olympe.C.$.Aq=new olympe.C.$(NaN);olympe.C.$.KC=olympe.C.$.Tz;olympe.C.$.vA=olympe.C.$.ex;olympe.C.$.yC=olympe.C.$.offset;olympe.C.$.cB=olympe.C.$.Gs;olympe.C.$.VE=olympe.C.$.Gs;olympe.C.$.ZB=olympe.C.$.fz;olympe.C.$.dB=olympe.C.$.Mx;olympe.C.$.LA=olympe.C.$.Bx;olympe.C.$.wA=olympe.C.$.animate;olympe.C.$.xA=olympe.C.$.qx;olympe.C.$.dE=olympe.C.$.Wc;olympe.C.$.eE=olympe.C.$.Qj;olympe.C.$.JC=olympe.C.$.ge;olympe.C.$.mC=olympe.C.$.uh;olympe.C.$.eB=olympe.C.$.vj;
356
+ olympe.C.$.lp={tq:function(a,b,c,d){return c*a/d+b},yB:function(a,b,c,d){a/=d;return c*a*a+b},IB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},uB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},nB:function(a,b,c,d){a/=d;return c*a*a*a+b},EB:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},sB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},zB:function(a,b,c,d){a/=d;return c*a*a*a*a+b},JB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
357
+ vB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},AB:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},KB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},wB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},BB:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},LB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},xB:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},qB:function(a,b,c,d){return c*Math.pow(2,
358
+ 10*(a/d-1))+b},HB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},tB:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},mB:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},DB:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},rB:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},hB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},iB:function(a,b,c,d){d=(a/=d)*a;return b+
359
+ c*(2*d*d+2*d*a+-3*d)},jB:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},kB:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},GB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},FB:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},pB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},oB:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},CB:function(a,
360
+ b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},lB:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.C.$.prototype;m.toJSON.K=olympe.C.J.j;m.fo.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Wc.K=olympe.C.J.D;
361
+ m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ge.K=new olympe.C.J(()=>olympe.C.$,[0]);m.uh.K=new olympe.C.J(()=>olympe.C.$,[0]);m.round.K=olympe.C.J.F;m.Qj.K=olympe.C.J.F;m.rl.K=new olympe.C.J(()=>olympe.C.$,[0]);m.vj.K=new olympe.C.J(()=>olympe.C.$,[0]);m.xz.K=new olympe.C.J(()=>olympe.C.$,[0]);m.floor.K=olympe.C.J.F;m.ceil.K=olympe.C.J.F;m.trunc.K=olympe.C.J.F;m.log.K=olympe.C.J.F;m.pow.K=new olympe.C.J(()=>olympe.C.$,[0]);m.exp.K=olympe.C.J.F;
362
+ m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ky.K=olympe.C.J.j;m.Pn.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.bA.K=new olympe.C.J(()=>olympe.C.$,[0]);m.st.K=new olympe.C.J(()=>olympe.C.$,[0]);m.nz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.sin.K=olympe.C.J.F;m.cos.K=olympe.C.J.F;m.atan2.K=new olympe.C.J(()=>olympe.C.$,[0]);m.abs.K=olympe.C.J.F;m.Ij.K=new olympe.C.J(()=>olympe.C.$,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.wb(b.value)}Ds(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.C.wb(d)},olympe.C.Sa,'OString.concat')}Wc(){return this}oA(a){return olympe.C.qa(parseInt(this.value,
363
+ a))}zt(){return olympe.C.qa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Jd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ba,'OString.oEquals')}nf(){return olympe.C.Rb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
364
+ olympe.C.ba,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Rb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ba,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Gn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ba,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.qa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
365
+ olympe.C.$,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.qa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.$,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}Gn(){return olympe.C.qa(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.wb(this.value.toLowerCase())}toUpperCase(){return olympe.C.wb(this.value.toUpperCase())}trim(){return olympe.C.wb(this.value.trim())}padStart(a,
366
+ b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}kA(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.wb(c.valueOf().substr(d.valueOf(),
367
+ e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.wb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.yw=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.Ds.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.oA.K=olympe.C.J.F;m.zt.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.nf.K=olympe.C.J.N;
368
+ m.contains.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.Gn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
369
+ m.replace.K=olympe.C.J.D;m.kA.K=olympe.C.J.D;olympe.C.ba=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ba.D:olympe.C.ba.j}and(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()&&b.valueOf()),olympe.C.ba,'and'):this.value&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Jd(a){if(void 0!==a)return olympe.C.gb(a)?
370
+ olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()===b.valueOf()),olympe.C.ba,'oEquals'):this.Ea(a)?olympe.C.ba.D:olympe.C.ba.j}zd(){return this.value?olympe.C.ba.j:olympe.C.ba.D}px(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(!(this.valueOf()&&b.valueOf())),olympe.C.ba,'andNot'):this.value&&!a.valueOf()?olympe.C.ba.D:olympe.C.ba.j}or(a){if(void 0!==a)return olympe.C.gb(a)?olympe.C.xe([a],b=>new olympe.C.ba(this.valueOf()||b.valueOf()),olympe.C.ba,'or'):this.value||a.valueOf()?
371
+ olympe.C.ba.D:olympe.C.ba.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Rb(b&&!c||!b&&c)},olympe.C.ba,'OBoolean.xor')}$x(){return this.value}Vs(){return!0===this.value?olympe.C.$.ONE:olympe.C.$.ZERO}Wc(){return olympe.C.wb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ba.D=new olympe.C.ba(!0);olympe.C.ba.j=new olympe.C.ba(!1);m=olympe.C.ba.prototype;m.toJSON.K=olympe.C.J.j;
372
+ m.and.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.Ea.K=olympe.C.J.j;m.Jd.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.zd.K=olympe.C.J.N;m.px.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.or.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.xor.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.$x.K=new olympe.C.J(()=>Boolean,[]);m.Vs.K=olympe.C.J.F;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;function nc(a){return new olympe.C.eb(new Date(a))}
373
+ olympe.C.eb=class{constructor(a){this.sb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.sb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.eb(new Date(b.value.valueOf()))}static now(){return new olympe.C.eb(new Date)}lq(){return this.sb&&!isNaN(this.sb.getTime())?olympe.C.ba.D:olympe.C.ba.j}Nu(){return olympe.C.qa(this.sb.getMilliseconds())}Pu(){return olympe.C.qa(this.sb.getSeconds())}Ou(){return olympe.C.qa(this.sb.getMinutes())}Mu(){return olympe.C.qa(this.sb.getHours())}py(){return olympe.C.qa(this.sb.getDate())}getMonth(){return olympe.C.qa(this.sb.getMonth()+1)}Qu(){return olympe.C.qa(this.sb.getFullYear())}getTime(){return this.sb.getTime()}hA(){var a=
374
+ olympe.C,b=a.wb;var c=this.sb.getDate();c=10>c?'0'+c:c;var d=this.sb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.sb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleDateString(c.valueOf())),
375
+ olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.wb(this.sb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.wb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Wc(){return olympe.C.wb(this.sb.toISOString())}lA(){return new Date(this.getTime())}nA(){return this}pA(){return this}pg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.sb.getTime()));d.sb['set'+a](this.sb['get'+a]()+c.valueOf());return d},olympe.C.eb)}hx(a){return this.pg('Milliseconds',
376
+ a)}mx(a){return this.pg('Seconds',a)}ix(a){return this.pg('Minutes',a)}gx(a){return this.pg('Hours',a)}ln(a){return this.pg('Date',a)}nx(a){return'number'===typeof a?this.ln(7*a):this.ln(a.rl(7))}jx(a){return this.pg('Month',a)}ox(a){return this.pg('FullYear',a)}iA(){let a=this.sb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth(),this.sb.getDate()-a))}jA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Jd(a){return olympe.C.ta([a],
377
+ b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Cy(){let a=this.sb.getDay();0===a&&(a=7);return olympe.C.qa(a)}uy(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.sb.getFullYear()-c.sb.getFullYear():'months'===d?c=12*(this.sb.getFullYear()-c.sb.getFullYear())+(this.sb.getMonth()-c.sb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
378
+ void 0===d&&(olympe.ha.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.sb.getTime()-c.sb.getTime())/d));return olympe.C.qa(c)},olympe.C.$)}iz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ba)}gz(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ba)}jz(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ba)}valueOf(){return this.lq().valueOf()?
379
+ new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=nc(0);olympe.C.eb.D=nc(Number.NaN);m=olympe.C.eb.prototype;m.lq.K=olympe.C.J.N;m.Nu.K=olympe.C.J.F;m.Pu.K=olympe.C.J.F;m.Ou.K=olympe.C.J.F;m.Mu.K=olympe.C.J.F;m.py.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Qu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.hA.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.lA.K=olympe.C.J.j;
380
+ m.nA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.pg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.hx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.gx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ln.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.nx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ox.K=new olympe.C.J(()=>olympe.C.eb,[0]);
381
+ m.iA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Jd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.Cy.K=olympe.C.J.F;m.uy.K=new olympe.C.J(()=>olympe.C.$,[0,1]);m.iz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.gz.K=new olympe.C.J(()=>olympe.C.ba,[0]);m.jz.K=new olympe.C.J(()=>olympe.C.ba,[0,1]);m.valueOf.K=olympe.C.J.j;const oc=new Map,pc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,qc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function rc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=qc.exec(c)):(d=1,c=pc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.pf(a)?olympe.C.xe([a],b,olympe.C.Color):b(a)}
382
382
  olympe.C.Color=class{constructor(a,b,c,d){this.j=olympe.C.qa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.D=olympe.C.qa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.C.qa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.C.qa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.j.valueOf(),g:this.D.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
383
- b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.qa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.qa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.qa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.qa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of oc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}oh(){return this.j}hh(){return this.b}lh(){return this.D}gh(){return this.a}px(a,
384
- b){return olympe.C.Color.create(this.j.Ij(a.oh(),b),this.D.Ij(a.lh(),b),this.b.Ij(a.hh(),b),this.a.Ij(a.gh(),b))}Px(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}wt(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}bo(){const a=(16777216|this.b|this.D<<8|this.j<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.bo()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
385
- this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.oh().valueOf()<<16|this.lh().valueOf()<<8|this.hh().valueOf())-(a.oh().valueOf()<<16|a.lh().valueOf()<<8|a.hh().valueOf());return 0===b?this.gh().valueOf()-a.gh().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.bo;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.wt;
386
- olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.gh;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.lh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.hh;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.oh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.oh.K=olympe.C.J.F;m.hh.K=olympe.C.J.F;m.lh.K=olympe.C.J.F;m.gh.K=olympe.C.J.F;m.px.K=new olympe.C.J(()=>olympe.C.Color,[]);
387
- m.Px.K=new olympe.C.J(()=>olympe.C.Color,[]);m.wt.K=new olympe.C.J(()=>String,[]);m.bo.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{ka(){}jq(){}kq(){}Qs(){}fl(){}Bn(){}gl(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.fe(a);this.y=olympe.C.fe(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Pa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Pa(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}Nu(){return this.x}bA(a){kc(this.x,a)}Ou(){return this.y}cA(a){kc(this.y,a)}Sy(){return this.x.ot(this.y)}ge(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.ge(c.x),b.y.ge(c.y)),
388
- olympe.C.Zb,'Vector2.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.uh(c.x),b.y.uh(c.y)),olympe.C.Zb,'Vector2.minus')}wz(a){return new olympe.C.Zb(this.x.ql(a),this.y.ql(a))}Kx(a){return new olympe.C.Zb(this.x.vj(a),this.y.vj(a))}yz(){return new olympe.C.Zb(this.x.Pj(),this.y.Pj())}Lx(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.qa(d*f+e*g),olympe.C.$),olympe.C.$)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.qa(Math.sqrt(a*
389
- a+b*b)),olympe.C.$)}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)}gx(a){return new olympe.C.Zb(this.x.ge(a),
390
- this.y.ge(a))}hx(a,b){return new olympe.C.Zb(this.x.ge(a),this.y.ge(b))}Vc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.wb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Eb}, ${this.y.Ba.Eb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Nu.K=olympe.C.J.F;m.bA.K=olympe.C.J.j;m.Ou.K=olympe.C.J.F;m.cA.K=olympe.C.J.j;m.Sy.K=olympe.C.J.F;m.ge.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
391
- m.uh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.wz.K=olympe.C.J.R;m.Kx.K=olympe.C.J.R;m.yz.K=olympe.C.J.R;m.Lx.K=new olympe.C.J(()=>olympe.C.$,[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.gx.K=olympe.C.J.R;m.hx.K=olympe.C.J.R;m.Vc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Ig=class{constructor(){}Mb(){}Qd(){}get(){}oi(){}has(){}rh(){}Hc(){}Rf(){}Bf(){}wg(){}forEach(){}oe(){}};olympe.C.Ig.prototype.forEachCurrentValue=olympe.C.Ig.prototype.oe;olympe.C.Ig.prototype.forEach=olympe.C.Ig.prototype.forEach;m=olympe.C.Ig.prototype;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Hc.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;olympe.C.ud=class extends olympe.C.Ig{Hd(){}Qf(){}mf(){}Pf(){}pe(){}lf(){}wj(){}si(){}};olympe.C.ud.prototype.getCurrentAt=olympe.C.ud.prototype.lf;olympe.C.ud.prototype.getAt=olympe.C.ud.prototype.pe;olympe.C.ud.prototype.getCurrentKeyAt=olympe.C.ud.prototype.Pf;olympe.C.ud.prototype.getKeyAt=olympe.C.ud.prototype.mf;olympe.C.ud.prototype.getCurrentRank=olympe.C.ud.prototype.Qf;olympe.C.ud.prototype.getRank=olympe.C.ud.prototype.Hd;m=olympe.C.ud.prototype;m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;
392
- m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.Za();this.valueType=a||Object;this.values={};this.Wa=this.ia=null;this.Pe=0;this.R=Object.create(null);this.lb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;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.H}Mb(){return this.valueType}Qd(a){this.valueType=a;const b=this.ia;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
383
+ b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.qa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.qa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.qa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.qa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of oc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}oh(){return this.j}hh(){return this.b}lh(){return this.D}gh(){return this.a}ux(a,
384
+ b){return olympe.C.Color.create(this.j.Ij(a.oh(),b),this.D.Ij(a.lh(),b),this.b.Ij(a.hh(),b),this.a.Ij(a.gh(),b))}Tx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}At(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}co(){const a=(16777216|this.b|this.D<<8|this.j<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.co()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
385
+ this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.oh().valueOf()<<16|this.lh().valueOf()<<8|this.hh().valueOf())-(a.oh().valueOf()<<16|a.lh().valueOf()<<8|a.hh().valueOf());return 0===b?this.gh().valueOf()-a.gh().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.co;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.At;
386
+ olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.gh;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.lh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.hh;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.oh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.oh.K=olympe.C.J.F;m.hh.K=olympe.C.J.F;m.lh.K=olympe.C.J.F;m.gh.K=olympe.C.J.F;m.ux.K=new olympe.C.J(()=>olympe.C.Color,[]);
387
+ m.Tx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.At.K=new olympe.C.J(()=>String,[]);m.co.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{ka(){}mq(){}nq(){}Us(){}gl(){}Cn(){}hl(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.fe(a);this.y=olympe.C.fe(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Qa(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}Ru(){return this.x}fA(a){kc(this.x,a)}Su(){return this.y}gA(a){kc(this.y,a)}Vy(){return this.x.st(this.y)}ge(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.ge(c.x),b.y.ge(c.y)),
388
+ olympe.C.Zb,'Vector2.plus')}uh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.uh(c.x),b.y.uh(c.y)),olympe.C.Zb,'Vector2.minus')}zz(a){return new olympe.C.Zb(this.x.rl(a),this.y.rl(a))}Ox(a){return new olympe.C.Zb(this.x.vj(a),this.y.vj(a))}Bz(){return new olympe.C.Zb(this.x.Qj(),this.y.Qj())}Px(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.qa(d*f+e*g),olympe.C.$),olympe.C.$)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.qa(Math.sqrt(a*
389
+ a+b*b)),olympe.C.$)}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)}kx(a){return new olympe.C.Zb(this.x.ge(a),
390
+ this.y.ge(a))}lx(a,b){return new olympe.C.Zb(this.x.ge(a),this.y.ge(b))}Wc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.wb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Eb}, ${this.y.Ba.Eb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Ru.K=olympe.C.J.F;m.fA.K=olympe.C.J.j;m.Su.K=olympe.C.J.F;m.gA.K=olympe.C.J.j;m.Vy.K=olympe.C.J.F;m.ge.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
391
+ m.uh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.zz.K=olympe.C.J.R;m.Ox.K=olympe.C.J.R;m.Bz.K=olympe.C.J.R;m.Px.K=new olympe.C.J(()=>olympe.C.$,[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.kx.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Ig=class{constructor(){}Mb(){}Qd(){}get(){}oi(){}has(){}rh(){}Ic(){}Rf(){}Bf(){}wg(){}forEach(){}oe(){}};olympe.C.Ig.prototype.forEachCurrentValue=olympe.C.Ig.prototype.oe;olympe.C.Ig.prototype.forEach=olympe.C.Ig.prototype.forEach;m=olympe.C.Ig.prototype;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;olympe.C.ud=class extends olympe.C.Ig{Hd(){}Qf(){}mf(){}Pf(){}pe(){}lf(){}wj(){}si(){}};olympe.C.ud.prototype.getCurrentAt=olympe.C.ud.prototype.lf;olympe.C.ud.prototype.getAt=olympe.C.ud.prototype.pe;olympe.C.ud.prototype.getCurrentKeyAt=olympe.C.ud.prototype.Pf;olympe.C.ud.prototype.getKeyAt=olympe.C.ud.prototype.mf;olympe.C.ud.prototype.getCurrentRank=olympe.C.ud.prototype.Qf;olympe.C.ud.prototype.getRank=olympe.C.ud.prototype.Hd;m=olympe.C.ud.prototype;m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;
392
+ m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.Za();this.valueType=a||Object;this.values={};this.Wa=this.ia=null;this.Pe=0;this.R=Object.create(null);this.nb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;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.H}Mb(){return this.valueType}Qd(a){this.valueType=a;const b=this.ia;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
393
393
  c)&&gc(b[c],a)}get(a){const b=c=>{null===this.ia&&(this.ia={});return this.Bj(this.ia,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}oi(a){a=this.values[a];return olympe.C.gb(a)?Sb(a.Ba)?a.Ba.Eb:void 0:a}has(a){const b=c=>{null===this.Wa&&(this.Wa={});return this.Bj(this.Wa,c,c in this.values?olympe.C.ba.D:olympe.C.ba.j,olympe.C.ba,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ba)}rh(a){return a in this.values}Bj(a,b,c,d,e){let f=a[b];
394
- f||this.H.run(()=>{f=olympe.C.Wd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.gb(c)?jc(f,c):hc(f,c)});return f}Hc(){throw Error('Abstract method getFirstKey needs to be overridden');}Rf(){throw Error('Abstract method getFirstKey needs to be overridden');}Bf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Wd(olympe.C.$,olympe.C.qa(this.size));this.F.Ba.onDestroy(()=>{this.F=null})});return this.F}wg(){return this.size}forEach(a,b){const c=this.fn();a=this.ss(c,a,b);this.en(c,a)}fn(){return String(++this.Pe)}en(a,
395
- b){this.lb[a]=b;olympe.C.Za().Xd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.lb[a]});this.oe(b)}ss(a,b,c){const d=olympe.C.Za();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.jn(a,f,g)})}}jn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}oe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
396
- a(b[c],c,this))break}$k(a,b){void 0!==this.values[a]&&this.pj(a,!0);this.values[a]=b;var c=this.ia;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?jc(c[a],b):hc(c[a],b));c=this.Wa;null!==c&&void 0!==c[a]&&kc(c[a],!0);this.size++;c=this.lb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}pj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.fh?d.Ba.Eb:d;var e=this.ia;null!==e&&void 0!==e[a]&&ic(e[a]);e=this.Wa;null!==e&&void 0!==
394
+ f||this.H.run(()=>{f=olympe.C.Wd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.gb(c)?jc(f,c):hc(f,c)});return f}Ic(){throw Error('Abstract method getFirstKey needs to be overridden');}Rf(){throw Error('Abstract method getFirstKey needs to be overridden');}Bf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Wd(olympe.C.$,olympe.C.qa(this.size));this.F.Ba.onDestroy(()=>{this.F=null})});return this.F}wg(){return this.size}forEach(a,b){const c=this.gn();a=this.ws(c,a,b);this.fn(c,a)}gn(){return String(++this.Pe)}fn(a,
395
+ b){this.nb[a]=b;olympe.C.Za().Xd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.nb[a]});this.oe(b)}ws(a,b,c){const d=olympe.C.Za();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.kn(a,f,g)})}}kn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}oe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
396
+ a(b[c],c,this))break}al(a,b){void 0!==this.values[a]&&this.pj(a,!0);this.values[a]=b;var c=this.ia;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?jc(c[a],b):hc(c[a],b));c=this.Wa;null!==c&&void 0!==c[a]&&kc(c[a],!0);this.size++;c=this.nb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}pj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.fh?d.Ba.Eb:d;var e=this.ia;null!==e&&void 0!==e[a]&&ic(e[a]);e=this.Wa;null!==e&&void 0!==
397
397
  e[a]&&kc(e[a],!1);delete c[a];this.size--;b||this.Mf()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Mf(){null!==this.F&&kc(this.F,this.size)}fi(){var a=this.ia;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&ic(a[c]);a=this.Wa;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&kc(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.R)if(Object.prototype.hasOwnProperty.call(this.R,
398
398
  c)){b=this.R[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.F&&kc(this.F,this.size)}Lg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.C.Ci.ya=[olympe.C.Ig];m=olympe.C.Ci.prototype;m.getContext.K=olympe.C.J.j;m.Mb.K=olympe.C.J.j;m.Qd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;
399
- m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.fn.K=olympe.C.J.j;m.en.K=olympe.C.J.j;m.ss.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.oe.K=olympe.C.J.j;m.$k.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Sj=class extends olympe.C.Ci{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.da=this.sa=this.Ga=this.Z=null}Qd(a){super.Qd(a);if(null!==this.da)for(let b of this.da.values())gc(b,a)}Hc(){return this.pe(0)}Rf(){return this.mf(0)}Hd(a){const b=c=>{null===this.Ga&&(this.Ga=Object.create(null));let d=this.Qf(a);d=void 0!==d?olympe.C.qa(d):void 0;return this.Bj(this.Ga,c,d,olympe.C.$,`List.getRank(${c})`)};return olympe.C.gb(a)?M(olympe.C.createNode(olympe.C.$,b,null,[a.Ba],
399
+ m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.gn.K=olympe.C.J.j;m.fn.K=olympe.C.J.j;m.ws.K=olympe.C.J.j;m.kn.K=olympe.C.J.j;m.oe.K=olympe.C.J.j;m.al.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Tj=class extends olympe.C.Ci{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.da=this.sa=this.Ha=this.Z=null}Qd(a){super.Qd(a);if(null!==this.da)for(let b of this.da.values())gc(b,a)}Ic(){return this.pe(0)}Rf(){return this.mf(0)}Hd(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Qf(a);d=void 0!==d?olympe.C.qa(d):void 0;return this.Bj(this.Ha,c,d,olympe.C.$,`List.getRank(${c})`)};return olympe.C.gb(a)?M(olympe.C.createNode(olympe.C.$,b,null,[a.Ba],
400
400
  [0],'onResolved('+(b.name||'')+')')):b(a)}Qf(a){return this.D[a]}mf(a){const b=c=>{const d=c.valueOf(),e=this.Pf(d);null===this.sa&&(this.sa=Object.create(null));return this.Bj(this.sa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Pf(a){return this.j[a.valueOf()]}pe(a){if(olympe.C.gb(a))return this.get(olympe.C.ta([a],c=>{c=this.mf(c);if(!Sb(c.Ba)){const d=olympe.C.Za();olympe.C.Uf(d)&&bc(d)}return c},String));null===this.da&&(this.da=new Map);let b=this.da.get(a);
401
- b||this.H.run(()=>{b=this.get(this.mf(a));this.da.set(a,b);b.Ba.onDestroy(()=>this.da.delete(a))});return b}lf(a){return this.oi(this.Pf(a))}wj(a,b,c,d){let e=this.fn();a=this.ft(e,a,b,c,d);this.en(e,a)}ft(a,b,c,d,e){return olympe.C.Za().rc((f,g)=>{let h=!1,k=olympe.C.zi([b,c,this.Hd(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.jn(a,g,k)})}si(){null===this.Z&&this.H.run(()=>{this.Z=olympe.C.Wd(Array,this.j.filter(a=>void 0!==a));this.Z.Ba.onDestroy(()=>
402
- {this.F=null})});return this.Z}oe(a){if(this.j.length!==this.size)super.oe(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}}hn(a,b){const c=this.Ga,d=this.sa,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]&&ic(c[g]),void 0!==c[a]&&hc(c[a],olympe.C.qa(f)));
403
- null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}gn(a){var b=this.sa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Eb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ga;null!==c&&void 0!==c[a]&&ic(c[a])}us(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Eb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Mf(){this.us();super.Mf()}fi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ga;if(null!==a)for(b in a)ic(a[b]);a=this.sa;
404
- if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.Ci.prototype.fi.call(this)}Lg(){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.Sj.ya=[olympe.C.ud];m=olympe.C.Sj.prototype;m.Qd.K=olympe.C.J.j;m.Hc.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);
405
- m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.ft.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);m.oe.K=olympe.C.J.j;m.hn.K=olympe.C.J.j;m.gn.K=olympe.C.J.j;m.us.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Ci{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Qd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&gc(this.D,a);super.Qd(a)}Hc(){null===this.D&&this.vn();return this.D}Rf(){null===this.j&&this.vn();return this.j}vn(){this.getContext().run(()=>{this.D=olympe.C.Wd(this.Mb());this.j=olympe.C.Wd(String);this.Nj(this.yn())})}yn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Nj(a){if(void 0!==
406
- a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Eb&&(ic(this.D),ic(this.j))}set(a,b){this.$k(a,b);1===this.size&&null!==this.j&&this.Nj(a);this.Mf()}remove(a){const b=this.pj(a);null!==this.j&&this.j.Ba.Eb===a&&this.Nj(this.yn());return b}clear(){this.fi();null!==this.j&&this.Nj()}};m=olympe.C.Map.prototype;m.Qd.K=olympe.C.J.j;m.Hc.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.vn.K=olympe.C.J.j;
407
- m.yn.K=olympe.C.J.j;m.Nj.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.Og=class extends olympe.C.Sj{constructor(a){super(a)}set(a,b,c){this.$k(a,b);void 0!==c&&olympe.C.Uc([c],d=>{this.hn(a,d)});this.Mf()}remove(a){this.gn(a);return this.pj(a)}clear(){this.fi()}};olympe.C.Og.prototype.remove.K=olympe.C.J.j;olympe.C.Og.prototype.clear.K=olympe.C.J.j;olympe.C.Gt=class extends olympe.C.kk{constructor(a,b){super(olympe.C.$,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.$.kp.qq}sb(){return olympe.C.Az(this.node,this.duration,this.j,void 0)}};let sc=null;olympe.C.G=void 0;olympe.C.Un=void 0;olympe.C.ki=void 0;olympe.C.ei=new Map;olympe.C.ei.set(0,olympe.C.$.ZERO);olympe.C.ei.set(1,olympe.C.$.ONE);olympe.C.ei.set(2,olympe.C.$.Jw);olympe.C.Zk=new Map;olympe.C.Zk.set('',olympe.C.Sa.EMPTY);olympe.C.Zk.set(' ',olympe.C.Sa.uw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Kc:b,Xf:c,Ln:d,debug:g,qg:e,$c:f,qj:h})};olympe.C.Uf=function(a){return a instanceof olympe.C.Node};
408
- olympe.C.Wd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Uf(b)?cc(a,b):olympe.C.gb(b)?cc(a,b.Ba):L(a,b);return M(a)};olympe.C.gb=function(a){return!(!a||!a.fh)};olympe.C.pf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.fh))};olympe.C.Pn=function(a){return a instanceof olympe.C.Wb||a instanceof olympe.C.Cr||a instanceof olympe.C.Node};olympe.C.sh=function(a){return a instanceof olympe.C.kk};
409
- olympe.C.Rn=function(a,b){if(void 0!==a){olympe.C.sh(a)&&(a=a.sb().Ba);if(!olympe.C.pf(a))return b(a);var c=[];olympe.C.gb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Pa=function(a,b){let c=a;olympe.C.gb(a)?c=a.Ba.Eb:olympe.C.Uf(a)?c=a.Eb:olympe.C.sh(a)&&(c=a.sb().Ba.Eb);return void 0===c?b:c};
410
- olympe.C.wh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Uf(a)?c=a:olympe.C.sh(a)&&(c=a.sb().Ba);c&&olympe.C.Uc([b],d=>{c.wh(d)},'setDefaultValue');return a};olympe.C.zi=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.qs?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.sh(h)&&(h=h.sb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
411
- olympe.C.xe=function(a,b,c,d){return M(olympe.C.zi(a,b,c,d||'syncProxies'))};const tc=a=>{for(const b of a)if(olympe.C.pf(b)||olympe.C.sh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(tc(a))return b(...a);const f=olympe.C.zi(a,b,c,d||'TransformFlows');e&&olympe.C.Uc([e],g=>{f.wh(g)},'setDefaultValue');return M(f)};olympe.C.Uc=function(a,b,c){tc(a)?b(...a):olympe.C.zi(a,b,void 0,c||'processFlows')};
412
- olympe.C.PE=function(a,b,c){const d=olympe.C.Uf(a)?a.Mb():olympe.C.sh(a)?a.sb().di:a.di,e=olympe.C.bc(d,c),f=olympe.U.Promise.uj(g=>{e.getContext().fb()||e.update(g)},b);olympe.C.Uc([a],g=>f(g).then());return e.sb()};olympe.C.jt=function(a,b){if(tc(a))b(...a);else{const c=olympe.C.Za();olympe.C.zi(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
413
- olympe.C.Sn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.C.gb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.sh(g)&&(g=g.sb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Kc:b,Ln:e,qg:f,Sz:!1,$c:c})};olympe.C.kt=function(a,b){const c=olympe.C.Za();olympe.C.Sn(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.NE=function(a,b,c){a=new olympe.C.kk(a,c);b(a);return a.sb()};
414
- olympe.C.bc=function(a,b='flowSource'){return new olympe.C.kk(a,b)};olympe.C.uF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.zi(a,(...f)=>{olympe.C.Za().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.$E=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.sb()};
415
- olympe.C.XE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.yF=function(a){return olympe.C.Za().rc(a)};olympe.C.UE=function(a,b,c){olympe.C.Mx(a?a.Ba:a,b,c)};
416
- olympe.C.Mx=function(a,b,c){if(a){var d=a.T();null===sc&&(sc={});if(sc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{sc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
417
- ''))});c.onDestroy(()=>{delete sc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.TE=function(){let a='',b=olympe.C.Za();for(;null!==b;)a+=b.Dn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
418
- olympe.C.qa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.xq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Cu;if(-Infinity===a)return olympe.C.$.zv;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.ei.has(a)||olympe.C.ei.set(a,new olympe.C.$(a)),olympe.C.ei.get(a)):new olympe.C.$(a)}return null};
419
- olympe.C.fe=function(a){return void 0===a?olympe.C.Wd(olympe.C.$):olympe.C.Wd(olympe.C.$,olympe.C.pf(a)?a:olympe.C.qa(a))};olympe.C.Az=olympe.C.$.animate;olympe.C.jF=function(a,b){return new olympe.C.Gt(a,b)};olympe.C.wb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.Zk.has(a)?olympe.C.Zk.get(a):new olympe.C.Sa(a)};
420
- olympe.C.oF=function(a){return void 0===a?olympe.C.Wd(olympe.C.Sa):olympe.C.Wd(olympe.C.Sa,olympe.C.pf(a)?a:olympe.C.wb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ba?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j};olympe.C.lF=function(a){return void 0===a?olympe.C.Wd(olympe.C.ba):olympe.C.Wd(olympe.C.ba,olympe.C.pf(a)?a:olympe.C.Rb(a))};olympe.C.kF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
421
- olympe.C.nF=function(a){return olympe.C.Wd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.$s=a=>a instanceof olympe.C.ba||a instanceof olympe.C.$||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.pF=function(a,b){return olympe.C.Wd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Mz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Wd(olympe.C.Color,e)};olympe.C.mF=olympe.C.Mz;
422
- olympe.C.Dx=function(a){olympe.C.G=a;olympe.C.ki=olympe.C.kh()};olympe.C.kh=function(){olympe.C.Un||(olympe.C.Un=new olympe.C.Cr);return olympe.C.Un};olympe.C.Za=function(){olympe.C.ki||(olympe.C.ki=olympe.C.kh());return olympe.C.ki};olympe.C.st=function(a){const b=olympe.C.ki;olympe.C.Pn(a)&&(olympe.C.ki=a);return null!=b?b:null};
401
+ b||this.H.run(()=>{b=this.get(this.mf(a));this.da.set(a,b);b.Ba.onDestroy(()=>this.da.delete(a))});return b}lf(a){return this.oi(this.Pf(a))}wj(a,b,c,d){let e=this.gn();a=this.jt(e,a,b,c,d);this.fn(e,a)}jt(a,b,c,d,e){return olympe.C.Za().rc((f,g)=>{let h=!1,k=olympe.C.zi([b,c,this.Hd(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.kn(a,g,k)})}si(){null===this.Z&&this.H.run(()=>{this.Z=olympe.C.Wd(Array,this.j.filter(a=>void 0!==a));this.Z.Ba.onDestroy(()=>
402
+ {this.F=null})});return this.Z}oe(a){if(this.j.length!==this.size)super.oe(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}}jn(a,b){const c=this.Ha,d=this.sa,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]&&ic(c[g]),void 0!==c[a]&&hc(c[a],olympe.C.qa(f)));
403
+ null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}hn(a){var b=this.sa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Eb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&ic(c[a])}xs(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Eb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Mf(){this.xs();super.Mf()}fi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ha;if(null!==a)for(b in a)ic(a[b]);a=this.sa;
404
+ if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.Ci.prototype.fi.call(this)}Lg(){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.Tj.ya=[olympe.C.ud];m=olympe.C.Tj.prototype;m.Qd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.Hd.K=olympe.C.J.F;m.Qf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);
405
+ m.Pf.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>Object,[]);m.lf.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.jt.K=olympe.C.J.j;m.si.K=new olympe.C.J(()=>Array,[]);m.oe.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.hn.K=olympe.C.J.j;m.xs.K=olympe.C.J.j;m.Mf.K=olympe.C.J.j;m.fi.K=olympe.C.J.j;m.Lg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Ci{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Qd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&gc(this.D,a);super.Qd(a)}Ic(){null===this.D&&this.wn();return this.D}Rf(){null===this.j&&this.wn();return this.j}wn(){this.getContext().run(()=>{this.D=olympe.C.Wd(this.Mb());this.j=olympe.C.Wd(String);this.Oj(this.zn())})}zn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Oj(a){if(void 0!==
406
+ a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Eb&&(ic(this.D),ic(this.j))}set(a,b){this.al(a,b);1===this.size&&null!==this.j&&this.Oj(a);this.Mf()}remove(a){const b=this.pj(a);null!==this.j&&this.j.Ba.Eb===a&&this.Oj(this.zn());return b}clear(){this.fi();null!==this.j&&this.Oj()}};m=olympe.C.Map.prototype;m.Qd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Rf.K=new olympe.C.J(()=>String,[]);m.wn.K=olympe.C.J.j;
407
+ m.zn.K=olympe.C.J.j;m.Oj.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.Og=class extends olympe.C.Tj{constructor(a){super(a)}set(a,b,c){this.al(a,b);void 0!==c&&olympe.C.Vc([c],d=>{this.jn(a,d)});this.Mf()}remove(a){this.hn(a);return this.pj(a)}clear(){this.fi()}};olympe.C.Og.prototype.remove.K=olympe.C.J.j;olympe.C.Og.prototype.clear.K=olympe.C.J.j;olympe.C.Kt=class extends olympe.C.lk{constructor(a,b){super(olympe.C.$,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.$.lp.tq}tb(){return olympe.C.Dz(this.node,this.duration,this.j,void 0)}};let sc=null;olympe.C.G=void 0;olympe.C.Vn=void 0;olympe.C.ki=void 0;olympe.C.ei=new Map;olympe.C.ei.set(0,olympe.C.$.ZERO);olympe.C.ei.set(1,olympe.C.$.ONE);olympe.C.ei.set(2,olympe.C.$.Nw);olympe.C.$k=new Map;olympe.C.$k.set('',olympe.C.Sa.EMPTY);olympe.C.$k.set(' ',olympe.C.Sa.yw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Lc:b,Xf:c,Mn:d,debug:g,qg:e,$c:f,qj:h})};olympe.C.Uf=function(a){return a instanceof olympe.C.Node};
408
+ olympe.C.Wd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Uf(b)?cc(a,b):olympe.C.gb(b)?cc(a,b.Ba):L(a,b);return M(a)};olympe.C.gb=function(a){return!(!a||!a.fh)};olympe.C.pf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.fh))};olympe.C.Qn=function(a){return a instanceof olympe.C.Wb||a instanceof olympe.C.Fr||a instanceof olympe.C.Node};olympe.C.sh=function(a){return a instanceof olympe.C.lk};
409
+ olympe.C.Sn=function(a,b){if(void 0!==a){olympe.C.sh(a)&&(a=a.tb().Ba);if(!olympe.C.pf(a))return b(a);var c=[];olympe.C.gb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Qa=function(a,b){let c=a;olympe.C.gb(a)?c=a.Ba.Eb:olympe.C.Uf(a)?c=a.Eb:olympe.C.sh(a)&&(c=a.tb().Ba.Eb);return void 0===c?b:c};
410
+ olympe.C.wh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Uf(a)?c=a:olympe.C.sh(a)&&(c=a.tb().Ba);c&&olympe.C.Vc([b],d=>{c.wh(d)},'setDefaultValue');return a};olympe.C.zi=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.us?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.sh(h)&&(h=h.tb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
411
+ olympe.C.xe=function(a,b,c,d){return M(olympe.C.zi(a,b,c,d||'syncProxies'))};const tc=a=>{for(const b of a)if(olympe.C.pf(b)||olympe.C.sh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(tc(a))return b(...a);const f=olympe.C.zi(a,b,c,d||'TransformFlows');e&&olympe.C.Vc([e],g=>{f.wh(g)},'setDefaultValue');return M(f)};olympe.C.Vc=function(a,b,c){tc(a)?b(...a):olympe.C.zi(a,b,void 0,c||'processFlows')};
412
+ olympe.C.TE=function(a,b,c){const d=olympe.C.Uf(a)?a.Mb():olympe.C.sh(a)?a.tb().di:a.di,e=olympe.C.bc(d,c),f=olympe.U.Promise.uj(g=>{e.getContext().fb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.nt=function(a,b){if(tc(a))b(...a);else{const c=olympe.C.Za();olympe.C.zi(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
413
+ olympe.C.Tn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.C.gb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.sh(g)&&(g=g.tb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Mn:e,qg:f,Vz:!1,$c:c})};olympe.C.ot=function(a,b){const c=olympe.C.Za();olympe.C.Tn(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.RE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
414
+ olympe.C.bc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.yF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.zi(a,(...f)=>{olympe.C.Za().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.dF=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
415
+ olympe.C.aF=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.CF=function(a){return olympe.C.Za().rc(a)};olympe.C.YE=function(a,b,c){olympe.C.Qx(a?a.Ba:a,b,c)};
416
+ olympe.C.Qx=function(a,b,c){if(a){var d=a.T();null===sc&&(sc={});if(sc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{sc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
417
+ ''))});c.onDestroy(()=>{delete sc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.XE=function(){let a='',b=olympe.C.Za();for(;null!==b;)a+=b.En()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
418
+ olympe.C.qa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.Aq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Gu;if(-Infinity===a)return olympe.C.$.Dv;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.ei.has(a)||olympe.C.ei.set(a,new olympe.C.$(a)),olympe.C.ei.get(a)):new olympe.C.$(a)}return null};
419
+ olympe.C.fe=function(a){return void 0===a?olympe.C.Wd(olympe.C.$):olympe.C.Wd(olympe.C.$,olympe.C.pf(a)?a:olympe.C.qa(a))};olympe.C.Dz=olympe.C.$.animate;olympe.C.nF=function(a,b){return new olympe.C.Kt(a,b)};olympe.C.wb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.$k.has(a)?olympe.C.$k.get(a):new olympe.C.Sa(a)};
420
+ olympe.C.sF=function(a){return void 0===a?olympe.C.Wd(olympe.C.Sa):olympe.C.Wd(olympe.C.Sa,olympe.C.pf(a)?a:olympe.C.wb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ba?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ba.D:olympe.C.ba.j};olympe.C.pF=function(a){return void 0===a?olympe.C.Wd(olympe.C.ba):olympe.C.Wd(olympe.C.ba,olympe.C.pf(a)?a:olympe.C.Rb(a))};olympe.C.oF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
421
+ olympe.C.rF=function(a){return olympe.C.Wd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.et=a=>a instanceof olympe.C.ba||a instanceof olympe.C.$||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.tF=function(a,b){return olympe.C.Wd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Pz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Wd(olympe.C.Color,e)};olympe.C.qF=olympe.C.Pz;
422
+ olympe.C.Hx=function(a){olympe.C.G=a;olympe.C.ki=olympe.C.kh()};olympe.C.kh=function(){olympe.C.Vn||(olympe.C.Vn=new olympe.C.Fr);return olympe.C.Vn};olympe.C.Za=function(){olympe.C.ki||(olympe.C.ki=olympe.C.kh());return olympe.C.ki};olympe.C.wt=function(a){const b=olympe.C.ki;olympe.C.Qn(a)&&(olympe.C.ki=a);return null!=b?b:null};
423
423
  olympe.C.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Pb(a);break;case 'number':b=olympe.C.$.Pb(a);break;case 'string':b=olympe.C.Sa.Pb(a);break;case 'vector2':b=olympe.C.Zb.Pb(a);break;case 'color':b=olympe.C.Color.Pb(a);break;case 'boolean':b=olympe.C.ba.Pb(a)}return b}return null};function uc(a){a.j.fb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.H.length=0)}
424
- olympe.C.kD=class{constructor(){this.j=new olympe.C.Wb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(vc,'Last slot manager entry');this.size=lc(olympe.C.bc(olympe.C.$,'SlotManager size').repeat(this.D.sb().En()),olympe.C.$.ZERO);this.N=lc(olympe.C.bc(olympe.C.$,'last valid slots'),olympe.C.qa(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{uc(this)})}};
425
- class vc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Wb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=lc(olympe.C.bc(olympe.C.$),olympe.C.$.ZERO);olympe.C.gb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.$);this.F=this.j.sb().ge(e.sb())});this.next=null}T(){return this.id}Wy(){return this.j.sb()}En(){return this.F}Hd(){return this.H}ez(){return this.N}nA(a){this.H=a}aA(a){null===a?this.j.update(olympe.C.$.ZERO):(this.j.repeat(a.En()),a.next=this)}Pu(){this.j.clear();
426
- this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=vc.prototype;m.T.K=olympe.C.J.j;m.Wy.K=new olympe.C.J(()=>olympe.C.$);m.En.K=new olympe.C.J(()=>olympe.C.$);m.Hd.K=olympe.C.J.j;m.ez.K=olympe.C.J.j;m.nA.K=olympe.C.J.j;m.aA.K=olympe.C.J.j;m.Pu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.V.config(a=>{E(a,olympe.C.Config.yq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Ca,[olympe.ha.P.Da],b=>b.ad('df'))},'olympe.df');olympe.V.run([olympe.C.P.Ca],a=>{olympe.C.Dx(a)},'olympe.df');olympe.host={};const wc=new Map,xc=new Map;olympe.host.Fq=class{static register(a,b,...c){wc.set(a,b);0<c.length&&xc.set(a,c)}static create(a,b,c,d){const e=wc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=xc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function yc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Fq.create(c,b,a.G,a.H))}function zc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ha.xb.j.ag&&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.gb(f))b.push(a.j.get(f.Yw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Za();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
427
- function Ac(a){var b=olympe.host.Oe.Ed,c=olympe.host.Oe.Eq.hs;++a.F;const d=a.F;yc(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.gb(p)?(h.push(n),p=p.Ba):olympe.C.Uf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{zc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
428
- {zc(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.Xd(a.N.bind(a,d));a=M(e);a.Yw=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')}Xa(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Sd=class{constructor(a){this.j=a;this.D=olympe.C.Za()}F(){return this.j}hd(){return this.j.Ba.hd()||this.D.hd()}fb(){return this.j.Ba.fb()}};olympe.host.Sd.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Sd,[]);olympe.host.Tk=class{j(){}D(){}};olympe.host.wu=class{};function Bc(a,b){var c=olympe.host.Yf;const d=olympe.U.Jc(),e=new olympe.C.Wb('onTimeout context');c.j.X(b,d,()=>{e.fb()||e.hd()||e.run(a);c.j.F(d)});return new olympe.host.Ed.D(c.j,d,e)}function Cc(a,b){var c=olympe.host.Yf;const d=olympe.U.Jc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.fb()||e.hd()?c.j.D(d):e.run(a)})}olympe.host.Ed=class{constructor(a){this.j=Ac(a)}};olympe.host.Ed.j=class{constructor(a,b,c){this.Yf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
429
- olympe.host.Ed.H=class extends olympe.host.Ed.j{cancel(){this.Yf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.D=class extends olympe.host.Ed.j{cancel(){this.Yf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.F=class extends olympe.host.Ed.j{cancel(){this.Yf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Je=class{H(a,b){return null!=b?b:''}ia(a,b){return null!=b?b:''}Ga(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Je.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Oe={};olympe.host.Oe.Sd=class{destroy(){}};olympe.host.Oe.Sd.prototype.destroy=olympe.host.Oe.Sd.prototype.destroy;olympe.host.Oe.Eq={vA:100,xA:101,wA:102,zA:103,yA:104,uA:105,bD:201,$C:202,XC:204,eD:205,WC:206,ZC:207,cD:208,fD:209,gD:210,hD:211,YC:212,dD:218,aD:219,iD:220,VC:221,UC:222,pD:300,qD:301,rD:302,vD:303,wD:304,xD:305,sD:310,tD:311,uD:312,vC:400,wC:401,xC:402,jC:450,cC:500,aC:501,fC:502,eC:503,bC:504,dC:505,QD:600,HD:601,LD:602,DD:603,ED:604,BD:605,GD:606,WD:607,OD:608,yD:609,CD:610,FD:611,ND:612,SD:613,zD:614,RD:615,MD:616,VD:617,ID:618,JD:619,KD:620,PD:630,AD:631,TD:632,UD:633,BE:700,eE:701,fE:702,
430
- gE:703,iE:704,jE:705,kE:706,hE:707,mE:708,lE:709,nE:710,rE:711,zE:712,oE:713,pE:714,sE:715,tE:716,vE:717,wE:718,yE:719,uE:720,xE:721,AE:722,qE:723,CE:724,DE:725,hs:800};olympe.host.Oe.Ed=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Pk:'host.System',Np:'host.HistoryManager',Er:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Ge:'host.ProcessManager'};olympe.host.Config={Ik:'host.role',Op:'host.currentHost',ar:'host.processProbe',Kr:'host.gracefulShutdownTimeout'};olympe.host.Wg={zl:'active',Th:'preview'};olympe.host.Yf=null;
431
- olympe.V.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';a.setParameter(olympe.host.Config.Op,d);b=olympe.host.Wg.zl;c=olympe.host.Wg.Th;E(a,olympe.host.Config.Ik,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.Pk);Xa(a,olympe.host.P.Np);C(a,olympe.host.P.Ge,olympe.host.Je);D(a,olympe.host.P.Ca,[olympe.ha.P.Da],e=>e.ad('host'));C(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.V.P.Eg);D(a,olympe.host.P.Er,
432
- [olympe.host.P.Da],e=>{null===olympe.host.Yf&&(olympe.host.Yf=new olympe.host.Ed(e));return olympe.host.Yf},!0)},'olympe.host');olympe.V.run([olympe.host.P.Er],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.host.kl=()=>a});olympe.error={};olympe.error.od=class extends Error{constructor(a,b=olympe.error.lc.Vk){super(a);this.code=b}Aj(){return this.code}};olympe.error.lc={Vk:0,Oi:1,Cq:401,jk:403,Zi:404,Dv:406,TIMEOUT:408,pw:503,Bq:530,Pl:600,Dq:1006};olympe.error.Uk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.TIMEOUT)}};olympe.error.Yq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.pw)}};olympe.error.tk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Cq)}};olympe.error.Dm=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Zi)}};
433
- olympe.error.Lq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Kq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Dv)}};olympe.error.mC=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Bq)}};olympe.error.Sl=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Pl)}};olympe.error.jp=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};
434
- olympe.error.Vq=class extends olympe.error.od{constructor(){super('Working offline',olympe.error.lc.Oi)}};olympe.error.To=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Ar=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Zm=class extends olympe.error.od{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Ph=class extends olympe.error.Zm{};olympe.error.Go=class extends olympe.error.Zm{};
435
- olympe.error.Mp=class extends olympe.error.Zm{};olympe.net={};olympe.net.va={};olympe.net.va.Rd={Sh:'POST',GET:'GET',tu:'HEAD',br:'PUT',Dc:'DELETE',Qq:'OPTIONS',yC:'PATCH'};olympe.net.va.ResponseType={Wr:'text',JSON:'json',Gl:'blob',$h:'uint8array',je:'stream'};olympe.net.va.Headers={Ii:'content-type',KA:'content-length',so:'authorization',Ft:'access-control-allow-origin',Dt:'access-control-allow-headers',Et:'access-control-allow-methods',xp:'x-forwarded-host',yp:'x-forwarded-proto'};
436
- olympe.net.va.Tl={MB:'text/html',JSON:'application/json',Xw:'application/zip',je:'application/octet-stream'};olympe.net.va.Tb={Lo:0,Qh:200,No:201,Qj:202,El:400,Mw:401,jk:403,Zi:404,gC:405,gj:500,lw:503};function Dc(a){return a.host&&encodeURI(a.host)}function Ec(a){return encodeURI(a.path).replace(olympe.net.oj.j,(b,c)=>'%'+c)}olympe.net.oj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.xh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.xh=d)}j(){return`${(void 0===this.xh?443===this.port:this.xh)?'wss':'ws'}://${Dc(this)}:${this.port}/${Ec(this)}`}toString(){return`${Dc(this)}:${this.port}/${Ec(this)}`}};
437
- olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.Nz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Si(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.yt&&(c=a.yt.split(':'),2===c.length&&(c=ab(olympe.U.jf(),`${c[0]}:${c[1]}`),Fc(b,{Authorization:`Basic ${c}`})));return b}function Gc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Hc(a,b){a.D=b;return a}function Fc(a,b){Object.assign(a.headers,b)}
438
- olympe.net.Si=class extends olympe.net.oj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.va.Rd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.va.ResponseType.Wr}Cj(){return this.headers}j(){let a=Gc(this);a=a?`?${a}`:'';if(!Dc(this))return`${Ec(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.xh?443===this.port:this.xh)?'https':'http'}://${Dc(this)}${b}/${Ec(this)}${a}`}toString(){return this.j()}};
439
- olympe.net.Si.Rd={Sh:'POST',GET:'GET',tu:'HEAD',br:'PUT',Dc:'DELETE',Qq:'OPTIONS'};olympe.net.pd=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}Ic(){return this.status}Cj(){return this.headers}};function Ic(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.Za(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Jc(a.j,c,b).finally(()=>{d.Wf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.ve.xu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}Vf(){}R(){}};function Kc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.yc,e=olympe.net.AMQPClient.j.zb;mb(a.state,b,a.ia.bind(a),[c]);mb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);mb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Lc(a);if(a.F&&!a.X&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.lt)?k:5E3)}}),
440
- [b,c,e]);nb(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Mc(a,b){kb(a.state,olympe.net.AMQPClient.j.ze,b)}function Nc(a,b){kb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Oc(a,b){kb(a.state,olympe.net.AMQPClient.j.yc,b)}
441
- function Lc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.U.Promise.Zf(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Pc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Qc(a,b){if(!Pc(a))throw new olympe.error.Sl(null!=b?b:'Not connected to the bus');}
424
+ olympe.C.oD=class{constructor(){this.j=new olympe.C.Wb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(vc,'Last slot manager entry');this.size=lc(olympe.C.bc(olympe.C.$,'SlotManager size').repeat(this.D.tb().Fn()),olympe.C.$.ZERO);this.N=lc(olympe.C.bc(olympe.C.$,'last valid slots'),olympe.C.qa(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{uc(this)})}};
425
+ class vc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Wb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=lc(olympe.C.bc(olympe.C.$),olympe.C.$.ZERO);olympe.C.gb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.$);this.F=this.j.tb().ge(e.tb())});this.next=null}T(){return this.id}Zy(){return this.j.tb()}Fn(){return this.F}Hd(){return this.H}hz(){return this.N}rA(a){this.H=a}eA(a){null===a?this.j.update(olympe.C.$.ZERO):(this.j.repeat(a.Fn()),a.next=this)}Tu(){this.j.clear();
426
+ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=vc.prototype;m.T.K=olympe.C.J.j;m.Zy.K=new olympe.C.J(()=>olympe.C.$);m.Fn.K=new olympe.C.J(()=>olympe.C.$);m.Hd.K=olympe.C.J.j;m.hz.K=olympe.C.J.j;m.rA.K=olympe.C.J.j;m.eA.K=olympe.C.J.j;m.Tu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.V.config(a=>{E(a,olympe.C.Config.Bq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Ca,[olympe.ha.P.Fa],b=>b.ad('df'))},'olympe.df');olympe.V.run([olympe.C.P.Ca],a=>{olympe.C.Hx(a)},'olympe.df');olympe.host={};const wc=new Map,xc=new Map;olympe.host.Iq=class{static register(a,b,...c){wc.set(a,b);0<c.length&&xc.set(a,c)}static create(a,b,c,d){const e=wc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=xc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function yc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Iq.create(c,b,a.G,a.H))}function zc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ha.xb.j.ag&&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.gb(f))b.push(a.j.get(f.bx)||null);else if('function'===typeof f){const g=f,h=olympe.C.Za();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
427
+ function Ac(a){var b=olympe.host.Oe.Ed,c=olympe.host.Oe.Hq.ls;++a.F;const d=a.F;yc(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.gb(p)?(h.push(n),p=p.Ba):olympe.C.Uf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{zc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
428
+ {zc(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.Xd(a.N.bind(a,d));a=M(e);a.bx=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')}Xa(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Sd=class{constructor(a){this.j=a;this.D=olympe.C.Za()}F(){return this.j}hd(){return this.j.Ba.hd()||this.D.hd()}fb(){return this.j.Ba.fb()}};olympe.host.Sd.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Sd,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.Au=class{};function Bc(a,b){var c=olympe.host.Yf;const d=olympe.U.Kc(),e=new olympe.C.Wb('onTimeout context');c.j.X(b,d,()=>{e.fb()||e.hd()||e.run(a);c.j.F(d)});return new olympe.host.Ed.D(c.j,d,e)}function Cc(a,b){var c=olympe.host.Yf;const d=olympe.U.Kc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.fb()||e.hd()?c.j.D(d):e.run(a)})}olympe.host.Ed=class{constructor(a){this.j=Ac(a)}};olympe.host.Ed.j=class{constructor(a,b,c){this.Yf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
429
+ olympe.host.Ed.H=class extends olympe.host.Ed.j{cancel(){this.Yf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.D=class extends olympe.host.Ed.j{cancel(){this.Yf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ed.F=class extends olympe.host.Ed.j{cancel(){this.Yf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Je=class{H(a,b){return null!=b?b:''}ia(a,b){return null!=b?b:''}Ha(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Je.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Oe={};olympe.host.Oe.Sd=class{destroy(){}};olympe.host.Oe.Sd.prototype.destroy=olympe.host.Oe.Sd.prototype.destroy;olympe.host.Oe.Hq={zA:100,BA:101,AA:102,DA:103,CA:104,yA:105,fD:201,dD:202,aD:204,iD:205,$C:206,cD:207,gD:208,jD:209,kD:210,lD:211,bD:212,hD:218,eD:219,mD:220,ZC:221,YC:222,tD:300,uD:301,vD:302,zD:303,AD:304,BD:305,wD:310,xD:311,yD:312,zC:400,AC:401,BC:402,nC:450,gC:500,eC:501,jC:502,iC:503,fC:504,hC:505,UD:600,LD:601,PD:602,HD:603,ID:604,FD:605,KD:606,$D:607,SD:608,CD:609,GD:610,JD:611,RD:612,WD:613,DD:614,VD:615,QD:616,ZD:617,MD:618,ND:619,OD:620,TD:630,ED:631,XD:632,YD:633,FE:700,iE:701,jE:702,
430
+ kE:703,mE:704,nE:705,oE:706,lE:707,qE:708,pE:709,rE:710,vE:711,DE:712,sE:713,tE:714,wE:715,xE:716,zE:717,AE:718,CE:719,yE:720,BE:721,EE:722,uE:723,GE:724,HE:725,ls:800};olympe.host.Oe.Ed=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Qk:'host.System',Op:'host.HistoryManager',Hr:'host.Scheduler',Ca:'host.platform.Logger',Fa:'host.Manager',Ge:'host.ProcessManager'};olympe.host.Config={Jk:'host.role',Pp:'host.currentHost',dr:'host.processProbe',Nr:'host.gracefulShutdownTimeout'};olympe.host.Wg={Al:'active',Th:'preview'};olympe.host.Yf=null;
431
+ olympe.V.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';a.setParameter(olympe.host.Config.Pp,d);b=olympe.host.Wg.Al;c=olympe.host.Wg.Th;E(a,olympe.host.Config.Jk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.Qk);Xa(a,olympe.host.P.Op);C(a,olympe.host.P.Ge,olympe.host.Je);D(a,olympe.host.P.Ca,[olympe.ha.P.Fa],e=>e.ad('host'));C(a,olympe.host.P.Fa,olympe.host.Ta,olympe.host.P.Ca,olympe.V.P.Eg);D(a,olympe.host.P.Hr,
432
+ [olympe.host.P.Fa],e=>{null===olympe.host.Yf&&(olympe.host.Yf=new olympe.host.Ed(e));return olympe.host.Yf},!0)},'olympe.host');olympe.V.run([olympe.host.P.Hr],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Fa],a=>a,'olympe.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.host.ll=()=>a});olympe.error={};olympe.error.od=class extends Error{constructor(a,b=olympe.error.lc.Wk){super(a);this.code=b}Aj(){return this.code}};olympe.error.lc={Wk:0,Oi:1,Fq:401,kk:403,Zi:404,Hv:406,TIMEOUT:408,tw:503,Eq:530,Ql:600,Gq:1006};olympe.error.Vk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.TIMEOUT)}};olympe.error.ar=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.tw)}};olympe.error.uk=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Fq)}};olympe.error.Em=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Zi)}};
433
+ olympe.error.Oq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Nq=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Hv)}};olympe.error.qC=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Eq)}};olympe.error.Tl=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Ql)}};olympe.error.kp=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};
434
+ olympe.error.Yq=class extends olympe.error.od{constructor(){super('Working offline',olympe.error.lc.Oi)}};olympe.error.Uo=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.Dr=class extends olympe.error.od{constructor(a){super(a,olympe.error.lc.Oi)}};olympe.error.$m=class extends olympe.error.od{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Ph=class extends olympe.error.$m{};olympe.error.Ho=class extends olympe.error.$m{};
435
+ olympe.error.Np=class extends olympe.error.$m{};olympe.net={};olympe.net.va={};olympe.net.va.Rd={Sh:'POST',GET:'GET',xu:'HEAD',er:'PUT',Dc:'DELETE',Tq:'OPTIONS',CC:'PATCH'};olympe.net.va.ResponseType={Zr:'text',JSON:'json',Hl:'blob',$h:'uint8array',je:'stream'};olympe.net.va.Headers={Ii:'content-type',OA:'content-length',uo:'authorization',Jt:'access-control-allow-origin',Ht:'access-control-allow-headers',It:'access-control-allow-methods',yp:'x-forwarded-host',zp:'x-forwarded-proto'};
436
+ olympe.net.va.Ul={QB:'text/html',JSON:'application/json',ax:'application/zip',je:'application/octet-stream'};olympe.net.va.Tb={Mo:0,Qh:200,Oo:201,Rj:202,Fl:400,Qw:401,kk:403,Zi:404,kC:405,gj:500,pw:503};function Dc(a){return a.host&&encodeURI(a.host)}function Ec(a){return encodeURI(a.path).replace(olympe.net.oj.j,(b,c)=>'%'+c)}olympe.net.oj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.xh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.xh=d)}j(){return`${(void 0===this.xh?443===this.port:this.xh)?'wss':'ws'}://${Dc(this)}:${this.port}/${Ec(this)}`}toString(){return`${Dc(this)}:${this.port}/${Ec(this)}`}};
437
+ olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.Qz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Si(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ct&&(c=a.Ct.split(':'),2===c.length&&(c=ab(olympe.U.jf(),`${c[0]}:${c[1]}`),Fc(b,{Authorization:`Basic ${c}`})));return b}function Gc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Hc(a,b){a.D=b;return a}function Fc(a,b){Object.assign(a.headers,b)}
438
+ olympe.net.Si=class extends olympe.net.oj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.va.Rd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.va.ResponseType.Zr}Cj(){return this.headers}j(){let a=Gc(this);a=a?`?${a}`:'';if(!Dc(this))return`${Ec(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.xh?443===this.port:this.xh)?'https':'http'}://${Dc(this)}${b}/${Ec(this)}${a}`}toString(){return this.j()}};
439
+ olympe.net.Si.Rd={Sh:'POST',GET:'GET',xu:'HEAD',er:'PUT',Dc:'DELETE',Tq:'OPTIONS'};olympe.net.pd=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}Jc(){return this.status}Cj(){return this.headers}};function Ic(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.Za(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Jc(a.j,c,b).finally(()=>{d.Wf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.ve.Bu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}Vf(){}R(){}};function Kc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.zc,e=olympe.net.AMQPClient.j.Ab;mb(a.state,b,a.ia.bind(a),[c]);mb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);mb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Lc(a);if(a.F&&!a.X&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.pt)?k:5E3)}}),
440
+ [b,c,e]);nb(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Mc(a,b){kb(a.state,olympe.net.AMQPClient.j.ze,b)}function Nc(a,b){kb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Oc(a,b){kb(a.state,olympe.net.AMQPClient.j.zc,b)}
441
+ function Lc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.U.Promise.Zf(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Pc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Qc(a,b){if(!Pc(a))throw new olympe.error.Tl(null!=b?b:'Not connected to the bus');}
442
442
  function Rc(a){let b,c;return Number.parseInt(null!=(c=null==(b=/^.*\((\d+)\)$/.exec(a instanceof Error?a.message:a))?void 0:b[1])?c:'0',10)}
443
- function Sc(a,b,c,d){return u(function*(){try{yield Tc(a,b,c)}catch(e){if(e instanceof olympe.error.Kq)return a.G.debug(`Queue ${b} already exists with different parameters, deleting it..`),yield Uc(a,b),new Promise((f,g)=>setTimeout(()=>{a.G.debug(`Redeclare queue ${b} with new parameters..`);Sc(a,b,c,d).then(f).catch(g)},500));throw Error(`Fail to declare queue ${b}: ${e}`);}try{let e,f;yield null==(e=a.D.get(b))?void 0:null==(f=e.un)?void 0:f.cancel()}catch(e){}try{yield Vc(a,b,c,d)}catch(e){throw Error(`Fail to consume queue ${b}: ${e}`);
444
- }})}function Wc(a,b,c,d){return u(function*(){Qc(a,'Cannot subscribe to a queue without being connected to the bus');if(a.D.has(b))throw Error(`Cannot subscribe twice to the queue ${b}.`);a.G.debug(`Subscribing to queue: ${b}, exclusive: ${c}`);a.D.set(b,{xl:new Set([b]),un:null,Kn:d,exclusive:c});yield Sc(a,b,c,d);a.G.debug(`Subscribed queue: ${b}.`)})}
445
- function Xc(a,b){return u(function*(){a.G.debug(`Closing subscription to queue: ${b}`);const c=a.D.get(b);a.D.delete(b);let d,e;if(!1===(null==(d=a.H)?void 0:d.closed)&&!1===(null==(e=a.j)?void 0:e.closed))try{let f;yield null==c?void 0:null==(f=c.un)?void 0:f.cancel()}catch(f){a.G.warn(`An error occurred while closing the subscription to queue: ${b}: ${f}`)}})}
446
- function Tc(a,b,c){return u(function*(){Qc(a,'Cannot declare a queue without being connected to the bus');a.G.debug(`Declaring queue: ${b}`);const d=yield Yc(a);try{yield d.queueDeclare(b,{durable:!c,exclusive:!1,autoDelete:!1,passive:!1},{'x-expires':c?15E3:a.N.Tz,'x-message-ttl':a.N.sz,'x-queue-type':c?'classic':'quorum'}),a.G.debug(`Queue: ${b} declared`)}catch(e){a.G.error(`Failed to declare queue: ${b}`,e);if(Rc(e)===olympe.net.AMQPClient.D.$q)throw new olympe.error.Kq(`Queue ${b} already exists with different parameters`);
443
+ function Sc(a,b,c,d){return u(function*(){try{yield Tc(a,b,c)}catch(e){if(e instanceof olympe.error.Nq)return a.G.debug(`Queue ${b} already exists with different parameters, deleting it..`),yield Uc(a,b),new Promise((f,g)=>setTimeout(()=>{a.G.debug(`Redeclare queue ${b} with new parameters..`);Sc(a,b,c,d).then(f).catch(g)},500));throw Error(`Fail to declare queue ${b}: ${e}`);}try{let e,f;yield null==(e=a.D.get(b))?void 0:null==(f=e.vn)?void 0:f.cancel()}catch(e){}try{yield Vc(a,b,c,d)}catch(e){throw Error(`Fail to consume queue ${b}: ${e}`);
444
+ }})}function Wc(a,b,c,d){return u(function*(){Qc(a,'Cannot subscribe to a queue without being connected to the bus');if(a.D.has(b))throw Error(`Cannot subscribe twice to the queue ${b}.`);a.G.debug(`Subscribing to queue: ${b}, exclusive: ${c}`);a.D.set(b,{yl:new Set([b]),vn:null,Ln:d,exclusive:c});yield Sc(a,b,c,d);a.G.debug(`Subscribed queue: ${b}.`)})}
445
+ function Xc(a,b){return u(function*(){a.G.debug(`Closing subscription to queue: ${b}`);const c=a.D.get(b);a.D.delete(b);let d,e;if(!1===(null==(d=a.H)?void 0:d.closed)&&!1===(null==(e=a.j)?void 0:e.closed))try{let f;yield null==c?void 0:null==(f=c.vn)?void 0:f.cancel()}catch(f){a.G.warn(`An error occurred while closing the subscription to queue: ${b}: ${f}`)}})}
446
+ function Tc(a,b,c){return u(function*(){Qc(a,'Cannot declare a queue without being connected to the bus');a.G.debug(`Declaring queue: ${b}`);const d=yield Yc(a);try{yield d.queueDeclare(b,{durable:!c,exclusive:!1,autoDelete:!1,passive:!1},{'x-expires':c?15E3:a.N.Xz,'x-message-ttl':a.N.wz,'x-queue-type':c?'classic':'quorum'}),a.G.debug(`Queue: ${b} declared`)}catch(e){a.G.error(`Failed to declare queue: ${b}`,e);if(Rc(e)===olympe.net.AMQPClient.D.cr)throw new olympe.error.Nq(`Queue ${b} already exists with different parameters`);
447
447
  throw e;}finally{try{yield d.close()}catch(e){}}})}function Uc(a,b){return u(function*(){const c=yield Yc(a);try{yield c.queueDelete(b)}finally{yield c.close()}})}
448
- function Vc(a,b,c,d){return u(function*(){Qc(a,'Cannot consume a queue without being connected to the bus');a.G.debug(`Will consume queue: ${b}..`);const e=a.j,f={exclusive:c,noAck:!1},g=yield a.push(()=>e.basicConsume(b,f,h=>{a.G.j()&&a.G.debug(`AMQP < [${b}]: ${h.bodyToString()}`);d(new olympe.net.AMQPMessage(h,b,e))}));a.D.get(b).un=g;a.G.debug(`Consumer ${g.tag} subscribed to queue: ${b}, on channel ${e.id}`);g.wait().catch(h=>{a.G.debug(`Consumer of queue ${b} has been closed: ${h}`);h=Rc(h);
449
- if(h===olympe.net.AMQPClient.D.Qm||h===olympe.net.AMQPClient.D.Vk)h=Math.round(5E3*Math.random()),a.G.warn(`Consumer of queue ${b} has been forced closed, will recreate the queue in ${h}ms..`),setTimeout(()=>{a.j===e&&!1===(null==e?void 0:e.closed)&&Sc(a,b,c,d).catch(k=>{a.G.error(`Failed to resubscribe to queue ${b}: ${k}`)})},h)})})}
450
- function Yc(a,{id:b,Jz:c}={}){return u(function*(){const d=yield a.H.channel(b);d.onerror=null!=c?c:e=>{a.G.debug(`Error with channel (${d.id}): ${e}`)};return d})}
451
- function Zc(a,b,c){return u(function*(){Qc(a,'Cannot bind a queue without being connected to the bus');var d;if(null==(d=a.D.get(b))?0:d.xl.has(c))throw Error(`Queue ${b} already bound to topic ${c}`);d=yield Yc(a);try{a.G.debug(`Binding queue ${b} to topic ${c}`),yield d.queueBind(b,'amq.topic',c),a.D.get(b).xl.add(c)}finally{yield d.close()}})}
452
- function $c(a,b,c){return u(function*(){Qc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Yc(a);try{a.G.debug(`Unbinding queue ${b} to topic ${c}`);let e,f;null==(e=a.D.get(b))||null==(f=e.xl)||f.delete(c);yield d.queueUnbind(b,'amq.topic',c)}finally{try{yield d.close()}catch(e){}}})}
453
- olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ha.Xa('AMQP');this.X=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.U.Aw(this.G);this.D=new Map;this.R=new Map;this.sa=new olympe.U.promise.Sk;const c=olympe.U.Promise.uj(()=>{const d=olympe.net.AMQPClient.j.CONNECTING,e=olympe.net.AMQPClient.j.yc,f=this.state.getState();f===e?this.F&&F(this.state,d):f!==d&&F(this.state,e,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
454
- this.N=d;null!==d&&(this.X=!1,c().then())});Kc(this)}connect(){const a=this;return u(function*(){if(Pc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.yc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield lb(a.state,olympe.net.AMQPClient.j.ze);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.yc;a.state.getState()!==b&&(F(a.state,b,!1),yield lb(a.state,b))})}kd(a,b,c,d={mandatory:!1,xt:!1}){const e=this;return u(function*(){Qc(e,'Cannot publish a message without being connected to the bus');
455
- const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,l=>h(new olympe.error.Lq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.xt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Rc(l)===olympe.net.AMQPClient.D.Qm?new olympe.error.Dm(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ia(){const a=
456
- this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.Z(a.N,a.name);try{let b;yield olympe.U.Promise.nt(a.Ga.bind(a),(null!=(b=a.N.lt)?b:5E3)/2,[olympe.error.Sl]);a.G.debug('AMQP Client connected')}catch(b){if(b instanceof Event&&'close'===b.type)throw Error('Bus not ready, will try to reconnect..');throw b;}})}Ga(a){const b=this;return u(function*(){b.G.debug(`Connecting to the bus, tentative ${a+1}..`);b.H.onerror=d=>{if(d instanceof amqp.AMQPError){var e=
457
- olympe.error.lc.Pl;const f=olympe.error.lc.Dq,g=Rc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.yc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.da(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.yc,b.F)})}catch(d){if(d instanceof Error)switch(Rc(d)){case olympe.error.lc.Pl:case olympe.error.lc.Dq:throw new olympe.error.Sl(d);case olympe.error.lc.Bq:case olympe.error.lc.Cq:case olympe.error.lc.jk:throw b.X=
458
- !0,new olympe.error.tk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.od(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Yc(b,{id:1,Jz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Rc(e);e!==olympe.net.AMQPClient.D.Qm&&e!==olympe.net.AMQPClient.D.$q||olympe.U.Promise.nt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
459
- {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Uz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.messageId,10)))||g(f)};b.D.forEach(({Kn:e,exclusive:f},g)=>{Sc(b,g,f,e)})});yield c()})}push(a){return vb(this.sa,a)}Z(){}da(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',yc:'DISCONNECTED',zb:'ERROR'};
460
- olympe.net.AMQPClient.D={Vk:0,Qm:404,JC:405,$q:406,DA:504,bq:541};function ad(a){let b;return null!=(b=a.F)?b:{}}function bd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ha.Xa('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
448
+ function Vc(a,b,c,d){return u(function*(){Qc(a,'Cannot consume a queue without being connected to the bus');a.G.debug(`Will consume queue: ${b}..`);const e=a.j,f={exclusive:c,noAck:!1},g=yield a.push(()=>e.basicConsume(b,f,h=>{a.G.j()&&a.G.debug(`AMQP < [${b}]: ${h.bodyToString()}`);d(new olympe.net.AMQPMessage(h,b,e))}));a.D.get(b).vn=g;a.G.debug(`Consumer ${g.tag} subscribed to queue: ${b}, on channel ${e.id}`);g.wait().catch(h=>{a.G.debug(`Consumer of queue ${b} has been closed: ${h}`);h=Rc(h);
449
+ if(h===olympe.net.AMQPClient.D.Rm||h===olympe.net.AMQPClient.D.Wk)h=Math.round(5E3*Math.random()),a.G.warn(`Consumer of queue ${b} has been forced closed, will recreate the queue in ${h}ms..`),setTimeout(()=>{a.j===e&&!1===(null==e?void 0:e.closed)&&Sc(a,b,c,d).catch(k=>{a.G.error(`Failed to resubscribe to queue ${b}: ${k}`)})},h)})})}
450
+ function Yc(a,{id:b,Mz:c}={}){return u(function*(){const d=yield a.H.channel(b);d.onerror=null!=c?c:e=>{a.G.debug(`Error with channel (${d.id}): ${e}`)};return d})}
451
+ function Zc(a,b,c){return u(function*(){Qc(a,'Cannot bind a queue without being connected to the bus');var d;if(null==(d=a.D.get(b))?0:d.yl.has(c))throw Error(`Queue ${b} already bound to topic ${c}`);d=yield Yc(a);try{a.G.debug(`Binding queue ${b} to topic ${c}`),yield d.queueBind(b,'amq.topic',c),a.D.get(b).yl.add(c)}finally{yield d.close()}})}
452
+ function $c(a,b,c){return u(function*(){Qc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Yc(a);try{a.G.debug(`Unbinding queue ${b} to topic ${c}`);let e,f;null==(e=a.D.get(b))||null==(f=e.yl)||f.delete(c);yield d.queueUnbind(b,'amq.topic',c)}finally{try{yield d.close()}catch(e){}}})}
453
+ olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ha.Xa('AMQP');this.X=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.U.Ew(this.G);this.D=new Map;this.R=new Map;this.sa=new olympe.U.promise.Tk;const c=olympe.U.Promise.uj(()=>{const d=olympe.net.AMQPClient.j.CONNECTING,e=olympe.net.AMQPClient.j.zc,f=this.state.getState();f===e?this.F&&F(this.state,d):f!==d&&F(this.state,e,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
454
+ this.N=d;null!==d&&(this.X=!1,c().then())});Kc(this)}connect(){const a=this;return u(function*(){if(Pc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.zc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield lb(a.state,olympe.net.AMQPClient.j.ze);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.zc;a.state.getState()!==b&&(F(a.state,b,!1),yield lb(a.state,b))})}kd(a,b,c,d={mandatory:!1,Bt:!1}){const e=this;return u(function*(){Qc(e,'Cannot publish a message without being connected to the bus');
455
+ const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,l=>h(new olympe.error.Oq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.Bt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Rc(l)===olympe.net.AMQPClient.D.Rm?new olympe.error.Em(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ia(){const a=
456
+ this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.Z(a.N,a.name);try{let b;yield olympe.U.Promise.rt(a.Ha.bind(a),(null!=(b=a.N.pt)?b:5E3)/2,[olympe.error.Tl]);a.G.debug('AMQP Client connected')}catch(b){if(b instanceof Event&&'close'===b.type)throw Error('Bus not ready, will try to reconnect..');throw b;}})}Ha(a){const b=this;return u(function*(){b.G.debug(`Connecting to the bus, tentative ${a+1}..`);b.H.onerror=d=>{if(d instanceof amqp.AMQPError){var e=
457
+ olympe.error.lc.Ql;const f=olympe.error.lc.Gq,g=Rc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.zc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.da(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.zc,b.F)})}catch(d){if(d instanceof Error)switch(Rc(d)){case olympe.error.lc.Ql:case olympe.error.lc.Gq:throw new olympe.error.Tl(d);case olympe.error.lc.Eq:case olympe.error.lc.Fq:case olympe.error.lc.kk:throw b.X=
458
+ !0,new olympe.error.uk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.od(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Yc(b,{id:1,Mz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Rc(e);e!==olympe.net.AMQPClient.D.Rm&&e!==olympe.net.AMQPClient.D.cr||olympe.U.Promise.rt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
459
+ {var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Yz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.messageId,10)))||g(f)};b.D.forEach(({Ln:e,exclusive:f},g)=>{Sc(b,g,f,e)})});yield c()})}push(a){return vb(this.sa,a)}Z(){}da(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',zc:'DISCONNECTED',Ab:'ERROR'};
460
+ olympe.net.AMQPClient.D={Wk:0,Rm:404,NC:405,cr:406,HA:504,eq:541};function ad(a){let b;return null!=(b=a.F)?b:{}}function bd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ha.Xa('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
461
461
  olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}wi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ha.Xa('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}};olympe.net.ci=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}D(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}R(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
462
- olympe.net.ci.ALL='*';olympe.net.yw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',nj:'net.WebServer',qw:'net.ServiceWorkerManager',Fm:'net.OfflineConfig'};olympe.net.Config={Af:'net.httpPort',Rp:'net.httpBodyLimit',gs:'net.http2',Qp:'net.httpsCertificatesPath',xm:'net.localNetworkSuffix',bj:'offline.enabled',Em:'offline.autoBackOnline',Pq:'offline.downloadBatchSize'};
463
- olympe.V.config(function(a){E(a,olympe.net.Config.Af,3141);E(a,olympe.net.Config.Rp,100);E(a,olympe.net.Config.gs,!1);E(a,olympe.net.Config.Qp,null);E(a,olympe.net.Config.xm,'frontend');E(a,olympe.net.Config.bj,!1);E(a,olympe.net.Config.Em,!1);E(a,olympe.net.Config.Pq,20);Xa(a,olympe.net.P.Da);D(a,olympe.net.P.Ca,[olympe.ha.P.Da],b=>b.ad('net'));C(a,olympe.net.P.nj,olympe.net.ci,olympe.net.P.Ca);C(a,olympe.net.P.qw,olympe.net.yw);D(a,olympe.net.P.Fm,[new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Em)],
464
- (b,c)=>new Map([['offlineEnabled',b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Sd=function(a,b){this.G=b};olympe.Va.node.host.Sd.prototype.constructor=olympe.Va.node.host.Sd;olympe.Va.node.host.Sd.prototype.destroy=function(){};olympe.Va.node.host.Sd.prototype.destroy=olympe.Va.node.host.Sd.prototype.destroy;olympe.Va.node.host.Sd.prototype.Xa=function(){return this.G};olympe.Va.node.host.Sd.ya=[olympe.host.Oe.Sd];olympe.Va.node.host.Gq=class{constructor(a){this.G=a}};olympe.Va.node.host.Gq.ya=[olympe.host.wu];olympe.Va.node.host.Ed=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}X(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.Fq.register(olympe.host.Oe.Eq.hs,olympe.Va.node.host.Ed);olympe.Va.node.host.Ed.ya=[olympe.host.Oe.Ed];olympe.Va.node.host.Tk=class{constructor(a){this.G=a}j(){return olympe.C.ba.D}D(){return!0}};olympe.Va.node.host.Tk.ya=[olympe.host.Tk];function cd(a){a.sa.D('readinessProbe','/readiness',[olympe.net.va.Rd.GET],()=>ed(a,a.da)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.sa.D('livenessProbe','/liveness',[olympe.net.va.Rd.GET],()=>ed(a,a.Z)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.sa.stop())}
462
+ olympe.net.ci.ALL='*';olympe.net.Cw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Fa:'net.Manager',Ca:'net.Logger',nj:'net.WebServer',uw:'net.ServiceWorkerManager',Gm:'net.OfflineConfig'};olympe.net.Config={Af:'net.httpPort',Sp:'net.httpBodyLimit',ks:'net.http2',Rp:'net.httpsCertificatesPath',ym:'net.localNetworkSuffix',bj:'offline.enabled',Fm:'offline.autoBackOnline',Sq:'offline.downloadBatchSize'};
463
+ olympe.V.config(function(a){E(a,olympe.net.Config.Af,3141);E(a,olympe.net.Config.Sp,100);E(a,olympe.net.Config.ks,!1);E(a,olympe.net.Config.Rp,null);E(a,olympe.net.Config.ym,'frontend');E(a,olympe.net.Config.bj,!1);E(a,olympe.net.Config.Fm,!1);E(a,olympe.net.Config.Sq,20);Xa(a,olympe.net.P.Fa);D(a,olympe.net.P.Ca,[olympe.ha.P.Fa],b=>b.ad('net'));C(a,olympe.net.P.nj,olympe.net.ci,olympe.net.P.Ca);C(a,olympe.net.P.uw,olympe.net.Cw);D(a,olympe.net.P.Gm,[new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Fm)],
464
+ (b,c)=>new Map([['offlineEnabled',b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Sd=function(a,b){this.G=b};olympe.Va.node.host.Sd.prototype.constructor=olympe.Va.node.host.Sd;olympe.Va.node.host.Sd.prototype.destroy=function(){};olympe.Va.node.host.Sd.prototype.destroy=olympe.Va.node.host.Sd.prototype.destroy;olympe.Va.node.host.Sd.prototype.Xa=function(){return this.G};olympe.Va.node.host.Sd.ya=[olympe.host.Oe.Sd];olympe.Va.node.host.Jq=class{constructor(a){this.G=a}};olympe.Va.node.host.Jq.ya=[olympe.host.Au];olympe.Va.node.host.Ed=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}X(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.Iq.register(olympe.host.Oe.Hq.ls,olympe.Va.node.host.Ed);olympe.Va.node.host.Ed.ya=[olympe.host.Oe.Ed];olympe.Va.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.ba.D}D(){return!0}};olympe.Va.node.host.Uk.ya=[olympe.host.Uk];function cd(a){a.sa.D('readinessProbe','/readiness',[olympe.net.va.Rd.GET],()=>ed(a,a.da)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.sa.D('livenessProbe','/liveness',[olympe.net.va.Rd.GET],()=>ed(a,a.Z)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.sa.stop())}
465
465
  function fd(a,b){b=Array.from(b.values()).map(c=>c());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 gd(a){return u(function*(){try{const b=yield fd(a,a.N),c=yield fd(a,a.R),d=yield fd(a,a.X);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.X.clear()}})}
466
466
  function ed(a,b){const c=olympe.net.va.Tb.Qh,d=olympe.net.va.Tb.gj;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.pd('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.pd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
467
467
  olympe.Va.node.host.Je=class extends olympe.host.Je{constructor(a,b,c,d=!0){super();this.G=a;this.sa=b;this.Wa=c;this.Z=new Map;this.da=new Map;this.R=new Map;this.N=new Map;this.X=new Map;d&&cd(this)}j(a,b=olympe.U.hf(),c=olympe.host.Je.j.ALL){switch(c){case olympe.host.Je.j.LIVENESS:this.Z.set(b,a);break;case olympe.host.Je.j.READINESS:this.da.set(b,a);break;default:this.Z.set(b,a),this.da.set(b,a)}return b}D(a){this.da.delete(a);this.Z.delete(a)}H(a,b=olympe.U.hf()){this.R.set(b,this.Zf(b,a,this.Wa));
468
- return b}ia(a,b=olympe.U.hf(),c){this.N.set(b,this.Zf(b,a,null!=c?c:this.Wa));return b}Ga(a,b=olympe.U.hf()){this.X.set(b,this.Zf(b,a,this.Wa));return b}F(a){this.R.has(a)?this.R.delete(a):this.N.has(a)?this.N.delete(a):this.X.delete(a)}Zf(a,b,c){return()=>olympe.U.Promise.Zf(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.V.config(function(a){E(a,olympe.host.Config.ar,!0);E(a,olympe.host.Config.Kr,1E4);Va(a,olympe.host.P.Np,olympe.Va.node.host.Gq,olympe.host.P.Ca);Va(a,olympe.host.P.Pk,olympe.Va.node.host.Tk,olympe.host.P.Ca);C(a,olympe.host.P.Ge,olympe.Va.node.host.Je,olympe.host.P.Ca,olympe.net.P.nj,new olympe.V.oa(olympe.host.Config.Kr),new olympe.V.oa(olympe.host.Config.ar))},'olympe.native.node.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.Va.node.host.kl=()=>a});olympe.net.ve={};function Jc(a,b,c){const d=olympe.net.va.Tb.Lo,e=olympe.net.va.Tb.gj,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.Cj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?hd(l,c.D).catch(n=>new olympe.net.pd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.pd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
468
+ return b}ia(a,b=olympe.U.hf(),c){this.N.set(b,this.Zf(b,a,null!=c?c:this.Wa));return b}Ha(a,b=olympe.U.hf()){this.X.set(b,this.Zf(b,a,this.Wa));return b}F(a){this.R.has(a)?this.R.delete(a):this.N.has(a)?this.N.delete(a):this.X.delete(a)}Zf(a,b,c){return()=>olympe.U.Promise.Zf(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.V.config(function(a){E(a,olympe.host.Config.dr,!0);E(a,olympe.host.Config.Nr,1E4);Va(a,olympe.host.P.Op,olympe.Va.node.host.Jq,olympe.host.P.Ca);Va(a,olympe.host.P.Qk,olympe.Va.node.host.Uk,olympe.host.P.Ca);C(a,olympe.host.P.Ge,olympe.Va.node.host.Je,olympe.host.P.Ca,olympe.net.P.nj,new olympe.V.oa(olympe.host.Config.Nr),new olympe.V.oa(olympe.host.Config.dr))},'olympe.native.node.host');olympe.V.run([olympe.host.P.Ge],a=>{olympe.Va.node.host.ll=()=>a});olympe.net.ve={};function Jc(a,b,c){const d=olympe.net.va.Tb.Mo,e=olympe.net.va.Tb.gj,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.Cj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?hd(l,c.D).catch(n=>new olympe.net.pd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.pd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
469
469
  l.name?new olympe.net.pd('',d,'Request canceled'):new olympe.net.pd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
470
- function hd(a,b){return u(function*(){switch(b){case olympe.net.va.ResponseType.Gl:var c=yield a.blob();break;case olympe.net.va.ResponseType.$h: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.je:c=a.body;break;default:c=yield a.text()}return new olympe.net.pd(c,a.status,a.statusText,a.headers)})}olympe.net.ve.xu=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.ve.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.ia(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));
470
+ function hd(a,b){return u(function*(){switch(b){case olympe.net.va.ResponseType.Hl:var c=yield a.blob();break;case olympe.net.va.ResponseType.$h: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.je:c=a.body;break;default:c=yield a.text()}return new olympe.net.pd(c,a.status,a.statusText,a.headers)})}olympe.net.ve.Bu=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.ve.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.ia(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));
471
471
  this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):bb(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()||
472
472
  this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);try{this.j.send(a)}catch(d){this.G.error(`Error while sending message to websocket: ${d}`)}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}`}`);
473
- this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=a||null}Z(a){this.F=a||null}D(a){this.N=a||null}X(a){this.H=a||null}ia(){}};olympe.net.ve.WebSocket.ya=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Fv=class extends olympe.net.Ta{R(){return'NodeJS'}Vf(){return olympe.C.ba.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.Hv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}N(a,b){return new olympe.Va.node.net.Gv(a,b)}};olympe.Va.node.net.Gv=class extends olympe.net.AMQPClient{Z(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.oA,g=a.bz;var h=URL,k=a.xh?'amqps':'amqp';var l=a.user;a=a.dd;l=`${encodeURIComponent(f||'/')}|${encodeURIComponent(l)}|${encodeURIComponent(a)}`;c=new h(`${k}://${l}:_@${c}:${d}${e}/${f}`);0<g&&c.searchParams.append('heartbeat',`${g}`);c.searchParams.append('name',b);this.G.debug(`Open AMQP Socket to: ${c.toString()}`);return new amqp.AMQPClient(c.toString())}da(a,b){a.socket.on('close',
474
- b)}};olympe.Va.node.net.Hv=class extends olympe.net.ve.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Va.node.net.Config={dE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.bj)&&a.setParameter(olympe.net.Config.bj,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.Fv,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const id=require('fastify'),{Readable:jd}=require('stream'),kd={Ok:0,Nk:1,Wm:2},ld=olympe.net.va.Rd.Qq,md=olympe.net.va.Headers.Ft,nd=olympe.net.va.Headers.Dt,od=olympe.net.va.Headers.Et,pd=olympe.net.va.Tb.Qh;
475
- function qd(a,b){const c=b.methods,d=b.Kn,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.X<<20,url:b.path,method:[...c,ld],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[md]:f,[od]:c,[nd]:e};if(k===ld)return a.G.debug('< HTTP: OPTIONS'),h.code(pd).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=
476
- new olympe.net.Si(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,v]of Object.entries(g.headers))k.headers[t]=v;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 v=t.Ic(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof jd)&&h.type(olympe.net.va.Tl.je);if(v>=olympe.net.va.Tb.gj)throw Error(x);v>=olympe.net.va.Tb.El?a.G.warn('> HTTP: client bad request: reply with error:',
473
+ this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=a||null}Z(a){this.F=a||null}D(a){this.N=a||null}X(a){this.H=a||null}ia(){}};olympe.net.ve.WebSocket.ya=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Jv=class extends olympe.net.Ta{R(){return'NodeJS'}Vf(){return olympe.C.ba.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.Lv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}N(a,b){return new olympe.Va.node.net.Kv(a,b)}};olympe.Va.node.net.Kv=class extends olympe.net.AMQPClient{Z(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.sA,g=a.ez;var h=URL,k=a.xh?'amqps':'amqp';var l=a.user;a=a.dd;l=`${encodeURIComponent(f||'/')}|${encodeURIComponent(l)}|${encodeURIComponent(a)}`;c=new h(`${k}://${l}:_@${c}:${d}${e}/${f}`);0<g&&c.searchParams.append('heartbeat',`${g}`);c.searchParams.append('name',b);this.G.debug(`Open AMQP Socket to: ${c.toString()}`);return new amqp.AMQPClient(c.toString())}da(a,b){a.socket.on('close',
474
+ b)}};olympe.Va.node.net.Lv=class extends olympe.net.ve.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Va.node.net.Config={hE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.bj)&&a.setParameter(olympe.net.Config.bj,!1);Va(a,olympe.net.P.Fa,olympe.Va.node.net.Jv,olympe.net.P.Ca,olympe.host.P.Fa)},'olympe.native.node.net');olympe.Va.node.net.http={};const id=require('fastify'),{Readable:jd}=require('stream'),kd={Pk:0,Ok:1,Xm:2},ld=olympe.net.va.Rd.Tq,md=olympe.net.va.Headers.Jt,nd=olympe.net.va.Headers.Ht,od=olympe.net.va.Headers.It,pd=olympe.net.va.Tb.Qh;
475
+ function qd(a,b){const c=b.methods,d=b.Ln,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.X<<20,url:b.path,method:[...c,ld],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[md]:f,[od]:c,[nd]:e};if(k===ld)return a.G.debug('< HTTP: OPTIONS'),h.code(pd).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=
476
+ new olympe.net.Si(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,v]of Object.entries(g.headers))k.headers[t]=v;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 v=t.Jc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof jd)&&h.type(olympe.net.va.Ul.je);if(v>=olympe.net.va.Tb.gj)throw Error(x);v>=olympe.net.va.Tb.Fl?a.G.warn('> HTTP: client bad request: reply with error:',
477
477
  x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(v).headers(Object.assign(l,t.Cj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.va.Tb.gj).headers(Object.assign(l,{[olympe.net.va.Headers.Ii]:'text/plain'})).send('Internal server error')})}})}
478
- olympe.Va.node.net.http.ci=class extends olympe.net.ci{constructor(a,b,c,d,e){super(a);this.X=c;this.port=b;this.Z=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=kd.Ok;this.jd=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.ci.ALL;this.H.set(a,{path:b,methods:c,Kn:d,headers:e,origin:e});return this.F()}R(a){const b=this;return u(function*(){b.H.delete(a);return 0<b.H.size?b.F():b.stop()})}start(){if(this.state===kd.Ok)return this.F();if(this.state===kd.Nk){for(const a of this.H.values())qd(this,
479
- a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=kd.Wm;this.G.debug('Web server listening on '+a);this.jd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.jd.forEach(b=>b(a))}).finally(()=>this.jd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.state===kd.Nk?(new Promise((a,b)=>{this.jd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.jd.add(c=>c?b(c):a());this.uj(()=>{const c=this;return u(function*(){c.state=
480
- kd.Nk;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===kd.Wm?this.j.close().then(()=>{this.state=kd.Ok}):Promise.resolve()}createServer(){var a=olympe.ha.xb.j.ls,b=this.G.H();a={logger:{level:olympe.ha.xb.D[b===olympe.ha.xb.j.nk?a:b].toLowerCase()},http2:this.Z};if('string'===typeof this.N){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.N,'key.pem')),cert:b.readFileSync(c.join(this.N,'cert.pem'))}})}a=
481
- id(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}uj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.nj,olympe.Va.node.net.http.ci,olympe.net.P.Ca,new olympe.V.oa(olympe.net.Config.Af),new olympe.V.oa(olympe.net.Config.Rp),new olympe.V.oa(olympe.net.Config.gs),new olympe.V.oa(olympe.net.Config.Qp))},'olympe.native.node.net.http');olympe.Va.node.U={};const rd=require('stream').Readable,sd=require('buffer');
482
- olympe.Va.node.U.Il=class extends olympe.U.Il{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 u(function*(){if(a instanceof rd){const d=[];for(const e=ha(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(()=>sd.resolveObjectURL(a)).catch(b=>
483
- {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.V.config(function(a){Va(a,olympe.U.P.Dg,olympe.Va.node.U.Il)},'olympe.native.node.utils');olympe.async={};function td(a,b){a.H||a.X.push(a.F.rc(b))}
484
- olympe.async.rp=class{constructor(a,b=void 0===a){this.D=[];this.X=[];this.F=a||new olympe.C.Wb('Async executor context');this.ia=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.Z=olympe.U.Jc()}Zf(a){0<=a&&(this.timeout=a);return this}Xa(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
478
+ olympe.Va.node.net.http.ci=class extends olympe.net.ci{constructor(a,b,c,d,e){super(a);this.X=c;this.port=b;this.Z=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=kd.Pk;this.jd=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.ci.ALL;this.H.set(a,{path:b,methods:c,Ln:d,headers:e,origin:e});return this.F()}R(a){const b=this;return u(function*(){b.H.delete(a);return 0<b.H.size?b.F():b.stop()})}start(){if(this.state===kd.Pk)return this.F();if(this.state===kd.Ok){for(const a of this.H.values())qd(this,
479
+ a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=kd.Xm;this.G.debug('Web server listening on '+a);this.jd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.jd.forEach(b=>b(a))}).finally(()=>this.jd.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.state===kd.Ok?(new Promise((a,b)=>{this.jd.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.jd.add(c=>c?b(c):a());this.uj(()=>{const c=this;return u(function*(){c.state=
480
+ kd.Ok;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===kd.Xm?this.j.close().then(()=>{this.state=kd.Pk}):Promise.resolve()}createServer(){var a=olympe.ha.xb.j.ps,b=this.G.H();a={logger:{level:olympe.ha.xb.D[b===olympe.ha.xb.j.pk?a:b].toLowerCase()},http2:this.Z};if('string'===typeof this.N){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.N,'key.pem')),cert:b.readFileSync(c.join(this.N,'cert.pem'))}})}a=
481
+ id(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}uj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.nj,olympe.Va.node.net.http.ci,olympe.net.P.Ca,new olympe.V.oa(olympe.net.Config.Af),new olympe.V.oa(olympe.net.Config.Sp),new olympe.V.oa(olympe.net.Config.ks),new olympe.V.oa(olympe.net.Config.Rp))},'olympe.native.node.net.http');olympe.Va.node.U={};const rd=require('stream').Readable,sd=require('buffer');
482
+ olympe.Va.node.U.Jl=class extends olympe.U.Jl{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 u(function*(){if(a instanceof rd){const d=[];for(const e=ha(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(()=>sd.resolveObjectURL(a)).catch(b=>
483
+ {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.V.config(function(a){Va(a,olympe.U.P.Dg,olympe.Va.node.U.Jl)},'olympe.native.node.utils');olympe.async={};function td(a,b){a.H||a.X.push(a.F.rc(b))}
484
+ olympe.async.sp=class{constructor(a,b=void 0===a){this.D=[];this.X=[];this.F=a||new olympe.C.Wb('Async executor context');this.ia=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.Z=olympe.U.Kc()}Zf(a){0<=a&&(this.timeout=a);return this}Xa(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
485
485
  this.Z),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.X=[];this.env.clear();this.ia&&this.F.destroy()}complete(a){this.F.Wf(this.Z);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.X)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
486
- function ud(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(()=>{ud(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.xw=class extends olympe.async.rp{static create(){return new olympe.async.xw(new olympe.C.Wb('SequencedExecutor'),!0)}start(){this.N||(super.start(),ud(this))}};
487
- olympe.async.Ck=class extends olympe.async.rp{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.Ck(new olympe.C.Wb('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(),
488
- 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.lv=class{D(){return u(function*(){})}X(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}Z(){}clear(){}H(){}};olympe.Db.mv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.wv=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={pk:'localStorage.KeyValueDatabaseManager',hj:'localStorage.Storage',OA:'localStorage.DatacloudStorage',ym:'localStorage.LocalStorage',Ca:'localStorage.Logger',$g:'localStorage.prefix'};olympe.V.config(function(a){Xa(a,olympe.Db.P.pk);D(a,olympe.Db.P.$g,[],()=>'olympe');D(a,olympe.Db.P.Ca,[olympe.ha.P.Da],b=>b.ad('localstorage'));C(a,olympe.Db.P.ym,olympe.Db.wv)},'olympe.localstorage');olympe.L={};olympe.L.Xb={hk:'urls.FileSvc',uo:'urls.BackupSvc',rr:'urls.RestoreBackupSvc',Jg:'urls.GetContext',Ip:'urls.GraphDef',Ho:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',es:'urls.UserTagFromToken',Sw:'urls.UserNameFromTag',Rw:'urls.UserRoles',ew:'urls.RoleMembers',vk:'urls.OpenIDSvc'};
489
- olympe.V.config(a=>{E(a,olympe.L.Xb.hk,'rest/filesvc');E(a,olympe.L.Xb.uo,'rest/backupsvc');E(a,olympe.L.Xb.rr,'rest/backupsvc/restore');E(a,olympe.L.Xb.vk,'rest/openid');E(a,olympe.L.Xb.Jg,'rest/initialData');E(a,olympe.L.Xb.Ip,'rest/querysvc/graphDef');E(a,olympe.L.Xb.Ho,'rest/querysvc/graphDef/static');E(a,olympe.L.Xb.TRANSACTION,'rest/transaction');E(a,olympe.L.Xb.es,'rest/token');E(a,olympe.L.Xb.Sw,'rest/authorization/getUserTag');E(a,olympe.L.Xb.Rw,'rest/authorization/getUserRoles');E(a,olympe.L.Xb.ew,
486
+ function ud(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(()=>{ud(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Bw=class extends olympe.async.sp{static create(){return new olympe.async.Bw(new olympe.C.Wb('SequencedExecutor'),!0)}start(){this.N||(super.start(),ud(this))}};
487
+ olympe.async.Dk=class extends olympe.async.sp{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.Dk(new olympe.C.Wb('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(),
488
+ 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.pv=class{D(){return u(function*(){})}X(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}Z(){}clear(){}H(){}};olympe.Db.qv=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Av=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={qk:'localStorage.KeyValueDatabaseManager',hj:'localStorage.Storage',SA:'localStorage.DatacloudStorage',zm:'localStorage.LocalStorage',Ca:'localStorage.Logger',$g:'localStorage.prefix'};olympe.V.config(function(a){Xa(a,olympe.Db.P.qk);D(a,olympe.Db.P.$g,[],()=>'olympe');D(a,olympe.Db.P.Ca,[olympe.ha.P.Fa],b=>b.ad('localstorage'));C(a,olympe.Db.P.zm,olympe.Db.Av)},'olympe.localstorage');olympe.L={};olympe.L.Xb={ik:'urls.FileSvc',vo:'urls.BackupSvc',ur:'urls.RestoreBackupSvc',Jg:'urls.GetContext',Jp:'urls.GraphDef',Io:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',js:'urls.UserTagFromToken',Ww:'urls.UserNameFromTag',Vw:'urls.UserRoles',iw:'urls.RoleMembers',wk:'urls.OpenIDSvc'};
489
+ olympe.V.config(a=>{E(a,olympe.L.Xb.ik,'rest/filesvc');E(a,olympe.L.Xb.vo,'rest/backupsvc');E(a,olympe.L.Xb.ur,'rest/backupsvc/restore');E(a,olympe.L.Xb.wk,'rest/openid');E(a,olympe.L.Xb.Jg,'rest/initialData');E(a,olympe.L.Xb.Jp,'rest/querysvc/graphDef');E(a,olympe.L.Xb.Io,'rest/querysvc/graphDef/static');E(a,olympe.L.Xb.TRANSACTION,'rest/transaction');E(a,olympe.L.Xb.js,'rest/token');E(a,olympe.L.Xb.Ww,'rest/authorization/getUserTag');E(a,olympe.L.Xb.Vw,'rest/authorization/getUserRoles');E(a,olympe.L.Xb.iw,
490
490
  'rest/authorization/roleMembers')});function vd(a,b){a.validate=b.ack.bind(b);a.H=b.wi();return a}
491
- olympe.L.wa=class{constructor(a,b,c,d,e,f){this.ae=c;this.F=a;this.source=b;this.D=d;this.messageType=e;this.j=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){})}static F(a,b,c){const d=olympe.L.wa.D.Km,e=ad(a);let f;var g=olympe.L.wa,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Lk],n=e[olympe.L.wa.D.mg],p=e[olympe.L.wa.D.TYPE];b.R=c;return vd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}wi(){return this.H}ic(){return this.F}ib(){return this.source}getType(){return this.messageType}ack(){return this.validate()}fa(a,b){const c=
492
- olympe.L.wa.D.Km,d={[olympe.L.wa.D.DESTINATION]:this.F,[olympe.L.wa.D.Zg]:this.source,[olympe.L.wa.D.Lk]:this.ae,[olympe.L.wa.D.mg]:this.D,[olympe.L.wa.D.TYPE]:this.messageType};null!==this.j&&(a.X=b,d[c]=a.fa(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.wa.D={DESTINATION:'d',Zg:'s',Lk:'i',mg:'tp',TYPE:'t',Km:'p',Hf:'tk'};
493
- olympe.L.wa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,js:4,je:5,mg:6,zb:7,Fr:10,Yr:11,hg:12,bs:13,Vm:14,Dp:15};olympe.L.Xm=class extends olympe.L.wa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.dd=c}static F(a,b,c){const d=olympe.L.wa.D.Km,e=ad(a);let f;var g=olympe.L.Xm,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Hf],n=e[olympe.L.wa.D.Lk],p=e[olympe.L.wa.D.mg],q=e[olympe.L.wa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));vd(b,a);return b}se(){return this.dd}fa(a,b){return Object.assign(super.fa(a,b),{[olympe.L.wa.D.Hf]:this.dd})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, token: ${this.dd}, payload: ${this.j}}`}};const wd=olympe.L.wa.j.SEND,xd=olympe.L.wa.j.GET,yd=olympe.L.wa.j.SUBSCRIBE,zd=olympe.L.wa.j.hg,Ad=olympe.L.wa.j.Fr,Bd=olympe.L.wa.j.zb,Cd=olympe.L.wa.j.js,Dd=olympe.L.wa.j.mg,Ed=olympe.L.wa.j.Yr;
494
- olympe.L.Fc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Bi(){return null!==this.user?Promise.resolve(this.user):Fd(this.D,this.j).then(a=>this.user=a)}wi(){return this.j.wi()}mt(){return this.j.getType()}source(){return this.j.ib()}body(){return this.j.j}ack(){const a=this;return u(function*(){if(a.j.getType()!==wd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.cd(a.j,Ad)})}cd(a){const b=
495
- this;return u(function*(){const c=b.j.getType();if(c===xd||c===zd)yield b.j.ack(),yield b.D.cd(b.j,Cd,a);else throw Error('Should only call `reply` on GET requests');})}Qn(a){return this.j.getType()!==yd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.U.Jc()}`,e={seq:Gd(this.D,f=>{switch(f.getType()){case Ed:Hd(this.F,d);b(d);break;case Bd:c(f.j.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
496
- id:d,refresh:this.D.ef};this.j.ack().then(()=>this.D.cd(this.j,Dd,e)).catch(c)})}li(a){const b=this;return u(function*(){yield b.D.cd(b.j,Bd,{reason:a.message})})}};olympe.L.Fc.prototype.fail=olympe.L.Fc.prototype.li;olympe.L.Fc.prototype.notifyOn=olympe.L.Fc.prototype.Qn;olympe.L.Fc.prototype.reply=olympe.L.Fc.prototype.cd;olympe.L.Fc.prototype.ack=olympe.L.Fc.prototype.ack;olympe.L.Fc.prototype.body=olympe.L.Fc.prototype.body;olympe.L.Fc.prototype.source=olympe.L.Fc.prototype.source;
497
- olympe.L.Fc.prototype.requestType=olympe.L.Fc.prototype.mt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.wi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Bi;function Id(a,b){b&&a.qf();null===a.D&&(a.D=setInterval(a.qf.bind(a),a.F))}function Jd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Kd(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Ld(a,b,c){const d=a.j.get(b);c=!(null==d||!d.delete(c));0===(null==d?void 0:d.size)&&a.j.delete(b)&&0===a.j.size&&Jd(a);return c}function Md(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Ld(a,c,e);null==d||d(new olympe.error.Ph(`Subscription ${e} to be refreshed`,e))})})}
491
+ olympe.L.wa=class{constructor(a,b,c,d,e,f){this.ae=c;this.F=a;this.source=b;this.D=d;this.messageType=e;this.j=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){})}static F(a,b,c){const d=olympe.L.wa.D.Lm,e=ad(a);let f;var g=olympe.L.wa,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Mk],n=e[olympe.L.wa.D.mg],p=e[olympe.L.wa.D.TYPE];b.R=c;return vd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}wi(){return this.H}ic(){return this.F}jb(){return this.source}getType(){return this.messageType}ack(){return this.validate()}fa(a,b){const c=
492
+ olympe.L.wa.D.Lm,d={[olympe.L.wa.D.DESTINATION]:this.F,[olympe.L.wa.D.Zg]:this.source,[olympe.L.wa.D.Mk]:this.ae,[olympe.L.wa.D.mg]:this.D,[olympe.L.wa.D.TYPE]:this.messageType};null!==this.j&&(a.X=b,d[c]=a.fa(this.j));return d}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, payload: ${this.j})`}};olympe.L.wa.D={DESTINATION:'d',Zg:'s',Mk:'i',mg:'tp',TYPE:'t',Lm:'p',Hf:'tk'};
493
+ olympe.L.wa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ms:4,je:5,mg:6,Ab:7,Ir:10,bs:11,hg:12,es:13,Wm:14,Ep:15};olympe.L.Ym=class extends olympe.L.wa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.dd=c}static F(a,b,c){const d=olympe.L.wa.D.Lm,e=ad(a);let f;var g=olympe.L.Ym,h=e[olympe.L.wa.D.DESTINATION],k=e[olympe.L.wa.D.Zg],l=e[olympe.L.wa.D.Hf],n=e[olympe.L.wa.D.Mk],p=e[olympe.L.wa.D.mg],q=e[olympe.L.wa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));vd(b,a);return b}se(){return this.dd}fa(a,b){return Object.assign(super.fa(a,b),{[olympe.L.wa.D.Hf]:this.dd})}toString(){return`SignedMessage{dest: ${this.F}, src: ${this.source}, seqId: ${this.ae}, topic: ${this.D}, type: ${this.messageType}, token: ${this.dd}, payload: ${this.j}}`}};const wd=olympe.L.wa.j.SEND,xd=olympe.L.wa.j.GET,yd=olympe.L.wa.j.SUBSCRIBE,zd=olympe.L.wa.j.hg,Ad=olympe.L.wa.j.Ir,Bd=olympe.L.wa.j.Ab,Cd=olympe.L.wa.j.ms,Dd=olympe.L.wa.j.mg,Ed=olympe.L.wa.j.bs;
494
+ olympe.L.Fc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Bi(){return null!==this.user?Promise.resolve(this.user):Fd(this.D,this.j).then(a=>this.user=a)}wi(){return this.j.wi()}qt(){return this.j.getType()}source(){return this.j.jb()}body(){return this.j.j}ack(){const a=this;return u(function*(){if(a.j.getType()!==wd)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.cd(a.j,Ad)})}cd(a){const b=
495
+ this;return u(function*(){const c=b.j.getType();if(c===xd||c===zd)yield b.j.ack(),yield b.D.cd(b.j,Cd,a);else throw Error('Should only call `reply` on GET requests');})}Rn(a){return this.j.getType()!==yd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.U.Kc()}`,e={seq:Gd(this.D,f=>{switch(f.getType()){case Ed:Hd(this.F,d);b(d);break;case Bd:c(f.j.reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
496
+ id:d,refresh:this.D.ef};this.j.ack().then(()=>this.D.cd(this.j,Dd,e)).catch(c)})}li(a){const b=this;return u(function*(){yield b.D.cd(b.j,Bd,{reason:a.message})})}};olympe.L.Fc.prototype.fail=olympe.L.Fc.prototype.li;olympe.L.Fc.prototype.notifyOn=olympe.L.Fc.prototype.Rn;olympe.L.Fc.prototype.reply=olympe.L.Fc.prototype.cd;olympe.L.Fc.prototype.ack=olympe.L.Fc.prototype.ack;olympe.L.Fc.prototype.body=olympe.L.Fc.prototype.body;olympe.L.Fc.prototype.source=olympe.L.Fc.prototype.source;
497
+ olympe.L.Fc.prototype.requestType=olympe.L.Fc.prototype.qt;olympe.L.Fc.prototype.isRedelivered=olympe.L.Fc.prototype.wi;olympe.L.Fc.prototype.userTag=olympe.L.Fc.prototype.Bi;function Id(a,b){b&&a.qf();null===a.D&&(a.D=setInterval(a.qf.bind(a),a.F))}function Jd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Kd(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Ld(a,b,c){const d=a.j.get(b);c=!(null==d||!d.delete(c));0===(null==d?void 0:d.size)&&a.j.delete(b)&&0===a.j.size&&Jd(a);return c}function Md(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Ld(a,c,e);null==d||d(new olympe.error.Ph(`Subscription ${e} to be refreshed`,e))})})}
498
498
  function Nd(a,b,c){let d;null==(d=a.j.get(b))||d.forEach((e,f)=>{Ld(a,b,f);e(c)})}
499
- olympe.L.Dw=class{constructor(a,b,c,d){this.G=a;this.H=b;this.N=c;this.F=d;this.j=new Map;this.D=null}qf(){if(Od(this.H)){var a=olympe.L.wa.j.hg;this.j.forEach((b,c)=>{this.H.request(c,this.N,a,Array.from(b.keys()),!0).then(d=>{d=d.j;0<d.length&&d.forEach(e=>{let f;const g=null==(f=this.j.get(c))?void 0:f.get(e);Ld(this,c,e);null==g||g(new olympe.error.Ph('Subscription does not exist in the service.',e))})}).catch(d=>{const e=`Impossible to keep alive subscriptions of provider ${c}: ${d}`;d instanceof
500
- olympe.error.Lq?d=new olympe.error.Ph('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Nd(this,c,d)})})}else Jd(this)}};const Pd=new Set([olympe.L.wa.j.SUBSCRIBE,olympe.L.wa.j.GET,olympe.L.wa.j.SEND,olympe.L.wa.j.mg,olympe.L.wa.j.je,olympe.L.wa.j.hg]);function Fd(a,b){return new Promise((c,d)=>{a.H.qh(b.se(),(e,f)=>{e?d(e):c(f)})})}function Gd(a,b){a.sa++;const c=a.sa;a.X.set(c,d=>{a.X.delete(c);b(d)});return c}function Od(a){return Qd(a.vd)&&Pc(a.F)}
501
- function Rd(a){Oc(a.F,()=>{a.Ga&&Sd(a);a.Ga=!1});Nc(a.F,()=>{a.Ga&&a.G.info('Reconnecting to bus...');a.N=!0});Mc(a.F,()=>{Td(a).then(()=>{a.Ga=!0;a.N=!1;Ud(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to the session: ${b}`);a.disconnect().catch(c=>{a.G.error(`An error occurred while trying to disconnect from the bus: ${c}`)})})})}
499
+ olympe.L.Hw=class{constructor(a,b,c,d){this.G=a;this.H=b;this.N=c;this.F=d;this.j=new Map;this.D=null}qf(){if(Od(this.H)){var a=olympe.L.wa.j.hg;this.j.forEach((b,c)=>{this.H.request(c,this.N,a,Array.from(b.keys()),!0).then(d=>{d=d.j;0<d.length&&d.forEach(e=>{let f;const g=null==(f=this.j.get(c))?void 0:f.get(e);Ld(this,c,e);null==g||g(new olympe.error.Ph('Subscription does not exist in the service.',e))})}).catch(d=>{const e=`Impossible to keep alive subscriptions of provider ${c}: ${d}`;d instanceof
500
+ olympe.error.Oq?d=new olympe.error.Ph('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Nd(this,c,d)})})}else Jd(this)}};const Pd=new Set([olympe.L.wa.j.SUBSCRIBE,olympe.L.wa.j.GET,olympe.L.wa.j.SEND,olympe.L.wa.j.mg,olympe.L.wa.j.je,olympe.L.wa.j.hg]);function Fd(a,b){return new Promise((c,d)=>{a.H.qh(b.se(),(e,f)=>{e?d(e):c(f)})})}function Gd(a,b){a.sa++;const c=a.sa;a.X.set(c,d=>{a.X.delete(c);b(d)});return c}function Od(a){return Qd(a.vd)&&Pc(a.F)}
501
+ function Rd(a){Oc(a.F,()=>{a.Ha&&Sd(a);a.Ha=!1});Nc(a.F,()=>{a.Ha&&a.G.info('Reconnecting to bus...');a.N=!0});Mc(a.F,()=>{Td(a).then(()=>{a.Ha=!0;a.N=!1;Ud(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to the session: ${b}`);a.disconnect().catch(c=>{a.G.error(`An error occurred while trying to disconnect from the bus: ${c}`)})})})}
502
502
  function Vd(a,b){return u(function*(){var c;const d=null==(c=a.D)?void 0:c.get(b);d&&(Jd(d),a.D.delete(b));a.G.debug(`Bus: Unsubscribe from ${b}`);c=a.yb.delete(b)?[a.j,b]:[a.j];yield Promise.all(c.map(e=>u(function*(){if(b!==e)try{yield $c(a.F,e,b)}catch(f){a.G.debug(`Failed to unbind topic ${b} from queue ${e}: ${f}`)}else try{a.Z.delete(b),yield Xc(a.F,e)}catch(f){a.G.debug(`Failed to unsubscribe from queue ${e}: ${f}`)}})))})}
503
- function Wd(a,b,c,d=!0){return u(function*(){Od(a)||(yield a.connect());const e=d?[a.j]:[a.j,b];a.Z.set(b,c);!d&&a.yb.add(b);yield Promise.all(e.map(f=>u(function*(){a.F.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Wc(a.F,f,f===a.j,a.sg.bind(a,f)));var g;if(!(g=b===f)){let h,k;g=null!=(k=null==(h=a.F.D.get(f))?void 0:h.xl.has(b))?k:!1}g||(yield Zc(a.F,f,b));a.G.debug(`Subscribed to topic ${b} over queue: ${f}`)})))})}
503
+ function Wd(a,b,c,d=!0){return u(function*(){Od(a)||(yield a.connect());const e=d?[a.j]:[a.j,b];a.Z.set(b,c);!d&&a.yb.add(b);yield Promise.all(e.map(f=>u(function*(){a.F.D.has(f)||(a.G.debug(`Bus: Subscribe to queue ${f}..`),yield Wc(a.F,f,f===a.j,a.sg.bind(a,f)));var g;if(!(g=b===f)){let h,k;g=null!=(k=null==(h=a.F.D.get(f))?void 0:h.yl.has(b))?k:!1}g||(yield Zc(a.F,f,b));a.G.debug(`Subscribed to topic ${b} over queue: ${f}`)})))})}
504
504
  function Sd(a){a.G.info('Disconnected from bus.');let b;null==(b=a.D)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${Kd(c)} subscriptions for ${d} service.`),Jd(c))})}function Td(a){return u(function*(){a.G.debug('Connection to bus established. Listening to responses on topic',a.j);yield Wd(a,a.j,b=>{let c;null==(c=a.X.get(b.ae))||c(b)},!0)})}
505
505
  function Ud(a){a.G.j()?a.G.debug(`Connected to bus: subscribe to ${a.Z.size} active topics.`):a.G.info(`Connected to bus (session: ${a.j}).`);let b;null==(b=a.D)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${Kd(c)} subscriptions for ${d} service.`),Id(c,!0))});a.R.forEach(c=>c(null));a.R=[]}function Xd(a){a.Fd=a.ia.j(()=>Od(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
506
- function Yd(a,b,c,d=new Map){a.Md.j&&rb(a.Md,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Zd(a,b,c){const d=`${b}:${c}`;b=a.da.get(d);b||(b=new olympe.L.Xq(()=>a.da.delete(d)),a.da.set(d,b));return b}
507
- function $d(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.zb,f=b.j,{id:g,e:h}=f,k=`${b.ib()}:${g}`,l=Zd(a,b.ib(),g);if(h===c){fb(a.da.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`));b.ack().catch(n=>a.G.error(`Failed to ack message: ${n}`))}
508
- function ae(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=be(a,b,b,olympe.L.wa.j.Dp);d=f.ae;yield a.kd(f)}let e=a.Wa.get(d);e||(e=[],a.Wa.set(d,e));return olympe.U.Promise.Zf(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function be(a,b,c,d,e){const f=ce(a.H).Gd();a.sa++;return new olympe.L.Xm(b,a.j,f,a.sa,c,d,e)}
509
- function de(a,b,c,d){const e=b.ae,f=h=>{g&&clearTimeout(g);a.X.delete(e);c(h)};a.X.set(e,f);const g=setTimeout(()=>f(new olympe.L.wa(a.j,a.j,e,b.D,olympe.L.wa.j.zb,{reason:'Timeout',code:olympe.error.lc.TIMEOUT})),d)}function ee(a,b,c,d,e,f){null===a.D&&(a.D=new Map);var g=a.D.get(b);g?(a=g,a.F!==e&&(a.F=e,null!==a.D&&(Jd(a),Id(a,!1)))):(g=new olympe.L.Dw(a.G,a,b,e),a.D.set(b,g));e=g;g=e.j.size;a=e.j.get(c);a||(a=new Map,e.j.set(c,a));a.set(d,f);0===g&&Id(e,!1)}
510
- function fe(a,b,c,d){var e;const f=null==(e=a.D)?void 0:e.get(b);if(null==f?0:Ld(f,c,d))e=olympe.L.wa.j.bs,Od(a)&&a.kd(be(a,c,b,e,d)).catch(g=>a.G.error(`Impossible to keep alive subscriptions: ${g}`)),0===Kd(f)&&(a.D.delete(b),0===a.D.size&&(a.D=null))}
511
- olympe.L.Kl=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.vd=c;this.H=d;this.ia=e;this.ke=f;this.Md=g;this.X=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Jc()}`;this.lb=h.get('requestTimeout');this.ef=h.get('subscriptionsRefreshRate');this.Oc=h.get('allowGuest');a=h.get('connection');d=this.H.dd.sb().asObservable();c=c.Vf().asObservable();c=rxjs.combineLatest([a,d,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.wc(),dd:l.Gd()}):null));this.F=b.N(c,this.j);Rd(this);
506
+ function Yd(a,b,c,d=new Map){a.Md.j&&rb(a.Md,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Zd(a,b,c){const d=`${b}:${c}`;b=a.da.get(d);b||(b=new olympe.L.$q(()=>a.da.delete(d)),a.da.set(d,b));return b}
507
+ function $d(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.Ab,f=b.j,{id:g,e:h}=f,k=`${b.jb()}:${g}`,l=Zd(a,b.jb(),g);if(h===c){fb(a.da.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`));b.ack().catch(n=>a.G.error(`Failed to ack message: ${n}`))}
508
+ function ae(a,b,c){return u(function*(){let d;if('number'===typeof c)d=c;else{const f=be(a,b,b,olympe.L.wa.j.Ep);d=f.ae;yield a.kd(f)}let e=a.Wa.get(d);e||(e=[],a.Wa.set(d,e));return olympe.U.Promise.Zf(new Promise(f=>{e.push(g=>f(g))}),15E3,`Timeout while getting the destination (sessionId) for message ${d}.`)})}function be(a,b,c,d,e){const f=ce(a.H).Gd();a.sa++;return new olympe.L.Ym(b,a.j,f,a.sa,c,d,e)}
509
+ function de(a,b,c,d){const e=b.ae,f=h=>{g&&clearTimeout(g);a.X.delete(e);c(h)};a.X.set(e,f);const g=setTimeout(()=>f(new olympe.L.wa(a.j,a.j,e,b.D,olympe.L.wa.j.Ab,{reason:'Timeout',code:olympe.error.lc.TIMEOUT})),d)}function ee(a,b,c,d,e,f){null===a.D&&(a.D=new Map);var g=a.D.get(b);g?(a=g,a.F!==e&&(a.F=e,null!==a.D&&(Jd(a),Id(a,!1)))):(g=new olympe.L.Hw(a.G,a,b,e),a.D.set(b,g));e=g;g=e.j.size;a=e.j.get(c);a||(a=new Map,e.j.set(c,a));a.set(d,f);0===g&&Id(e,!1)}
510
+ function fe(a,b,c,d){var e;const f=null==(e=a.D)?void 0:e.get(b);if(null==f?0:Ld(f,c,d))e=olympe.L.wa.j.es,Od(a)&&a.kd(be(a,c,b,e,d)).catch(g=>a.G.error(`Impossible to keep alive subscriptions: ${g}`)),0===Kd(f)&&(a.D.delete(b),0===a.D.size&&(a.D=null))}
511
+ olympe.L.Ll=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.vd=c;this.H=d;this.ia=e;this.ke=f;this.Md=g;this.X=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Kc()}`;this.nb=h.get('requestTimeout');this.ef=h.get('subscriptionsRefreshRate');this.Qc=h.get('allowGuest');a=h.get('connection');d=this.H.dd.tb().asObservable();c=c.Vf().asObservable();c=rxjs.combineLatest([a,d,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.xc(),dd:l.Gd()}):null));this.F=b.N(c,this.j);Rd(this);
512
512
  this.Yb='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.Yb;this.Yb=k;if(l!==k&&Od(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.Z).map(([p,q])=>{const r=this;return u(function*(){yield Vd(r,p);yield Wd(r,p,q,r.yb.has(p))})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.D)||n.forEach(p=>{Md(p)})}});this.mi=this.sa=0;this.D=null;this.N=
513
- !1;this.R=[];this.Z=new Map;this.yb=new Set;this.Wa=new Map;this.da=new olympe.U.Zh(this.lb);this.Pe=this.Fd='';this.Ga=this.Gc=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};Od(this)?a():this.N||this.Gc?this.R.push(d=>d?b(d):a()):Qd(this.vd)?(this.Gc=!0,olympe.C.jt([this.H.pl()],d=>{Xd(this);this.Gc=!1;d.valueOf()||this.Oc?(this.Oc||ge(this.H,()=>this.disconnect().then()),this.N=!0,this.R.push(e=>e?b(e):a()),this.F.connect().catch(e=>{this.N=!1;c(e)}),
514
- this.Pe=this.ia.Ga(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){const a=this;return u(function*(){a.G.debug('Disconnecting from bus');a.H.R.delete('busLogoutCallback');a.ia.D(a.Fd);a.ia.F(a.Pe);yield a.F.disconnect()})}kd(a,b=!1){const c=this;return u(function*(){if(!c.N||a.getType()!==olympe.L.wa.j.hg){Od(c)||
515
- (yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.ic():c.Yb+a.ic();try{Yd(c,a.ae.toString(),'serialize');var f=a.fa(c.ke,c.tg.bind(c,a.D,a.ae));c.G.j()&&c.G.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.ae}): ${h}`);}var g=Pd.has(a.getType());yield c.F.kd(a.ae,e,f,{mandatory:g,xt:!(d||b)});Yd(c,a.ae.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}tg(a,b,
516
- c){const d=this.mi++;(()=>{const e=this;return u(function*(){let f;try{f=yield ae(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.kd(new olympe.L.wa(f,e.j,b,a,olympe.L.wa.j.je,p)),h=olympe.L.Me.Gg,k=olympe.L.Me.Eh,l=olympe.L.Me.zb;let n=0;try{for(const p=ha(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();
517
- return d}cd(a,b,c){return this.send(a.ae,a.ib(),a.ib(),b,c)}send(a,b,c,d,e){return this.kd(new olympe.L.wa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=be(this,a,b,c,d);return c===olympe.L.wa.j.PUBLISH?this.kd(g,e):new Promise((h,k)=>{de(this,g,h,null!=f?f:this.lb);this.kd(g,e).catch(k)})}sg(a,b){const c=olympe.L.wa.D.Zg;a=olympe.L.wa.D.Lk;var d=olympe.L.wa.D.Hf;const e=ad(b);this.G.j()&&this.G.debug(`BUS < #${b.N}:`,JSON.stringify(e));Yd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.wa.F:olympe.L.Xm.F;
518
- d=null;let f=!1;try{d=a.call(null,b,this.ke,h=>{f=!0;return Zd(this,e[c],h).stream}),Pd.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);bd(b).catch(k=>this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.ae;Yd(this,b.toString(),'deserialized',(new Map).set('source',g.ib()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.wa.j.je:$d(this,
519
- g);break;case olympe.L.wa.j.Dp:this.cd(g,olympe.L.wa.j.Vm).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.wa.j.Vm:let h;null==(h=this.Wa.get(b))||h.forEach(k=>k(g.ib()));break;default:f&&this.cd(g,olympe.L.wa.j.Vm).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));try{let k;null==(k=this.Z.get(g.D))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Kl.D='Timeout';
520
- olympe.L.Kl.j='olympe-runtime';const he=olympe.net.va.Headers.so,ie=olympe.net.va.Tb.Qh,je=olympe.net.va.Tb.No,ke=olympe.net.va.Tb.Qj,le=olympe.net.va.Tb.lw,me=olympe.net.va.Tb.Lo,ne=olympe.net.va.Tb.jk,oe=olympe.net.va.Tb.Mw,pe=olympe.net.va.Tb.Zi;function qe(a,b){let c;return null!=(c=a.F.get(b))?c:''}function re(a,b,c,d=new Map){a.j.j&&rb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
521
- function se(a,b,c){if(null===b)return Promise.reject('No http request to send');Fc(b,{[he]:c});const d=b.j();return rxjs.firstValueFrom(rxjs.defer(()=>{a.D++;const e=a.D;if(a.G.j()){const f=b.body;a.G.debug('HTTP >',d,`body: ${'string'===typeof f?f:typeof f}`)}re(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Ic(a.H,b).then(f=>{re(a,e,'reply');switch(f.Ic()){case ie:case je:case ke:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Ic(),`content: ${'string'===
522
- typeof g?g:typeof g}`);return f;case le:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.Yq(f);case me:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case ne:case oe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.tk(f);case pe:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Dm(f);default:g=`HTTP < Error: ${f.Ic()}, ${f.statusText}`;
523
- a.G.error(g);if(500===f.Ic()&&'Connection refused'===f.statusText)throw new olympe.error.To(g);throw new olympe.error.od(g);}})}).pipe(sb(olympe.error.Yq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.uu=class{constructor(a,b,c,d,e){this.G=a;this.H=b;this.j=c;this.F=null;d.subscribe(f=>{this.F=f});this.N=e;this.D=0}};function O(a,b){if(a.state!==b)switch(a.G.debug('State change '+a.state+' --\x3e '+b),a.state=b,a.yb.forEach(c=>c(b)),b){case olympe.L.Na.j.Yk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.ep:break;case olympe.L.Na.j.ze:a.connected.update(olympe.C.ba.D);break;case olympe.L.Na.j.Tg:a.F=[0,0,a.F[2]];te(a);break;case olympe.L.Na.j.zb:let c;a.G.error('Connection to server',null==(c=a.N)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ba.j);break;case olympe.L.Na.j.no:te(a);break;case olympe.L.Na.j.yc:a.connected.update(olympe.C.ba.j);
513
+ !1;this.R=[];this.Z=new Map;this.yb=new Set;this.Wa=new Map;this.da=new olympe.U.Zh(this.nb);this.Pe=this.Fd='';this.Ha=this.Gc=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};Od(this)?a():this.N||this.Gc?this.R.push(d=>d?b(d):a()):Qd(this.vd)?(this.Gc=!0,olympe.C.nt([this.H.ql()],d=>{Xd(this);this.Gc=!1;d.valueOf()||this.Qc?(this.Qc||ge(this.H,()=>this.disconnect().then()),this.N=!0,this.R.push(e=>e?b(e):a()),this.F.connect().catch(e=>{this.N=!1;c(e)}),
514
+ this.Pe=this.ia.Ha(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){const a=this;return u(function*(){a.G.debug('Disconnecting from bus');a.H.R.delete('busLogoutCallback');a.ia.D(a.Fd);a.ia.F(a.Pe);yield a.F.disconnect()})}kd(a,b=!1){const c=this;return u(function*(){if(!c.N||a.getType()!==olympe.L.wa.j.hg){Od(c)||
515
+ (yield c.connect());var d=a.F.startsWith('olympe-runtime'),e=d?a.ic():c.Yb+a.ic();try{Yd(c,a.ae.toString(),'serialize');var f=a.fa(c.ke,c.tg.bind(c,a.D,a.ae));c.G.j()&&c.G.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.ae}): ${h}`);}var g=Pd.has(a.getType());yield c.F.kd(a.ae,e,f,{mandatory:g,Bt:!(d||b)});Yd(c,a.ae.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}tg(a,b,
516
+ c){const d=this.mi++;(()=>{const e=this;return u(function*(){let f;try{f=yield ae(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.kd(new olympe.L.wa(f,e.j,b,a,olympe.L.wa.j.je,p)),h=olympe.L.Me.Gg,k=olympe.L.Me.Eh,l=olympe.L.Me.Ab;let n=0;try{for(const p=ha(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();
517
+ return d}cd(a,b,c){return this.send(a.ae,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.kd(new olympe.L.wa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=be(this,a,b,c,d);return c===olympe.L.wa.j.PUBLISH?this.kd(g,e):new Promise((h,k)=>{de(this,g,h,null!=f?f:this.nb);this.kd(g,e).catch(k)})}sg(a,b){const c=olympe.L.wa.D.Zg;a=olympe.L.wa.D.Mk;var d=olympe.L.wa.D.Hf;const e=ad(b);this.G.j()&&this.G.debug(`BUS < #${b.N}:`,JSON.stringify(e));Yd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.wa.F:olympe.L.Ym.F;
518
+ d=null;let f=!1;try{d=a.call(null,b,this.ke,h=>{f=!0;return Zd(this,e[c],h).stream}),Pd.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);bd(b).catch(k=>this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.ae;Yd(this,b.toString(),'deserialized',(new Map).set('source',g.jb()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.wa.j.je:$d(this,
519
+ g);break;case olympe.L.wa.j.Ep:this.cd(g,olympe.L.wa.j.Wm).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.wa.j.Wm:let h;null==(h=this.Wa.get(b))||h.forEach(k=>k(g.jb()));break;default:f&&this.cd(g,olympe.L.wa.j.Wm).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));try{let k;null==(k=this.Z.get(g.D))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Ll.D='Timeout';
520
+ olympe.L.Ll.j='olympe-runtime';const he=olympe.net.va.Headers.uo,ie=olympe.net.va.Tb.Qh,je=olympe.net.va.Tb.Oo,ke=olympe.net.va.Tb.Rj,le=olympe.net.va.Tb.pw,me=olympe.net.va.Tb.Mo,ne=olympe.net.va.Tb.kk,oe=olympe.net.va.Tb.Qw,pe=olympe.net.va.Tb.Zi;function qe(a,b){let c;return null!=(c=a.F.get(b))?c:''}function re(a,b,c,d=new Map){a.j.j&&rb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
521
+ function se(a,b,c){if(null===b)return Promise.reject('No http request to send');Fc(b,{[he]:c});const d=b.j();return rxjs.firstValueFrom(rxjs.defer(()=>{a.D++;const e=a.D;if(a.G.j()){const f=b.body;a.G.debug('HTTP >',d,`body: ${'string'===typeof f?f:typeof f}`)}re(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Ic(a.H,b).then(f=>{re(a,e,'reply');switch(f.Jc()){case ie:case je:case ke:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Jc(),`content: ${'string'===
522
+ typeof g?g:typeof g}`);return f;case le:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.ar(f);case me:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case ne:case oe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.uk(f);case pe:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Em(f);default:g=`HTTP < Error: ${f.Jc()}, ${f.statusText}`;
523
+ a.G.error(g);if(500===f.Jc()&&'Connection refused'===f.statusText)throw new olympe.error.Uo(g);throw new olympe.error.od(g);}})}).pipe(sb(olympe.error.ar,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.yu=class{constructor(a,b,c,d,e){this.G=a;this.H=b;this.j=c;this.F=null;d.subscribe(f=>{this.F=f});this.N=e;this.D=0}};function O(a,b){if(a.state!==b)switch(a.G.debug('State change '+a.state+' --\x3e '+b),a.state=b,a.yb.forEach(c=>c(b)),b){case olympe.L.Na.j.Zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.fp:break;case olympe.L.Na.j.ze:a.connected.update(olympe.C.ba.D);break;case olympe.L.Na.j.Tg:a.F=[0,0,a.F[2]];te(a);break;case olympe.L.Na.j.Ab:let c;a.G.error('Connection to server',null==(c=a.N)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ba.j);break;case olympe.L.Na.j.oo:te(a);break;case olympe.L.Na.j.zc:a.connected.update(olympe.C.ba.j);
524
524
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
525
- function ue(a){const b=olympe.L.Na.j.no,c=olympe.L.Na.j.Yk,d=olympe.L.Na.j.yc,e=Ec(a.Z);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Gc.D(a.Z);f.Z(g=>{const h=JSON.parse(g);a.G.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':O(a,b);f.close();break;case 'asleep':a.G.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');O(a,c);break;case 'waking-up':break;default:a.G.warn(`Invalid message from ${e}: ${g}`),f.close(),
525
+ function ue(a){const b=olympe.L.Na.j.oo,c=olympe.L.Na.j.Zk,d=olympe.L.Na.j.zc,e=Ec(a.Z);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Gc.D(a.Z);f.Z(g=>{const h=JSON.parse(g);a.G.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':O(a,b);f.close();break;case 'asleep':a.G.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');O(a,c);break;case 'waking-up':break;default:a.G.warn(`Invalid message from ${e}: ${g}`),f.close(),
526
526
  O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.da(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
527
- function ve(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}we(a,olympe.L.Ee.zb,d=>{switch(d.c){case olympe.L.rk.Ow:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.rk.mu:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.D.forEach((e,f)=>{null!==e.Vn&&xe(a,f,d.i)})}});we(a,olympe.L.Ee.oc,d=>
528
- {d.c===olympe.L.rk.aw&&'boolean'===typeof d.a&&a.tg.update(olympe.C.Rb(d.a))});olympe.C.Gj(a.connected,()=>{let d=!1;olympe.C.Gj(a.Wa.j(),()=>{d&&(a.Oc(),a.lb(),d=!1);Cc(a.Oc.bind(a),a.Md);Cc(a.lb.bind(a),a.sa)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Bc(a.lb.bind(a),a.sa)});c.j(()=>ye(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.Ga(()=>a.disconnect(),'Orchestrator websocket');hb(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
527
+ function ve(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}we(a,olympe.L.Ee.Ab,d=>{switch(d.c){case olympe.L.sk.Sw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.sk.qu:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.D.forEach((e,f)=>{null!==e.Wn&&xe(a,f,d.i)})}});we(a,olympe.L.Ee.oc,d=>
528
+ {d.c===olympe.L.sk.ew&&'boolean'===typeof d.a&&a.tg.update(olympe.C.Rb(d.a))});olympe.C.Gj(a.connected,()=>{let d=!1;olympe.C.Gj(a.Wa.j(),()=>{d&&(a.Qc(),a.nb(),d=!1);Cc(a.Qc.bind(a),a.Md);Cc(a.nb.bind(a),a.sa)},()=>{a.F=[0,0,a.F[2]];d=!0})},()=>{a.R=null;Bc(a.nb.bind(a),a.sa)});c.j(()=>ye(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.state}`));c.Ha(()=>a.disconnect(),'Orchestrator websocket');hb(a.H,(d,e)=>{e.throw(Error('Stream timeout'))});
529
529
  a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function ye(a){return a.state===olympe.L.Na.j.ze}function ze(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.yb.delete(e),c(f)};a.yb.add(e);e(a.state)}function Ae(a,b,c,d,e){a.da.j&&rb(a.da,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
530
- function te(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.ze,e=olympe.L.Na.j.yc,f=olympe.L.Na.j.Tg,g=olympe.L.Na.j.Yk,h=olympe.L.Na.j.zb;if(null===a.N)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.j&&(a.j.X(null),a.j.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.N)?void 0:Dc(k)}:${null==(l=a.N)?void 0:l.port}...`);a.j=a.Gc.D(a.N);a.j.da(a.ke.bind(a));a.j.Z(a.ef.bind(a));
531
- a.j.X(()=>{a.j=null;a.state===d?O(a,f):a.state!==h&&a.state!==g&&O(a,e)});a.Z&&a.state===b&&a.j.D(()=>{a.j.D(null);a.state===c&&ue(a);a.Z=null});a.state!==f&&O(a,c)}}function Be(a,b,c,d){const e=a.Pe;a.Pe++;c={message:{seqId:e,messageFamily:b,payload:c},pn:d?Ce(d):null,Vn:null};a.D.set(e,c);Ae(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Tg];(ye(a)||b===olympe.L.Ee.mk&&d.includes(a.state))&&De(a,e,c)}
532
- function Ce(a){const b=olympe.L.Na.D.ij;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.error.Ar;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.error.Uk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
533
- function De(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.j.send(JSON.stringify(d)))?null===c.pn?a.D.delete(b):c.Vn=Date.now():olympe.C.Pa(a.Wa.j()).valueOf()&&O(a,olympe.L.Na.j.Tg);return d}function we(a,b,c,d){void 0===d&&(d=olympe.U.Jc());let e=a.ia.get(b);void 0===e&&(e=new Map,a.ia.set(b,e));e.set(d,c)}function Ee(a){a=a.ia.get(olympe.L.Ee.Ng);void 0!==a&&a.delete('logoutHandler')}
534
- function xe(a,b,c){if(a.D.has(b)){const {pn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Na.D.bq,error:c})}}function Fe(a,b){a.G.error(b);O(a,olympe.L.Na.j.zb)}function Ge(a,b,c){a.vd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.N)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.D).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!De(a,e,f))return;O(a,olympe.L.Na.j.ze)}
535
- function He(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.zb,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.Xq(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){fb(a.H.j,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
536
- olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Gc=b;this.N=null;e.subscribe(k=>{this.N=k;k=olympe.L.Na.j.CONNECTING;if(this.state===olympe.L.Na.j.ze||this.state===k){let l;null==(l=this.j)||l.close()}});this.Z=this.j=null;e.subscribe(k=>{this.Z=k;k=olympe.L.Na.j.yc;this.state===olympe.L.Na.j.Yk&&(O(this,k),ue(this))});this.da=g;this.Md=h.get('pingInterval');this.sa=h.get('messageTimeout');this.X=olympe.U.Lf.parse(h.get('clientVersion'));this.Ga=olympe.U.Lf.parse(h.get('serverVersion'));
537
- this.state=olympe.L.Na.j.INIT;this.Wa=d;this.Yb=h.get('getContextMode');this.Pe=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.ba,'Server is connected');this.tg=lc(olympe.C.bc(olympe.C.ba,'Server is readonly'),olympe.C.ba.j);this.yb=new Set;this.D=new Map;this.H=new olympe.U.Zh(this.sa);this.Fd=new Map;this.vd=-1;ve(this,h,c)}connect(){const a=olympe.L.Na.j.ze,b=olympe.L.Na.j.yc,c=olympe.L.Na.j.zb,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
538
- b||te(this);ze(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.ep,d=olympe.L.Na.j.yc,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.zb;this.state===olympe.L.Na.j.ze||this.state===e||this.state===c?(ze(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.state!==c&&(O(this,c),this.j.close())):(O(this,d),a())})}ke(){this.G.debug('Websocket connected, sending handshake. Client version:',
539
- Hb(this.X),'subscribeEverything:',this.Yb?'NO':'YES');Be(this,olympe.L.Ee.mk,{c:olympe.L.rk.mk,cv:Hb(this.X),m:this.Yb?0:1,s:this.R,b:this.Wa.D()},this.sg.bind(this))}sg(a,b){if(a)Fe(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Fu:Fe(this,`Framework version (${Hb(this.X)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
540
- return;case c.Fw:Fe(this,`Framework version (${Hb(this.X)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.pu:Fe(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ga.Ea(olympe.U.Lf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.U.Lf.parse(a);if(e.Oj(this.Ga)){Fe(this,`Framework v${Hb(this.X)} is expecting Orchestrator to be at least in v${Hb(this.Ga)}`);
541
- return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Hb(this.Ga))}catch(f){Fe(this,f);return}e=olympe.L.Na.j.yc;if(this.state===olympe.L.Na.j.Tg&&null!==this.R&&this.R!==b.sessionId)this.G.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),O(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Fd.set(f,g);this.R=b.sessionId||null;Ge(this,a,d)}}}Oc(){this.F[0]-this.F[1]>this.Md/2?
542
- (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Na.j.Tg)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Tg)))}ef(a){this.F[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.Wa.j()).valueOf()&&(this.F[1]=this.F[2]),null;var b=0;this.da.j&&(b=performance.now()-this.da.D);try{var c=JSON.parse(a)}catch(g){return this.G.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=
530
+ function te(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.ze,e=olympe.L.Na.j.zc,f=olympe.L.Na.j.Tg,g=olympe.L.Na.j.Zk,h=olympe.L.Na.j.Ab;if(null===a.N)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.j&&(a.j.X(null),a.j.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.N)?void 0:Dc(k)}:${null==(l=a.N)?void 0:l.port}...`);a.j=a.Gc.D(a.N);a.j.da(a.ke.bind(a));a.j.Z(a.ef.bind(a));
531
+ a.j.X(()=>{a.j=null;a.state===d?O(a,f):a.state!==h&&a.state!==g&&O(a,e)});a.Z&&a.state===b&&a.j.D(()=>{a.j.D(null);a.state===c&&ue(a);a.Z=null});a.state!==f&&O(a,c)}}function Be(a,b,c,d){const e=a.Pe;a.Pe++;c={message:{seqId:e,messageFamily:b,payload:c},qn:d?Ce(d):null,Wn:null};a.D.set(e,c);Ae(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Tg];(ye(a)||b===olympe.L.Ee.nk&&d.includes(a.state))&&De(a,e,c)}
532
+ function Ce(a){const b=olympe.L.Na.D.ij;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.error.Dr;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.error.Vk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
533
+ function De(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.j.send(JSON.stringify(d)))?null===c.qn?a.D.delete(b):c.Wn=Date.now():olympe.C.Qa(a.Wa.j()).valueOf()&&O(a,olympe.L.Na.j.Tg);return d}function we(a,b,c,d){void 0===d&&(d=olympe.U.Kc());let e=a.ia.get(b);void 0===e&&(e=new Map,a.ia.set(b,e));e.set(d,c)}function Ee(a){a=a.ia.get(olympe.L.Ee.Ng);void 0!==a&&a.delete('logoutHandler')}
534
+ function xe(a,b,c){if(a.D.has(b)){const {qn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Na.D.eq,error:c})}}function Fe(a,b){a.G.error(b);O(a,olympe.L.Na.j.Ab)}function Ge(a,b,c){a.vd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.N)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.D).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!De(a,e,f))return;O(a,olympe.L.Na.j.ze)}
535
+ function He(a,b){const c=olympe.L.Me.Gg,d=olympe.L.Me.Eh,e=olympe.L.Me.Ab,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.$q(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){fb(a.H.j,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
536
+ olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Gc=b;this.N=null;e.subscribe(k=>{this.N=k;k=olympe.L.Na.j.CONNECTING;if(this.state===olympe.L.Na.j.ze||this.state===k){let l;null==(l=this.j)||l.close()}});this.Z=this.j=null;e.subscribe(k=>{this.Z=k;k=olympe.L.Na.j.zc;this.state===olympe.L.Na.j.Zk&&(O(this,k),ue(this))});this.da=g;this.Md=h.get('pingInterval');this.sa=h.get('messageTimeout');this.X=olympe.U.Lf.parse(h.get('clientVersion'));this.Ha=olympe.U.Lf.parse(h.get('serverVersion'));
537
+ this.state=olympe.L.Na.j.INIT;this.Wa=d;this.Yb=h.get('getContextMode');this.Pe=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.ba,'Server is connected');this.tg=lc(olympe.C.bc(olympe.C.ba,'Server is readonly'),olympe.C.ba.j);this.yb=new Set;this.D=new Map;this.H=new olympe.U.Zh(this.sa);this.Fd=new Map;this.vd=-1;ve(this,h,c)}connect(){const a=olympe.L.Na.j.ze,b=olympe.L.Na.j.zc,c=olympe.L.Na.j.Ab,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
538
+ b||te(this);ze(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.fp,d=olympe.L.Na.j.zc,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Ab;this.state===olympe.L.Na.j.ze||this.state===e||this.state===c?(ze(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.state!==c&&(O(this,c),this.j.close())):(O(this,d),a())})}ke(){this.G.debug('Websocket connected, sending handshake. Client version:',
539
+ Hb(this.X),'subscribeEverything:',this.Yb?'NO':'YES');Be(this,olympe.L.Ee.nk,{c:olympe.L.sk.nk,cv:Hb(this.X),m:this.Yb?0:1,s:this.R,b:this.Wa.D()},this.sg.bind(this))}sg(a,b){if(a)Fe(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Ju:Fe(this,`Framework version (${Hb(this.X)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
540
+ return;case c.Jw:Fe(this,`Framework version (${Hb(this.X)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.tu:Fe(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ha.Ea(olympe.U.Lf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.U.Lf.parse(a);if(e.Pj(this.Ha)){Fe(this,`Framework v${Hb(this.X)} is expecting Orchestrator to be at least in v${Hb(this.Ha)}`);
541
+ return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Hb(this.Ha))}catch(f){Fe(this,f);return}e=olympe.L.Na.j.zc;if(this.state===olympe.L.Na.j.Tg&&null!==this.R&&this.R!==b.sessionId)this.G.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),O(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Fd.set(f,g);this.R=b.sessionId||null;Ge(this,a,d)}}}Qc(){this.F[0]-this.F[1]>this.Md/2?
542
+ (this.G.debug('Ping did not get answer, try to reconnect'),O(this,olympe.L.Na.j.Tg)):(this.F[0]=Date.now(),this.j.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Tg)))}ef(a){this.F[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Qa(this.Wa.j()).valueOf()&&(this.F[1]=this.F[2]),null;var b=0;this.da.j&&(b=performance.now()-this.da.D);try{var c=JSON.parse(a)}catch(g){return this.G.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=
543
543
  c.seqId;var d=c.stream;const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Me.Gg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Me.Eh?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Ae(this,a,'consumed',new Map,b);Ae(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.H.has(f);He(this,d);if(b)return null;d=this.H.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
544
- null;f=d.stream}this.D.has(a)&&({pn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ia.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}lb(){const a=Date.now();for(const [b,{Vn:c}]of this.D)null!==c&&a-c>this.sa&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),xe(this,b,'Message timeout: never receive acknowledge'))}};function Qd(a){return olympe.C.Pa(a.state)===olympe.L.tc.j.cj}
545
- function Ie(a,b){const c=olympe.L.tc.j.Lm,d=olympe.L.tc.j.Df,e=olympe.L.tc.j.yc,f=olympe.L.tc.j.sw,g=b.get('reconnectionDelay');ze(a.D,[olympe.L.Na.j.INIT],()=>{Je(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);ze(a.D,[olympe.L.Na.j.yc],()=>{if(olympe.C.Pa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Je(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
544
+ null;f=d.stream}this.D.has(a)&&({qn:d}=this.D.get(a),this.D.delete(a),null==d||d(c,f));a=this.ia.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}nb(){const a=Date.now();for(const [b,{Wn:c}]of this.D)null!==c&&a-c>this.sa&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),xe(this,b,'Message timeout: never receive acknowledge'))}};function Qd(a){return olympe.C.Qa(a.state)===olympe.L.uc.j.cj}
545
+ function Ie(a,b){const c=olympe.L.uc.j.Mm,d=olympe.L.uc.j.Df,e=olympe.L.uc.j.zc,f=olympe.L.uc.j.ww,g=b.get('reconnectionDelay');ze(a.D,[olympe.L.Na.j.INIT],()=>{Je(a)?(a.state.update(c),a.connect().catch(h=>a.G.error(h))):a.D.disconnect().catch(h=>a.G.error(h))},!0);ze(a.D,[olympe.L.Na.j.zc],()=>{if(olympe.C.Qa(a.state)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.state.update(a.j?d:e),Je(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.j?a.G.log(h):
546
546
  a.G.error(h);setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.H.H(()=>{a.state.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Je(a){return null===a.storage.get(a.F+'olympe_manual_offline')}
547
- olympe.L.tc=class{constructor(a,b,c,d,e,f){this.G=a;this.D=b;this.H=d;this.storage=e;this.state=olympe.C.bc(Number).update(olympe.L.tc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Ie(this,f)}Vf(){const a=olympe.L.tc.j.cj,b=olympe.L.tc.j.Df,c=olympe.L.tc.j.yc;let d=olympe.C.ba.j;return olympe.C.ta([this.state],e=>{if(e===a)d=olympe.C.ba.D;else if(e===b||e===c)d=olympe.C.ba.j;return d},olympe.C.ba)}getState(){return this.state.sb()}connect(){const a=
548
- this;return u(function*(){const b=olympe.L.tc.j.cj,c=olympe.L.tc.j.Lm;olympe.C.Pa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Ke(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.tc.j.Df,c=olympe.L.tc.j.Lm;if(!a.j)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.F+'olympe_manual_offline','true');olympe.C.Pa(a.state)!==
549
- b&&(a.state.update(c),yield olympe.L.ih().disconnect(),yield a.D.disconnect())})}};olympe.L.tc.j={INIT:0,Lm:1,cj:2,Df:3,yc:4,sw:5};olympe.L.tc.D='olympe_manual_offline';olympe.L.cc=class{constructor(){this.R=this.X=null}fa(a){a=this.D(a);this.X=null;return a}N(a){a=this.j(a);this.R=null;return a}D(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 this.format(olympe.L.cc.j.Vl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Vl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
550
- a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.uq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Yg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.jf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.jf().j(a),this.format(olympe.L.cc.j.$h,a);case Symbol.asyncIterator in
551
- a:if(!this.X)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.cc.j.je,null==(b=this.X)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.D(e);return c},{}),this.format(olympe.L.cc.j.Nq,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}j(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===
552
- typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.jp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Vl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Pb(c);case olympe.L.cc.j.uq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Yg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.jf().D(c).buffer;case olympe.L.cc.j.$h:return olympe.U.jf().D(c);
553
- case olympe.L.cc.j.je: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.Nq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.jp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Vl:1,COLOR:2,uq:3,Yg:4,ARRAY_BUFFER:5,$h:6,je:7,Nq:8};const Le=olympe.L.wa.j.SEND,Me=olympe.L.wa.j.GET,Ne=olympe.L.wa.j.PUBLISH,Oe=olympe.L.wa.j.SUBSCRIBE,Pe=olympe.L.wa.j.hg,Qe=olympe.L.wa.j.bs,Re=olympe.L.wa.j.Fr,Se=olympe.L.wa.j.zb,Te=olympe.L.wa.j.js,Ue=olympe.L.wa.j.mg;function Hd(a,b){a.j||(a.j=gb(new olympe.U.bn(a.D.ef+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
554
- function Ve(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.lc.Vk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.lc.TIMEOUT?new olympe.error.Uk(a):new olympe.error.od(a,d)}function We(a,b){const c=olympe.L.wa.j.mg,d=olympe.L.wa.j.Yr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.ib(),b.ib(),d)}
555
- olympe.L.qb=class{constructor(a,b){this.D=olympe.L.ih();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Bb?b.Bb():b);this.G=olympe.ha.Xa(`Service ${this.F}`)}ut(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Vd(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static kd(a,b){return u(function*(){yield olympe.L.ih().request(a,
556
- a,Ne,b,!1)})}static Vs(a){const b=olympe.L.ih(),c=new olympe.L.Dk(a,b);ae(b,a).then(d=>Xe(c,d)).catch(d=>olympe.ha.Xa('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.ih().request(a,a,Le,b,!0,c.timeout).then(d=>{switch(d.getType()){case Re:break;case Se:throw Ve(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ih().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Te:d=
557
- d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Se:throw Ve(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Bb?b.Bb():b,f=olympe.L.ih(),g=new olympe.L.Dk(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(fe(f,a,n,l),l=n=null);k&&(Vd(f,k).catch(q=>olympe.ha.Xa('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
558
- e.Xd(p);f.request(a,a,Oe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ue:Xe(g,q.ib());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ha.Xa('Service '+a).error('Failed to ack the msg'));Wd(f,k,t=>{t.getType()===Ne?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.ib();ee(f,a,n,l,r.refresh,t=>h.error(t));We(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
547
+ olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.D=b;this.H=d;this.storage=e;this.state=olympe.C.bc(Number).update(olympe.L.uc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Ie(this,f)}Vf(){const a=olympe.L.uc.j.cj,b=olympe.L.uc.j.Df,c=olympe.L.uc.j.zc;let d=olympe.C.ba.j;return olympe.C.ta([this.state],e=>{if(e===a)d=olympe.C.ba.D;else if(e===b||e===c)d=olympe.C.ba.j;return d},olympe.C.ba)}getState(){return this.state.tb()}connect(){const a=
548
+ this;return u(function*(){const b=olympe.L.uc.j.cj,c=olympe.L.uc.j.Mm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Ke(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.uc.j.Df,c=olympe.L.uc.j.Mm;if(!a.j)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.F+'olympe_manual_offline','true');olympe.C.Qa(a.state)!==
549
+ b&&(a.state.update(c),yield olympe.L.ih().disconnect(),yield a.D.disconnect())})}};olympe.L.uc.j={INIT:0,Mm:1,cj:2,Df:3,zc:4,ww:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.cc=class{constructor(){this.R=this.X=null}fa(a){a=this.D(a);this.X=null;return a}N(a){a=this.j(a);this.R=null;return a}D(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 this.format(olympe.L.cc.j.Wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
550
+ a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.xq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Yg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.jf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.jf().j(a),this.format(olympe.L.cc.j.$h,a);case Symbol.asyncIterator in
551
+ a:if(!this.X)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.cc.j.je,null==(b=this.X)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.D(e);return c},{}),this.format(olympe.L.cc.j.Qq,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}j(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===
552
+ typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.kp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Wl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Pb(c);case olympe.L.cc.j.xq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Yg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.jf().D(c).buffer;case olympe.L.cc.j.$h:return olympe.U.jf().D(c);
553
+ case olympe.L.cc.j.je: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.Qq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.kp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Wl:1,COLOR:2,xq:3,Yg:4,ARRAY_BUFFER:5,$h:6,je:7,Qq:8};const Le=olympe.L.wa.j.SEND,Me=olympe.L.wa.j.GET,Ne=olympe.L.wa.j.PUBLISH,Oe=olympe.L.wa.j.SUBSCRIBE,Pe=olympe.L.wa.j.hg,Qe=olympe.L.wa.j.es,Re=olympe.L.wa.j.Ir,Se=olympe.L.wa.j.Ab,Te=olympe.L.wa.j.ms,Ue=olympe.L.wa.j.mg;function Hd(a,b){a.j||(a.j=gb(new olympe.U.cn(a.D.ef+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
554
+ function Ve(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.lc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.lc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.od(a,d)}function We(a,b){const c=olympe.L.wa.j.mg,d=olympe.L.wa.j.bs;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
555
+ olympe.L.qb=class{constructor(a,b){this.D=olympe.L.ih();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ha.Xa(`Service ${this.F}`)}yt(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Vd(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static kd(a,b){return u(function*(){yield olympe.L.ih().request(a,
556
+ a,Ne,b,!1)})}static Zs(a){const b=olympe.L.ih(),c=new olympe.L.Ek(a,b);ae(b,a).then(d=>Xe(c,d)).catch(d=>olympe.ha.Xa('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.ih().request(a,a,Le,b,!0,c.timeout).then(d=>{switch(d.getType()){case Re:break;case Se:throw Ve(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ih().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Te:d=
557
+ d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Se:throw Ve(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ih(),g=new olympe.L.Ek(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(fe(f,a,n,l),l=n=null);k&&(Vd(f,k).catch(q=>olympe.ha.Xa('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
558
+ e.Xd(p);f.request(a,a,Oe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ue:Xe(g,q.jb());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ha.Xa('Service '+a).error('Failed to ack the msg'));Wd(f,k,t=>{t.getType()===Ne?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();ee(f,a,n,l,r.refresh,t=>h.error(t));We(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
559
559
  p()});break;case Se:h.error(Ve(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(sb(olympe.error.Ph,(h,k)=>{olympe.ha.Xa(`Service ${a}`).debug(`Subscribed to topic ${h.T()} now that we are back online, after waiting for ${k}ms`);let l;null==(l=d.onRetry)||l.call(d)})),publisher:g}}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);Wd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
560
- {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}xi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Ne,a,!1,b.D.lb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Pe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:fb(g,f))});c.cd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Qe:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
561
- olympe.L.qb.prototype.multicast=olympe.L.qb.prototype.xi;olympe.L.qb.prototype.listen=olympe.L.qb.prototype.listen;olympe.L.qb.observe=olympe.L.qb.observe;olympe.L.qb.get=olympe.L.qb.get;olympe.L.qb.send=olympe.L.qb.send;olympe.L.qb.getPublisher=olympe.L.qb.Vs;olympe.L.qb.publish=olympe.L.qb.kd;olympe.L.qb.prototype.stop=olympe.L.qb.prototype.stop;olympe.L.qb.prototype.setUnsubscriptionHandler=olympe.L.qb.prototype.ut;olympe.L.Xq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.U.stream.lg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
562
- this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};function Xe(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Dk=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}kd(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.wa.j.PUBLISH,a,!0)})}};olympe.L.Dk.prototype.publish=olympe.L.Dk.prototype.kd;olympe.L.Ee={Gg:1,ag:2,zb:3,Ng:4,EA:5,mk:6,oc:7};olympe.L.rk={mk:1,Ow:2,mu:3,hg:5,aw:1,bE:2};olympe.L.Me={Gg:0,Eh:1,zb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',yc:'disconnected',ep:'disconnecting',ze:'connected',Tg:'reconnecting',Yk:'waking',no:'awake',zb:'error'};olympe.L.Na.F={Qh:1,pu:-1,Fu:-2,Fw:-3};olympe.L.Na.D={ij:0,bq:23};
560
+ {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}xi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Ne,a,!1,b.D.nb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Pe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:fb(g,f))});c.cd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Qe:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
561
+ olympe.L.qb.prototype.multicast=olympe.L.qb.prototype.xi;olympe.L.qb.prototype.listen=olympe.L.qb.prototype.listen;olympe.L.qb.observe=olympe.L.qb.observe;olympe.L.qb.get=olympe.L.qb.get;olympe.L.qb.send=olympe.L.qb.send;olympe.L.qb.getPublisher=olympe.L.qb.Zs;olympe.L.qb.publish=olympe.L.qb.kd;olympe.L.qb.prototype.stop=olympe.L.qb.prototype.stop;olympe.L.qb.prototype.setUnsubscriptionHandler=olympe.L.qb.prototype.yt;olympe.L.$q=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.U.stream.lg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
562
+ this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};function Xe(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ek=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}kd(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.wa.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.kd;olympe.L.Ee={Gg:1,ag:2,Ab:3,Ng:4,IA:5,nk:6,oc:7};olympe.L.sk={nk:1,Sw:2,qu:3,hg:5,ew:1,fE:2};olympe.L.Me={Gg:0,Eh:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',zc:'disconnected',fp:'disconnecting',ze:'connected',Tg:'reconnecting',Zk:'waking',oo:'awake',Ab:'error'};olympe.L.Na.F={Qh:1,tu:-1,Ju:-2,Jw:-3};olympe.L.Na.D={ij:0,eq:23};
563
563
  olympe.L.Na.oc={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',
564
- 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.L.P={uf:'com.ConnectivityManager',Mk:'com.ServerManager',Ao:'com.BusManager',km:'com.HttpManager',Le:'com.Serializer',Ca:'com.Logger',Zg:'com.Source',cs:'com.Urls',zC:'com.peerFileSvcUrl'};
565
- olympe.L.Config={Xl:'defaultHost',kw:'server.host',mw:'server.port',nw:'server.ssl',Gr:'server.basePath',ns:'server.wsPath',Rm:'server.reconnectionDelay',Zq:'server.pingInterval',ms:'server.messageTimeout',tr:'server.retryHttpOnOverload',Nl:'server.clientVersion',Jr:'server.serverVersion',ow:'server.wakeUpService',Nt:'bus.host',Ot:'bus.path',Pt:'bus.port',Rt:'bus.vhost',Qt:'bus.ssl',Eo:'bus.requestTimeout',Fo:'bus.subscriptionRefreshRate',Do:'bus.reconnectionDelay',zo:'bus.heartbeat',Bo:'bus.queueExpiration',
566
- Co:'bus.queuePrefetch',Hl:'bus.allowGuest',Zr:'bus.topicPrefix'};
567
- olympe.V.config(function(a){const b=olympe.host.Wg.Th;E(a,olympe.L.Config.Xl,a.getParameter(olympe.host.Config.Op));E(a,olympe.L.Config.Gr,'OlympeServer');E(a,olympe.L.Config.Zr,'');Ya(a,'com.hostConfig',[olympe.host.Config.Ik,olympe.L.Config.Xl,olympe.L.Config.kw,olympe.L.Config.mw,olympe.L.Config.nw,olympe.L.Config.Gr,olympe.L.Config.Nt,olympe.L.Config.Rt,olympe.L.Config.Pt,olympe.L.Config.Ot,olympe.L.Config.Qt],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.Config.xm);e=e===olympe.host.Wg.Th;
568
- var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A='object'===typeof window;g=null!=g?g:z;n=null!=n?n:!A&&y?z.replace(new RegExp(`${v}.*`),'rabbitmq'):z;z=(v=x.includes(g))||y;y=(x=x.includes(n))||y;f=x?'/':f.split('.')[0];return{Wn:g,Xn:null!=h?h:v?8080:z?e?85:80:443,Yn:null!=k?k:!z,qt:l,qx:n,vx:null!=p?p:f,tx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,sx:null!=r?r:!x&&A?'/amqp/ws':'',ux:null!=t?t:!y}});E(a,olympe.L.Config.ns,'websocket');E(a,olympe.L.Config.Rm,5E3);
569
- E(a,olympe.L.Config.Zq,5E3);E(a,olympe.L.Config.ms,3E4);E(a,olympe.L.Config.tr,4E3);E(a,olympe.L.Config.Jr,'7.5.3');E(a,olympe.L.Config.Eo,6E4);E(a,olympe.L.Config.Fo,3E4);E(a,olympe.L.Config.Hl,!1);E(a,olympe.L.Config.Do,a.getParameter(olympe.L.Config.Rm));E(a,olympe.L.Config.zo,15);E(a,olympe.L.Config.Bo,3E5);E(a,olympe.L.Config.Co,20);const c=a.getParameter(olympe.xg.Config.wp);if(void 0!==c)a.setParameter(olympe.L.Config.Nl,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
570
- D(a,olympe.L.P.Ca,[olympe.ha.P.Da],e=>e.ad('communication'));D(a,'server.WebSocketRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.ns)],(e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt:l})=>new olympe.net.oj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.ow)],(e,f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k})=>{if(null===f||void 0===
571
- f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.oj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Xb));D(a,olympe.L.P.cs,[new olympe.V.Dh('com.hostConfig'),...d.map(e=>new olympe.V.oa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Wn:g,Xn:h,Yn:k,qt:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Si(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));
572
- C(a,olympe.L.P.Le,olympe.L.cc);C(a,olympe.L.P.km,olympe.L.uu,olympe.L.P.Ca,olympe.net.P.Da,olympe.U.P.ig,olympe.L.P.cs,new olympe.V.oa(olympe.L.Config.tr));D(a,'com.server.ManagerConfig',[new olympe.V.oa(olympe.L.Config.Zq),new olympe.V.oa(olympe.L.Config.ms),new olympe.V.oa(olympe.L.Config.Nl),new olympe.V.oa(olympe.L.Config.Jr),new olympe.V.oa(olympe.dc.Config.Yh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],
573
- h));return g});C(a,olympe.L.P.Mk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Ge,olympe.host.P.Pk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.ig,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Ik,olympe.L.Config.Zr],(e,f)=>e===olympe.host.Wg.Th?`${b}-${f}`:f);D(a,'com.bus.ManagerConfig',[new olympe.V.Dh('com.hostConfig'),new olympe.V.Dh('com.bus.TopicPrefix'),new olympe.V.oa(olympe.L.Config.Hl),new olympe.V.oa(olympe.L.Config.Eo),new olympe.V.oa(olympe.L.Config.Fo),
574
- new olympe.V.oa(olympe.L.Config.Do),new olympe.V.oa(olympe.L.Config.Bo),new olympe.V.oa(olympe.L.Config.Co),new olympe.V.oa(olympe.L.Config.zo)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({qx:r,sx:t,tx:v,vx:x,ux:y})=>({host:r,xh:y,port:v,path:t,oA:x,lt:l,Tz:n,Uz:p,sz:h+3E4,bz:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Ao,olympe.L.Kl,olympe.L.P.Ca,olympe.net.P.Da,
575
- olympe.L.P.uf,olympe.auth.P.Da,olympe.host.P.Ge,olympe.L.P.Le,olympe.U.P.ig,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Fm,olympe.Db.P.$g,new olympe.V.oa(olympe.L.Config.Rm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.uf,olympe.L.tc,olympe.L.P.Ca,olympe.L.P.Mk,olympe.net.P.Da,olympe.host.P.Ge,olympe.Db.P.ym,'com.connectivity.ManagerConfig')},'olympe.communication');
576
- olympe.V.run([olympe.L.P.Ao,olympe.L.P.uf],(a,b)=>{olympe.L.ih=()=>a;olympe.L.An=()=>b});olympe.auth={};function Ye(a,b){Ee(a.j);we(a.j,olympe.L.Ee.Ng,c=>{const d=c.c;d===olympe.auth.td.j.qv?(a.j.ke(),b(olympe.auth.Ta.D.Qj,c)):d===olympe.auth.td.j.iw&&b(olympe.auth.Ta.D.Up,c)},'logoutHandler')}
577
- function Ze(a,b,c){const d=null==b?void 0:b.Cf();if(b instanceof olympe.auth.yk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Gd();h.access_token=$e(b);g=`${qe(a.Lh,olympe.L.Xb.vk)}/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 Be(a.j,
578
- olympe.L.Ee.Ng,Object.assign({},{c:olympe.auth.td.j.rv},d&&{idpName:d}),c)}function af(a,b,c,d){olympe.C.Pa(a.H.getState())===olympe.L.tc.j.Df?d(new olympe.error.Vq,'Working offline'):(c.c=b,Be(a.j,olympe.L.Ee.Ng,c,d))}
579
- function bf(a,b,c){if(b.Mg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Cf()}&access_token=${$e(b)}`;d=`${qe(a.Lh,olympe.L.Xb.vk)}/refresh${d}`;d=Hc(N(d),olympe.net.va.ResponseType.JSON);se(a.Lh,d,b.Gd()).then(e=>{(e=e.getData())?(e=new olympe.auth.yk(b.wc(),b.te(),b.Gd(),e,b.Cf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
580
- olympe.auth.td=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Lh=c;this.H=d;this.D=e;this.F=f;cf(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.Kk.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}`)})}qf(a){Be(this.j,olympe.L.Ee.Ng,{c:olympe.auth.td.j.hg},b=>a(b))}qh(a,b,c){const d=qe(this.Lh,olympe.L.Xb.es);
581
- a=N(`${d}/${a}`);se(this.Lh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.td.j={Ng:1,rv:2,zb:3,hg:5,ij:6,yu:10,ww:11,Ct:12,SAML:13,iw:14,qv:20};function ge(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.ni());a.R.set(c,b)}function ce(a){return olympe.C.Pa(a.dd.sb())}
582
- function Ke(){var a=olympe.auth.qe();const b=olympe.auth.Ta.j.Rj,c=olympe.auth.Ta.j.INIT;df(a,b);a.ia?(a.j=olympe.auth.Ta.F.Bt,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ef(a)):(a.j=olympe.auth.Ta.F.Hf,a.G.log('Connector online, attempting to log with token'),ff(a));return rxjs.firstValueFrom(a.state.sb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
583
- function gf(a){a.G.log('Initializing AUTH layer');let b=a.Yb;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&&hf(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Uc([a.sa.getState()],c=>{switch(c){case olympe.L.tc.j.Df:a.j=olympe.auth.Ta.F.Hf;a.G.log('Connector offline, attempting to recover sessions from current token');
584
- ff(a);break;case olympe.L.tc.j.yc:switch(olympe.C.Pa(a.state)){case olympe.auth.Ta.j.rf:c=olympe.C.Pa(a.dd).wc();jf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Pi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Rj:jf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:jf(a,'Cannot open auth session - no server connection');break;default:jf(a,'Should not get there, investigate',!0)}}});
585
- Ye(a.D,(c,d)=>{if(c===olympe.auth.Ta.D.Qj){jf(a,'authentication revoked');let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.Up){a.G.info('Redirection to IDP to invalidate token (SAML)');ce(a);let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ga.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.Z=lf(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
586
- function mf(a,b){let c=null;olympe.C.Gj(a.state.sb().Jd(olympe.auth.Ta.j.rf).and(b),()=>{const d=ce(a);!nf(a)&&d&&(c=a.Yd.get(d.Mg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.Jj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&of(a,f)}))},()=>{let d;null==(d=c)||d()})}
587
- function ff(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.se().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.wc();e.set('username',c);c=e;var d=b.Gd();c.set('nonce',d);'string'===typeof b.Cf()&&e.set('idpName',b.Cf());a.G.debug('Token found, trying login with',e);pf(a,e,olympe.auth.Ec.j.Gm)}else jf(a,'No token found, cannot perform auto login')}).catch(b=>{jf(a,b.message,!0)})):jf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
564
+ 18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.L.P={uf:'com.ConnectivityManager',Nk:'com.ServerManager',Bo:'com.BusManager',mm:'com.HttpManager',Le:'com.Serializer',Ca:'com.Logger',Zg:'com.Source',gs:'com.Urls',DC:'com.peerFileSvcUrl'};
565
+ olympe.L.Config={Yl:'defaultHost',ow:'server.host',qw:'server.port',rw:'server.ssl',Jr:'server.basePath',rs:'server.wsPath',Sm:'server.reconnectionDelay',br:'server.pingInterval',qs:'server.messageTimeout',wr:'server.retryHttpOnOverload',Ol:'server.clientVersion',Mr:'server.serverVersion',sw:'server.wakeUpService',Rt:'bus.host',St:'bus.path',Tt:'bus.port',Vt:'bus.vhost',Ut:'bus.ssl',Fo:'bus.requestTimeout',Go:'bus.subscriptionRefreshRate',Eo:'bus.reconnectionDelay',Ao:'bus.heartbeat',Co:'bus.queueExpiration',
566
+ Do:'bus.queuePrefetch',Il:'bus.allowGuest',cs:'bus.topicPrefix'};
567
+ olympe.V.config(function(a){const b=olympe.host.Wg.Th;E(a,olympe.L.Config.Yl,a.getParameter(olympe.host.Config.Pp));E(a,olympe.L.Config.Jr,'OlympeServer');E(a,olympe.L.Config.cs,'');Ya(a,'com.hostConfig',[olympe.host.Config.Jk,olympe.L.Config.Yl,olympe.L.Config.ow,olympe.L.Config.qw,olympe.L.Config.rw,olympe.L.Config.Jr,olympe.L.Config.Rt,olympe.L.Config.Vt,olympe.L.Config.Tt,olympe.L.Config.St,olympe.L.Config.Ut],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.Config.ym);e=e===olympe.host.Wg.Th;
568
+ var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A='object'===typeof window;g=null!=g?g:z;n=null!=n?n:!A&&y?z.replace(new RegExp(`${v}.*`),'rabbitmq'):z;z=(v=x.includes(g))||y;y=(x=x.includes(n))||y;f=x?'/':f.split('.')[0];return{Xn:g,Yn:null!=h?h:v?8080:z?e?85:80:443,Zn:null!=k?k:!z,ut:l,vx:n,zx:null!=p?p:f,xx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,wx:null!=r?r:!x&&A?'/amqp/ws':'',yx:null!=t?t:!y}});E(a,olympe.L.Config.rs,'websocket');E(a,olympe.L.Config.Sm,5E3);
569
+ E(a,olympe.L.Config.br,5E3);E(a,olympe.L.Config.qs,3E4);E(a,olympe.L.Config.wr,4E3);E(a,olympe.L.Config.Mr,'7.5.3');E(a,olympe.L.Config.Fo,6E4);E(a,olympe.L.Config.Go,3E4);E(a,olympe.L.Config.Il,!1);E(a,olympe.L.Config.Eo,a.getParameter(olympe.L.Config.Sm));E(a,olympe.L.Config.Ao,15);E(a,olympe.L.Config.Co,3E5);E(a,olympe.L.Config.Do,20);const c=a.getParameter(olympe.xg.Config.xp);if(void 0!==c)a.setParameter(olympe.L.Config.Ol,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
570
+ D(a,olympe.L.P.Ca,[olympe.ha.P.Fa],e=>e.ad('communication'));D(a,'server.WebSocketRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.rs)],(e,f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k,ut:l})=>new olympe.net.oj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.V.Dh('com.hostConfig'),new olympe.V.oa(olympe.L.Config.sw)],(e,f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k})=>{if(null===f||void 0===
571
+ f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.oj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Xb));D(a,olympe.L.P.gs,[new olympe.V.Dh('com.hostConfig'),...d.map(e=>new olympe.V.oa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Xn:g,Yn:h,Zn:k,ut:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Si(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));
572
+ C(a,olympe.L.P.Le,olympe.L.cc);C(a,olympe.L.P.mm,olympe.L.yu,olympe.L.P.Ca,olympe.net.P.Fa,olympe.U.P.ig,olympe.L.P.gs,new olympe.V.oa(olympe.L.Config.wr));D(a,'com.server.ManagerConfig',[new olympe.V.oa(olympe.L.Config.br),new olympe.V.oa(olympe.L.Config.qs),new olympe.V.oa(olympe.L.Config.Ol),new olympe.V.oa(olympe.L.Config.Mr),new olympe.V.oa(olympe.dc.Config.Yh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],
573
+ h));return g});C(a,olympe.L.P.Nk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Fa,olympe.host.P.Ge,olympe.host.P.Qk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.ig,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Jk,olympe.L.Config.cs],(e,f)=>e===olympe.host.Wg.Th?`${b}-${f}`:f);D(a,'com.bus.ManagerConfig',[new olympe.V.Dh('com.hostConfig'),new olympe.V.Dh('com.bus.TopicPrefix'),new olympe.V.oa(olympe.L.Config.Il),new olympe.V.oa(olympe.L.Config.Fo),new olympe.V.oa(olympe.L.Config.Go),
574
+ new olympe.V.oa(olympe.L.Config.Eo),new olympe.V.oa(olympe.L.Config.Co),new olympe.V.oa(olympe.L.Config.Do),new olympe.V.oa(olympe.L.Config.Ao)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({vx:r,wx:t,xx:v,zx:x,yx:y})=>({host:r,xh:y,port:v,path:t,sA:x,pt:l,Xz:n,Yz:p,wz:h+3E4,ez:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Bo,olympe.L.Ll,olympe.L.P.Ca,olympe.net.P.Fa,
575
+ olympe.L.P.uf,olympe.auth.P.Fa,olympe.host.P.Ge,olympe.L.P.Le,olympe.U.P.ig,'com.bus.ManagerConfig');D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Gm,olympe.Db.P.$g,new olympe.V.oa(olympe.L.Config.Sm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.uf,olympe.L.uc,olympe.L.P.Ca,olympe.L.P.Nk,olympe.net.P.Fa,olympe.host.P.Ge,olympe.Db.P.zm,'com.connectivity.ManagerConfig')},'olympe.communication');
576
+ olympe.V.run([olympe.L.P.Bo,olympe.L.P.uf],(a,b)=>{olympe.L.ih=()=>a;olympe.L.Bn=()=>b});olympe.auth={};function Ye(a,b){Ee(a.j);we(a.j,olympe.L.Ee.Ng,c=>{const d=c.c;d===olympe.auth.td.j.vv?(a.j.ke(),b(olympe.auth.Ta.D.Rj,c)):d===olympe.auth.td.j.mw&&b(olympe.auth.Ta.D.Vp,c)},'logoutHandler')}
577
+ function Ze(a,b,c){const d=null==b?void 0:b.Cf();if(b instanceof olympe.auth.zk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Gd();h.access_token=$e(b);g=`${qe(a.Lh,olympe.L.Xb.wk)}/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 Be(a.j,
578
+ olympe.L.Ee.Ng,Object.assign({},{c:olympe.auth.td.j.wv},d&&{idpName:d}),c)}function af(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.uc.j.Df?d(new olympe.error.Yq,'Working offline'):(c.c=b,Be(a.j,olympe.L.Ee.Ng,c,d))}
579
+ function bf(a,b,c){if(b.Mg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Cf()}&access_token=${$e(b)}`;d=`${qe(a.Lh,olympe.L.Xb.wk)}/refresh${d}`;d=Hc(N(d),olympe.net.va.ResponseType.JSON);se(a.Lh,d,b.Gd()).then(e=>{(e=e.getData())?(e=new olympe.auth.zk(b.xc(),b.te(),b.Gd(),e,b.Cf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
580
+ olympe.auth.td=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Lh=c;this.H=d;this.D=e;this.F=f;cf(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.Lk.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}`)})}qf(a){Be(this.j,olympe.L.Ee.Ng,{c:olympe.auth.td.j.hg},b=>a(b))}qh(a,b,c){const d=qe(this.Lh,olympe.L.Xb.js);
581
+ a=N(`${d}/${a}`);se(this.Lh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.td.j={Ng:1,wv:2,Ab:3,hg:5,ij:6,Cu:10,Aw:11,Gt:12,SAML:13,mw:14,vv:20};function ge(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.ni());a.R.set(c,b)}function ce(a){return olympe.C.Qa(a.dd.tb())}
582
+ function Ke(){var a=olympe.auth.qe();const b=olympe.auth.Ta.j.Sj,c=olympe.auth.Ta.j.INIT;df(a,b);a.ia?(a.j=olympe.auth.Ta.F.Ft,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ef(a)):(a.j=olympe.auth.Ta.F.Hf,a.G.log('Connector online, attempting to log with token'),ff(a));return rxjs.firstValueFrom(a.state.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
583
+ function gf(a){a.G.log('Initializing AUTH layer');let b=a.Yb;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&&hf(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Vc([a.sa.getState()],c=>{switch(c){case olympe.L.uc.j.Df:a.j=olympe.auth.Ta.F.Hf;a.G.log('Connector offline, attempting to recover sessions from current token');
584
+ ff(a);break;case olympe.L.uc.j.zc:switch(olympe.C.Qa(a.state)){case olympe.auth.Ta.j.rf:c=olympe.C.Qa(a.dd).xc();jf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Pi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Sj:jf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:jf(a,'Cannot open auth session - no server connection');break;default:jf(a,'Should not get there, investigate',!0)}}});
585
+ Ye(a.D,(c,d)=>{if(c===olympe.auth.Ta.D.Rj){jf(a,'authentication revoked');let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.Vp){a.G.info('Redirection to IDP to invalidate token (SAML)');ce(a);let e;null==(e=a.storage)||kf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ha.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.Z=lf(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
586
+ function mf(a,b){let c=null;olympe.C.Gj(a.state.tb().Jd(olympe.auth.Ta.j.rf).and(b),()=>{const d=ce(a);!nf(a)&&d&&(c=a.Yd.get(d.Mg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.Jj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&of(a,f)}))},()=>{let d;null==(d=c)||d()})}
587
+ function ff(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.se().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.xc();e.set('username',c);c=e;var d=b.Gd();c.set('nonce',d);'string'===typeof b.Cf()&&e.set('idpName',b.Cf());a.G.debug('Token found, trying login with',e);pf(a,e,olympe.auth.Ec.j.Hm)}else jf(a,'No token found, cannot perform auto login')}).catch(b=>{jf(a,b.message,!0)})):jf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
588
588
  !0)}function jf(a,b,c=!1){a.dd.update(a.N);df(a,olympe.auth.Ta.j.Pi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function lf(a){const b=[olympe.auth.Ta.j.rf];a.ia||b.push(olympe.auth.Ta.j.Pi);return a.da.j(()=>{const c=qf(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function df(a,b){a.G.log('State change: ',qf(a),'--\x3e',b);a.state.update(b)}
589
- function ef(a){if(a.H){const b=new olympe.auth.Request;b.set('username',a.H);b.set('password',a.Wa);a.G.log('Autologin with user "'+a.H+'"');pf(a,b)}else jf(a,'No user specified for auto login',!0)}function nf(a){return olympe.C.Pa(a.dd)===a.N}function of(a,b){if(b){a.dd.update(b);let c;null==(c=a.storage)||hf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function qf(a){return olympe.C.Pa(a.state.sb())}function rf(){var a=olympe.public.Ma.get();return new Map(a.D.j.Fd)}
590
- function sf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.wb(b));df(a,olympe.auth.Ta.j.zb);if(d)throw Error(b);}function pf(a,b,c,d){void 0===c&&(c=a.lb);void 0===c&&sf(a,'No authentication provider specified',null,!0);const e=a.Yd.get(c);e||sf(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.F.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.se(b,a.yb.bind(a));df(a,olympe.auth.Ta.j.Rj)}
589
+ function ef(a){if(a.H){const b=new olympe.auth.Request;b.set('username',a.H);b.set('password',a.Wa);a.G.log('Autologin with user "'+a.H+'"');pf(a,b)}else jf(a,'No user specified for auto login',!0)}function nf(a){return olympe.C.Qa(a.dd)===a.N}function of(a,b){if(b){a.dd.update(b);let c;null==(c=a.storage)||hf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function qf(a){return olympe.C.Qa(a.state.tb())}function rf(){var a=olympe.public.Ma.get();return new Map(a.D.j.Fd)}
590
+ function sf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.wb(b));df(a,olympe.auth.Ta.j.Ab);if(d)throw Error(b);}function pf(a,b,c,d){void 0===c&&(c=a.nb);void 0===c&&sf(a,'No authentication provider specified',null,!0);const e=a.Yd.get(c);e||sf(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.F.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.se(b,a.yb.bind(a));df(a,olympe.auth.Ta.j.Sj)}
591
591
  function tf(a,b,c){a.F.forEach(d=>{d(b,c)})}
592
- olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.sa=b;this.D=c;this.storage=d;this.Ga=e;this.lb=k.get('defaultProvider');this.ia=!!k.get('autoLogin');this.H=k.get('autoUser');this.Wa=k.get('autoPassword');this.Yb=k.get('autoToken');this.Yd=new Map;this.da=f;this.Z='';this.state=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.j=null;this.N=new olympe.auth.eh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.dd=olympe.C.bc(olympe.auth.eh).update(this.N);
593
- this.F=new Map;this.R=new Map;this.X=new olympe.U.Zh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Yd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Yd.set(n,l)});gf(this);mf(this,g.j())}pl(){const a=olympe.auth.Ta.j.rf,b=olympe.auth.Ta.j.Pi,c=olympe.auth.Ta.j.zb,d=olympe.C.bc(olympe.C.ba);olympe.C.Uc([this.state],e=>{e===a?d.update(olympe.C.ba.D):e===b?d.update(olympe.C.ba.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ba.j)):d.clear()});
594
- return d.sb()}yg(a){if(olympe.C.Pa(this.state)===olympe.auth.Ta.j.rf){var b=ce(this);!nf(this)&&b&&this.Yd.get(b.Mg()).yg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Jj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&of(this,d);a(c)})}}getState(){return this.state.sb()}wc(){return this.dd.sb().wc()}te(){return this.dd.sb().te()}ri(){return this.dd.sb().ri()}qh(a,b){if(fb(this.X.j,a))b(null,this.X.get(a));else{var c,d=null==(c=olympe.C.Pa(this.dd.sb()))?
592
+ olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.sa=b;this.D=c;this.storage=d;this.Ha=e;this.nb=k.get('defaultProvider');this.ia=!!k.get('autoLogin');this.H=k.get('autoUser');this.Wa=k.get('autoPassword');this.Yb=k.get('autoToken');this.Yd=new Map;this.da=f;this.Z='';this.state=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.j=null;this.N=new olympe.auth.eh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.dd=olympe.C.bc(olympe.auth.eh).update(this.N);
593
+ this.F=new Map;this.R=new Map;this.X=new olympe.U.Zh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Yd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Yd.set(n,l)});gf(this);mf(this,g.j())}ql(){const a=olympe.auth.Ta.j.rf,b=olympe.auth.Ta.j.Pi,c=olympe.auth.Ta.j.Ab,d=olympe.C.bc(olympe.C.ba);olympe.C.Vc([this.state],e=>{e===a?d.update(olympe.C.ba.D):e===b?d.update(olympe.C.ba.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ba.j)):d.clear()});
594
+ return d.tb()}yg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ta.j.rf){var b=ce(this);!nf(this)&&b&&this.Yd.get(b.Mg()).yg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Jj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&of(this,d);a(c)})}}getState(){return this.state.tb()}xc(){return this.dd.tb().xc()}te(){return this.dd.tb().te()}ri(){return this.dd.tb().ri()}qh(a,b){if(fb(this.X.j,a))b(null,this.X.get(a));else{var c,d=null==(c=olympe.C.Qa(this.dd.tb()))?
595
595
  void 0:c.Gd();this.D.qh(a,d,(e,f)=>{'string'===typeof f&&this.X.set(a,f);b(e,f)})}}Jj(){return nf(this)?(this.G.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.G.debug('Sending logout');let c;null==(c=this.storage)||kf(c).catch(d=>this.G.error('Failed to clear token',d));Ze(this.D,ce(this),d=>{d?(sf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.da.D(this.Z)})}qf(a){qf(this)===olympe.auth.Ta.j.rf&&
596
- this.D.qf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}yb(a,b){const c=null===this.j?olympe.auth.Ta.F.yv:this.j;this.j=null;if(!a||a instanceof olympe.error.Vq){null===a?this.G.info(`User ${b.wc()} (#${b.te()}) successfully authenticated`):this.G.info(`User ${b.wc()} (#${b.te()}) recovered from token, while offline`);this.dd.update(b);df(this,olympe.auth.Ta.j.rf);tf(this,a,c);let d;null==(d=this.storage)||hf(d,b).catch(e=>this.G.error(e))}else{let d;
597
- null==(d=this.storage)||kf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.wb(a.message));jf(this,'authentication rejected: '+a.message);tf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Rj:'authenticating',Pi:'guest',rf:'authenticated',zb:'error'};olympe.auth.Ta.F={yv:'manual',Bt:'auto',Hf:'tokenOnFirstConnection'};olympe.auth.Ta.D={Qj:'accepted',Up:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}se(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.qf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.vd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}yg(a,b){this.D.qf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Gm:'olympeToken'};function uf(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Uc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.fh&&(a=a.Ba.Eb);return a?a.valueOf():a}wc(){return this.get('username')}Gd(){return this.get('nonce')}toString(){return this.wc()+(this.Gd()?' with nonce':'')+(this.get('password')?' with password':'')+(uf(this)?` with idp name ${uf(this)}`:'')}};olympe.auth.eh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Bi=b;this.D=c;this.j=e;this.F=d}wc(){return this.user}te(){return this.Bi}Gd(){return this.D}Vi(){return this.F}ri(){return null}Cf(){return this.j}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.user,userTag:this.Bi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.U.vs(ab(a,JSON.stringify(b)))}Mg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.eh.prototype;m.wc.K=new olympe.C.J(()=>String,[]);
598
- m.te.K=new olympe.C.J(()=>String,[]);m.Gd.K=new olympe.C.J(()=>String,[]);m.Vi.K=new olympe.C.J(()=>Object,[]);m.ri.K=new olympe.C.J(()=>String,[]);m.Cf.K=new olympe.C.J(()=>String,[]);m.fa.K=new olympe.C.J(()=>String,[]);m.Mg.K=new olympe.C.J(()=>String,[]);function $e(a){return a.Vi().access_token||null}function vf(a){return 1E3*parseInt(a.Vi().access_token_exp||'0',10)}olympe.auth.yk=class extends olympe.auth.eh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}ri(){return $e(this)}Mg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Dr=class extends olympe.auth.eh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}ri(){return this.H}Mg(){return olympe.auth.Ec.j.SAML}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.wc(),userTag:this.te(),nonce:this.Gd()},this.Cf()&&{idpName:this.Cf()},{payload:this.Vi(),fullToken:this.H});return olympe.U.vs(ab(a,JSON.stringify(b)))}};function cf(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function hf(a,b){return vb(a.D,()=>a.db.set('main','string'===typeof b?b:b.fa(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function kf(a){return vb(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}`)}))}
599
- olympe.auth.It=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.U.promise.Sk;this.db=this.F.D('AUTH')}se(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return vb(this.D,()=>{const a=this;return u(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=
600
- d.parse;var f=bb(olympe.U.jf().D(olympe.U.ox(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Dr(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.yk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.eh(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.Kk=class{redirect(){}D(){}j(){}};olympe.auth.Kk.j={GET:'GET',Sh:'POST'};olympe.auth.qo=class{constructor(a){this.j=a||'default'}};olympe.auth.Yd={};function wf(a,b,c){af(a.D,olympe.auth.td.j.Ng,{token:b.Gd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.td.j.zb:c(Error('Invalid token'),null);break;case olympe.auth.td.j.ij: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.Dr(f,g,h,e.samlToken,k,uf(b)):'openid'===l&&(d=new olympe.auth.yk(f,g,h,k,uf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
601
- olympe.auth.Yd.xv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Gm}se(a,b){this.storage.se().then(c=>{wf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function xf(a,b,c){var d=vf(b);const e=Math.max(d-b.H,0),f=olympe.V.getParameter(olympe.auth.Config.Xr);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.yg(b,c)},d);a.yg(b,c);return null}
602
- olympe.auth.Yd.Ov=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}se(a){const b=encodeURIComponent(this.N.j());a=uf(a)?`idpName=${uf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Kk.j.GET)}H(a,b){0<vf(a)?this.j=xf(this,a,b):b(null,a);return this.X.bind(this)}yg(a,b){bf(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=xf(this,d,b)))})}X(){this.j&&clearTimeout(this.j);this.j=null}};function yf(a,b){af(a.D,olympe.auth.td.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.Yd.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}se(a,b){yf(this,c=>{c?b(c,null):this.N.D(uf(a))})}};function zf(a,b,c){const d=olympe.auth.td.j.yu,e=olympe.auth.td.j.zb,f=olympe.auth.td.j.ww,g={I:b.wc()};af(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.wc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
603
- function Af(a,b,c){const d=olympe.auth.td.j.Ct,e=olympe.auth.td.j.zb,f=olympe.auth.td.j.ij;b={A:b.get('a'),M:b.get('m1'),I:b.wc()};af(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.eh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
604
- null)}})}olympe.auth.Yd.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}se(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');zf(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.wc(),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');Af(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',hj:'auth.Storage',Bl:'auth.appNameToken',Gk:'auth.Redirector',Hr:'auth.ServerConnector'};olympe.auth.Config={Yl:'auth.defaultProvider',ko:'auth.autoLogin',mo:'auth.autoUser',lo:'auth.autoPassword',Hf:'auth.token',Io:'auth.cacheTokenTimeout',Xr:'auth.tokenDurationPercentage'};
605
- olympe.V.config(function(a){E(a,olympe.auth.Config.Yl,olympe.auth.Ec.j.SRP);E(a,olympe.auth.Config.ko,!1);E(a,olympe.auth.Config.mo,'');E(a,olympe.auth.Config.lo,'');E(a,olympe.auth.Config.Hf,'');E(a,olympe.auth.Config.Xr,50);E(a,olympe.auth.Config.Io,3E5);D(a,olympe.auth.P.Ca,[olympe.ha.P.Da],b=>b.ad('auth'));C(a,olympe.auth.P.Bl,olympe.auth.qo,olympe.Db.P.$g);C(a,olympe.auth.P.hj,olympe.auth.It,olympe.Db.P.pk,olympe.auth.P.Ca,olympe.auth.P.Bl);C(a,olympe.auth.P.Hr,olympe.auth.td,olympe.auth.P.Ca,
606
- olympe.L.P.Mk,olympe.L.P.km,olympe.L.P.uf,olympe.auth.P.Gk,olympe.auth.P.hj);Xa(a,olympe.auth.P.Gk);D(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.uf,olympe.auth.P.Hr,olympe.host.P.Ge,olympe.host.P.Pk,new olympe.V.qb(olympe.auth.P.hj,olympe.V.Ah.j.Cm),new olympe.V.qb(olympe.auth.P.Gk,olympe.V.Ah.j.Cm),new olympe.V.oa(olympe.auth.Config.Yl),new olympe.V.oa(olympe.auth.Config.ko),new olympe.V.oa(olympe.auth.Config.mo),new olympe.V.oa(olympe.auth.Config.lo),new olympe.V.oa(olympe.auth.Config.Hf),
607
- new olympe.V.oa(olympe.auth.Config.Io)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=[new olympe.auth.Yd.xv(b,d,g),new olympe.auth.Yd.SRP(b,d),new olympe.auth.Yd.SAML(b,d,h),new olympe.auth.Yd.Ov(b,d,h,qe(d.Lh,olympe.L.Xb.vk))];if(!t.map(v=>v.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.Config.Yl} 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',
608
- r]]))},!0)},'olympe.auth');olympe.V.run([olympe.auth.P.Da],a=>{olympe.auth.qe=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.Jq=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.Jq.ya=[olympe.auth.Kk];olympe.V.config(a=>{C(a,olympe.auth.P.Gk,olympe.Va.node.auth.Jq)},'olympe.native.node.auth');olympe.Va.node.Db={};function Bf(){throw Error('Key-Value Database does not implement this in NodeJS');}
609
- olympe.Va.node.Db.Hq=class{constructor(a){this.G=a;this.j=new Map}X(){return 0}N(a){const b=this;return u(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 u(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return u(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;
596
+ this.D.qf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}yb(a,b){const c=null===this.j?olympe.auth.Ta.F.Cv:this.j;this.j=null;if(!a||a instanceof olympe.error.Yq){null===a?this.G.info(`User ${b.xc()} (#${b.te()}) successfully authenticated`):this.G.info(`User ${b.xc()} (#${b.te()}) recovered from token, while offline`);this.dd.update(b);df(this,olympe.auth.Ta.j.rf);tf(this,a,c);let d;null==(d=this.storage)||hf(d,b).catch(e=>this.G.error(e))}else{let d;
597
+ null==(d=this.storage)||kf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.wb(a.message));jf(this,'authentication rejected: '+a.message);tf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Sj:'authenticating',Pi:'guest',rf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Cv:'manual',Ft:'auto',Hf:'tokenOnFirstConnection'};olympe.auth.Ta.D={Rj:'accepted',Vp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}se(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.qf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.vd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}yg(a,b){this.D.qf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Hm:'olympeToken'};function uf(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Vc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.fh&&(a=a.Ba.Eb);return a?a.valueOf():a}xc(){return this.get('username')}Gd(){return this.get('nonce')}toString(){return this.xc()+(this.Gd()?' with nonce':'')+(this.get('password')?' with password':'')+(uf(this)?` with idp name ${uf(this)}`:'')}};olympe.auth.eh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Bi=b;this.D=c;this.j=e;this.F=d}xc(){return this.user}te(){return this.Bi}Gd(){return this.D}Vi(){return this.F}ri(){return null}Cf(){return this.j}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.user,userTag:this.Bi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.U.ys(ab(a,JSON.stringify(b)))}Mg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.eh.prototype;m.xc.K=new olympe.C.J(()=>String,[]);
598
+ m.te.K=new olympe.C.J(()=>String,[]);m.Gd.K=new olympe.C.J(()=>String,[]);m.Vi.K=new olympe.C.J(()=>Object,[]);m.ri.K=new olympe.C.J(()=>String,[]);m.Cf.K=new olympe.C.J(()=>String,[]);m.fa.K=new olympe.C.J(()=>String,[]);m.Mg.K=new olympe.C.J(()=>String,[]);function $e(a){return a.Vi().access_token||null}function vf(a){return 1E3*parseInt(a.Vi().access_token_exp||'0',10)}olympe.auth.zk=class extends olympe.auth.eh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}ri(){return $e(this)}Mg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.Gr=class extends olympe.auth.eh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}ri(){return this.H}Mg(){return olympe.auth.Ec.j.SAML}fa(){const a=olympe.U.jf(),b=Object.assign({},{user:this.xc(),userTag:this.te(),nonce:this.Gd()},this.Cf()&&{idpName:this.Cf()},{payload:this.Vi(),fullToken:this.H});return olympe.U.ys(ab(a,JSON.stringify(b)))}};function cf(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function hf(a,b){return vb(a.D,()=>a.db.set('main','string'===typeof b?b:b.fa(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function kf(a){return vb(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}`)}))}
599
+ olympe.auth.Mt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.U.promise.Tk;this.db=this.F.D('AUTH')}se(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return vb(this.D,()=>{const a=this;return u(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=
600
+ d.parse;var f=bb(olympe.U.jf().D(olympe.U.tx(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Gr(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.zk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.eh(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.Lk=class{redirect(){}D(){}j(){}};olympe.auth.Lk.j={GET:'GET',Sh:'POST'};olympe.auth.ro=class{constructor(a){this.j=a||'default'}};olympe.auth.Yd={};function wf(a,b,c){af(a.D,olympe.auth.td.j.Ng,{token:b.Gd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.td.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.td.j.ij: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.Gr(f,g,h,e.samlToken,k,uf(b)):'openid'===l&&(d=new olympe.auth.zk(f,g,h,k,uf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
601
+ olympe.auth.Yd.Bv=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.Hm}se(a,b){this.storage.se().then(c=>{wf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function xf(a,b,c){var d=vf(b);const e=Math.max(d-b.H,0),f=olympe.V.getParameter(olympe.auth.Config.$r);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.yg(b,c)},d);a.yg(b,c);return null}
602
+ olympe.auth.Yd.Sv=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}se(a){const b=encodeURIComponent(this.N.j());a=uf(a)?`idpName=${uf(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.Lk.j.GET)}H(a,b){0<vf(a)?this.j=xf(this,a,b):b(null,a);return this.X.bind(this)}yg(a,b){bf(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=xf(this,d,b)))})}X(){this.j&&clearTimeout(this.j);this.j=null}};function yf(a,b){af(a.D,olympe.auth.td.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.Yd.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}se(a,b){yf(this,c=>{c?b(c,null):this.N.D(uf(a))})}};function zf(a,b,c){const d=olympe.auth.td.j.Cu,e=olympe.auth.td.j.Ab,f=olympe.auth.td.j.Aw,g={I:b.xc()};af(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.xc()}' 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'))}})}
603
+ function Af(a,b,c){const d=olympe.auth.td.j.Gt,e=olympe.auth.td.j.Ab,f=olympe.auth.td.j.ij;b={A:b.get('a'),M:b.get('m1'),I:b.xc()};af(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.eh(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
604
+ null)}})}olympe.auth.Yd.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}se(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');zf(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.xc(),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');Af(this,a,b)}})}};olympe.auth.P={Fa:'auth.Manager',Ca:'auth.Logger',hj:'auth.Storage',Cl:'auth.appNameToken',Hk:'auth.Redirector',Kr:'auth.ServerConnector'};olympe.auth.Config={Zl:'auth.defaultProvider',lo:'auth.autoLogin',no:'auth.autoUser',mo:'auth.autoPassword',Hf:'auth.token',Jo:'auth.cacheTokenTimeout',$r:'auth.tokenDurationPercentage'};
605
+ olympe.V.config(function(a){E(a,olympe.auth.Config.Zl,olympe.auth.Ec.j.SRP);E(a,olympe.auth.Config.lo,!1);E(a,olympe.auth.Config.no,'');E(a,olympe.auth.Config.mo,'');E(a,olympe.auth.Config.Hf,'');E(a,olympe.auth.Config.$r,50);E(a,olympe.auth.Config.Jo,3E5);D(a,olympe.auth.P.Ca,[olympe.ha.P.Fa],b=>b.ad('auth'));C(a,olympe.auth.P.Cl,olympe.auth.ro,olympe.Db.P.$g);C(a,olympe.auth.P.hj,olympe.auth.Mt,olympe.Db.P.qk,olympe.auth.P.Ca,olympe.auth.P.Cl);C(a,olympe.auth.P.Kr,olympe.auth.td,olympe.auth.P.Ca,
606
+ olympe.L.P.Nk,olympe.L.P.mm,olympe.L.P.uf,olympe.auth.P.Hk,olympe.auth.P.hj);Xa(a,olympe.auth.P.Hk);D(a,olympe.auth.P.Fa,[olympe.auth.P.Ca,olympe.L.P.uf,olympe.auth.P.Kr,olympe.host.P.Ge,olympe.host.P.Qk,new olympe.V.qb(olympe.auth.P.hj,olympe.V.Ah.j.Dm),new olympe.V.qb(olympe.auth.P.Hk,olympe.V.Ah.j.Dm),new olympe.V.oa(olympe.auth.Config.Zl),new olympe.V.oa(olympe.auth.Config.lo),new olympe.V.oa(olympe.auth.Config.no),new olympe.V.oa(olympe.auth.Config.mo),new olympe.V.oa(olympe.auth.Config.Hf),
607
+ new olympe.V.oa(olympe.auth.Config.Jo)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=[new olympe.auth.Yd.Bv(b,d,g),new olympe.auth.Yd.SRP(b,d),new olympe.auth.Yd.SAML(b,d,h),new olympe.auth.Yd.Sv(b,d,h,qe(d.Lh,olympe.L.Xb.wk))];if(!t.map(v=>v.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.Config.Zl} 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',
608
+ r]]))},!0)},'olympe.auth');olympe.V.run([olympe.auth.P.Fa],a=>{olympe.auth.qe=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.Mq=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.Mq.ya=[olympe.auth.Lk];olympe.V.config(a=>{C(a,olympe.auth.P.Hk,olympe.Va.node.auth.Mq)},'olympe.native.node.auth');olympe.Va.node.Db={};function Bf(){throw Error('Key-Value Database does not implement this in NodeJS');}
609
+ olympe.Va.node.Db.Kq=class{constructor(a){this.G=a;this.j=new Map}X(){return 0}N(a){const b=this;return u(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 u(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return u(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;
610
610
  return u(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 u(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return u(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return u(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}da(){Bf();return Promise.resolve()}Z(){Bf();return Promise.resolve()}clear(a){const b=this;return u(function*(){let c;
611
- null==(c=b.j.get(a))||c.clear()})}H(){Bf();return Promise.resolve([])}D(){return u(function*(){Bf()})}};olympe.Va.node.Db.Hq.ya=[olympe.Db.lv];olympe.Va.node.Db.Iq=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.Hq(this.G));return this.j.get(a)}};olympe.Va.node.Db.Iq.ya=[olympe.Db.mv];olympe.V.config(function(a){C(a,olympe.Db.P.pk,olympe.Va.node.Db.Iq,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.ya=[olympe.Db.Storage];olympe.V.config(function(a){Va(a,olympe.Db.P.hj,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.xg={};olympe.xg.Config={VERSION:'version.version',Lt:'version.branch',tf:'version.commit',Ew:'version.tag',wp:'version.olympe-framework',Mt:'version.build'};olympe.V.config(function(a){E(a,olympe.xg.Config.VERSION,'');E(a,olympe.xg.Config.Lt,'');E(a,olympe.xg.Config.tf,'');E(a,olympe.xg.Config.Ew,'');E(a,olympe.xg.Config.wp,'');E(a,olympe.xg.Config.Mt,'')},'olympe.main');const Cf=require('fs'),Df=require('fs/promises');let Ef;const Ff=null!=(Ef=process.env.EXTRA_CONFIG_PATH)?Ef:null;let Gf;const Gb=null!=(Gf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Gf:'';function Fb(a){return Df.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
612
- function Hf(a){var b=If;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Df.access(c,Cf.constants.F_OK).then(()=>{Cf.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.et([c]),f=olympe.V.Ns(e);for(const [g,h]of f)a.Ai(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
613
- function Jf(){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).kl)?void 0:null==(c=b.call(a))?void 0:gd(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',Jf);process.on('SIGINT',Jf);process.on('SIGBREAK',Jf);process.on('SIGHUP',Jf);
611
+ null==(c=b.j.get(a))||c.clear()})}H(){Bf();return Promise.resolve([])}D(){return u(function*(){Bf()})}};olympe.Va.node.Db.Kq.ya=[olympe.Db.pv];olympe.Va.node.Db.Lq=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.Kq(this.G));return this.j.get(a)}};olympe.Va.node.Db.Lq.ya=[olympe.Db.qv];olympe.V.config(function(a){C(a,olympe.Db.P.qk,olympe.Va.node.Db.Lq,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.ya=[olympe.Db.Storage];olympe.V.config(function(a){Va(a,olympe.Db.P.hj,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.xg={};olympe.xg.Config={VERSION:'version.version',Pt:'version.branch',tf:'version.commit',Iw:'version.tag',xp:'version.olympe-framework',Qt:'version.build'};olympe.V.config(function(a){E(a,olympe.xg.Config.VERSION,'');E(a,olympe.xg.Config.Pt,'');E(a,olympe.xg.Config.tf,'');E(a,olympe.xg.Config.Iw,'');E(a,olympe.xg.Config.xp,'');E(a,olympe.xg.Config.Qt,'')},'olympe.main');const Cf=require('fs'),Df=require('fs/promises');let Ef;const Ff=null!=(Ef=process.env.EXTRA_CONFIG_PATH)?Ef:null;let Gf;const Gb=null!=(Gf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Gf:'';function Fb(a){return Df.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
612
+ function Hf(a){var b=If;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Df.access(c,Cf.constants.F_OK).then(()=>{Cf.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.it([c]),f=olympe.V.Rs(e);for(const [g,h]of f)a.Ai(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
613
+ function Jf(){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).ll)?void 0:null==(c=b.call(a))?void 0:gd(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',Jf);process.on('SIGINT',Jf);process.on('SIGBREAK',Jf);process.on('SIGHUP',Jf);
614
614
  process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Jf()});const If=['oConfig.json','conf.d/oConfig.json','version.json'];Ff&&If.push(Ff);
615
- olympe.U.et(If).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.U.ws(g[3])}const d=new olympe.V.Zt(a,b);La(d);const e=d.compile();Na(e);Hf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
616
- setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ua);olympe.dc.fc={Zc:'ff022000000000000000',Li:'ff02200000000000000e',Yj:'ff02200000000000000f'};olympe.dc.hq={VERSION:'@v',Zg:'@s'};olympe.dc.he={Xe:'?',gg:'~'};olympe.dc.mD={cj:'online',Df:'offline',RB:'invalidate'};olympe.dc.Ha={SELF:'self',SERVER:'server',Ze:'remote'};
617
- olympe.dc.Lb={NONE:null,fp:'ff023000000000000037',Dc:'ff023000000000000137',jg:'ff023000000000000237',tw:'ff023000000000000337',fu:'ff023000000000000437',Qw:'ff023000000000000537',TB:olympe.dc.he.gg+'ff023000000000000037',UB:olympe.dc.he.gg+'ff023000000000000237',SB:olympe.dc.he.gg+'ff023000000000000437',cE:olympe.dc.he.gg+'ff023000000000000537'};olympe.dc.Tq=class extends Error{constructor(a){var b=olympe.dc.ga(),c=olympe.dc.ee(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.ib(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Mq=class extends Error{constructor(){var a=Kf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Qc(){}Xc(){}D(){}Oa(){}hc(){}};olympe.dc.er=class{qc(){}T(){}H(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Ea(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.ya=[olympe.dc.Ye];olympe.dc.uc.prototype.Ea.K=olympe.C.J.j;olympe.dc.ou=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.da=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.Zh(6E5),(h,k)=>{URL.revokeObjectURL(k);Lf(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Wa(c).then(g=>{this.lb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
615
+ olympe.U.it(If).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.U.zs(g[3])}const d=new olympe.V.cu(a,b);La(d);const e=d.compile();Na(e);Hf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
616
+ setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ua);olympe.dc.fc={Zc:'ff022000000000000000',Li:'ff02200000000000000e',Zj:'ff02200000000000000f'};olympe.dc.kq={VERSION:'@v',Zg:'@s'};olympe.dc.he={Xe:'?',gg:'~'};olympe.dc.qD={cj:'online',Df:'offline',VB:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',Ze:'remote'};
617
+ olympe.dc.Lb={NONE:null,gp:'ff023000000000000037',Dc:'ff023000000000000137',jg:'ff023000000000000237',xw:'ff023000000000000337',ju:'ff023000000000000437',Uw:'ff023000000000000537',XB:olympe.dc.he.gg+'ff023000000000000037',YB:olympe.dc.he.gg+'ff023000000000000237',WB:olympe.dc.he.gg+'ff023000000000000437',gE:olympe.dc.he.gg+'ff023000000000000537'};olympe.dc.Wq=class extends Error{constructor(a){var b=olympe.dc.ga(),c=olympe.dc.ee(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.jb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Pq=class extends Error{constructor(){var a=Kf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Rc(){}Xc(){}D(){}Oa(){}hc(){}};olympe.dc.hr=class{qc(){}T(){}H(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.ya=[olympe.dc.Ye];olympe.dc.vc.prototype.Ea.K=olympe.C.J.j;olympe.dc.su=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.da=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.Zh(6E5),(h,k)=>{URL.revokeObjectURL(k);Lf(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Wa(c).then(g=>{this.nb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
618
618
  new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.H(f)).then(f=>{if(c.N){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.R(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.W(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.X(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
619
- 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.dg,olympe.dc.ee().Qe(b),{tag:c,model:d,url:e.valueOf()}),this.Jb.request(c);c=N(e);Hc(c,olympe.net.va.ResponseType.Gl);return Ic(this.da,c).then(f=>{const g=f.Ic();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}sa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.bg,d,{tag:b,model:c});return this.Jb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
620
- {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ga(b){const c=new olympe.U.stream.lg;this.H(b).then(d=>{cb(d).pipeTo(c).catch(()=>{})});return c}yb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Xc(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.md(Mf(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}X(b){return new Promise((c,d)=>{let e;
621
- const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}lb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.ng,olympe.dc.ee().Qe(b),{tag:b,model:e,content:c,mimeType:d});this.Jb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Wa(b){return u(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
622
- 0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Nf(this.db,d,f=>{f||(this.F.delete(d),Lf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Of(a,b){let c=Pf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.ff(b);if(null===b)break;c=Pf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Hu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.Yp)})}};function Qf(a,b){a.origin=b;return a}function Rf(a,b,c){a.D.set(b,c);return a}function Sf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ha.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:ce(olympe.auth.qe()).te();this.D=new Map}getType(){return this.type}wc(){return this.user}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
623
- olympe.dc.Request.j={oc:1,Jg:10,qu:24,Jp:25,ru:28,Sg:30,Fk:31,IC:32,df:40,dh:41,vo:42,sr:43,YD:44,Fi:45,xo:46,ik:47,ng:50,dg:51,bg:52,Nw:60,bw:61,Ep:62,KB:63,Tt:64,yh:65,bk:91,su:93,Bm:95,QUERY_RESULT:97};function Tf(a,b,c,d,e){const f=olympe.C.kh();a.sources.set(olympe.dc.Ha.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ha.Ze,d.init(a)):Nf(b,a.j,()=>{a.sources.set(olympe.dc.Ha.Ze,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.gi,!0)).observe(f).subscribe(h=>{var k=h.Ej();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.yj();for(const p of h)if(h=
624
- p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.rq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Je.j.READINESS);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Lf(b,a.j,'router',!0)},'router')}function Uf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
625
- olympe.dc.gw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Tf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.ib(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.ib(a.ic()).subscribe(a,b)}cd(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}xi(a){let b;null==
626
- (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.ib(olympe.dc.Ha.Ze).xi(a)}ib(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ha.Ze)}};function Mf(a,b){b=new olympe.dc.Hg(a.T(),null!=b?b:null);b.j=a;return b}function Vf(a,b,c,d){c=new olympe.dc.Hg(null!=d?d:olympe.U.Jc(),null!=c?c:null);c.D=b;c.Fa=a;return c}
627
- olympe.dc.Hg=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.cl=b}static j(a){return Vf(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.dj(this.D)).D(this.Fa,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Fa)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}ac(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Fa,
628
- this.id),this.Fa=null,this.j):new olympe.dc.db.ec(this.id)}il(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.He;this.j.qc(a);return Wf(a)}return[]}fa(){return{p:this.il(),t:this.cl,s:this.D,i:this.id}}};olympe.dc.Hg.ya=[olympe.dc.er];olympe.dc.Ra={};const Xf=olympe.dc.ua.ORIGIN,Yf=olympe.dc.ua.DESTINATION,Zf=new Map,$f=new Map,ag=new Map,bg=new Map;function Pf(a){let b;return null!=(b=Zf.get(a))?b:null}function cg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ao||[])];return olympe.dc.na.j(b,c,...a)}function dg(a,b){bg.set(a,b);return a}function eg(a){let b,c;return null!=(c=null==(b=Zf.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
629
- function fg(a,b,c){const d=a+'@'+(b===Yf?Xf:Yf);if($f.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);$f.set(d,c)}function gg(a){a=a.W()+'@'+a.Ka();return $f.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;ag.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
630
- olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Zf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Zf.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.V.qb(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Zf.set(a,b);return b.D.entry=b}static Vb(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.W())?c:null}};function hg(a,b){a.j=b}function R(a,b){b=b.$b();fg(b.W(),b.Ka(),a.D);return b}function ig(a){a.F=!0;return a}
631
- olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.ao=c||null;this.j=null;this.F=!1}W(){return this.tag}instantiate(a,b){const c=this.D;if(this.Mn()&&b.getParameter(olympe.dc.Config.op)){var d=olympe.dc.ga();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.W()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ha.Xa('dc').error(d)}return this.ao?(a=[void 0,a].concat(Oa(b,this.ao)),new c(...a)):
632
- new c(void 0,a)}ja(a){return new olympe.dc.Ra.Property(a)}ra(a,b=olympe.dc.ua.DESTINATION){fg(a,b,this.D);return new olympe.dc.aa.$e(a,b)}Mn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.ra;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ja;olympe.dc.Ra.Entry.ya=[olympe.dc.Ye];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}W(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.W;olympe.dc.Ra.Property.ya=[olympe.dc.Ye];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ea(a);this.direction=b;this.origin=c;this.H=d}W(){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.W()===this.W()&&a.Ka()===this.Ka():!1}toString(){return`${this.direction}${olympe.dc.ga().name(this.tag)} (${this.tag})`}};
633
- 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.W;olympe.dc.Ra.Relation.ya=[olympe.dc.Ye];olympe.dc.db={};function jg(a,b){const c=a.H,d=olympe.dc.ga(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Xe,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.Ab.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Id())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of kg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
634
- y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Qc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?lg(p,v,!0):p.Qa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Xc(n,r);for(const [t,v,x]of l.Id())x?k.hc(t,n,v):k.Oa(t,n,v)}}});return k}
635
- function mg(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 ng(b,jg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Ys(c);a.write(b,!1,!1)}
619
+ 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.dg,olympe.dc.ee().Qe(b),{tag:c,model:d,url:e.valueOf()}),this.Jb.request(c);c=N(e);Hc(c,olympe.net.va.ResponseType.Hl);return Ic(this.da,c).then(f=>{const g=f.Jc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}sa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.bg,d,{tag:b,model:c});return this.Jb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
620
+ {throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ha(b){const c=new olympe.U.stream.lg;this.H(b).then(d=>{cb(d).pipeTo(c).catch(()=>{})});return c}yb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Xc(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.md(Mf(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}X(b){return new Promise((c,d)=>{let e;
621
+ const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}nb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.ng,olympe.dc.ee().Qe(b),{tag:b,model:e,content:c,mimeType:d});this.Jb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Wa(b){return u(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
622
+ 0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Nf(this.db,d,f=>{f||(this.F.delete(d),Lf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Of(a,b){let c=Pf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.ff(b);if(null===b)break;c=Pf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Lu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.$p)})}};function Qf(a,b){a.origin=b;return a}function Rf(a,b,c){a.D.set(b,c);return a}function Sf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:ce(olympe.auth.qe()).te();this.D=new Map}getType(){return this.type}xc(){return this.user}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
623
+ olympe.dc.Request.j={oc:1,Jg:10,uu:24,Kp:25,vu:28,Sg:30,Gk:31,MC:32,df:40,dh:41,wo:42,vr:43,bE:44,Fi:45,yo:46,jk:47,ng:50,dg:51,bg:52,Rw:60,fw:61,Fp:62,OB:63,Xt:64,yh:65,ck:91,wu:93,Cm:95,QUERY_RESULT:97};function Tf(a,b,c,d,e){const f=olympe.C.kh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.Ze,d.init(a)):Nf(b,a.j,()=>{a.sources.set(olympe.dc.Ia.Ze,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).observe(f).subscribe(h=>{var k=h.Ej();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.yj();for(const p of h)if(h=
624
+ p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.uq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Je.j.READINESS);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Lf(b,a.j,'router',!0)},'router')}function Uf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
625
+ olympe.dc.kw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Tf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.ic()).subscribe(a,b)}cd(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}xi(a){let b;null==
626
+ (b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.Ze).xi(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.Ze)}};function Mf(a,b){b=new olympe.dc.Hg(a.T(),null!=b?b:null);b.j=a;return b}function Vf(a,b,c,d){c=new olympe.dc.Hg(null!=d?d:olympe.U.Kc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
627
+ olympe.dc.Hg=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl=b}static j(a){return Vf(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Ga)?(new olympe.dc.transaction.dj(this.D)).D(this.Ga,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Ga)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}ac(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Ga,
628
+ this.id),this.Ga=null,this.j):new olympe.dc.db.ec(this.id)}jl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.He;this.j.qc(a);return Wf(a)}return[]}fa(){return{p:this.jl(),t:this.dl,s:this.D,i:this.id}}};olympe.dc.Hg.ya=[olympe.dc.hr];olympe.dc.Ra={};const Xf=olympe.dc.ua.ORIGIN,Yf=olympe.dc.ua.DESTINATION,Zf=new Map,$f=new Map,ag=new Map,bg=new Map;function Pf(a){let b;return null!=(b=Zf.get(a))?b:null}function cg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.bo||[])];return olympe.dc.na.j(b,c,...a)}function dg(a,b){bg.set(a,b);return a}function eg(a){let b,c;return null!=(c=null==(b=Zf.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
629
+ function fg(a,b,c){const d=a+'@'+(b===Yf?Xf:Yf);if($f.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);$f.set(d,c)}function gg(a){a=a.W()+'@'+a.La();return $f.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;ag.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
630
+ olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Zf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Zf.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.V.qb(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Zf.set(a,b);return b.D.entry=b}static Vb(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.W())?c:null}};function hg(a,b){a.j=b}function R(a,b){b=b.$b();fg(b.W(),b.La(),a.D);return b}function ig(a){a.F=!0;return a}
631
+ olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.bo=c||null;this.j=null;this.F=!1}W(){return this.tag}instantiate(a,b){const c=this.D;if(this.Nn()&&b.getParameter(olympe.dc.Config.pp)){var d=olympe.dc.ga();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.W()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ha.Xa('dc').error(d)}return this.bo?(a=[void 0,a].concat(Oa(b,this.bo)),new c(...a)):
632
+ new c(void 0,a)}ja(a){return new olympe.dc.Ra.Property(a)}ra(a,b=olympe.dc.ua.DESTINATION){fg(a,b,this.D);return new olympe.dc.aa.$e(a,b)}Nn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.ra;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ja;olympe.dc.Ra.Entry.ya=[olympe.dc.Ye];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}W(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.W;olympe.dc.Ra.Property.ya=[olympe.dc.Ye];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ea(a);this.direction=b;this.origin=c;this.H=d}W(){return this.tag}La(){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.W()===this.W()&&a.La()===this.La():!1}toString(){return`${this.direction}${olympe.dc.ga().name(this.tag)} (${this.tag})`}};
633
+ olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.La;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.W;olympe.dc.Ra.Relation.ya=[olympe.dc.Ye];olympe.dc.db={};function jg(a,b){const c=a.H,d=olympe.dc.ga(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Xe,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.Id())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of kg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
634
+ y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Rc(r,l,t)}else{const r=new Map;for(const t of l.zb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?lg(p,v,!0):p.Pa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Xc(n,r);for(const [t,v,x]of l.Id())x?k.hc(t,n,v):k.Oa(t,n,v)}}});return k}
635
+ function mg(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 ng(b,jg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.bt(c);a.write(b,!1,!1)}
636
636
  function og(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.md(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new pg(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}
637
- function qg(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.md(d))?f:d},b)}function rg(a,b,c,d=!1){return u(function*(){const e=new olympe.dc.db.dn(a.G,a.H,a.ga,c);e.open(d);for(const f=ha(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
638
- function sg(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&og(a,qg(a,e.ac(),a.D.length),e.cl)}));return rg(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
639
- olympe.dc.db.Xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ga=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.Ap,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}md(a,b,c){const d=a.T(),e=a.cl;this.F.has(d)?this.push(d,e):(a=og(this,qg(this,a.ac(),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,
640
- 1);og(this,qg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.dn(this.G,this.H,this.ga,b);b.open(c);b.write(a,this.R);b.close()}};class tg{T(){}md(){}}function ug(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Sc(c);b.Cb().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.da()){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)}}
641
- function vg(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Sc(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Id()){const n=c.lb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
637
+ function qg(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.md(d))?f:d},b)}function rg(a,b,c,d=!1){return u(function*(){const e=new olympe.dc.db.en(a.G,a.H,a.ga,c);e.open(d);for(const f=ha(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
638
+ function sg(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&og(a,qg(a,e.ac(),a.D.length),e.dl)}));return rg(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
639
+ olympe.dc.db.au=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ga=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.Bp,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}md(a,b,c){const d=a.T(),e=a.dl;this.F.has(d)?this.push(d,e):(a=og(this,qg(this,a.ac(),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,
640
+ 1);og(this,qg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.en(this.G,this.H,this.ga,b);b.open(c);b.write(a,this.R);b.close()}};class tg{T(){}md(){}}function ug(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.Tc(c);b.zb().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.da()){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)}}
641
+ function vg(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.Tc(f);b.zb().forEach((h,k)=>{void 0!==c.Pa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Id()){const n=c.nb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
642
642
  class ng extends tg{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ga()}T(){return this.D.T()}md(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.yd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.yd()?(ug(this,c,b,a),a.j(d,b.F())):vg(this,c,b,a)}return a}}function wg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
643
643
  class pg extends tg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;wg(this)}T(){return this.j.T()}md(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);wg(this);return this}};const xg=olympe.dc.fc.Zc,yg=olympe.dc.fc.Li,zg=olympe.dc.ua.ORIGIN,Ag=olympe.dc.ua.DESTINATION;let Bg=0;
644
- 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.Ha.SELF;this.G=b;this.vd=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Yb=[];this.X=new Map;this.H=null;this.da=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.zf.j.$l;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Fd=new olympe.dc.db.zf(c,this,b,f);d.get('debug')&&this.Ws()}T(){return this.id}getState(){return this.state}Xa(){return this.G}create(b,
645
- 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.Z(f,!0)}e&&f.persist();this.state===a.F.Fl&&Cg(f,!0);d&&this.Oc(f,d);this.D(a.j.Zp,b)}update(b,c){c&&(b=this.N(b,!0),this.Oc(b,c))}sa(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.$p,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case xg:Dg(c,d);break;case yg:Eg(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!==
646
- d)switch(b){case xg:Fg(c,d);break;case yg:Gg(c,d);break;default:c.unlink(b,d)}}sg(b,c){for(const d of b)this.N(d).ne(c)}mi(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Ys(b){b.forEach(c=>{this.N(c).persist()})}Md(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.mp,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Qc(b,c)}Qc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.lp,b);c&&this.state!==a.F.Fl&&this.D(a.j.cn,b);return d}yb(b){var c=
647
- olympe.U.ni();this.H?Hg(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ga(b,...c){this.ia.has(b)&&this.ia.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ga(b,c,...d)}Z(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Ig(f,b).ja(e?Jg+c:c,d)}ef(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Kg?f?Ig(g,b).link(c,e):Ig(g,b).unlink(c,e):f?Ig(g,b).yb(c,e):Ig(g,b).Gc(c,e))}Wa(b,c,d){let e;null!=(e=this.H)&&Ig(e,b).Md(c,d)}addEventListener(b,c){let d=this.ia.get(b);void 0===
648
- d&&(d=[],this.ia.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}lb(b){this.Yb.push(b)}F(b){for(const c of this.X.values())if(c.R.has(b))return!0;return!1}tg(b=!1){const c=Bg++;this.state=a.F.zl;this.da.add(c);b||this.X.set(c,new olympe.dc.db.ku(c,this,this.vd));return c}dt(b,c){if(!this.da.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.X.get(b))?d:null;b=this.state;this.state=null===this.H?a.F.Fl:a.F.Tv;c();this.state=b;this.H=
649
- null}ke(b){this.state=a.F.tf;const c=this.X.get(b);c&&(this.H=c,Lg(this.H),Mg(this.H),this.X.delete(b),this.H=null);this.da.delete(b);0===this.da.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Ng(this.Fd))}Oc(b,c){const d=a.D.Xe;for(const [e,f]of c)void 0!==f&&(e[0]===d?Og(b,e.substring(1),f):b.update(e,f))}Gc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(zg+xg)))for(const f of c.values())null!==f.source()&&this.Gc(b,f,d);return d}Ws(){const b=a.j.cm,c=a.j.Hk,d=new Set,
650
- e=new Map;this.j(a.j.Zp,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===yg&&g[1]===Ag){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.lb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+
651
- `\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={ej:'$',Du:'~',Xe:'?',Al:'=',Wp:'|',Hi:'@',ORIGIN:olympe.dc.ua.ORIGIN,DESTINATION:olympe.dc.ua.DESTINATION};olympe.dc.db.Database.j={lp:0,mp:1,ds:2,cn:3,Jo:4,Ko:5,cm:6,Dc:7,Hk:8,Sm:9,Zp:10,$p:11,lr:12,GA:13,FA:14,Iw:15,Ap:16};olympe.dc.db.Database.F={IDLE:0,zl:1,Tv:2,Fl:3,tf:4};function Pg(a,b,c=[]){const d=b.T();mg(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=qg(e,f.j,e.D.length);e.write(og(e,f,Date.now()),!1);e.F.delete(d)}}}}function Qg(a,b,c={}){let d,e;return sg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.nn)?e:!1)}function Rg(a,b){a.D.lb(b)}
652
- olympe.dc.db.gu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.Xt(a,b,c,d);this.vz=new olympe.dc.db.Cv(a,c,b,e)}Xa(){return this.G}md(a,b={}){let c,d;this.j.md(a,null!=(c=b.persist)?c:!0,null!=(d=b.nn)?d:!1)}ne(a,b){this.D.sg(a,b)}detach(a,b){this.D.mi(a,b);return this}};const Sg=olympe.dc.db.Database.D.ORIGIN,Tg=olympe.dc.db.Database.D.DESTINATION,Ug=olympe.dc.db.Database.D.ej,Vg=olympe.dc.db.Database.D.Xe,Wg=olympe.dc.db.Database.D.Al,Xg=olympe.dc.db.Database.D.Wp,Yg=Sg+Tg,Zg=Ug+Ug,$g=olympe.dc.db.Database.F;let ah=0;function Lf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=bh(e,'',c);void 0!==f&&(a.j.getState()!==$g.tf||e.F()&&!d||a.j.R(c),d||!e.Ia()&&!e.F()||f(!1,b))}}
653
- function Nf(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function kg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ea(e));for(const h of g)yield h,d.hl(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function dh(){++ah;return String(ah)}function ch(a){if(a)return olympe.dc.ea(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
654
- function fh(a,b,c,d,e){a=a.j.N(ch(b));c=ch(c);b=Ug+c;e=null!=e?e:dh();if(eh(a,b,e,d)&&a.Ia()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Wg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ea(b)),!a||c&&!a.Ia()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function gh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ea(c),bh(b,Ug+c,d),a.j.getState()===$g.tf&&a.j.R(d))}
655
- function hh(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,Zg,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==Ug&&g!==Wg||c(f.substring(1),e,g===Wg)});return d}function ih(a,b,c){b=S(a,b);null!==b&&(bh(b,Zg,c),a.j.getState()===$g.tf&&a.j.R(c))}function jh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(ch(b));c=c.Ka()+c.W();e=null!=e?e:dh();(d=kh(a,c,e,d))&&a.Ia()&&jh(a,c,!0,d,!1);return e}
656
- function lh(a,b,c,d){const e=a.j.N(ch(b));a=null!=d?d:dh();const f=kh(e,Yg,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==Sg&&g!==Tg||jh(e,h,!0,f,!0)})}function mh(a,b,c){const d=S(a,b);if(null!==d){const e=bh(d,Yg,c);void 0!==e&&(a.j.getState()!==$g.tf||d.F()||a.j.R(c),!d.Ia()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Sg||f===Tg)&&e&&jh(d,g,!1,e,!0)}))}}
657
- function nh(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.he.gg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.uc&&(h===Ug||h===Vg))(f=a.j.get(f.W()))&&e.push([f,g.substring(1),null,!0]);else if(h===Sg||h===Tg){const k=g.substring(1),l=(h===Sg?12:3)&oh(a,k,c);l&&f.forEach(n=>{e.push([n,k,h,!!(l&10)])})}});if(d&&void 0!==b.D){const [f,g]=void 0!==b.D?[b.D.tag,b.D.La]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
658
- function ph(a,b,c,d,e){const f=a.j.N(ch(b));e=null!=e?e:dh();const g=kh(f,Xg+c,e,d);g&&f.Ia()&&nh(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function qh(a,b,c,d){const e=S(a,b);if(null!==e){const f=bh(e,Xg+c,d);void 0!==f&&(a.j.getState()!==$g.tf||e.F()||a.j.R(d),!e.Ia()&&!e.F()||nh(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.F())&&f(...h,!1,g.tag())}))}}function rh(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Vg&&b.set(c.substring(1),d);return b}
659
- function oh(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.he.gg;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function sh(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Sg||c===Tg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
660
- function th(a,b,c){if(!a.Ia(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ea(b)];for(const f of e){const g=a.cb(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.ea(b)}`);return d}function uh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ia()).length:0}
661
- olympe.dc.jb=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.W();const e=bh(a,b,c);void 0!==e&&(this.j.getState()!==$g.tf||a.F()&&!d||this.j.R(c),d||!a.Ia()&&!a.F()||jh(a,b,!1,e,!1))}}Ia(a){a=this.j.get(olympe.dc.ea(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.W()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}ff(a){return(a=(a=S(this,
662
- a,!0))&&a.ff())?a.tag():null}vi(a){a=S(this,a,!0);return!(!a||!a.ff())}Nb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Tf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.ea(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===Ug||!b&&c===Wg)&&a.set(d.substring(1),e);return a}hl(a,b){return nh(this,a,b).filter(([c])=>c.Ia()).map(([c,
663
- ...d])=>[c.tag(),...d])}cb(a,b){a=S(this,a,!0);b=b.Ka()+b.W();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ia()&&a.push(c.tag());return a}bt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ka()+b.W()))?void 0:e.get(olympe.dc.ea(c));return!(null==a||!a.Ia())}Hn(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.W()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
664
- S(this,a,!0);const d=b.Ka()+b.W();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.W()} 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.Ia())?a.tag():null}nh(a,b,c){a=olympe.dc.ea(a);const d=th(this,a,b);d.delete(a);return c?(c=olympe.dc.ea(c),d.has(c)?Array.from(th(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Gs(a,b,c){if(!this.Ia(a))return null;b=th(this,
665
- a,b);const d=[olympe.dc.ea(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}zn(a,b,c){return this.Hn(a,b).find(c)||null}Qx(a,b,c){return this.Hn(a,b).filter(c)}Ls(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.ff();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.ea(a)} but one of them does not exists (${c.tag()})`,
666
- 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())}Tf(a,b){const c=olympe.dc.ea(b);return!!this.Gs(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Tc(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.jb.prototype.getInstances=olympe.dc.jb.prototype.Tc;olympe.dc.jb.prototype.isExtending=olympe.dc.jb.prototype.Tf;
667
- olympe.dc.jb.prototype.getExtendedModels=olympe.dc.jb.prototype.Ls;olympe.dc.jb.prototype.findAllRelated=olympe.dc.jb.prototype.Qx;olympe.dc.jb.prototype.findRelated=olympe.dc.jb.prototype.zn;olympe.dc.jb.prototype.findRecursive=olympe.dc.jb.prototype.Gs;olympe.dc.jb.prototype.getRecursiveRelated=olympe.dc.jb.prototype.nh;olympe.dc.jb.prototype.getUniqueRelated=olympe.dc.jb.prototype.Ib;olympe.dc.jb.prototype.getMultiRelated=olympe.dc.jb.prototype.Hn;olympe.dc.jb.prototype.isRelated=olympe.dc.jb.prototype.bt;
668
- olympe.dc.jb.prototype.getRelated=olympe.dc.jb.prototype.cb;olympe.dc.jb.prototype.getProperties=olympe.dc.jb.prototype.Cb;olympe.dc.jb.prototype.getProperty=olympe.dc.jb.prototype.Qa;olympe.dc.jb.prototype.isPersisted=olympe.dc.jb.prototype.Re;olympe.dc.jb.prototype.instanceOf=olympe.dc.jb.prototype.Nb;olympe.dc.jb.prototype.isModel=olympe.dc.jb.prototype.vi;olympe.dc.jb.prototype.extension=olympe.dc.jb.prototype.ff;olympe.dc.jb.prototype.model=olympe.dc.jb.prototype.model;
669
- olympe.dc.jb.prototype.name=olympe.dc.jb.prototype.name;olympe.dc.jb.prototype.exist=olympe.dc.jb.prototype.Ia;const vh=olympe.dc.db.Database.D.ORIGIN,Kg=olympe.dc.db.Database.D.DESTINATION,Jg=olympe.dc.db.Database.D.Al,wh=olympe.dc.db.Database.D.ej,xh=olympe.dc.db.Database.D.Wp,yh=olympe.dc.db.Database.D.Hi,zh=vh+Kg,Ah=wh+wh,Bh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function Hg(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)}
644
+ 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.Ia.SELF;this.G=b;this.vd=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Yb=[];this.X=new Map;this.H=null;this.da=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.zf.j.am;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Fd=new olympe.dc.db.zf(c,this,b,f);d.get('debug')&&this.$s()}T(){return this.id}getState(){return this.state}Xa(){return this.G}create(b,
645
+ 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.Z(f,!0)}e&&f.persist();this.state===a.F.Gl&&Cg(f,!0);d&&this.Qc(f,d);this.D(a.j.aq,b)}update(b,c){c&&(b=this.N(b,!0),this.Qc(b,c))}sa(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.bq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case xg:Dg(c,d);break;case yg:Eg(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!==
646
+ d)switch(b){case xg:Fg(c,d);break;case yg:Gg(c,d);break;default:c.unlink(b,d)}}sg(b,c){for(const d of b)this.N(d).ne(c)}mi(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Kj(...b){for(const c of b)null!=(b=this.get(c))&&(b.e=!1)}bt(b){b.forEach(c=>{this.N(c).persist()})}Md(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.np,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Rc(b,c)}Rc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.mp,b);c&&
647
+ this.state!==a.F.Gl&&this.D(a.j.dn,b);return d}yb(b){var c=olympe.U.ni();this.H?Hg(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ia.has(b)&&this.ia.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}Z(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Ig(f,b).ja(e?Jg+c:c,d)}ef(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Kg?f?Ig(g,b).link(c,e):Ig(g,b).unlink(c,e):f?Ig(g,b).yb(c,e):Ig(g,b).Gc(c,e))}Wa(b,c,d){let e;null!=(e=this.H)&&Ig(e,b).Md(c,
648
+ d)}addEventListener(b,c){let d=this.ia.get(b);void 0===d&&(d=[],this.ia.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}nb(b){this.Yb.push(b)}F(b){for(const c of this.X.values())if(c.R.has(b))return!0;return!1}tg(b=!1){const c=Bg++;this.state=a.F.Al;this.da.add(c);b||this.X.set(c,new olympe.dc.db.ou(c,this,this.vd));return c}ht(b,c){if(!this.da.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.X.get(b))?d:null;b=this.state;this.state=
649
+ null===this.H?a.F.Gl:a.F.Xv;c();this.state=b;this.H=null}ke(b){this.state=a.F.tf;const c=this.X.get(b);c&&(this.H=c,Lg(this.H),Mg(this.H),this.X.delete(b),this.H=null);this.da.delete(b);0===this.da.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Ng(this.Fd))}Qc(b,c){const d=a.D.Xe;for(const [e,f]of c)void 0!==f&&(e[0]===d?Og(b,e.substring(1),f):b.update(e,f))}Gc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(zg+xg)))for(const f of c.values())null!==f.source()&&this.Gc(b,
650
+ f,d);return d}$s(){const b=a.j.em,c=a.j.Ik,d=new Set,e=new Map;this.j(a.j.aq,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===yg&&g[1]===Ag){const h=g[2];this.get(h).Ja()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.nb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+
651
+ `\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={ej:'$',Hu:'~',Xe:'?',Bl:'=',Xp:'|',Hi:'@',ORIGIN:olympe.dc.ua.ORIGIN,DESTINATION:olympe.dc.ua.DESTINATION};olympe.dc.db.Database.j={mp:0,np:1,hs:2,dn:3,Ko:4,Lo:5,em:6,Dc:7,Ik:8,Tm:9,aq:10,bq:11,qr:12,KA:13,JA:14,Mw:15,Bp:16};olympe.dc.db.Database.F={IDLE:0,Al:1,Xv:2,Gl:3,tf:4};function Pg(a,b,c=[]){const d=b.T();mg(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=qg(e,f.j,e.D.length);e.write(og(e,f,Date.now()),!1);e.F.delete(d)}}}}function Qg(a,b,c={}){let d,e;return sg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.pn)?e:!1)}function Rg(a,b){a.D.nb(b)}
652
+ olympe.dc.db.ku=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.au(a,b,c,d);this.yz=new olympe.dc.db.Gv(a,c,b,e)}Xa(){return this.G}md(a,b={}){let c,d;this.j.md(a,null!=(c=b.persist)?c:!0,null!=(d=b.pn)?d:!1)}ne(a,b){this.D.sg(a,b)}detach(a,b){this.D.mi(a,b);return this}Kj(...a){this.D.Kj(...a.map(olympe.dc.ea))}};const Sg=olympe.dc.db.Database.D.ORIGIN,Tg=olympe.dc.db.Database.D.DESTINATION,Ug=olympe.dc.db.Database.D.ej,Vg=olympe.dc.db.Database.D.Xe,Wg=olympe.dc.db.Database.D.Bl,Xg=olympe.dc.db.Database.D.Xp,Yg=Sg+Tg,Zg=Ug+Ug,$g=olympe.dc.db.Database.F;let ah=0;function Lf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=bh(e,'',c);void 0!==f&&(a.j.getState()!==$g.tf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
653
+ function Nf(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function kg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ea(e));for(const h of g)yield h,d.il(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function dh(){++ah;return String(ah)}function ch(a){if(a)return olympe.dc.ea(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
654
+ function fh(a,b,c,d,e){a=a.j.N(ch(b));c=ch(c);b=Ug+c;e=null!=e?e:dh();if(eh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Wg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ea(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function gh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ea(c),bh(b,Ug+c,d),a.j.getState()===$g.tf&&a.j.R(d))}
655
+ function hh(a,b,c,d){a=a.j.N(ch(b));d=null!=d?d:dh();eh(a,Zg,d,c)&&a.Ja()&&a.forEach((e,f)=>{const g=f[0];g!==Ug&&g!==Wg||c(f.substring(1),e,g===Wg)});return d}function ih(a,b,c){b=S(a,b);null!==b&&(bh(b,Zg,c),a.j.getState()===$g.tf&&a.j.R(c))}function jh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ja()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(ch(b));c=c.La()+c.W();e=null!=e?e:dh();(d=kh(a,c,e,d))&&a.Ja()&&jh(a,c,!0,d,!1);return e}
656
+ function lh(a,b,c,d){const e=a.j.N(ch(b));a=null!=d?d:dh();const f=kh(e,Yg,a,c);f&&e.Ja()&&e.forEach((g,h)=>{g=h[0];g!==Sg&&g!==Tg||jh(e,h,!0,f,!0)})}function mh(a,b,c){const d=S(a,b);if(null!==d){const e=bh(d,Yg,c);void 0!==e&&(a.j.getState()!==$g.tf||d.F()||a.j.R(c),!d.Ja()&&!d.F()||d.forEach((f,g)=>{f=g[0];(f===Sg||f===Tg)&&e&&jh(d,g,!1,e,!0)}))}}
657
+ function nh(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.he.gg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Ug||h===Vg))(f=a.j.get(f.W()))&&e.push([f,g.substring(1),null,!0]);else if(h===Sg||h===Tg){const k=g.substring(1),l=(h===Sg?12:3)&oh(a,k,c);l&&f.forEach(n=>{e.push([n,k,h,!!(l&10)])})}});if(d&&void 0!==b.D){const [f,g]=void 0!==b.D?[b.D.tag,b.D.Da]:null;b=a.j.get(f);e.push([b,g,null,!0])}return e}
658
+ function ph(a,b,c,d,e){const f=a.j.N(ch(b));e=null!=e?e:dh();const g=kh(f,Xg+c,e,d);g&&f.Ja()&&nh(a,b,c).forEach(([h,...k])=>{h.Ja()&&g(...k,!0,h.tag())})}function qh(a,b,c,d){const e=S(a,b);if(null!==e){const f=bh(e,Xg+c,d);void 0!==f&&(a.j.getState()!==$g.tf||e.F()||a.j.R(d),!e.Ja()&&!e.F()||nh(a,b,c).forEach(([g,...h])=>{(g.Ja()||g.F())&&f(...h,!1,g.tag())}))}}function rh(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Vg&&b.set(c.substring(1),d);return b}
659
+ function oh(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.he.gg;c=d?c.substring(1):c;a=a.Pa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function sh(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Sg||c===Tg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
660
+ function th(a,b,c){if(!a.Ja(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ea(b)];for(const f of e){const g=a.cb(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.ea(b)}`);return d}function uh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ja()).length:0}
661
+ 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.La()+b.W();const e=bh(a,b,c);void 0!==e&&(this.j.getState()!==$g.tf||a.F()&&!d||this.j.R(c),d||!a.Ja()&&!a.F()||jh(a,b,!1,e,!1))}}Ja(a){a=this.j.get(olympe.dc.ea(a));return!(null==a||!a.Ja())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Pa(olympe.dc.CloudObject.nameProp.W()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}ff(a){return(a=(a=S(this,
662
+ a,!0))&&a.ff())?a.tag():null}vi(a){a=S(this,a,!0);return!(!a||!a.ff())}Nb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Tf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Re(a){a=S(this,a,!1);return!a||a.N}Pa(a,b,c){a=S(this,a,!0);b=olympe.dc.ea(b);let d;return null!=(d=null==a?void 0:a.Pa(b,c))?d:null}zb(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Ug||!b&&c===Wg)&&a.set(d.substring(1),e);return a}il(a,b){return nh(this,a,b).filter(([c])=>c.Ja()).map(([c,
663
+ ...d])=>[c.tag(),...d])}cb(a,b){a=S(this,a,!0);b=b.La()+b.W();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ja()&&a.push(c.tag());return a}gt(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.La()+b.W()))?void 0:e.get(olympe.dc.ea(c));return!(null==a||!a.Ja())}In(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.La()+c.W()),void 0!==a)for(const e of a.values())e.Ja()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
664
+ S(this,a,!0);const d=b.La()+b.W();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.W()} 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.Ja())?a.tag():null}nh(a,b,c){a=olympe.dc.ea(a);const d=th(this,a,b);d.delete(a);return c?(c=olympe.dc.ea(c),d.has(c)?Array.from(th(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Js(a,b,c){if(!this.Ja(a))return null;b=th(this,
665
+ a,b);const d=[olympe.dc.ea(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}An(a,b,c){return this.In(a,b).find(c)||null}Ux(a,b,c){return this.In(a,b).filter(c)}Ps(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.ff();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ja())throw a=`Try to get all extensions of the model ${olympe.dc.ea(a)} but one of them does not exists (${c.tag()})`,
666
+ 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())}Tf(a,b){const c=olympe.dc.ea(b);return!!this.Js(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Uc(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Uc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Tf;
667
+ olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.Ps;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.Ux;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.An;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Js;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.nh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Ib;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.In;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.gt;
668
+ olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.cb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.zb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Pa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Re;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Nb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.vi;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.ff;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
669
+ olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const vh=olympe.dc.db.Database.D.ORIGIN,Kg=olympe.dc.db.Database.D.DESTINATION,Jg=olympe.dc.db.Database.D.Bl,wh=olympe.dc.db.Database.D.ej,xh=olympe.dc.db.Database.D.Xp,yh=olympe.dc.db.Database.D.Hi,zh=vh+Kg,Ah=wh+wh,Bh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function Hg(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)}
670
670
  function Lg(a){for(const [b,c]of a.H)a.D.Gc(new Set,b).filter(d=>Cg(d,c)).forEach(d=>{d=d.tag();c?Ig(a,d).create():Ig(a,d).delete()})}
671
- function Mg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.yd()){var f=e.get(yh);f&&Ch(a,f,c.D(),d);c.yd()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===Jg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(yh+wh+h);q&&Ch(f,q,l,g);(k=k.get(yh+Ah))&&Ch(f,k,h,l,g)}for(const n of c.da())Dh(a,e,...n);(e=c.X)&&Eh(a,e,d,c.Yb,!c.yd())});a.H.clear();a.F.clear();a.N.clear();Fh(a)}function Ig(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Jh(b),a.F.set(b,c));return c}
671
+ function Mg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.yd()){var f=e.get(yh);f&&Ch(a,f,c.D(),d);c.yd()&&a.R.add(d)}for(const [n,p]of c.zb()){var g=n[0]===Jg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(yh+wh+h);q&&Ch(f,q,l,g);(k=k.get(yh+Ah))&&Ch(f,k,h,l,g)}for(const n of c.da())Dh(a,e,...n);(e=c.X)&&Eh(a,e,d,c.Yb,!c.yd())});a.H.clear();a.F.clear();a.N.clear();Fh(a)}function Ig(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Jh(b),a.F.set(b,c));return c}
672
672
  function Ch(a,b,...c){b.forEach((d,e)=>{Hg(a,e,d.bind(null,...c))})}function Dh(a,b,c,d,e,f){var g=b.get(yh+d+c);g&&Ch(a,g,f,e);(g=b.get(yh+zh))&&Ch(a,g,c,d,f,e);Gh(a,c,d).forEach((h,k)=>{(k=b.get(yh+xh+k))&&Ch(a,k,c,d,h,f,e)})}function Eh(a,b,c,d,e){Bh.forEach(f=>{const g=f[0]===olympe.dc.he.gg;(f=a.D.get(g?c:b).get(yh+xh+f))&&Ch(a,f,d,null,!0,e,g?b:c)})}
673
673
  function Fh(a){a.X.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 Gh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Bh.forEach(g=>{const h=g[0]===olympe.dc.he.gg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(wh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===vh?12:3)&k&&e.set(g,!!((c===vh?8:2)&k))});a.N.set(d,e)}return e}
674
- olympe.dc.db.ku=class{constructor(a,b,c){this.id=a;this.D=b;this.X=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 Ng(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.zf.j.io:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.zf.j.vw:a.F=!0,a.run()}}
675
- olympe.dc.db.zf=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.zf.j.$l&&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.Md(c),b.push(c))}this.D.clear();this.j.Ga(olympe.dc.db.Database.j.Ap,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.ds,b=olympe.dc.db.Database.j.$p,
676
- c=olympe.dc.db.Database.j.lr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Ng(this)};this.j.j(olympe.dc.db.Database.j.cn,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.Iw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.zf.j={$l:0,vw:1,io:2};olympe.dc.db.zf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.U.hf();this.Ab=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.Jh.j.Am,c=olympe.dc.db.Jh.j.Dc,d=olympe.dc.db.Jh.j.Wk;this.Ab.forEach((e,f)=>{const g=e.Ub();switch(e.getState()){case b:const h=e.ib();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.Cb():void 0;a.Qc(f,h,k,g);break;case d:e.N()&&a.Xc(f,e.Cb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Id())e=this.Ab.get(k),
677
- l?a.Oa(h,f,k,g,e.Ub()):a.hc(h,f,k,g,e.Ub())});return a}nf(){return 0===this.Ab.size}H(){let a=0;this.Ab.forEach(b=>{a+=b.vd()});return a}Qc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Zc,a,d,d,null);c&&b.ln(c)}Xc(a,b,c=null){b&&this.F(a,c).ln(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Ab.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.hl(a,b,!1))this.Ab.get(e).Cb().clear(),this.X(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
678
- c);this.F(c,e).yb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}Z(a){var b=olympe.dc.ga();if(b.Ia(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);rh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.he.Xe}${g}`,f)});this.Qc(a,d,e,c);(b=b.ff(a))&&this.Oa(olympe.dc.fc.Li,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.Z(f.W())})}}Tc(){return function*(a){for(const b of a.values())if(b.D()||b.yd()||b.N())yield b}(this.Ab)}Sc(a){let b;return null!=(b=this.Ab.get(olympe.dc.ea(a)))?
679
- b:null}j(a,b=olympe.dc.Lb.NONE){a=this.hl(a,b);for(const c of a)this.X(c,!1),this.Ab.delete(c)}Id(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Id((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Ab.values())}nh(a,b,c=(d,e)=>[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.Sc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Ab.get(b),e=this.Ab.get(c);d&&d.H(a,olympe.dc.ua.DESTINATION,c);e&&e.H(a,olympe.dc.ua.ORIGIN,
680
- b)}X(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Ab.get(a);for(const [g,h,k]of e.Id())if(k||!b){e.H(g,d,h);var f=this.Ab.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Wa())if(k||!b)e.H(g,c,h),(f=this.Ab.get(h))&&f.H(g,d,a)}*Ps(a){let b;for(const [c,d]of(null==(b=this.Sc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.yd()||(yield a))}hl(a,b,c=!0){const d=olympe.dm.Relation.j.ur,e=olympe.dm.Relation.j.$r,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ga();a=new Set([a]);
681
- const h=new Set;for(const l of a){var k=this.Ab.get(l);if(void 0!==k){for(const [n,p,q]of k.Id())q&&oh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Wa())q&&oh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of sh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&oh(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Ab.has(l))}F(a,b){let c=this.Ab.get(a);void 0===c&&(c=new olympe.dc.db.Jh(a),this.Ab.set(a,c));return b?c.sa(b):c}R(a){const b=
682
- olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.yd())this.j(a,d.F());else if(c.yd())d.D()&&this.j(a,c.F());else{c.Cb().forEach((e,f)=>{void 0!==d.Qa(f)&&c.Z(f)});for(const [e,f,g]of c.Id()){const h=d.lb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Ab;const c=a.Ab,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.ya=[olympe.dc.Writable,olympe.dc.er];const Hh=olympe.dc.db.Database.j,Ih=olympe.dc.db.Database.D.ej,Jh=olympe.dc.db.Database.D.Du,Kh=olympe.dc.db.Database.D.Xe,Lh=olympe.dc.db.Database.D.Al,Mh=olympe.dc.db.Database.D.Hi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,Nh=olympe.dc.fc.Zc,Oh=olympe.dc.fc.Li;function lg(a,b,c=!1){const d=a.get(Kh+b);return c||void 0!==d?d:a.get(Jh+b)}function Cg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Ph(a)):(Qh(a),a.e=b),a.db.D(b?Hh.cm:Hh.Dc,a.j));return c}
674
+ olympe.dc.db.ou=class{constructor(a,b,c){this.id=a;this.D=b;this.X=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 Ng(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.zf.j.jo:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.zf.j.zw:a.F=!0,a.run()}}
675
+ olympe.dc.db.zf=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.zf.j.am&&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.Md(c),b.push(c))}this.D.clear();this.j.Ha(olympe.dc.db.Database.j.Bp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.hs,b=olympe.dc.db.Database.j.bq,
676
+ c=olympe.dc.db.Database.j.qr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Ng(this)};this.j.j(olympe.dc.db.Database.j.dn,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.Mw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.zf.j={am:0,zw:1,jo:2};olympe.dc.db.zf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.U.hf();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.Jh.j.Bm,c=olympe.dc.db.Jh.j.Dc,d=olympe.dc.db.Jh.j.Xk;this.Bb.forEach((e,f)=>{const g=e.Ub();switch(e.getState()){case b:const h=e.jb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.zb():void 0;a.Rc(f,h,k,g);break;case d:e.N()&&a.Xc(f,e.zb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Id())e=this.Bb.get(k),
677
+ l?a.Oa(h,f,k,g,e.Ub()):a.hc(h,f,k,g,e.Ub())});return a}nf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.vd()});return a}Rc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Zc,a,d,d,null);c&&b.mn(c)}Xc(a,b,c=null){b&&this.F(a,c).mn(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.il(a,b,!1))this.Bb.get(e).zb().clear(),this.X(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
678
+ c);this.F(c,e).yb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Gc(a,b)}Z(a){var b=olympe.dc.ga();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.zb(a,!0);rh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.he.Xe}${g}`,f)});this.Rc(a,d,e,c);(b=b.ff(a))&&this.Oa(olympe.dc.fc.Li,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.Z(f.W())})}}Uc(){return function*(a){for(const b of a.values())if(b.D()||b.yd()||b.N())yield b}(this.Bb)}Tc(a){let b;return null!=(b=this.Bb.get(olympe.dc.ea(a)))?
679
+ b:null}j(a,b=olympe.dc.Lb.NONE){a=this.il(a,b);for(const c of a)this.X(c,!1),this.Bb.delete(c)}Id(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Id((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}nh(a,b,c=(d,e)=>[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.Tc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(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.H(a,olympe.dc.ua.DESTINATION,c);e&&e.H(a,olympe.dc.ua.ORIGIN,
680
+ b)}X(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.Id())if(k||!b){e.H(g,d,h);var f=this.Bb.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Wa())if(k||!b)e.H(g,c,h),(f=this.Bb.get(h))&&f.H(g,d,a)}*Ts(a){let b;for(const [c,d]of(null==(b=this.Tc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.yd()||(yield a))}il(a,b,c=!0){const d=olympe.dm.Relation.j.xr,e=olympe.dm.Relation.j.ds,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ga();a=new Set([a]);
681
+ 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.Id())q&&oh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Wa())q&&oh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of sh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&oh(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.Jh(a),this.Bb.set(a,c));return b?c.sa(b):c}R(a){const b=
682
+ olympe.dc.ua.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.yd())this.j(a,d.F());else if(c.yd())d.D()&&this.j(a,c.F());else{c.zb().forEach((e,f)=>{void 0!==d.Pa(f)&&c.Z(f)});for(const [e,f,g]of c.Id()){const h=d.nb(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.ya=[olympe.dc.Writable,olympe.dc.hr];const Hh=olympe.dc.db.Database.j,Ih=olympe.dc.db.Database.D.ej,Jh=olympe.dc.db.Database.D.Hu,Kh=olympe.dc.db.Database.D.Xe,Lh=olympe.dc.db.Database.D.Bl,Mh=olympe.dc.db.Database.D.Hi,U=olympe.dc.ua.ORIGIN,V=olympe.dc.ua.DESTINATION,Nh=olympe.dc.fc.Zc,Oh=olympe.dc.fc.Li;function lg(a,b,c=!1){const d=a.get(Kh+b);return c||void 0!==d?d:a.get(Jh+b)}function Cg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Ph(a)):(Qh(a),a.e=b),a.db.D(b?Hh.em:Hh.Dc,a.j));return c}
683
683
  function Dg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Nh,c)}a.link(Nh,b);b.forEach((d,e)=>{if(e[0]===Kh||e[0]===Jh)e=e.substring(1),Rh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.Z(a,!0)}function Eg(a,b){const c=a.ff();if(null!==c){if(c===b)return;a.unlink(Oh,c)}a.link(Oh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Kh||f[0]===Jh)f=f.substring(1),a.has(Kh+f)||(a.set(Jh+f,e),d.set(f,e))});Sh(a,d)}
684
684
  function Fg(a,b){a.unlink(Nh,b);a.forEach((c,d)=>{c=d.substring(1);Rh(a,c,null)});a.db.Z(a,!1)}function Gg(a,b){a.unlink(Oh,b);const c=new Map;a.forEach((d,e)=>{e[0]===Jh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Sh(a,c)}
685
- function Og(a,b,c){const d=Kh+b;var e=a.get(d);e=void 0===e?null:e;if(!Th(e,c))if(Uh(a,b,e,c,!0),e=Jh+b,null===c){a.delete(d);let f;c=null==(f=a.ff())?void 0:lg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Sh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Sh(a,(new Map).set(b,c))}function eh(a,b,c,d){const e=Vh(a,Mh+b);return e.has(c)?!1:(e.set(c,d),a.ne(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Jo,a.j,b,c),!0)}
686
- function bh(a,b,c){const d=Wh(a,Mh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Ko,a.j,b,c));return d}function kh(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.dw+b;h?g.ne(k):g.detach(k)}d(...f)};return eh(a,b,c,e)?e:null}function Th(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
687
- function Uh(a,b,c,d,e){c instanceof olympe.dc.uc&&(Xh(a.db.get(c.W())),a.db.sa(c.W()));d instanceof olympe.dc.uc&&(c=a.db.N(d.W(),!0),c.D&&c.D.tag!==a.j&&a.db.Xa().fatal('Instance',d.W(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.La+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.ne(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Wa(d.j,a,b)),d.D={tag:a,La:b,hz:e})}
685
+ function Og(a,b,c){const d=Kh+b;var e=a.get(d);e=void 0===e?null:e;if(!Th(e,c))if(Uh(a,b,e,c,!0),e=Jh+b,null===c){a.delete(d);let f;c=null==(f=a.ff())?void 0:lg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Sh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Sh(a,(new Map).set(b,c))}function eh(a,b,c,d){const e=Vh(a,Mh+b);return e.has(c)?!1:(e.set(c,d),a.ne(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Ko,a.j,b,c),!0)}
686
+ function bh(a,b,c){const d=Wh(a,Mh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Hh.Lo,a.j,b,c));return d}function kh(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.hw+b;h?g.ne(k):g.detach(k)}d(...f)};return eh(a,b,c,e)?e:null}function Th(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
687
+ function Uh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Xh(a.db.get(c.W())),a.db.sa(c.W()));d instanceof olympe.dc.vc&&(c=a.db.N(d.W(),!0),c.D&&c.D.tag!==a.j&&a.db.Xa().fatal('Instance',d.W(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Da+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.ne(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Wa(d.j,a,b)),d.D={tag:a,Da:b,kz:e})}
688
688
  function Yh(a,b,c,d){a.e&&a.db.Pe(a.j,b,c,d)}function Sh(a,b,c=[]){const d=a.get(U+Nh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Rh(e,g,f))});a=a.get(U+Oh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Kh+k)||(g.set(k,h),null!==h?e.set(Jh+k,h):e.delete(Jh+k))});Sh(e,g,[...c,f])}})}function Vh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Zh(a,b,c,d,e){a.db.ef(a.j,b,c,d.j,e)}
689
689
  function Wh(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function Rh(a,b,c){if(!a.has(Ih+b)){const d=Lh+b,e=a.get(d);Th(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Yh(a,b,c,null!==c))}}function Ph(a){a.forEach((b,c)=>{const d=c[0];if(d===U||d===V){const e=c.substring(1),f=d===U?V:U;b.forEach(g=>{g.e&&(Zh(a,e,d,g,!0),Zh(g,e,f,a,!0))})}else if(d===Ih||d===Lh)c=c.substring(1),Yh(a,c,b,d===Lh)})}
690
- function Qh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Mh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Ih?a.update(e,null):d===Kh&&Og(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.hz;let d,e;(null==(d=b.get(`${c?Kh:Ih}${a.D.La}`))?void 0:null==(e=d.W)?void 0:e.call(d))===a.j&&(c?Og(b,a.D.La,null):b.update(a.D.La,null))}}
691
- function Xh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.fj+a.D.tag+':'+a.D.La),a.db.Wa(a.j,a.D.tag,a.D.La),a.D=void 0)}
692
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ia(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+Nh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}ff(){const a=this.get(V+Oh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Qa(olympe.dc.CloudObject.nameProp.W());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
693
- var b=this.model();if(b){var c=b.Qa(olympe.dc.CloudObject.nameProp.W())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.ff())?(c=b.Qa(olympe.dc.CloudObject.nameProp.W())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(Ih+a);return b||void 0!==c?c:this.get(Lh+a)}update(a,b){const c=Ih+a;var d=this.get(c);d=void 0===d?null:d;if(!Th(d,b))if(Uh(this,
694
- a,d,b,!1),d=Lh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:lg(e,a);void 0!==b?(this.set(d,b),Yh(this,a,b,!0)):Yh(this,a,null,!1)}else this.set(c,b),this.delete(d),Yh(this,a,b,!1)}link(a,b){var c=U+a;const d=Vh(this,V+a);c=Vh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Hh.Hk,this.j,a,V,b.j),this.db.D(Hh.Hk,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!0),Zh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Wh(this,V+a,b.j)&&(Wh(b,c,this.j),this.db.D(Hh.Sm,this.j,
695
- a,V,b.j),this.db.D(Hh.Sm,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!1),Zh(b,a,U,this,!1)))}persist(){this.N=!0;return this}ne(){this.c++;1===this.c&&this.db.D(Hh.ds,this.j)}detach(){0<this.c?--this.c:this.db.D(Hh.lr,this.j,`Try to decrease references on instance ${this.j} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.D(Hh.cn,
696
- 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===Ih&&a instanceof olympe.dc.uc&&Xh(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Ih+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Yp:'instance',dw:'rel',Hi:'cb',fj:'ref',TRANSACTION:'tx'};olympe.dc.db.Jh=class a{constructor(b){this.Oc=b;this.R=this.Ga=null;this.Ob=olympe.dc.Lb.NONE;this.state=a.j.Wk;this.j=this.ob=this.Yb=this.X=this.properties=null}tag(){return this.Oc}Ub(){return this.R}ib(){return this.Ga}getState(){return this.state}sa(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Dc?this.Ob:olympe.dc.Lb.NONE}create(b){this.state=a.j.Am;
697
- this.Ga=null!=b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.state=a.j.Dc;this.Ob=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}ln(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Md(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Yb=
698
- c}Z(b){let c;null==(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.Zc&&this.sa(c);this.ra(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.sa(c);this.ra(this.ob,b,c,!1);return this}yb(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!0)}Gc(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!1)}lb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)return(b=
699
- c.get(b))&&b.get(d)}H(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.state===a.j.Am}yd(){return this.state===a.j.Dc}vd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}Fd(){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)}cb(b,c=(d,e)=>[d,
700
- e]){return function*(d){if(d=d&&d.get(b.W()))for(const [e,f]of d)yield c(e,f)}(b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob)}Ib(b){const c=b.Ka()===olympe.dc.ua.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.W()))&&0!==b.size?Array.from(b.keys())[0]:null}Id(b=(c,d,e)=>[c,d,e]){return this.ia(this.ob,b)}Wa(b=(c,d,e)=>[c,d,e]){return this.ia(this.j,b)}da(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)=>
701
- b(h,c,k,l))}(this.ia.bind(this),this.ob,this.j)}ra(b,c,d,e){if(this.state!==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)}}*ia(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.Jh.j={Am:0,Wk:1,Dc:2};olympe.dc.db.Cv=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.ea(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){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.ej+olympe.dc.CloudObject.nameProp.W();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
702
- ' (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.mp,b=olympe.dc.db.Database.j.cm,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.Hk,e=olympe.dc.db.Database.j.Sm,f=olympe.dc.db.Database.j.Jo,g=olympe.dc.db.Database.j.Ko,h=()=>{};this.j.j(olympe.dc.db.Database.j.lp,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.yb(()=>{lh(this.view,
703
- k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.yb(()=>{mh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.dn=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ga=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.tg(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new $h(this.ga),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
704
- this.transactionId);this.j.dt(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.ke(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Qc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Zc,a,d)}Xc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of kg(this.ga,a,b))this.j.sa(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
705
- function ai(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.uc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.oh()+','+f.lh()+','+f.hh()+','+f.gh()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=ai(a,f,
690
+ function Qh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Mh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Ih?a.update(e,null):d===Kh&&Og(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.kz;let d,e;(null==(d=b.get(`${c?Kh:Ih}${a.D.Da}`))?void 0:null==(e=d.W)?void 0:e.call(d))===a.j&&(c?Og(b,a.D.Da,null):b.update(a.D.Da,null))}}
691
+ function Xh(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.fj+a.D.tag+':'+a.D.Da),a.db.Wa(a.j,a.D.tag,a.D.Da),a.D=void 0)}
692
+ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ja(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+Nh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}ff(){const a=this.get(V+Oh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Pa(olympe.dc.CloudObject.nameProp.W());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
693
+ var b=this.model();if(b){var c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.ff())?(c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Pa(a,b=!1){const c=this.get(Ih+a);return b||void 0!==c?c:this.get(Lh+a)}update(a,b){const c=Ih+a;var d=this.get(c);d=void 0===d?null:d;if(!Th(d,b))if(Uh(this,
694
+ a,d,b,!1),d=Lh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:lg(e,a);void 0!==b?(this.set(d,b),Yh(this,a,b,!0)):Yh(this,a,null,!1)}else this.set(c,b),this.delete(d),Yh(this,a,b,!1)}link(a,b){var c=U+a;const d=Vh(this,V+a);c=Vh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Hh.Ik,this.j,a,V,b.j),this.db.D(Hh.Ik,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!0),Zh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Wh(this,V+a,b.j)&&(Wh(b,c,this.j),this.db.D(Hh.Tm,this.j,
695
+ a,V,b.j),this.db.D(Hh.Tm,b.j,a,U,this.j),this.e&&b.e&&(Zh(this,a,V,b,!1),Zh(b,a,U,this,!1)))}persist(){this.N=!0;return this}ne(){this.c++;1===this.c&&this.db.D(Hh.hs,this.j)}detach(){0<this.c?--this.c:this.db.D(Hh.qr,this.j,`Try to decrease references on instance ${this.j} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.D(Hh.dn,
696
+ 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===Ih&&a instanceof olympe.dc.vc&&Xh(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Ih+this.D.Da)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={$p:'instance',hw:'rel',Hi:'cb',fj:'ref',TRANSACTION:'tx'};olympe.dc.db.Jh=class a{constructor(b){this.Qc=b;this.R=this.Ha=null;this.Ob=olympe.dc.Lb.NONE;this.state=a.j.Xk;this.j=this.ob=this.Yb=this.X=this.properties=null}tag(){return this.Qc}Ub(){return this.R}jb(){return this.Ha}getState(){return this.state}sa(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Dc?this.Ob:olympe.dc.Lb.NONE}create(b){this.state=a.j.Bm;
697
+ this.Ha=null!=b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.state=a.j.Dc;this.Ob=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}mn(b){this.state!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Md(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Yb=
698
+ c}Z(b){let c;null==(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.Zc&&this.sa(c);this.ra(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Zc&&this.sa(c);this.ra(this.ob,b,c,!1);return this}yb(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!0)}Gc(b,c){null===this.j&&(this.j=new Map);this.ra(this.j,b,c,!1)}nb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.ob)return(b=
699
+ c.get(b))&&b.get(d)}H(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.state===a.j.Bm}yd(){return this.state===a.j.Dc}vd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}Fd(){return null!==this.ob||null!==this.j}zb(){let b;return null!=(b=this.properties)?b:new Map}Pa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,
700
+ e]){return function*(d){if(d=d&&d.get(b.W()))for(const [e,f]of d)yield c(e,f)}(b.La()===olympe.dc.ua.ORIGIN?this.j:this.ob)}Ib(b){const c=b.La()===olympe.dc.ua.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.W()))&&0!==b.size?Array.from(b.keys())[0]:null}Id(b=(c,d,e)=>[c,d,e]){return this.ia(this.ob,b)}Wa(b=(c,d,e)=>[c,d,e]){return this.ia(this.j,b)}da(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)=>
701
+ b(h,c,k,l))}(this.ia.bind(this),this.ob,this.j)}ra(b,c,d,e){if(this.state!==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)}}*ia(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.Jh.j={Bm:0,Xk:1,Dc:2};olympe.dc.db.Gv=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.ea(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ja()){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.ej+olympe.dc.CloudObject.nameProp.W();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
702
+ ' (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.np,b=olympe.dc.db.Database.j.em,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.Ik,e=olympe.dc.db.Database.j.Tm,f=olympe.dc.db.Database.j.Ko,g=olympe.dc.db.Database.j.Lo,h=()=>{};this.j.j(olympe.dc.db.Database.j.mp,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.yb(()=>{lh(this.view,
703
+ k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.yb(()=>{mh(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.en=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ga=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.tg(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new $h(this.ga),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
704
+ this.transactionId);this.j.ht(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.ke(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Rc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Zc,a,d)}Xc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of kg(this.ga,a,b))this.j.sa(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
705
+ function ai(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.vc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.oh()+','+f.lh()+','+f.hh()+','+f.gh()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=ai(a,f,
706
706
  (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function bi(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function ci(a,b){let c;return b===olympe.dc.fc.Zc?'Model':null!=(c=a.db.name(b))?c:b}
707
- class $h{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Qc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${ai(this,c)})`,bi(this,d))}Xc(a,b,c){this.log(`updateInstance(tag: ${a}, ${ai(this,b)})`,bi(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,bi(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ci(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
708
- ci(this,a))}}olympe.dc.db.dn.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',im:'dc.db.gc.Logger',Da:'dc.db.DatabaseManager',ak:'dc.db.Database',Wl:'dc.db.DBView',LB:'dc.db.Graph',NA:'dc.db.DatabaseWriter',AC:'dc.db.PermissionProcessor',Yi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Bp:'db.garbageCollector',Cp:'db.garbageCollectorDelay',Ol:'db.commitBufferTimeout',Yi:'db.monitor',Bv:'db.monitorCounters',Av:'db.monitorCallbacks',cp:'db.debug'};
709
- olympe.V.config(function(a){E(a,olympe.dc.db.Config.Bp,olympe.dc.db.zf.j.io);E(a,olympe.dc.db.Config.Cp,5E3);E(a,olympe.dc.db.Config.Ol,3E4);E(a,olympe.dc.db.Config.Yi,!1);E(a,olympe.dc.db.Config.cp,!1);D(a,olympe.dc.db.P.Ca,[olympe.ha.P.Da],b=>b.ad('db'));D(a,olympe.dc.db.P.im,[olympe.ha.P.Da],b=>b.ad('gc'));D(a,olympe.dc.db.P.ak,[olympe.dc.db.P.Ca,olympe.dc.db.P.im,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.db.Config.Bp),new olympe.V.oa(olympe.dc.db.Config.Cp),new olympe.V.oa(olympe.dc.Config.Yh),
710
- new olympe.V.oa(olympe.dc.db.Config.cp)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.zf.j.$l:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.P.Wl,olympe.dc.jb,olympe.dc.db.P.Ca,olympe.dc.db.P.ak);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Da],b=>b.vz);D(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.ak,olympe.dc.db.P.Wl,new olympe.V.oa(olympe.dc.Config.ag),new olympe.V.oa(olympe.dc.db.Config.Ol),
711
- new olympe.V.oa(olympe.dc.db.Config.Yi),new olympe.V.oa(olympe.dc.db.Config.Bv),new olympe.V.oa(olympe.dc.db.Config.Av)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.gu(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.ak,olympe.dc.db.P.Yi],(a,b)=>{olympe.de().db=a;olympe.de().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function di(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
712
- olympe.dc.query.wf=class{constructor(a,b,c){this.db=olympe.dc.ga();this.j=a;this.La=b;this.Wi=c}fa(){return{p:this.La.W(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.La.W()}jh(){const a=this.db.Ib(this.La,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.Tf(a,olympe.dm.String))return di((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return di((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return di((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return di((c,
713
- d)=>c.compare(d));olympe.ha.Xa('dc.query').warn(`No comparator found for type with tag ${a}`);return di(()=>-1)}Qa(){return this.La}};olympe.dc.Ye=class{W(){}};olympe.dc.Ye.prototype.getTag=olympe.dc.Ye.prototype.W;olympe.dc.OB=olympe.dc.Ye;function ei(a){let b;if(null==(b=a.j)?0:b.nf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function fi(a,b,c,d,e){ei(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function gi(a){let b;const c=!(null==(b=a.j)?0:b.nf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
714
- olympe.dc.query.Iv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ga();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Nf(this.db,a,(d,e)=>{if(d){ei(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&ih(this.db,e,c),!this.db.Ia(e)){ei(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&hh(this.db,a,(d,e,f)=>{ei(this);let g;f||null!=(g=this.j)&&g.Xc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
715
- Lf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Ak={ASC:'ASC',DESC:'DESC'};function hi(a){const b=ii(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Tc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,Y)=>K.add(Y),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
707
+ class $h{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Rc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${ai(this,c)})`,bi(this,d))}Xc(a,b,c){this.log(`updateInstance(tag: ${a}, ${ai(this,b)})`,bi(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,bi(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ci(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
708
+ ci(this,a))}}olympe.dc.db.en.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',jm:'dc.db.gc.Logger',Fa:'dc.db.DatabaseManager',bk:'dc.db.Database',Xl:'dc.db.DBView',PB:'dc.db.Graph',RA:'dc.db.DatabaseWriter',EC:'dc.db.PermissionProcessor',Yi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Cp:'db.garbageCollector',Dp:'db.garbageCollectorDelay',Pl:'db.commitBufferTimeout',Yi:'db.monitor',Fv:'db.monitorCounters',Ev:'db.monitorCallbacks',ep:'db.debug'};
709
+ olympe.V.config(function(a){E(a,olympe.dc.db.Config.Cp,olympe.dc.db.zf.j.jo);E(a,olympe.dc.db.Config.Dp,5E3);E(a,olympe.dc.db.Config.Pl,3E4);E(a,olympe.dc.db.Config.Yi,!1);E(a,olympe.dc.db.Config.ep,!1);D(a,olympe.dc.db.P.Ca,[olympe.ha.P.Fa],b=>b.ad('db'));D(a,olympe.dc.db.P.jm,[olympe.ha.P.Fa],b=>b.ad('gc'));D(a,olympe.dc.db.P.bk,[olympe.dc.db.P.Ca,olympe.dc.db.P.jm,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.db.Config.Cp),new olympe.V.oa(olympe.dc.db.Config.Dp),new olympe.V.oa(olympe.dc.Config.Yh),
710
+ new olympe.V.oa(olympe.dc.db.Config.ep)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.zf.j.am:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.P.Xl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Fa],b=>b.yz);D(a,olympe.dc.db.P.Fa,[olympe.dc.db.P.Ca,olympe.dc.db.P.bk,olympe.dc.db.P.Xl,new olympe.V.oa(olympe.dc.Config.ag),new olympe.V.oa(olympe.dc.db.Config.Pl),
711
+ new olympe.V.oa(olympe.dc.db.Config.Yi),new olympe.V.oa(olympe.dc.db.Config.Fv),new olympe.V.oa(olympe.dc.db.Config.Ev)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.ku(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.bk,olympe.dc.db.P.Yi],(a,b)=>{olympe.de().db=a;olympe.de().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function di(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
712
+ olympe.dc.query.wf=class{constructor(a,b,c){this.db=olympe.dc.ga();this.j=a;this.Da=b;this.Wi=c}fa(){return{p:this.Da.W(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.Da.W()}jh(){const a=this.db.Ib(this.Da,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.Tf(a,olympe.dm.String))return di((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return di((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return di((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return di((c,
713
+ d)=>c.compare(d));olympe.ha.Xa('dc.query').warn(`No comparator found for type with tag ${a}`);return di(()=>-1)}Pa(){return this.Da}};olympe.dc.Ye=class{W(){}};olympe.dc.Ye.prototype.getTag=olympe.dc.Ye.prototype.W;olympe.dc.SB=olympe.dc.Ye;function ei(a){let b;if(null==(b=a.j)?0:b.nf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function fi(a,b,c,d,e){ei(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function gi(a){let b;const c=!(null==(b=a.j)?0:b.nf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
714
+ olympe.dc.query.Mv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ga();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Nf(this.db,a,(d,e)=>{if(d){ei(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&ih(this.db,e,c),!this.db.Ja(e)){ei(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&hh(this.db,a,(d,e,f)=>{ei(this);let g;f||null!=(g=this.j)&&g.Xc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
715
+ Lf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Bk={ASC:'ASC',DESC:'DESC'};function hi(a){const b=ii(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Uc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,Y)=>K.add(Y),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
716
716
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const v of k.j(r))n.has(v)?n.get(v).add(t):n.set(v,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,v]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let Y;const ya=null!=(Y=x.get(z))?Y:new Set;y.forEach(db=>ya.add(db+K));x.set(z,ya)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+v)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
717
- q+A)))});c.set(g,[x,t&&h,q+v])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function ji(a){if(null===a.D){const b={Gb:a.query.jh(),Ld:a.Ld,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ja.from(a.X,hi(a),b)}return a.D}function ki(a,b){a.R=b}function li(a){if(!a.N){null!==a.D&&(a.X=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
718
- function mi(a,b){let c;return null!=(c=a.j.get(b).Tc())?c:[]}function ni(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function oi(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&li(a);let g;f&&(null==(g=a.Se)||g.watch(b,a.H.has(c)));return f}function pi(a,b,c,d,e,f){null!==a.Se&&(d===olympe.dc.ua.ORIGIN?fi(a.Se,b,c,f,e):fi(a.Se,b,c,e,f))}
719
- function qi(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Iv(a.G,a.query.ib(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Tc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Se=b}function ri(a){null!==a.Se&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Tc())a.Se.stop(c)}),a.Se=null)}function si(a){a.N=!1;let b;null==(b=a.Se)||gi(b)}
720
- olympe.dc.query.cr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.tb(b.D);this.ma=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.ma.Ym);this.H=new Set(b.F);this.Ld=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ja.empty();this.Se=this.D=null;a=ii(b);a.forEach(c=>{const d=c.T();this.ma.set(d,c.N());this.j.set(d,c.ia())});b=b.jh();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Ld=c;break}}}remove(a,b=this.F,c='root'){b=
721
- this.j.get(b);if(null==b?0:b.remove(a,c))if(li(this),!b.has(a)){let d;null==(d=this.Se)||d.stop(a);return!0}return!1}Pc(a){const b=a.D,c=olympe.U.tb(b);a=ii(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.Z(k,this.ma.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ma.get(k))?void 0:l.Pc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function ti(a){if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
722
- function ui(a){var b=olympe.dc.query.Aa.j.Vr;const c=olympe.dc.query.Aa.j.np,d=olympe.dc.query.Aa.j.Yj,e=olympe.dc.query.Aa.j.Xp,f=olympe.dc.query.Aa.j.zq,g=olympe.dc.query.Aa.j.mr,h=olympe.dc.query.Aa.j.fo,k=olympe.dc.query.Aa.j.Rq;switch(a.pr){case b:return new olympe.dc.query.Y.an(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.Y.Be(a.p,b,olympe.dc.ga());case d:return new olympe.dc.query.Y.xf(a.p,
723
- a.s,olympe.dc.ga(),a.c);case e:return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.ie(ui(a.v));case g:return new olympe.dc.query.Y.Gf(a.p,new RegExp(a.r),olympe.dc.ga(),a.c);case k:return new olympe.dc.query.Y.Fe(...a.p.map(l=>ui(l)));case h:return new olympe.dc.query.Y.Nd(...a.p.map(l=>ui(l)));default:return null}}
724
- olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}zd(){return new olympe.dc.query.Y.ie(this)}Cb(){}Pc(){}clear(){}fa(){}Wc(){}toString(){}Ea(a){return this===a}static Zs(...a){return new olympe.dc.query.Y.an(a)}static Ea(a,b){ti(a);return new olympe.dc.query.Y.Be(a,b,olympe.dc.ga())}static contains(a,b,c=!0){ti(a);return new olympe.dc.query.Y.xf(a,b,olympe.dc.ga(),c)}static Wz(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Gf(a,b,olympe.dc.ga(),c)}static ml(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),
725
- a,b,!1,c)}static Oj(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Y.Nd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
726
- return new olympe.dc.query.Y.Fe(...a)}static zd(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Cd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Y.ie(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.zd;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.Oj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.ml;
727
- olympe.dc.query.Aa.regex=olympe.dc.query.Aa.Wz;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.Zs;olympe.dc.query.Aa.j={Vr:0,np:1,Yj:2,Xp:3,zq:4,mr:5,Rq:6,fo:7};function ii(a){return Array.from(a.ma)}
728
- function vi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.Ka()===olympe.dc.ua.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.ma[a.cursor],null!==e.sa)e=e.sa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ga().Ib(e.relation,e.relation.Ka()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ia(olympe.dc.CloudObject)&&(null===d||!a.db.Tf(d,e)&&!a.db.Tf(e,d)))throw new olympe.dc.query.Cd(`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=
729
- b.T();for(c=a.cursor+1;c<a.ma.length&&a.ma[c].T()!==d;)c++;b=c<a.ma.length?a.ma:a.ma.concat(b);return new olympe.dc.la(a.D,a.source,b,c,a.F,a.j)}function wi(a,b=a.cursor){return 0<=b?a.ma[b].T():olympe.U.tb(a.D)}
730
- function xi(a,b,c,d={}){var e=olympe.dc.Lb.jg;const f=(null==d?0:d.ld)?d.ld:olympe.dc.la.nc.vf,g=(null==d?0:d.$n)?'__code-as-data__':void 0;b=olympe.dc.ea(b);const h=olympe.dc.ee().Qe(b);b=(new olympe.dc.la(b,h)).me();b.ma=[f===olympe.dc.la.nc.Qg?new olympe.dc.query.ma.hm(wi(b),e,c):new olympe.dc.query.ma.Od(wi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.at)?k:!1;return b.observe(a,{ld:f,bl:g})}
717
+ q+A)))});c.set(g,[x,t&&h,q+v])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function ji(a){if(null===a.D){const b={Gb:a.query.jh(),Ld:a.Ld,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.X,hi(a),b)}return a.D}function ki(a,b){a.R=b}function li(a){if(!a.N){null!==a.D&&(a.X=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
718
+ function mi(a,b){let c;return null!=(c=a.j.get(b).Uc())?c:[]}function ni(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function oi(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&li(a);let g;f&&(null==(g=a.Se)||g.watch(b,a.H.has(c)));return f}function pi(a,b,c,d,e,f){null!==a.Se&&(d===olympe.dc.ua.ORIGIN?fi(a.Se,b,c,f,e):fi(a.Se,b,c,e,f))}
719
+ function qi(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Mv(a.G,a.query.jb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Uc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Se=b}function ri(a){null!==a.Se&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Uc())a.Se.stop(c)}),a.Se=null)}function si(a){a.N=!1;let b;null==(b=a.Se)||gi(b)}
720
+ olympe.dc.query.fr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.rb(b.D);this.ma=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.ma.Zm);this.H=new Set(b.F);this.Ld=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ka.empty();this.Se=this.D=null;a=ii(b);a.forEach(c=>{const d=c.T();this.ma.set(d,c.N());this.j.set(d,c.ia())});b=b.jh();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Ld=c;break}}}remove(a,b=this.F,c='root'){b=
721
+ this.j.get(b);if(null==b?0:b.remove(a,c))if(li(this),!b.has(a)){let d;null==(d=this.Se)||d.stop(a);return!0}return!1}Hc(a){const b=a.D,c=olympe.U.rb(b);a=ii(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.Z(k,this.ma.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ma.get(k))?void 0:l.Hc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function ti(a){if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
722
+ function ui(a){var b=olympe.dc.query.za.j.Yr;const c=olympe.dc.query.za.j.op,d=olympe.dc.query.za.j.Zj,e=olympe.dc.query.za.j.Zp,f=olympe.dc.query.za.j.Cq,g=olympe.dc.query.za.j.rr,h=olympe.dc.query.za.j.ho,k=olympe.dc.query.za.j.Uq,l=olympe.dc.query.za.j.Yp;switch(a.pr){case b:return new olympe.dc.query.Y.bn(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.Y.Be(a.p,b,olympe.dc.ga());
723
+ case d:return new olympe.dc.query.Y.xf(a.p,a.s,olympe.dc.ga(),a.c);case e:return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.ie(ui(a.v));case g:return new olympe.dc.query.Y.Gf(a.p,new RegExp(a.r),olympe.dc.ga(),a.c);case k:return new olympe.dc.query.Y.Fe(...a.p.map(n=>ui(n)));case h:return new olympe.dc.query.Y.Nd(...a.p.map(n=>ui(n)));case l:return b=4===a.t?a.v.map(n=>olympe.C.Color.create(n.r,n.g,n.b,n.a)):3===a.t?a.v.map(n=>olympe.dc.CloudObject.get(n)):
724
+ 2===a.t?a.v.map(n=>new Date(n)):a.v,new olympe.dc.query.Y.iq(a.p,b);default:return null}}
725
+ olympe.dc.query.za=class{observe(){}lb(){}compile(){return[[this]]}zd(){return new olympe.dc.query.Y.ie(this)}zb(){}Hc(){}clear(){}fa(){}Mc(){}toString(){}Ea(a){return this===a}static dt(...a){return new olympe.dc.query.Y.bn(a)}static Wz(a,b){ti(a);return new olympe.dc.query.Y.iq(a,b)}static Ea(a,b){ti(a);return new olympe.dc.query.Y.Be(a,b,olympe.dc.ga())}static contains(a,b,c=!0){ti(a);return new olympe.dc.query.Y.xf(a,b,olympe.dc.ga(),c)}static $z(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Gf(a,
726
+ b,olympe.dc.ga(),c)}static nl(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a,b,!1,c)}static Pj(a,b,c=!0){ti(a);return new olympe.dc.query.Y.Ti(olympe.dc.ga(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Y.Nd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
727
+ return new olympe.dc.query.Y.Fe(...a)}static zd(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Y.ie(a)}};olympe.dc.query.za.not=olympe.dc.query.za.zd;olympe.dc.query.za.or=olympe.dc.query.za.or;olympe.dc.query.za.and=olympe.dc.query.za.and;olympe.dc.query.za.smallerThan=olympe.dc.query.za.Pj;olympe.dc.query.za.greaterThan=olympe.dc.query.za.nl;
728
+ olympe.dc.query.za.regex=olympe.dc.query.za.$z;olympe.dc.query.za.contains=olympe.dc.query.za.contains;olympe.dc.query.za.equals=olympe.dc.query.za.Ea;olympe.dc.query.za.propertyIn=olympe.dc.query.za.Wz;olympe.dc.query.za['in']=olympe.dc.query.za.dt;olympe.dc.query.za.j={Yr:0,op:1,Zj:2,Zp:3,Cq:4,rr:5,Uq:6,ho:7,Yp:8};function ii(a){return Array.from(a.ma)}
729
+ function vi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.La()===olympe.dc.ua.ORIGIN?e:d);if(0>a.cursor)e=a.j.Te;else if(e=a.ma[a.cursor],null!==e.sa)e=e.sa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ga().Ib(e.relation,e.relation.La()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ja(olympe.dc.CloudObject)&&(null===d||!a.db.Tf(d,e)&&!a.db.Tf(e,d)))throw new olympe.dc.query.Cd(`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=
730
+ b.T();for(c=a.cursor+1;c<a.ma.length&&a.ma[c].T()!==d;)c++;b=c<a.ma.length?a.ma:a.ma.concat(b);return new olympe.dc.la(a.D,a.source,b,c,a.F,a.j)}function wi(a,b=a.cursor){return 0<=b?a.ma[b].T():olympe.U.rb(a.D)}
731
+ function xi(a,b,c,d={}){var e=olympe.dc.Lb.jg;const f=(null==d?0:d.ld)?d.ld:olympe.dc.la.nc.vf,g=(null==d?0:d.ao)?'__code-as-data__':void 0;b=olympe.dc.ea(b);const h=olympe.dc.ee().Qe(b);b=(new olympe.dc.la(b,h)).me();b.ma=[f===olympe.dc.la.nc.Qg?new olympe.dc.query.ma.im(wi(b),e,c):new olympe.dc.query.ma.Od(wi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.ft)?k:!1;return b.observe(a,{ld:f,cl:g})}
731
732
  function yi(a){const b=0===a.F.size?a.me():a;if(null!==b.j.Ld&&!b.F.has(wi(a,b.j.Ld)))throw new olympe.dc.query.Cd('AndReturn was not called for the current level before sortBy operator');return b}function zi(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
732
733
  olympe.dc.la=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ld:null,Te:null}){this.db=olympe.dc.ga();if('string'!==typeof a||''===a)throw new olympe.dc.query.Cd('The root of the query cannot be empty.');this.D=a;this.source=b;this.ma=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.ea(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Cd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
733
- b=null!=b?b:olympe.dc.ee().Qe(a);b=new olympe.dc.la(a,b);b.j.Te=olympe.dc.ga().model(a);return b}static Qe(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Cd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.ee().fromModel(b);c=new olympe.dc.la(a,c);c.j.Te=olympe.dc.ea(b);return c}static ol(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ga();if(!e.vi(d))throw new olympe.dc.query.Cd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
734
- a=null!=c?c:olympe.dc.ee().fromModel(d);a=new olympe.dc.la(d,a);a.j.Te=e.model(d);b&&(a=vi(a,new olympe.dc.query.ma.Ce(wi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ma.Hh(wi(a),olympe.dc.CloudObject.instancesRel,!1);e.sa=d;return vi(b,e)}static Ob(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.ld)?f:olympe.dc.la.nc.vf;f=(null==e?0:e.$n)?'__code-as-data__':void 0;b=olympe.dc.ea(b);d=null!=d?d:olympe.dc.ee().Qe(b);d=(new olympe.dc.la(b,d)).me();b=g===olympe.dc.la.nc.Qg;
735
- d.ma=[b?new olympe.dc.query.ma.hm(wi(d),c):new olympe.dc.query.ma.Od(wi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.at)?h:!1;let k;return d.observe(a,{ld:g,bl:f,rj:null!=(k=null==e?void 0:e.rj)?k:b})}bb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to follow() is invalid: ${a}`);return vi(this,new olympe.dc.query.ma.Hh(wi(this),a,b))}ug(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to followRecursively() is invalid: ${a}`);
736
- return vi(this,new olympe.dc.query.ma.Ce(wi(this),a,b,c))}me(){const a=(new Set(this.F)).add(wi(this));return new olympe.dc.la(this.D,this.source,this.ma,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Cd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ma);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.la(this.D,this.source,b,this.cursor,this.F,this.j)}sj(){return this}Hj(a,b=0){return new olympe.dc.la(this.D,
737
- this.source,this.ma,this.cursor,this.F,{Ld:this.j.Ld,max:a,offset:b,Te:this.j.Te})}wl(a,b=olympe.dc.query.Ak.ASC){if(0>this.cursor)throw new olympe.dc.query.Cd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ma[this.cursor],d={Ld:this.cursor,max:this.j.max,offset:this.j.offset,Te:this.j.Te},
734
+ b=null!=b?b:olympe.dc.ee().Qe(a);b=new olympe.dc.la(a,b);b.j.Te=olympe.dc.ga().model(a);return b}static Qe(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Cd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.ee().fromModel(b);c=new olympe.dc.la(a,c);c.j.Te=olympe.dc.ea(b);return c}static pl(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ga();if(!e.vi(d))throw new olympe.dc.query.Cd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
735
+ a=null!=c?c:olympe.dc.ee().fromModel(d);a=new olympe.dc.la(d,a);a.j.Te=e.model(d);b&&(a=vi(a,new olympe.dc.query.ma.Ce(wi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ma.Hh(wi(a),olympe.dc.CloudObject.instancesRel,!1);e.sa=d;return vi(b,e)}static Ob(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.ld)?f:olympe.dc.la.nc.vf;f=(null==e?0:e.ao)?'__code-as-data__':void 0;b=olympe.dc.ea(b);d=null!=d?d:olympe.dc.ee().Qe(b);d=(new olympe.dc.la(b,d)).me();b=g===olympe.dc.la.nc.Qg;
736
+ d.ma=[b?new olympe.dc.query.ma.im(wi(d),c):new olympe.dc.query.ma.Od(wi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.ft)?h:!1;let k;return d.observe(a,{ld:g,cl:f,rj:null!=(k=null==e?void 0:e.rj)?k:b})}bb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to follow() is invalid: ${a}`);return vi(this,new olympe.dc.query.ma.Hh(wi(this),a,b))}ug(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Cd(`The relation given to followRecursively() is invalid: ${a}`);
737
+ return vi(this,new olympe.dc.query.ma.Ce(wi(this),a,b,c))}me(){const a=(new Set(this.F)).add(wi(this));return new olympe.dc.la(this.D,this.source,this.ma,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Cd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ma);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.la(this.D,this.source,b,this.cursor,this.F,this.j)}sj(){return this}Hj(a,b=0){return new olympe.dc.la(this.D,
738
+ this.source,this.ma,this.cursor,this.F,{Ld:this.j.Ld,max:a,offset:b,Te:this.j.Te})}xl(a,b=olympe.dc.query.Bk.ASC){if(0>this.cursor)throw new olympe.dc.query.Cd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Cd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ma[this.cursor],d={Ld:this.cursor,max:this.j.max,offset:this.j.offset,Te:this.j.Te},
738
739
  e=Array.from(this.ma);e[this.cursor]=c.sort(a,b);return new olympe.dc.la(this.D,this.source,e,this.cursor,this.F,d)}jh(){const a=this.j.Ld;let b;return null!==a?null==(b=this.ma[a])?void 0:b.jh():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.ma[b].j;for(b--;-1<b&&wi(this,b)!==d;)b--}return new olympe.dc.la(this.D,this.source,Array.from(this.ma),b,this.F,this.j)}parse(){const a=new Map,b=wi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
739
- filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.vi(this.D)?c.dataType=olympe.dc.ea(this.D):(c.root=olympe.dc.ea(this.D),c.dataType=this.j.Te);this.ma.forEach((d,e)=>{const f=d.T(),g=d.Wc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Ld!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ma.Hh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ma.Ce&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
740
- 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.ld)?a.ld:olympe.dc.la.nc.Bk;let c;return olympe.dc.query.ll().executeQuery(yi(this),b,{ii:null!=(c=null==a?void 0:a.bl)?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:ji(d))?e:olympe.dc.Ja.empty()})}Cc(){return ji(Ai(olympe.dc.query.ll(),yi(this)))}observe(a,b){const c=(null==b?0:b.ld)?b.ld:olympe.dc.la.nc.vf;a='function'===typeof a.Bb?a.Bb():
741
- a;let d;return Bi(olympe.dc.query.ll(),yi(this),a,olympe.dc.Ha.SELF,c,{ii:null!=(d=null==b?void 0:b.bl)?d:null==b?void 0:b.cacheId,Ac:null==b?void 0:b.Ac,rj:null==b?void 0:b.rj}).pipe(rxjs.operators.map(e=>ji(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.U.tb(this.D+ii(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Ld+this.j.max+this.j.offset));return this.id}ib(){return this.source}fa(){let a;return{b:this.D,p:this.ma.map(b=>b.fa()),
742
- r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Ld,rm:null!=(a=this.j.Te)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ia(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.ma.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Cc;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.nb;
743
- olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.wl;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Hj;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.sj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.me;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.ug;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
744
- olympe.dc.la.followRule=olympe.dc.la.Ob;olympe.dc.la.instancesOf=olympe.dc.la.ol;olympe.dc.la.fromTag=olympe.dc.la.Qe;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.nc={vf:1,Bk:2,Qg:3};olympe.dc.la.j={Ll:'cacheBucketName',eq:'isCacheable'};function Ci(a){null===a.Fa&&null===a.j&&(a.Fa=Wf(a.F))}
745
- olympe.dc.query.Dd=class extends olympe.dc.Hg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.He}static xj(a){const b=new olympe.dc.query.Dd(`DataResult_${a.T()}`);b.D=a.ib();return b}static j(a){const b=new olympe.dc.query.Dd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.cl=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){Ci(this);return super.qc(a)}ac(){Ci(this);return super.ac()}il(){Ci(this);return super.il()}create(a,b,c){this.F.Qc(a,this.D,c,b);return this}Oa(a,
746
- b,c){this.F.Oa(a,b,c,null,null);return this}fa(){return super.fa()}};olympe.dc.query.Dd.prototype.createRelation=olympe.dc.query.Dd.prototype.Oa;olympe.dc.query.Dd.prototype.create=olympe.dc.query.Dd.prototype.create;olympe.dc.query.Dd.fromQuery=olympe.dc.query.Dd.xj;function Ai(a,b){const c=new olympe.dc.query.cr(a.G,b);if(a.D.view.Ia(b.D)){oi(c,b.D);for(const d of ii(b))d.nb(c)}return c}
747
- function Bi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.ib();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.Ha.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.kr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Di(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.ii)&&Ei(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=>
748
- {const n=()=>{p&&c.it(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ha.SELF&&(t.Z--,0===t.Z&&ri(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),v.destroy())}},p=c.Xd(n),q=Fi(h,d,l);return n})}
749
- function Gi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||Hi(c)});a.F.clear()}function Ii(a,b,c,d){return u(function*(){const e=null!=d?d:c===olympe.dc.la.nc.Qg;if(b instanceof ReadableStream)yield Qg(a.D,b,{nn:e});else{var f;if(f=b instanceof olympe.dc.Hg)f=b.T(),f=!a.N.H.has(f);f&&a.D.md(b,{nn:e})}})}function Ji(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Jg,olympe.dc.Ha.SERVER);return a.Jb.request(b).then(c=>{a.D.md(c)})}
750
- function Ki(a,b){const c=b.ib();if(c===olympe.dc.Ha.SELF||a.H&&c===olympe.dc.Ha.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Pc(b)).map(d=>new Promise(e=>d.jd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Ei(a,b,c,d){return u(function*(){var e=b.ib();e=Rf(Rf(new olympe.dc.Request(olympe.dc.Request.j.Sg,e,b),olympe.dc.la.j.eq,c===olympe.dc.la.nc.Qg),olympe.dc.la.j.Ll,null==d?void 0:d.ii);return a.Jb.request(e)})}
751
- function Li(a,b,c){const d=[];for(const e of a.j.values())Mi(e,b,c)&&d.push(Ei(a,e.query,olympe.dc.la.nc.Bk,{}).then(f=>Ii(a,f,olympe.dc.la.nc.Bk)));return Promise.all(d).then(()=>{})}
752
- olympe.dc.query.$v=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Rg(b,()=>Gi(this));Uf(d,olympe.dc.Request.j.bk,f=>{Ii(this,f.content,olympe.dc.la.nc.vf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Ac?c.Ac:yield Ki(d,a);if(!e||(null==c?0:c.ii))try{const f=yield Ei(d,a,b,c);e||(yield Ii(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.ib()}: ${f}`),
753
- null}return Ai(d,a)})}R(a,b,c,d,e,f){const g=c.ib();if(g===olympe.dc.Ha.SELF||b.Ac||this.H&&g===olympe.dc.Ha.SERVER)return e(),null;if(a!==olympe.dc.la.nc.vf)return Ei(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Ii(this,t,a,b.rj)}).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`);Ei(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.`),
754
- Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ii(this,v,a,b.rj).then(()=>{h.forEach(x=>Ii(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Rf(new olympe.dc.Request(olympe.dc.Request.j.Fk,g,c),olympe.dc.la.j.Ll,null==b?void 0:b.ii),q=this.Jb.subscribe(p,l.bind(this,!0)).pipe(sb(olympe.error.Mp,()=>{},0)).pipe(sb(olympe.error.Go,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
755
- l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ii(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Ni(a){const b=olympe.dc.ga();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.ha.Xa('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ja.create(d,a.a,a.r)}
756
- olympe.dc.Ja=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ja}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Ue(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Ue().includes(a)}indexOf(a){return null===
757
- a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ue().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Hc(){return this.pe(0)}pe(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ue();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ue();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ue();a.shift();return a}return[]}filter(a){return this.Ue().filter(a)}find(a){return(a=this.Ue().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
758
- a(this.D.get(b),c))}map(a){return this.Ue().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ja.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Ue().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ja.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ue()}yj(){return this.F.map(a=>
759
- this.D.get(this.j[a]))}Ej(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Gb:c,Ld:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ga(),q=c.Wi===olympe.dc.query.Ak.ASC?1:-1,r=c.jh(),t=c.Qa();b.sort((v,x)=>{x=x[d];v=p.Qa(v[d],t);x=p.Qa(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.mb.Bc(v),olympe.dc.mb.Bc(x))})}else b.sort((p,q)=>p.reduce((r,t,v)=>r||t.localeCompare(q[v]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.U.tb(b.flat().join(''));
760
- 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.Ja.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ja;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.U.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}fa(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
761
- return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ja.prototype.getRemoved=olympe.dc.Ja.prototype.Ej;olympe.dc.Ja.prototype.getAdded=olympe.dc.Ja.prototype.yj;olympe.dc.Ja.prototype.concat=olympe.dc.Ja.prototype.concat;olympe.dc.Ja.prototype.reduce=olympe.dc.Ja.prototype.reduce;olympe.dc.Ja.prototype.sort=olympe.dc.Ja.prototype.sort;olympe.dc.Ja.prototype.map=olympe.dc.Ja.prototype.map;olympe.dc.Ja.prototype.forEach=olympe.dc.Ja.prototype.forEach;olympe.dc.Ja.prototype.find=olympe.dc.Ja.prototype.find;
762
- olympe.dc.Ja.prototype.filter=olympe.dc.Ja.prototype.filter;olympe.dc.Ja.prototype.shift=olympe.dc.Ja.prototype.shift;olympe.dc.Ja.prototype.pop=olympe.dc.Ja.prototype.pop;olympe.dc.Ja.prototype.push=olympe.dc.Ja.prototype.push;olympe.dc.Ja.prototype.getAt=olympe.dc.Ja.prototype.pe;olympe.dc.Ja.prototype.getFirst=olympe.dc.Ja.prototype.Hc;olympe.dc.Ja.prototype.get=olympe.dc.Ja.prototype.get;olympe.dc.Ja.prototype.indexOf=olympe.dc.Ja.prototype.indexOf;olympe.dc.Ja.prototype.has=olympe.dc.Ja.prototype.has;
763
- olympe.dc.Ja.prototype.size=olympe.dc.Ja.prototype.size;olympe.dc.Ja.prototype.toArray=olympe.dc.Ja.prototype.Ue;olympe.dc.Ja.prototype.keys=olympe.dc.Ja.prototype.keys;olympe.dc.Ja.prototype.values=olympe.dc.Ja.prototype.values;olympe.dc.Ja.prototype.entries=olympe.dc.Ja.prototype.entries;olympe.dc.Ja.empty=olympe.dc.Ja.empty;function Oi(a){return 1<a.size()?(olympe.ha.Xa('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Hc()||null}olympe.dc.rd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.rd(olympe.dc.la.from(a))}bb(a){return new olympe.dc.rd(this.query.bb(a))}sj(){return this}nb(a){return this.query.nb(a).then(b=>Oi(b))}Cc(){return Oi(this.query.Cc())}};olympe.dc.rd.prototype.executeFromCache=olympe.dc.rd.prototype.Cc;
764
- olympe.dc.rd.prototype.execute=olympe.dc.rd.prototype.nb;olympe.dc.rd.prototype.cast=olympe.dc.rd.prototype.sj;olympe.dc.rd.prototype.follow=olympe.dc.rd.prototype.bb;const Pi=olympe.dc.ua.ORIGIN,Qi=olympe.dc.ua.DESTINATION;function Di(a,b){ki(a.j,()=>{a.fb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ha.SELF?a.jd(e=>e?c.error(e):c.next(a.j)):(a.Z++,1===a.Z&&a.jd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
765
- function Mi(a,b,c){if(a.query.ib()!==b)return!1;c.qc(a.ia);(b=a.ia.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Hi(a){si(a.j);a.H.forEach(b=>{b.next(a.j)})}
766
- function Ri(a,b,c){const d=[];let e=!1;const f=new olympe.async.Ck(olympe.C.kh());for(const g of b)if(g.Pc(a.query)&&(e||(e=!0),f.add(h=>g.jd(k=>{!k&&d.push(g);h()}))),null!==g.D&&zi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}td(f,g=>c(g?d:[]));f.start();return e}
767
- function Si(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,v,x,y)=>r.forEach(z=>z(t,v,x,y)):()=>{}},e=ii(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 v;c.set(t,(null!=(v=c.get(t))?v:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.U.tb(k),n=Nf(h,k,(q,r)=>{q?oi(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.X)||p.push(()=>{Lf(h,k,n)});Ti(a)}
768
- function Ui(a){const b=a.Ga(a.query,a.Wa.bind(a),()=>{null===a.D||a.fb()||Si(a)},d=>{a.fb()||(a.G.error(`Error while getting data from data source (${a.query.ib()}) to ensure coverage of the query ${a.query.T()}: ${d}`),Ti(a))});let c;b&&(null==(c=a.X)||c.push(b))}function Vi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.fb()&&Ui(a)}))}function Ti(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
769
- olympe.dc.query.kr=class{constructor(a,b,c,d,e){this.G=a;this.sa=b;this.db=b.view;this.query=c;this.ld=d;this.j=new olympe.dc.query.cr(this.G,c);this.Z=0;this.da=1;this.X=[];this.H=new Map;this.D=[()=>si(this.j)];this.Ga=e;this.ia=new Wi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return Ri(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)}),Si(this)):Ui(this)})}Pc(a){return!this.fb()&&this.query.ib()===a.ib()&&(this.query.T()===a.T()||
770
- (null===this.D||this.query.D===a.D)&&this.j.Pc(a))}jd(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.X;this.X=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Vi(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())}fb(){return null===this.X}Wa(){const a=
771
- olympe.dc.la.nc.Qg;if(this.ld===a)return olympe.U.stream.tap(c=>{c=c.il().filter(e=>e.o===olympe.dc.Mc.j).map(e=>e.t);this.sa.ne(c,'Batch mode');const d=ii(this.query)[0];d instanceof olympe.dc.query.ma.hm&&c.forEach(e=>oi(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.ld===a).map(e=>new Promise(f=>e.jd(f))),d=this.R.filter(e=>e.ld!==a).map(e=>new Promise(f=>e.jd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
740
+ filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.vi(this.D)?c.dataType=olympe.dc.ea(this.D):(c.root=olympe.dc.ea(this.D),c.dataType=this.j.Te);this.ma.forEach((d,e)=>{const f=d.T(),g=d.Mc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Ld!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ma.Hh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ma.Ce&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
741
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}lb(a){const b=(null==a?0:a.ld)?a.ld:olympe.dc.la.nc.Ck;let c;return olympe.dc.query.ml().executeQuery(yi(this),b,{ii:null!=(c=null==a?void 0:a.cl)?c:null==a?void 0:a.cacheId,Bc:null==a?void 0:a.Bc}).then(d=>{let e;return null!=(e=null==d?void 0:ji(d))?e:olympe.dc.Ka.empty()})}Cc(){return ji(Ai(olympe.dc.query.ml(),yi(this)))}observe(a,b){const c=(null==b?0:b.ld)?b.ld:olympe.dc.la.nc.vf;a='function'===typeof a.Cb?a.Cb():
742
+ a;let d;return Bi(olympe.dc.query.ml(),yi(this),a,olympe.dc.Ia.SELF,c,{ii:null!=(d=null==b?void 0:b.cl)?d:null==b?void 0:b.cacheId,Bc:null==b?void 0:b.Bc,rj:null==b?void 0:b.rj}).pipe(rxjs.operators.map(e=>ji(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.U.rb(this.D+ii(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Ld+this.j.max+this.j.offset));return this.id}jb(){return this.source}fa(){let a;return{b:this.D,p:this.ma.map(b=>b.fa()),
743
+ r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Ld,rm:null!=(a=this.j.Te)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ja(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.ma.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Cc;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.lb;
744
+ olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.xl;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Hj;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.sj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.me;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.ug;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
745
+ olympe.dc.la.followRule=olympe.dc.la.Ob;olympe.dc.la.instancesOf=olympe.dc.la.pl;olympe.dc.la.fromTag=olympe.dc.la.Qe;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.nc={vf:1,Ck:2,Qg:3};olympe.dc.la.j={Ml:'cacheBucketName',gq:'isCacheable'};function Ci(a){null===a.Ga&&null===a.j&&(a.Ga=Wf(a.F))}
746
+ olympe.dc.query.Dd=class extends olympe.dc.Hg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.He}static xj(a){const b=new olympe.dc.query.Dd(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Dd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.dl=null!=(d=a.t)?d:null;let e;b.Ga=null!=(e=a.p)?e:[];return b}qc(a){Ci(this);return super.qc(a)}ac(){Ci(this);return super.ac()}jl(){Ci(this);return super.jl()}create(a,b,c){this.F.Rc(a,this.D,c,b);return this}Oa(a,
747
+ b,c){this.F.Oa(a,b,c,null,null);return this}fa(){return super.fa()}};olympe.dc.query.Dd.prototype.createRelation=olympe.dc.query.Dd.prototype.Oa;olympe.dc.query.Dd.prototype.create=olympe.dc.query.Dd.prototype.create;olympe.dc.query.Dd.fromQuery=olympe.dc.query.Dd.xj;function Ai(a,b){const c=new olympe.dc.query.fr(a.G,b);if(a.D.view.Ja(b.D)){oi(c,b.D);for(const d of ii(b))d.lb(c)}return c}
748
+ function Bi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.jb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Bc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.nr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Di(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.ii)&&Ei(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=>
749
+ {const n=()=>{p&&c.mt(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ia.SELF&&(t.Z--,0===t.Z&&ri(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),v.destroy())}},p=c.Xd(n),q=Fi(h,d,l);return n})}
750
+ function Gi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||Hi(c)});a.F.clear()}function Ii(a,b,c,d){return u(function*(){const e=null!=d?d:c===olympe.dc.la.nc.Qg;if(b instanceof ReadableStream)yield Qg(a.D,b,{pn:e});else{var f;if(f=b instanceof olympe.dc.Hg)f=b.T(),f=!a.N.H.has(f);f&&a.D.md(b,{pn:e})}})}function Ji(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Jg,olympe.dc.Ia.SERVER);return a.Jb.request(b).then(c=>{a.D.md(c)})}
751
+ function Ki(a,b){const c=b.jb();if(c===olympe.dc.Ia.SELF||a.H&&c===olympe.dc.Ia.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Hc(b)).map(d=>new Promise(e=>d.jd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Ei(a,b,c,d){return u(function*(){var e=b.jb();e=Rf(Rf(new olympe.dc.Request(olympe.dc.Request.j.Sg,e,b),olympe.dc.la.j.gq,c===olympe.dc.la.nc.Qg),olympe.dc.la.j.Ml,null==d?void 0:d.ii);return a.Jb.request(e)})}
752
+ function Li(a,b,c){const d=[];for(const e of a.j.values())Mi(e,b,c)&&d.push(Ei(a,e.query,olympe.dc.la.nc.Ck,{}).then(f=>Ii(a,f,olympe.dc.la.nc.Ck)));return Promise.all(d).then(()=>{})}
753
+ olympe.dc.query.dw=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Rg(b,()=>Gi(this));Uf(d,olympe.dc.Request.j.ck,f=>{Ii(this,f.content,olympe.dc.la.nc.vf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Bc?c.Bc:yield Ki(d,a);if(!e||(null==c?0:c.ii))try{const f=yield Ei(d,a,b,c);e||(yield Ii(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.jb()}: ${f}`),
754
+ null}return Ai(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ia.SELF||b.Bc||this.H&&g===olympe.dc.Ia.SERVER)return e(),null;if(a!==olympe.dc.la.nc.vf)return Ei(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Ii(this,t,a,b.rj)}).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`);Ei(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.`),
755
+ Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ii(this,v,a,b.rj).then(()=>{h.forEach(x=>Ii(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Rf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.la.j.Ml,null==b?void 0:b.ii),q=this.Jb.subscribe(p,l.bind(this,!0)).pipe(sb(olympe.error.Np,()=>{},0)).pipe(sb(olympe.error.Ho,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
756
+ l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ii(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Ni(a){const b=olympe.dc.ga();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ha.Xa('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ka.create(d,a.a,a.r)}
757
+ olympe.dc.Ka=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ka}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Ue(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Ue().includes(a)}indexOf(a){return null===
758
+ a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ue().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Ic(){return this.pe(0)}pe(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ue();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ue();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ue();a.shift();return a}return[]}filter(a){return this.Ue().filter(a)}find(a){return(a=this.Ue().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
759
+ a(this.D.get(b),c))}map(a){return this.Ue().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Ue().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ka.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ue()}yj(){return this.F.map(a=>
760
+ this.D.get(this.j[a]))}Ej(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Gb:c,Ld:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ga(),q=c.Wi===olympe.dc.query.Bk.ASC?1:-1,r=c.jh(),t=c.Pa();b.sort((v,x)=>{x=x[d];v=p.Pa(v[d],t);x=p.Pa(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.ib.tc(v),olympe.dc.ib.tc(x))})}else b.sort((p,q)=>p.reduce((r,t,v)=>r||t.localeCompare(q[v]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.U.rb(b.flat().join(''));
761
+ 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.Ka.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.U.rb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}fa(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
762
+ return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc.Ka.prototype.Ej;olympe.dc.Ka.prototype.getAdded=olympe.dc.Ka.prototype.yj;olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;olympe.dc.Ka.prototype.map=olympe.dc.Ka.prototype.map;olympe.dc.Ka.prototype.forEach=olympe.dc.Ka.prototype.forEach;olympe.dc.Ka.prototype.find=olympe.dc.Ka.prototype.find;
763
+ olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.pe;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Ic;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
764
+ olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ue;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Oi(a){return 1<a.size()?(olympe.ha.Xa('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Ic()||null}olympe.dc.rd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.rd(olympe.dc.la.from(a))}bb(a){return new olympe.dc.rd(this.query.bb(a))}sj(){return this}lb(a){return this.query.lb(a).then(b=>Oi(b))}Cc(){return Oi(this.query.Cc())}};olympe.dc.rd.prototype.executeFromCache=olympe.dc.rd.prototype.Cc;
765
+ olympe.dc.rd.prototype.execute=olympe.dc.rd.prototype.lb;olympe.dc.rd.prototype.cast=olympe.dc.rd.prototype.sj;olympe.dc.rd.prototype.follow=olympe.dc.rd.prototype.bb;const Pi=olympe.dc.ua.ORIGIN,Qi=olympe.dc.ua.DESTINATION;function Di(a,b){ki(a.j,()=>{a.fb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.jd(e=>e?c.error(e):c.next(a.j)):(a.Z++,1===a.Z&&a.jd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
766
+ function Mi(a,b,c){if(a.query.jb()!==b)return!1;c.qc(a.ia);(b=a.ia.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Hi(a){si(a.j);a.H.forEach(b=>{b.next(a.j)})}
767
+ function Ri(a,b,c){const d=[];let e=!1;const f=new olympe.async.Dk(olympe.C.kh());for(const g of b)if(g.Hc(a.query)&&(e||(e=!0),f.add(h=>g.jd(k=>{!k&&d.push(g);h()}))),null!==g.D&&zi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}td(f,g=>c(g?d:[]));f.start();return e}
768
+ function Si(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,v,x,y)=>r.forEach(z=>z(t,v,x,y)):()=>{}},e=ii(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 v;c.set(t,(null!=(v=c.get(t))?v:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.U.rb(k),n=Nf(h,k,(q,r)=>{q?oi(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.X)||p.push(()=>{Lf(h,k,n)});Ti(a)}
769
+ function Ui(a){const b=a.Ha(a.query,a.Wa.bind(a),()=>{null===a.D||a.fb()||Si(a)},d=>{a.fb()||(a.G.error(`Error while getting data from data source (${a.query.jb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),Ti(a))});let c;b&&(null==(c=a.X)||c.push(b))}function Vi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.fb()&&Ui(a)}))}function Ti(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
770
+ olympe.dc.query.nr=class{constructor(a,b,c,d,e){this.G=a;this.sa=b;this.db=b.view;this.query=c;this.ld=d;this.j=new olympe.dc.query.fr(this.G,c);this.Z=0;this.da=1;this.X=[];this.H=new Map;this.D=[()=>si(this.j)];this.Ha=e;this.ia=new Wi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return Ri(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)}),Si(this)):Ui(this)})}Hc(a){return!this.fb()&&this.query.jb()===a.jb()&&(this.query.T()===a.T()||
771
+ (null===this.D||this.query.D===a.D)&&this.j.Hc(a))}jd(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.X;this.X=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Vi(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())}fb(){return null===this.X}Wa(){const a=
772
+ olympe.dc.la.nc.Qg;if(this.ld===a)return olympe.U.stream.tap(c=>{c=c.jl().filter(e=>e.o===olympe.dc.Oc.j).map(e=>e.t);this.sa.ne(c,'Batch mode');const d=ii(this.query)[0];d instanceof olympe.dc.query.ma.im&&c.forEach(e=>oi(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.ld===a).map(e=>new Promise(f=>e.jd(f))),d=this.R.filter(e=>e.ld!==a).map(e=>new Promise(f=>e.jd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
772
773
  function Xi(a,b){return a.F.has(Qi+b)||a.F.has(Pi+b)}
773
- class Wi{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 ii(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.ma.Wh){a=f.relation;a=`${a.Ka()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Yi(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}Qc(){}Xc(a,b){if(!(this.j||
774
- !this.N&&this.db.Ia(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&ni(this.H,a,e)))}}D(a){this.j||this.db.Ia(a)&&!this.N||this.j||(this.j=this.R.some(b=>ni(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Xi(this,a)){var d=this.db.Ia(b),e=this.db.Ia(c);if(d&&!e||!d&&e){const f=this.F.get(Qi+a);a=this.F.get(Pi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>ni(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>ni(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Xi(this,a)&&this.db.bt(b,
775
- new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(Qi+a);a=this.F.get(Pi+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>ni(e,b,f.j)&&ni(e,c,f.T())))||(null==a?void 0:a.some(f=>ni(e,c,f.j)&&ni(e,b,f.T()))))}}}olympe.dc.query.kr.ya=[olympe.dc.Writable];function Zi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
776
- 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.W())+', ';a+='"direction": '+JSON.stringify(this.Ka())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(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.W(),a.Ka(),null!=b?b:a instanceof olympe.dc.aa.Ke)}$b(){const a=
777
- 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',Ek:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Da],b=>b.ad('query'));C(a,olympe.dc.query.P.Ek,olympe.dc.query.$v,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ug,new olympe.V.oa(olympe.dc.Config.Yh))});olympe.V.run([olympe.dc.query.P.Ek],a=>{olympe.dc.query.ll=()=>a});olympe.dc.query.Cd=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Nd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}zd(){return new olympe.dc.query.Y.Fe(...this.Y.map(a=>a.zd()))}Cb(){return this.Y.flatMap(a=>a.Cb())}Pc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Y.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
778
- Array(this.Y.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.Y.forEach((g,h)=>{g.observe(a,olympe.U.tb('AND-'+b+a+h),f.bind(null,h))})}fa(){return{pr:olympe.dc.query.Aa.j.fo,p:this.Y.map(a=>a.fa())}}Wc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.tb('AND-'+b+a+d))})}};olympe.dc.query.Y.xf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.ea(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.La]}Pc(a,b){return a instanceof olympe.dc.query.Y.xf&&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,
779
- this.La))}observe(a,b,c){fh(this.db,a,this.La,d=>{c(this.apply(d))},olympe.U.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){gh(this.db,a,this.La,olympe.U.tb(b+a+this.toString()))}Wc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}fa(){return{pr:olympe.dc.query.Aa.j.Yj,
780
- p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Y.Be=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.ea(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Cb(){return[this.La]}Pc(a){if(a instanceof olympe.dc.query.Y.Be&&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===
781
- a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){fh(this.db,a,this.La,d=>{c(this.apply(d))},olympe.U.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){gh(this.db,a,this.La,olympe.U.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===
782
- 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}Wc(){return{name:'EQUALS',property:this.La,value:this.j}}fa(){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.W();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.np,p:this.La,t:a,v:b}}};function $i(a,b,c){return olympe.U.tb(c+b+a.j+a.La)}
783
- olympe.dc.query.Y.Ti=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ea(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ea(c):c;this.D=d;this.H=e}zd(){return new olympe.dc.query.Y.Ti(this.db,this.La,this.j,!this.D,!this.H)}Cb(){return[this.La]}Pc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Ti&&this.La===a.La?
784
- 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&&fh(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},$i(this,a,b));fh(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)},$i(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
785
- this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){gh(this.db,a,this.La,$i(this,a,b));this.F&&gh(this.db,a,this.j,$i(this,a,b))}Wc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}fa(){return{pr:olympe.dc.query.Aa.j.Xp,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.Y.ie=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.zd();return this.Ea(a)?super.compile():a.compile()}zd(){return this.j}Cb(){return this.j.Cb()}Pc(a,b){return a instanceof olympe.dc.query.Y.ie?this.j.Pc(a.j,b):this.j.Pc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.U.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Wc(){return{name:'NOT',predicate:this.j.Wc()}}fa(){return{pr:olympe.dc.query.Aa.j.zq,v:this.j.fa()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
786
- b){this.j.clear(a,olympe.U.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Y.ie?this.j.Ea(a.j):!1}};olympe.dc.query.Y.Fe=class extends olympe.dc.query.Aa{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}zd(){return new olympe.dc.query.Y.Nd(...this.Y.map(a=>a.zd()))}Cb(){return this.Y.flatMap(a=>a.Cb())}Pc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Y.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
787
- k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.tb('OR-'+b+a+h),f.bind(null,h))})}Wc(){throw Error('toObject for OR predicate should not be called');}fa(){return{pr:olympe.dc.query.Aa.j.Rq,p:this.Y.map(a=>a.fa())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.tb('OR-'+b+a+d))})}};olympe.dc.query.Y.Gf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.ea(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]}Pc(a){return a instanceof olympe.dc.query.Y.Gf&&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){fh(this.db,a,this.La,d=>{c(this.apply(d))},olympe.U.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
788
- 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}Wc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}fa(){return{pr:olympe.dc.query.Aa.j.mr,p:this.La,r:this.j.source,c:this.D}}clear(a,b){gh(this.db,a,this.La,olympe.U.tb(b+a+this.toString()))}};olympe.dc.query.Y.an=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.ea))}Cb(){return[]}Pc(a){return a instanceof olympe.dc.query.Y.an&&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)}Wc(){return{name:'IS',tags:Array.from(this.j)}}fa(){return{pr:olympe.dc.query.Aa.j.Vr,t:Array.from(this.j)}}};olympe.dc.query.ma={};function Yi(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Cb())?c:[]);let e;a.Gb&&d.add(null==(e=a.Gb)?void 0:e.Qa().W());return d}function aj(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function bj(a,b){for(const c of b)if(a.some(d=>d.Pc(c,!1)))return!0;return!1}
789
- function cj(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.U.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 dj(a,b,c){if(null===a.Gb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Gb.Qa();h=olympe.U.tb(h+d);e?fh(a.db,f,k,()=>{li(b)},h):gh(a.db,f,k,h);c(e,f,g,h)}}
790
- olympe.dc.query.ma.Om=class{constructor(a,b){this.db=olympe.dc.ga();this.j=a;this.optional=b;this.da=this.Gb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ma.Od(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.ma.Ce(b,d,a.s,c):new olympe.dc.query.ma.Hh(b,d,c);void 0!==a.p&&(b.D=ui(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.wf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Gb=a);return b}N(){}H(){let a,
791
- b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Gb)?void 0:b.toString())?d:''}`}Wc(){}toJSON(){}fa(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.fa());null!==this.Gb&&(a.c=this.Gb.fa());return a}X(){}ia(){return new olympe.dc.query.ma.Ym}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Pc(a){const b=aj(this);if(0===b.length)return!0;a=aj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
792
- bj(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Y.Nd?new olympe.dc.query.Y.Nd(...Array.from(c.Y),a):new olympe.dc.query.Y.Nd(b.D,a);return b}sort(a,b){const c=this.N();c.Gb=new olympe.dc.query.wf(this.T(),a,b);return c}jh(){return this.Gb}nb(a){if(null!==this.D){var b=this.T();for(const c of mi(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return cj(this,dj(this,a,(d,e,f,g)=>{(d?oi(a,e,c,f):a.remove(e,c,f))&&b(d,e,
793
- f,g)}))}Ea(){}};olympe.dc.query.ma.Wh=class extends olympe.dc.query.ma.Om{constructor(a,b,c){super(a,c);this.relation=b;this.sa=null}};olympe.dc.query.ma.Pm=class{has(){}H(){}j(){}Tc(){}D(){}remove(){}};olympe.dc.query.ma.Od=class extends olympe.dc.query.ma.Om{constructor(a,b,c){super(a,!1);this.Ob=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.ma.Od(this.j,this.Ob,this.F)}X(){return olympe.U.tb(this.j+'followRules')}ia(){return new olympe.dc.query.ma.fq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.ma.Od?[a]:[olympe.U.tb(a+'followRules')]}Pc(a){if(a instanceof olympe.dc.query.ma.Wh){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.fc.Zc,e=olympe.dc.fc.Li,f=
794
- olympe.dm.Relation.j.ur,g=olympe.dm.Relation.j.$r;a=a.relation;const h=a.Ka(),k=a.W();return h!==c||k!==d&&k!==e?!!(oh(this.db,a,this.Ob)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.ma.Od?this.Ob===a.Ob:!1}nb(a){const b=this.T();for(const c of mi(a,this.j))for(const d of kg(this.db,c,this.Ob))oi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?ph(this.db,g,this.Ob,(l,n,p,q,r)=>{p&&(p=q?oi(a,r,c,g):a.remove(r,c,g),null!==n&&pi(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
795
- qh(this.db,g,this.Ob,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?oi(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.tb(h+f+this.toString()))}}fa(){return Object.assign(super.fa(),{f:this.Ob})}H(){return`followRulePart-${this.Ob}-${super.H()}`}Wc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Ea(a){return a instanceof olympe.dc.query.ma.Od&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
796
- rule:`${this.db.name(this.Ob)} (${this.Ob})`}}R(){return!1}filter(){olympe.ha.Xa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Xa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ma.Od.D='followRules';olympe.dc.query.ma.Hh=class extends olympe.dc.query.ma.Wh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.ma.Hh(this.j,this.relation,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.tb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T(),a+Zi(this.relation).T()+!1,a+Zi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.tb(d));b instanceof olympe.dc.query.ma.Ce&&b.relation.Ea(this.relation)&&
797
- c.push(a);return c}nb(a){const b=this.T();for(const c of mi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.W(),e=this.relation.Ka(),f=this.toString();return(g,h,k,l)=>{const n=olympe.U.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{pi(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}fa(){return Object.assign(super.fa(),{t:this.relation.W(),d:this.relation.Ka()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Wc(){const a=
798
- {recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Wc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Qa(),order:this.Gb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.ma.Hh&&this.relation.Ea(a.relation)}};olympe.dc.query.ma.Ce=class extends olympe.dc.query.ma.Wh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ia(){return new olympe.dc.query.ma.yr}N(){const a=new olympe.dc.query.ma.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.tb(this.j+this.relation.T()+this.F)}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.U.tb(d));b instanceof olympe.dc.query.ma.Ce&&
799
- b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of mi(a,this.j))this.F&&oi(a,c,b,c),this.db.nh(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.W(),d=this.relation.Ka(),e=(f,g,h,k)=>{const l=olympe.U.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{pi(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
800
- g,olympe.U.tb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Wc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Wc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Qa(),order:this.Gb.Wi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
801
- relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.ma.Ce&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.ma.hm=class extends olympe.dc.query.ma.Od{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?oi(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.ma.fq=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Tc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
802
- b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ia(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.ma.fq.ya=[olympe.dc.query.ma.Pm];olympe.dc.query.ma.yr=class{constructor(){this.content=new Map}Tc(){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!=
803
- (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.ma.yr.ya=[olympe.dc.query.ma.Pm];olympe.dc.query.ma.Ym=class{constructor(){this.content=new Map}Tc(){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);
804
- return b}};olympe.dc.query.ma.Ym.ya=[olympe.dc.query.ma.Pm];olympe.dc.sources={};olympe.dc.sources.ek=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const ej=olympe.net.va.Rd.GET,fj=olympe.net.va.Rd.Sh,gj=olympe.net.va.Rd.Dc,hj=olympe.net.va.Rd.br,ij=olympe.net.va.Headers.Ii,jj=olympe.net.va.Headers.so,kj=olympe.net.va.Tb.Qh,lj=olympe.net.va.Tb.No,mj=olympe.net.va.Tb.jk,nj=olympe.net.va.Tb.gj,oj=olympe.net.va.Tb.Zi;
805
- function pj(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.Config.jm)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.D('_DataSourcesHTTPService',b,[ej,fj,gj,hj],(c,d,e)=>u(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ga().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.pd(`No handler found for datasource ${f} called '${g}'`,oj,'Invalid source id'))}h=c.method;const k=c.Cj();try{var l=
774
+ class Wi{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 ii(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.ma.Wh){a=f.relation;a=`${a.La()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Yi(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}Rc(){}Xc(a,b){if(!(this.j||
775
+ !this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&ni(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>ni(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Xi(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Qi+a);a=this.F.get(Pi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>ni(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>ni(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Xi(this,a)&&this.db.gt(b,
776
+ new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(Qi+a);a=this.F.get(Pi+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>ni(e,b,f.j)&&ni(e,c,f.T())))||(null==a?void 0:a.some(f=>ni(e,c,f.j)&&ni(e,b,f.T()))))}}}olympe.dc.query.nr.ya=[olympe.dc.Writable];function Zi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
777
+ 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.W())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(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.W(),a.La(),null!=b?b:a instanceof olympe.dc.aa.Ke)}$b(){const a=
778
+ 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',Fk:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Fa],b=>b.ad('query'));C(a,olympe.dc.query.P.Fk,olympe.dc.query.dw,olympe.dc.query.P.Ca,olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.Ug,new olympe.V.oa(olympe.dc.Config.Yh))});olympe.V.run([olympe.dc.query.P.Fk],a=>{olympe.dc.query.ml=()=>a});olympe.dc.query.Cd=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Nd=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}zd(){return new olympe.dc.query.Y.Fe(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Hc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b&&c.lb(a),!0)}observe(a,b,c){const d=
779
+ Array(this.Y.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.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('AND-'+b+a+h),f.bind(null,h))})}fa(){return{pr:olympe.dc.query.za.j.ho,p:this.Y.map(a=>a.fa())}}Mc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('AND-'+b+a+d))})}};olympe.dc.query.Y.xf=class extends olympe.dc.query.za{constructor(a,b,c,d=!1){super();this.Da=olympe.dc.ea(a);this.substring=b;this.db=c;this.j=d}zb(){return[this.Da]}Hc(a,b){return a instanceof olympe.dc.query.Y.xf&&a.Da===this.Da?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}Pa(){return this.Da}lb(a){return this.apply(this.db.Pa(a,
780
+ this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Da+'-'+this.substring+'-'+this.j}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}Mc(){return{name:'CONTAINS',property:this.Pa(),value:this.substring,caseSensitive:this.j}}fa(){return{pr:olympe.dc.query.za.j.Zj,
781
+ p:this.Da,s:this.substring,c:this.j}}};olympe.dc.query.Y.Be=class extends olympe.dc.query.za{constructor(a,b,c){super();this.Da=olympe.dc.ea(a);this.j=olympe.dc.ib.tc(null!=b?b:null);this.db=c}zb(){return[this.Da]}Hc(a){if(a instanceof olympe.dc.query.Y.Be&&this.Da===a.Da)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===
782
+ a.j;return!1}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()));null===this.j&&null===this.db.Pa(a,this.Da)&&c(!0)}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(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===
783
+ this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.Da+'-'+c}Mc(){return{name:'EQUALS',property:this.Da,value:this.j}}fa(){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.W();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.za.j.op,p:this.Da,t:a,v:b}}};olympe.dc.query.Y.iq=class extends olympe.dc.query.za{constructor(a,b){var c=olympe.dc.ga();super();this.Da=olympe.dc.ea(a);this.values=b.map(d=>olympe.dc.ib.tc(null!=d?d:null));this.db=c}zb(){return[this.Da]}Hc(){return!1}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}apply(a){const b=olympe.dc.ib.tc(a);return'object'===typeof b&&null!==b?b instanceof
784
+ olympe.dc.CloudObject||b instanceof olympe.C.Color?this.values.some(c=>b.Ea(c)):b instanceof Date?this.values.some(c=>c instanceof Date&&c.getTime()===b.getTime()):!1:this.values.includes(b)}toString(){const a=this.values.map(b=>{let c;return null!=(c=null==b?void 0:b.toString())?c:'null'}).join('');return'In-'+this.Da+'-'+a}Mc(){return{name:'IN',property:this.Da,values:this.values}}fa(){var a,b=null!=(a=this.values[0])?a:null;a=b instanceof olympe.C.Color?4:b instanceof olympe.dc.CloudObject?3:b instanceof
785
+ Date?2:1;b=4===a||2===a?this.values.map(c=>c.toJSON()):3===a?this.values.map(c=>c.W()):this.values;return{pr:olympe.dc.query.za.j.Yp,p:this.Da,t:a,v:b}}};function $i(a,b,c){return olympe.U.rb(c+b+a.j+a.Da)}
786
+ olympe.dc.query.Y.Ti=class extends olympe.dc.query.za{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Da=olympe.dc.ea(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ea(c):c;this.D=d;this.H=e}zd(){return new olympe.dc.query.Y.Ti(this.db,this.Da,this.j,!this.D,!this.H)}zb(){return[this.Da]}Hc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Ti&&this.Da===a.Da?
787
+ 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}Pa(){return this.Da}lb(a){return this.compare(this.db.Pa(a,this.Da),this.F?this.db.Pa(a,this.j):this.j)}observe(a,b,c){this.F&&fh(this.db,a,this.j,d=>{const e=this.db.Pa(a,this.Da);null!==e&&c(this.compare(e,d))},$i(this,a,b));fh(this.db,a,this.Da,d=>{const e=this.F?this.db.Pa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},$i(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
788
+ this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){gh(this.db,a,this.Da,$i(this,a,b));this.F&&gh(this.db,a,this.j,$i(this,a,b))}Mc(){return{name:'INEQUALITY_OPERATOR',property:this.Pa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}fa(){return{pr:olympe.dc.query.za.j.Zp,p:this.Da,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.Da+'-'+this.H+'-'+this.j}};olympe.dc.query.Y.ie=class extends olympe.dc.query.za{constructor(a){super();this.j=a}compile(){const a=this.j.zd();return this.Ea(a)?super.compile():a.compile()}zd(){return this.j}zb(){return this.j.zb()}Hc(a,b){return a instanceof olympe.dc.query.Y.ie?this.j.Hc(a.j,b):this.j.Hc(a,!b)}lb(a){return!this.j.lb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.U.rb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Mc(){return{name:'NOT',predicate:this.j.Mc()}}fa(){return{pr:olympe.dc.query.za.j.Cq,v:this.j.fa()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
789
+ b){this.j.clear(a,olympe.U.rb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Y.ie?this.j.Ea(a.j):!1}};olympe.dc.query.Y.Fe=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}zd(){return new olympe.dc.query.Y.Nd(...this.Y.map(a=>a.zd()))}zb(){return this.Y.flatMap(a=>a.zb())}Hc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}lb(a){return this.Y.reduce((b,c)=>b||c.lb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
790
+ k);e!==g&&(e=g,c(g))};this.Y.forEach((g,h)=>{g.observe(a,olympe.U.rb('OR-'+b+a+h),f.bind(null,h))})}Mc(){throw Error('toObject for OR predicate should not be called');}fa(){return{pr:olympe.dc.query.za.j.Uq,p:this.Y.map(a=>a.fa())}}toString(){return'And-'+this.Y.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.rb('OR-'+b+a+d))})}};olympe.dc.query.Y.Gf=class extends olympe.dc.query.za{constructor(a,b,c,d=!0){super();this.Da=olympe.dc.ea(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}zb(){return[this.Da]}Hc(a){return a instanceof olympe.dc.query.Y.Gf&&this.Da===a.Da&&this.j.toString()===a.j.toString()}lb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){fh(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.rb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.tc(a);
791
+ return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.Da+'-'+this.j.toString()+'-'+this.D}Mc(){return{name:'REGEX',property:this.Da,pattern:this.j,caseSensitive:this.D}}fa(){return{pr:olympe.dc.query.za.j.rr,p:this.Da,r:this.j.source,c:this.D}}clear(a,b){gh(this.db,a,this.Da,olympe.U.rb(b+a+this.toString()))}};olympe.dc.query.Y.bn=class extends olympe.dc.query.za{constructor(a){super();this.j=new Set(a.map(olympe.dc.ea))}zb(){return[]}Hc(a){return a instanceof olympe.dc.query.Y.bn&&Array.from(a.j).every(b=>this.j.has(b))}lb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Mc(){return{name:'IS',tags:Array.from(this.j)}}fa(){return{pr:olympe.dc.query.za.j.Yr,t:Array.from(this.j)}}};olympe.dc.query.ma={};function Yi(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.zb())?c:[]);let e;a.Gb&&d.add(null==(e=a.Gb)?void 0:e.Pa().W());return d}function aj(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function bj(a,b){for(const c of b)if(a.some(d=>d.Hc(c,!1)))return!0;return!1}
792
+ function cj(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.U.rb(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 dj(a,b,c){if(null===a.Gb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Gb.Pa();h=olympe.U.rb(h+d);e?fh(a.db,f,k,()=>{li(b)},h):gh(a.db,f,k,h);c(e,f,g,h)}}
793
+ olympe.dc.query.ma.Pm=class{constructor(a,b){this.db=olympe.dc.ga();this.j=a;this.optional=b;this.da=this.Gb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ma.Od(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.ma.Ce(b,d,a.s,c):new olympe.dc.query.ma.Hh(b,d,c);void 0!==a.p&&(b.D=ui(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.wf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Gb=a);return b}N(){}H(){let a,
794
+ b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Gb)?void 0:b.toString())?d:''}`}Mc(){}toJSON(){}fa(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.fa());null!==this.Gb&&(a.c=this.Gb.fa());return a}X(){}ia(){return new olympe.dc.query.ma.Zm}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Hc(a){const b=aj(this);if(0===b.length)return!0;a=aj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
795
+ bj(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Y.Nd?new olympe.dc.query.Y.Nd(...Array.from(c.Y),a):new olympe.dc.query.Y.Nd(b.D,a);return b}sort(a,b){const c=this.N();c.Gb=new olympe.dc.query.wf(this.T(),a,b);return c}jh(){return this.Gb}lb(a){if(null!==this.D){var b=this.T();for(const c of mi(a,b))this.D.lb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return cj(this,dj(this,a,(d,e,f,g)=>{(d?oi(a,e,c,f):a.remove(e,c,f))&&b(d,e,
796
+ f,g)}))}Ea(){}};olympe.dc.query.ma.Wh=class extends olympe.dc.query.ma.Pm{constructor(a,b,c){super(a,c);this.relation=b;this.sa=null}};olympe.dc.query.ma.Qm=class{has(){}H(){}j(){}Uc(){}D(){}remove(){}};olympe.dc.query.ma.Od=class extends olympe.dc.query.ma.Pm{constructor(a,b,c){super(a,!1);this.Ob=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.ma.Od(this.j,this.Ob,this.F)}X(){return olympe.U.rb(this.j+'followRules')}ia(){return new olympe.dc.query.ma.hq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.ma.Od?[a]:[olympe.U.rb(a+'followRules')]}Hc(a){if(a instanceof olympe.dc.query.ma.Wh){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.fc.Zc,e=olympe.dc.fc.Li,f=
797
+ olympe.dm.Relation.j.xr,g=olympe.dm.Relation.j.ds;a=a.relation;const h=a.La(),k=a.W();return h!==c||k!==d&&k!==e?!!(oh(this.db,a,this.Ob)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.ma.Od?this.Ob===a.Ob:!1}lb(a){const b=this.T();for(const c of mi(a,this.j))for(const d of kg(this.db,c,this.Ob))oi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?ph(this.db,g,this.Ob,(l,n,p,q,r)=>{p&&(p=q?oi(a,r,c,g):a.remove(r,c,g),null!==n&&pi(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
798
+ qh(this.db,g,this.Ob,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?oi(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.rb(h+f+this.toString()))}}fa(){return Object.assign(super.fa(),{f:this.Ob})}H(){return`followRulePart-${this.Ob}-${super.H()}`}Mc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Ea(a){return a instanceof olympe.dc.query.ma.Od&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
799
+ rule:`${this.db.name(this.Ob)} (${this.Ob})`}}R(){return!1}filter(){olympe.ha.Xa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Xa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ma.Od.D='followRules';olympe.dc.query.ma.Hh=class extends olympe.dc.query.ma.Wh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.ma.Hh(this.j,this.relation,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T(),a+Zi(this.relation).T()+!1,a+Zi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.Ce&&b.relation.Ea(this.relation)&&
800
+ c.push(a);return c}lb(a){const b=this.T();for(const c of mi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.lb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.W(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.U.rb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{pi(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}fa(){return Object.assign(super.fa(),{t:this.relation.W(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Mc(){const a=
801
+ {recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Mc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.Hh&&this.relation.Ea(a.relation)}};olympe.dc.query.ma.Ce=class extends olympe.dc.query.ma.Wh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ia(){return new olympe.dc.query.ma.Br}N(){const a=new olympe.dc.query.ma.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Gb=this.Gb;return a}X(){return olympe.U.rb(this.j+this.relation.T()+this.F)}Z(a,b){if(b instanceof olympe.dc.query.ma.Od)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.U.rb(d));b instanceof olympe.dc.query.ma.Ce&&
802
+ b.relation.Ea(this.relation)&&c.push(a);return c}lb(a){const b=this.T();for(const c of mi(a,this.j))this.F&&oi(a,c,b,c),this.db.nh(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.lb(a)}observe(a,b){const c=this.relation.W(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.U.rb(k+g);f?T(this.db,g,this.relation,(n,p)=>{pi(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
803
+ g,olympe.U.rb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Mc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Mc())),optional:this.R()};this.Gb&&(a.sort={property:this.Gb.Pa(),order:this.Gb.Wi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
804
+ relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Ea(a){return a instanceof olympe.dc.query.ma.Ce&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.ma.im=class extends olympe.dc.query.ma.Od{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?oi(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.ma.hq=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Uc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
805
+ b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ja(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.ma.hq.ya=[olympe.dc.query.ma.Qm];olympe.dc.query.ma.Br=class{constructor(){this.content=new Map}Uc(){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!=
806
+ (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.ma.Br.ya=[olympe.dc.query.ma.Qm];olympe.dc.query.ma.Zm=class{constructor(){this.content=new Map}Uc(){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);
807
+ return b}};olympe.dc.query.ma.Zm.ya=[olympe.dc.query.ma.Qm];olympe.dc.sources={};olympe.dc.sources.fk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const ej=olympe.net.va.Rd.GET,fj=olympe.net.va.Rd.Sh,gj=olympe.net.va.Rd.Dc,hj=olympe.net.va.Rd.er,ij=olympe.net.va.Headers.Ii,jj=olympe.net.va.Headers.uo,kj=olympe.net.va.Tb.Qh,lj=olympe.net.va.Tb.Oo,mj=olympe.net.va.Tb.kk,nj=olympe.net.va.Tb.gj,oj=olympe.net.va.Tb.Zi;
808
+ function pj(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.Config.km)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.D('_DataSourcesHTTPService',b,[ej,fj,gj,hj],(c,d,e)=>u(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ga().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.pd(`No handler found for datasource ${f} called '${g}'`,oj,'Invalid source id'))}h=c.method;const k=c.Cj();try{var l=
806
809
  yield qj(a,k[jj])}catch(r){return new olympe.net.pd(`Invalid token ${r}`,mj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Sg,v=olympe.dc.Request.j.df,x=olympe.dc.Request.j.dh,y=olympe.dc.Request.j.yh,z=olympe.dc.Request.j.bg,A=olympe.dc.Request.j.dg,K=olympe.dc.Request.j.ng;let Y;switch(n){case r:break;case t:case v:case y:case x:Y=a.D.N(p);break;case K:case z:case A:Y={tag:e.get('tag'),model:e.get('model'),mimeType:k[ij]};p instanceof
807
- Uint8Array&&(Y.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let ya;const db=null!=(ya=k['X-Source-Origin'])?ya:olympe.dc.Ha.Ze;var q=Qf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let dd;void 0===Qa?dd='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?dd=Qa:dd=JSON.stringify(a.D.fa(Qa));return new olympe.net.pd(dd,h===hj?lj:kj)}catch(r){return r instanceof olympe.error.tk?new olympe.net.pd(`Authorization error: ${r}`,
810
+ Uint8Array&&(Y.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let ya;const db=null!=(ya=k['X-Source-Origin'])?ya:olympe.dc.Ia.Ze;var q=Qf(new olympe.dc.Request(n,f,Y,l),db);const Qa=yield g(q);let dd;void 0===Qa?dd='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?dd=Qa:dd=JSON.stringify(a.D.fa(Qa));return new olympe.net.pd(dd,h===hj?lj:kj)}catch(r){return r instanceof olympe.error.uk?new olympe.net.pd(`Authorization error: ${r}`,
808
811
  mj,'Forbidden'):new olympe.net.pd(`Internal server error: ${r}`,nj,'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 rj(a){a.R.R('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function sj(a,b,c){0===a.F.size&&pj(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&rj(a)}}
809
812
  function tj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Of(c):uj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
810
- function vj(a,b,c){if(b===olympe.dc.Ha.SERVER){var d;return null!=(d=qe(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.ib(b);e=olympe.dc.sources.Config.Ih;const f=olympe.dc.sources.Config.Af,g=olympe.dc.sources.Config.Qi,h=olympe.dc.sources.Config.jm;let k;e=`${tj(a,null!=d?d:b,g)?'https':'http'}://${tj(a,null!=d?d:b,e)}:${null!=(k=tj(a,null!=d?d:b,f))?k:tj(a,null!=d?d:b,g)?443:80}`+`/${tj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
813
+ function vj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=qe(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.jb(b);e=olympe.dc.sources.Config.Ih;const f=olympe.dc.sources.Config.Af,g=olympe.dc.sources.Config.Qi,h=olympe.dc.sources.Config.km;let k;e=`${tj(a,null!=d?d:b,g)?'https':'http'}://${tj(a,null!=d?d:b,e)}:${null!=(k=tj(a,null!=d?d:b,f))?k:tj(a,null!=d?d:b,g)?443:80}`+`/${tj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
811
814
  function wj(a,b){return b instanceof olympe.net.Si?se(a.H,b,ce(a.X).Gd()):Promise.reject('No http request to send')}function xj(a,b){var c=vj(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.fa(d));c=N(c,fj,e,olympe.net.va.ResponseType.JSON);Fc(c,{['X-Source-Origin']:b.origin,[ij]:'application/json'});return wj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.Dd.xj(d))}
812
815
  function yj(a,b){var c=vj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.fa(b.content));c=N(c,fj,d);Fc(c,{['X-Source-Origin']:b.origin,[ij]:'application/json'});return wj(a,c).then(e=>Number.parseInt(e.getData(),10))}function qj(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.X.qh(b,(e,f)=>{e?d(e):c(f)})})}
813
- olympe.dc.sources.vu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Wb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Jg,olympe.L.Xb.Jg],[olympe.dc.Request.j.dg,olympe.L.Xb.hk],[olympe.dc.Request.j.ng,olympe.L.Xb.hk],[olympe.dc.Request.j.bg,olympe.L.Xb.hk],[olympe.dc.Request.j.vo,olympe.L.Xb.uo],[olympe.dc.Request.j.sr,olympe.L.Xb.rr],[olympe.dc.Request.j.Jp,olympe.L.Xb.Ip],
814
- [olympe.dc.Request.j.Sg,olympe.L.Xb.Ho],[olympe.dc.Request.j.dh,olympe.L.Xb.TRANSACTION]])}Ic(a){var b=vj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Hc(N(b,ej),olympe.net.va.ResponseType.JSON);Fc(b,{['X-Source-Origin']:a.origin});return wj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=vj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
815
- const g=N(e===olympe.dc.Ha.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,hj,d);Fc(g,{[ij]:'application/octet-stream'});e!==olympe.dc.Ha.SERVER&&Fc(g,{['X-Source-Origin']:a.origin});return wj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ha.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,gj,b);d!==olympe.dc.Ha.SERVER&&Fc(e,
816
- {['X-Source-Origin']:a.origin});return wj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,li:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ha.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,ej,void 0,olympe.net.va.ResponseType.$h);d!==olympe.dc.Ha.SERVER&&
817
- Fc(e,{['X-Source-Origin']:a.origin});wj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.li(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.cq=class{constructor(a,b){this.G=a;this.Jb=b}};olympe.dc.sources.cq.Tb={ij:0,RC:1,SC:3,lC:4};const zj=olympe.dc.Request.j.oc,Aj=olympe.dc.Request.j.Sg,Bj=olympe.dc.Request.j.Fk,Cj=olympe.dc.Request.j.ng,Dj=olympe.dc.Request.j.dg,Ej=olympe.dc.Request.j.bg,Fj=olympe.dc.Request.j.Fi,Gj=olympe.dc.Request.j.yh,Hj=olympe.dc.Request.j.df,Ij=olympe.dc.Request.j.dh,Jj=olympe.dc.Request.j.bk;
818
- function Kj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.Zh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}function Lj(a,b){return u(function*(){const c=Qf(new olympe.dc.Request(olympe.dc.Request.j.bk,a.T(),b),olympe.dc.Ha.SELF);let d;yield null==(d=a.Jb)?void 0:d.xi(c)})}
816
+ olympe.dc.sources.zu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Wb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Jg,olympe.L.Xb.Jg],[olympe.dc.Request.j.dg,olympe.L.Xb.ik],[olympe.dc.Request.j.ng,olympe.L.Xb.ik],[olympe.dc.Request.j.bg,olympe.L.Xb.ik],[olympe.dc.Request.j.wo,olympe.L.Xb.vo],[olympe.dc.Request.j.vr,olympe.L.Xb.ur],[olympe.dc.Request.j.Kp,olympe.L.Xb.Jp],
817
+ [olympe.dc.Request.j.Sg,olympe.L.Xb.Io],[olympe.dc.Request.j.dh,olympe.L.Xb.TRANSACTION]])}Jc(a){var b=vj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Hc(N(b,ej),olympe.net.va.ResponseType.JSON);Fc(b,{['X-Source-Origin']:a.origin});return wj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=vj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
818
+ const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,hj,d);Fc(g,{[ij]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&Fc(g,{['X-Source-Origin']:a.origin});return wj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,gj,b);d!==olympe.dc.Ia.SERVER&&Fc(e,
819
+ {['X-Source-Origin']:a.origin});return wj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=vj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,li:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,ej,void 0,olympe.net.va.ResponseType.$h);d!==olympe.dc.Ia.SERVER&&
820
+ Fc(e,{['X-Source-Origin']:a.origin});wj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.li(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.fq=class{constructor(a,b){this.G=a;this.Jb=b}};olympe.dc.sources.fq.Tb={ij:0,VC:1,WC:3,pC:4};const zj=olympe.dc.Request.j.oc,Aj=olympe.dc.Request.j.Sg,Bj=olympe.dc.Request.j.Gk,Cj=olympe.dc.Request.j.ng,Dj=olympe.dc.Request.j.dg,Ej=olympe.dc.Request.j.bg,Fj=olympe.dc.Request.j.Fi,Gj=olympe.dc.Request.j.yh,Hj=olympe.dc.Request.j.df,Ij=olympe.dc.Request.j.dh,Jj=olympe.dc.Request.j.ck;
821
+ function Kj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.Zh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}function Lj(a,b){return u(function*(){const c=Qf(new olympe.dc.Request(olympe.dc.Request.j.ck,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Jb)?void 0:d.xi(c)})}
819
822
  function Mj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Nj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.N?rxjs.interval(a.N).pipe(rxjs.operators.switchMap(()=>c)):c}
820
- olympe.dc.sources.rq=class{constructor(a,b){this.G=a;this.j=b;this.Jb=null;this.H=olympe.dc.query.ll();this.F=new olympe.C.Wb('Context of source '+this.T());let c;this.N=null!=(c=b.Of(olympe.dc.sources.Config.Mm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Jb=a;if(this.T()===olympe.dc.Ha.SELF)return this;(new Promise((b,c)=>{let d=!0;Oj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
821
- 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 zj:const d=olympe.dm.DataSource.oc.zb,e=olympe.dm.DataSource.oc.Vh;
822
- return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Aj:return this.j.executeQuery(b);case Fj:const f=b.ac();Kj(this,f);Lj(this,Mf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Hj:case Ij:const g=b.ac();return this.applyTransaction(g,c===Ij).finally(()=>{if(a.origin===olympe.dc.Ha.SELF){var h=g.T();h=Qf(new olympe.dc.Request(olympe.dc.Request.j.ik,olympe.dc.Ha.SELF,{id:h,finalize:olympe.dc.transaction.If.j.$i,
823
- error:null}),this.T());let k;null==(k=this.Jb)||k.cd(h)}});case Gj:return Mj(this,b.ac());case Cj: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 Dj:return this.j.downloadFileContent(b.tag,b.model);case Ej:return this.j.deleteFileContent(b.tag,b.model);case Jj:return c=Qf(new olympe.dc.Request(Jj,olympe.dc.Ha.SELF,b,a.wc()),this.T()),this.Jb.cd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
824
- Bj){const b=a.content;a=a.origin;return a===olympe.dc.Ha.SELF?Nj(this,b):Bi(this.H,b,this.F,a,olympe.dc.la.nc.vf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Se)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Mf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Pj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Li(c.H,c.T(),a);const e=
825
- Mf(a,d);yield Lj(c,e);return d})}};olympe.dc.sources.rq.ya=[olympe.dc.sources.ek];function Pj(a){const b=olympe.dc.sources.kg.j.Ut,c=olympe.dc.sources.kg.j.Pw,d=olympe.dc.sources.kg.j.$t,e=olympe.dc.sources.kg.j.Vt,f=olympe.dc.sources.kg.j.au,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Ub();p.D()?g.push(Qj(b,q,r,p.N()?p.Cb():null)):p.yd()?k.push(Qj(d,q,r,null,p.F())):p.N()&&h.push(Qj(c,q,r,p.Cb()));for(const [t,v,x]of p.Id())p=a.Sc(v),x?l.push(new Rj(e,t,q,v,r,p.Ub())):n.push(new Rj(f,t,q,v,r,p.Ub()))});return n.concat(k,g,h,l)}
823
+ olympe.dc.sources.uq=class{constructor(a,b){this.G=a;this.j=b;this.Jb=null;this.H=olympe.dc.query.ml();this.F=new olympe.C.Wb('Context of source '+this.T());let c;this.N=null!=(c=b.Of(olympe.dc.sources.Config.Nm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Jb=a;if(this.T()===olympe.dc.Ia.SELF)return this;(new Promise((b,c)=>{let d=!0;Oj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
824
+ 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 zj:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Vh;
825
+ return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Aj:return this.j.executeQuery(b);case Fj:const f=b.ac();Kj(this,f);Lj(this,Mf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Hj:case Ij:const g=b.ac();return this.applyTransaction(g,c===Ij).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Qf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.If.j.$i,
826
+ error:null}),this.T());let k;null==(k=this.Jb)||k.cd(h)}});case Gj:return Mj(this,b.ac());case Cj: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 Dj:return this.j.downloadFileContent(b.tag,b.model);case Ej:return this.j.deleteFileContent(b.tag,b.model);case Jj:return c=Qf(new olympe.dc.Request(Jj,olympe.dc.Ia.SELF,b,a.xc()),this.T()),this.Jb.cd(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
827
+ Bj){const b=a.content;a=a.origin;return a===olympe.dc.Ia.SELF?Nj(this,b):Bi(this.H,b,this.F,a,olympe.dc.la.nc.vf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Se)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Mf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Pj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Li(c.H,c.T(),a);const e=
828
+ Mf(a,d);yield Lj(c,e);return d})}};olympe.dc.sources.uq.ya=[olympe.dc.sources.fk];function Pj(a){const b=olympe.dc.sources.kg.j.Yt,c=olympe.dc.sources.kg.j.Tw,d=olympe.dc.sources.kg.j.du,e=olympe.dc.sources.kg.j.Zt,f=olympe.dc.sources.kg.j.eu,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Ub();p.D()?g.push(Qj(b,q,r,p.N()?p.zb():null)):p.yd()?k.push(Qj(d,q,r,null,p.F())):p.N()&&h.push(Qj(c,q,r,p.zb()));for(const [t,v,x]of p.Id())p=a.Tc(v),x?l.push(new Rj(e,t,q,v,r,p.Ub())):n.push(new Rj(f,t,q,v,r,p.Ub()))});return n.concat(k,g,h,l)}
826
829
  function Qj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new Sj(a,b,c,d,e)}olympe.dc.sources.kg=class{constructor(a){this.type=a}};class Sj extends olympe.dc.sources.kg{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}}
827
- class Rj extends olympe.dc.sources.kg{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.kg.j={Ut:'CREATE',Pw:'UPDATE',$t:'DELETE',Vt:'CREATE_RELATION',au:'DELETE_RELATION'};function Tj(a,b){b=Qf(new olympe.dc.Request(olympe.dc.Request.j.ik,olympe.dc.Ha.SELF,{id:b,finalize:olympe.dc.transaction.If.j.$i,error:null}),a.T());let c;null==(c=a.Jb)||c.cd(b)}
828
- olympe.dc.sources.Ql=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Sg;const e=olympe.dc.Request.j.df,f=olympe.dc.Request.j.dh;var g=olympe.dc.Request.j.Fi;const h=olympe.dc.Request.j.yh,k=olympe.dc.Request.j.ng;var l=olympe.dc.Request.j.dg;const n=olympe.dc.Request.j.bg,p=olympe.dc.sources.ce(),
829
- q=a.getType(),r=a.ic();if(Qd(b.D)){q===d&&(c=a.content,(g=Sf(a).get(olympe.dc.la.j.Ll))&&(yield Uj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.X(a);if(q===d){const t=a.content;d=l;const v=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>u(function*(){const z=
830
- x.ac();yield Vj(p,z);z.qc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Id()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Wj(p,t.T(),r,v,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Xj(p,null,r,a.content.ac(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Df};
830
+ class Rj extends olympe.dc.sources.kg{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.kg.j={Yt:'CREATE',Tw:'UPDATE',du:'DELETE',Zt:'CREATE_RELATION',eu:'DELETE_RELATION'};function Tj(a,b){b=Qf(new olympe.dc.Request(olympe.dc.Request.j.jk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.If.j.$i,error:null}),a.T());let c;null==(c=a.Jb)||c.cd(b)}
831
+ olympe.dc.sources.Rl=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Sg;const e=olympe.dc.Request.j.df,f=olympe.dc.Request.j.dh;var g=olympe.dc.Request.j.Fi;const h=olympe.dc.Request.j.yh,k=olympe.dc.Request.j.ng;var l=olympe.dc.Request.j.dg;const n=olympe.dc.Request.j.bg,p=olympe.dc.sources.ce(),
832
+ q=a.getType(),r=a.ic();if(Qd(b.D)){q===d&&(c=a.content,(g=Sf(a).get(olympe.dc.la.j.Ml))&&(yield Uj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.X(a);if(q===d){const t=a.content;d=l;const v=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>u(function*(){const z=
833
+ x.ac();yield Vj(p,z);z.qc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Id()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Wj(p,t.T(),r,v,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Xj(p,null,r,a.content.ac(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Df};
831
834
  case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.ac().T();return p.applyTransaction(d,r).finally(()=>Tj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.j)return this.Z(a,
832
- b);const c=olympe.dc.sources.ce(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Qd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.kt([this.D.Vf()],()=>{h.error(new olympe.error.Mp('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.kt([this.D.Vf()],()=>{f.error(new olympe.error.Go('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Xj(c,d.T(),e,f.ac()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
833
- throw g;}))))}};olympe.dc.sources.Ql.ya=[olympe.dc.sources.ek];const Yj=olympe.dc.Request.j.oc,Zj=olympe.dc.Request.j.Sg,ak=olympe.dc.Request.j.Fk,bk=olympe.dc.Request.j.df,ck=olympe.dc.Request.j.dh,dk=olympe.dc.Request.j.Fi,ek=olympe.dc.Request.j.yh,fk=olympe.dc.Request.j.ng,gk=olympe.dc.Request.j.dg,hk=olympe.dc.Request.j.bg;function ik(a,b){let c;return(null==(c=a.Ga.ib(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.Pp}
834
- function jk(a,b){let c;return(null==(c=a.Ga.ib(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.yo}function kk(a,b,c){const d=c.content.ac().T();let e=a.da.get(d);e||(e=olympe.L.qb.Vs(b),a.da.set(d,e));return e.kd(c)}function lk(a,b){b=b.wc();if(b!==olympe.dm.User.j&&a.Of(olympe.dc.sources.Config.Tm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.error.tk(a);}
835
- function mk(a,b,c,d,e){return u(function*(){var f=olympe.L.wa.j.SEND,g=olympe.L.wa.j.GET;const h=olympe.L.wa.j.PUBLISH,k=olympe.L.wa.j.SUBSCRIBE,l=d.mt();var n=d.body();if(e!==n.wc())throw Error('Access denied: try to impersonate a user');lk(c,n);let p;if(null==(p=a.Jb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===ak)f=n.content.T();else throw Error('Not supported type of subscription');
836
- g=yield d.Qn(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new nk(a.G,f,b,Qf(n,olympe.dc.Ha.Ze)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.cd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
837
- olympe.dc.sources.Br=class extends olympe.dc.sources.Ql{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Wb('Remote Provider Context');this.sa=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ga=f;this.da=new Map}T(){return olympe.dc.Ha.Ze}X(a){var b=olympe.L.qb;const c=a.ic();var d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Yj:const e=olympe.dm.DataSource.oc.zb,f=
838
- olympe.dm.DataSource.oc.Vh;b=ik(this,c)?b.get(c,a):Promise.resolve({s:f});a=jk(this,c)?this.j.Ic(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Zj:return jk(this,c)?xj(this.j,a):b.get(c,a);case bk:const g=a.content.ac().T();return(ik(this,c)?b.get(c,a):yj(this.j,a)).finally(()=>Tj(this,g));case ck:const h=a.content.ac().T();
835
+ b);const c=olympe.dc.sources.ce(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Qd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.ot([this.D.Vf()],()=>{h.error(new olympe.error.Np('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.ot([this.D.Vf()],()=>{f.error(new olympe.error.Ho('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Xj(c,d.T(),e,f.ac()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
836
+ throw g;}))))}};olympe.dc.sources.Rl.ya=[olympe.dc.sources.fk];const Yj=olympe.dc.Request.j.oc,Zj=olympe.dc.Request.j.Sg,ak=olympe.dc.Request.j.Gk,bk=olympe.dc.Request.j.df,ck=olympe.dc.Request.j.dh,dk=olympe.dc.Request.j.Fi,ek=olympe.dc.Request.j.yh,fk=olympe.dc.Request.j.ng,gk=olympe.dc.Request.j.dg,hk=olympe.dc.Request.j.bg;function ik(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.Qp}
837
+ function jk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Of(olympe.dc.sources.Config.Ve))!==olympe.dm.DataSource.Ve.zo}function kk(a,b,c){const d=c.content.ac().T();let e=a.da.get(d);e||(e=olympe.L.qb.Zs(b),a.da.set(d,e));return e.kd(c)}function lk(a,b){b=b.xc();if(b!==olympe.dm.User.j&&a.Of(olympe.dc.sources.Config.Um))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.error.uk(a);}
838
+ function mk(a,b,c,d,e){return u(function*(){var f=olympe.L.wa.j.SEND,g=olympe.L.wa.j.GET;const h=olympe.L.wa.j.PUBLISH,k=olympe.L.wa.j.SUBSCRIBE,l=d.qt();var n=d.body();if(e!==n.xc())throw Error('Access denied: try to impersonate a user');lk(c,n);let p;if(null==(p=a.Jb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===ak)f=n.content.T();else throw Error('Not supported type of subscription');
839
+ g=yield d.Rn(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new nk(a.G,f,b,Qf(n,olympe.dc.Ia.Ze)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.cd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
840
+ olympe.dc.sources.Er=class extends olympe.dc.sources.Rl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Wb('Remote Provider Context');this.sa=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ha=f;this.da=new Map}T(){return olympe.dc.Ia.Ze}X(a){var b=olympe.L.qb;const c=a.ic();var d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Yj:const e=olympe.dm.DataSource.oc.Ab,f=
841
+ olympe.dm.DataSource.oc.Vh;b=ik(this,c)?b.get(c,a):Promise.resolve({s:f});a=jk(this,c)?this.j.Jc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Zj:return jk(this,c)?xj(this.j,a):b.get(c,a);case bk:const g=a.content.ac().T();return(ik(this,c)?b.get(c,a):yj(this.j,a)).finally(()=>Tj(this,g));case ck:const h=a.content.ac().T();
839
842
  return(jk(this,c)?yj(this.j,a):b.get(c,a)).finally(()=>Tj(this,h));case dk:return ik(this,c)?kk(this,c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case ek:return d=a.content.ac().T(),this.da.delete(d),ik(this,c)?b.get(c,a):yj(this.j,a);case fk:return jk(this,c)?this.j.uploadFileContent(a):b.get(c,a);case gk:return jk(this,c)?this.j.downloadFileContent(a):b.get(c,a);case hk:return jk(this,c)?this.j.deleteFileContent(a):
840
843
  b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.ic(),d=a.getType();if(!ik(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===ak?olympe.L.qb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
841
- Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Lj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.gi,!0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Fs,!0)).observe(this.F).subscribe(b=>{b.yj().forEach(this.lb.bind(this,a));b.Ej().forEach(c=>{let d;null==(d=this.sa.get(c))||d.destroy();this.sa.delete(c)})});this.db.Qa(this.H,olympe.dm.DataSource.Fs)&&(new olympe.L.qb(this.H,this.F)).listen().subscribe(b=>
842
- {b=b.body();b instanceof olympe.dc.Request?a.cd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}lb(a,b){const c=b.W(),d=new olympe.C.Wb(`Published data provider context ${c}`,this.F);this.sa.set(c,d);let e;ok(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.Ve.yo&&(e=sj(this.j,c,k=>{lk(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
843
- (k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ve.Pp&&(f=new olympe.C.Wb(`Bus Service of data source ${c}`,d),f=(new olympe.L.qb(c,f)).ut(this.Wa.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Bi().then(l=>mk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.li(l instanceof Error?l:Error(l))})}))})}xi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.ic()))?void 0:c.xi(a)})}Wa(a){const b=this.ia.get(a);this.ia.delete(a);
844
+ Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Mj).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.gi,!0)).filter(olympe.dc.query.za.Ea(olympe.dm.DataSource.Is,!0)).observe(this.F).subscribe(b=>{b.yj().forEach(this.nb.bind(this,a));b.Ej().forEach(c=>{let d;null==(d=this.sa.get(c))||d.destroy();this.sa.delete(c)})});this.db.Pa(this.H,olympe.dm.DataSource.Is)&&(new olympe.L.qb(this.H,this.F)).listen().subscribe(b=>
845
+ {b=b.body();b instanceof olympe.dc.Request?a.cd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}nb(a,b){const c=b.W(),d=new olympe.C.Wb(`Published data provider context ${c}`,this.F);this.sa.set(c,d);let e;ok(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.Ve.zo&&(e=sj(this.j,c,k=>{lk(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
846
+ (k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ve.Qp&&(f=new olympe.C.Wb(`Bus Service of data source ${c}`,d),f=(new olympe.L.qb(c,f)).yt(this.Wa.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Bi().then(l=>mk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.li(l instanceof Error?l:Error(l))})}))})}xi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.ic()))?void 0:c.xi(a)})}Wa(a){const b=this.ia.get(a);this.ia.delete(a);
844
847
  if(a=b)null==(a=this.N.get(b))?a=0:(0<a.j&&--a.j,0===a.j?(a.G.debug(`Data subscription ${a.D} has more subscriber: unsubscribe`),a.F.unsubscribe(),a=!0):(a.G.debug(`Data subscription ${a.D} has ${a.j} subscribers`),a=!1));a&&this.N.delete(b)}};
845
- class nk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.qb.kd(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Br.ya=[olympe.dc.sources.ek];const W={ps:10,Mo:11,sp:12,hr:13,QUERY_RESULT:14,Kp:15,ap:16,df:17,ir:18,$o:19,fj:20};function pk(a,b){const c=new olympe.dc.transaction.He,d=new olympe.dc.transaction.He;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Qc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.Z.md(Vf(Wf(d),olympe.dc.Ha.SELF),{persist:!1});a.Z.md(Vf(Wf(c),olympe.dc.Ha.SELF))}
846
- olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}fa(a){a=super.fa(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.ps,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.ps&&Array.isArray(null==a?void 0:a.i)?(pk(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.sp;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Re(d))){const f=
847
- a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Ms().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='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.W()));case a instanceof olympe.dc.la:return this.format(W.hr,a.fa());case a instanceof olympe.dc.Ja:return this.format(W.QUERY_RESULT,a.fa(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.He,
848
- a.qc(b),this.format(W.Kp,{i:a.T(),p:Wf(b)});case a instanceof olympe.dc.Request:return this.format(W.ap,{r:a.getType(),o:a.origin,d:a.ic(),u:a.wc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.lj:return this.format(W.df,{r:a.th(),p:this.D(a.ac())});case a instanceof olympe.dc.query.Dd:return this.format(W.ir,a.fa());case a instanceof olympe.dc.Hg:return this.format(W.$o,a.fa());case a instanceof olympe.dc.uc:return this.format(W.fj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
849
- a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.sp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Ms().yb(d,a));return olympe.dc.CloudObject.get(d);case W.Mo:return olympe.dc.CloudObject.get(c);case W.hr:return d=c.p.map(olympe.dc.query.ma.Om.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ld:a.s,Te:a.rm});case W.QUERY_RESULT:return Ni(c);case W.Kp:return(new olympe.dc.transaction.dj).j(c.p,c.i);case W.ap:return a=null!=(d=this.j(c.c))?d:void 0,
850
- Qf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.df:return d=this.j(c.p),new olympe.dc.transaction.lj(d,c.r);case W.ir:return olympe.dc.query.Dd.j(c);case W.$o:return olympe.dc.Hg.j(c);case W.fj:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ia(a))throw new olympe.dc.Tq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of sh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
851
- d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Re(a)||(c.v=!0);this.F.set(a,c);return a}};const qk=olympe.dc.Request.j.Jg,rk=olympe.dc.Request.j.df,sk=olympe.dc.Request.j.dh,tk=olympe.dc.Request.j.Fi,uk=olympe.dc.Request.j.vo,vk=olympe.dc.Request.j.sr,wk=olympe.dc.Request.j.Sg,xk=olympe.dc.Request.j.Fk,yk=olympe.dc.Request.j.Jp,zk=olympe.dc.Request.j.qu,Ak=olympe.dc.Request.j.ru,Bk=olympe.dc.Request.j.su,Ck=olympe.dc.Request.j.bg,Dk=olympe.dc.Request.j.dg,Ek=olympe.dc.Request.j.ng,Fk=olympe.dc.Request.j.ik,Gk=olympe.dc.Request.j.Nw,Hk=olympe.dc.Request.j.bw,Ik=olympe.dc.Request.j.Ep,Jk=
852
- olympe.dc.Request.j.yh,Kk=olympe.dc.Request.j.Tt,Lk=olympe.dc.Request.j.oc;function Mk(a){return Nk(a,olympe.dc.Request.j.Jg).then(b=>{b=b.getData().p;const c=Vf(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 Ok(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1}),d=b.ac(),e=b.j;d.qc(c);return Pk(a,rk,{i:d.T(),r:b.th(),p:Wf(c),bd:e?!0:void 0}).then(f=>f.ct)}
853
- function Qk(a,b){const c=b.ac(),d=new olympe.dc.transaction.He({vl:!0,le:!1,hi:!1});c.qc(d);b=b.j?'bd=true':'';return Nk(a,sk,Wf(d),b,olympe.net.va.ResponseType.Wr).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(()=>{Rk(a,Fk,{id:c.T(),finalize:olympe.dc.transaction.If.j.$i})})}
848
+ class nk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.qb.kd(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Er.ya=[olympe.dc.sources.fk];const W={ss:10,No:11,tp:12,kr:13,QUERY_RESULT:14,Lp:15,bp:16,df:17,lr:18,ap:19,fj:20};function pk(a,b){const c=new olympe.dc.transaction.He,d=new olympe.dc.transaction.He;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Rc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.Z.md(Vf(Wf(d),olympe.dc.Ia.SELF),{persist:!1});a.Z.md(Vf(Wf(c),olympe.dc.Ia.SELF))}
849
+ olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}fa(a){a=super.fa(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.ss,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.ss&&Array.isArray(null==a?void 0:a.i)?(pk(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.tp;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Re(d))){const f=
850
+ a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.Qs().Ha(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='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.No,this.H(a.W()));case a instanceof olympe.dc.la:return this.format(W.kr,a.fa());case a instanceof olympe.dc.Ka:return this.format(W.QUERY_RESULT,a.fa(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.He,
851
+ a.qc(b),this.format(W.Lp,{i:a.T(),p:Wf(b)});case a instanceof olympe.dc.Request:return this.format(W.bp,{r:a.getType(),o:a.origin,d:a.ic(),u:a.xc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.lj:return this.format(W.df,{r:a.th(),p:this.D(a.ac())});case a instanceof olympe.dc.query.Dd:return this.format(W.lr,a.fa());case a instanceof olympe.dc.Hg:return this.format(W.ap,a.fa());case a instanceof olympe.dc.vc:return this.format(W.fj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
852
+ a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.tp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.Qs().yb(d,a));return olympe.dc.CloudObject.get(d);case W.No:return olympe.dc.CloudObject.get(c);case W.kr:return d=c.p.map(olympe.dc.query.ma.Pm.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ld:a.s,Te:a.rm});case W.QUERY_RESULT:return Ni(c);case W.Lp:return(new olympe.dc.transaction.dj).j(c.p,c.i);case W.bp:return a=null!=(d=this.j(c.c))?d:void 0,
853
+ Qf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.df:return d=this.j(c.p),new olympe.dc.transaction.lj(d,c.r);case W.lr:return olympe.dc.query.Dd.j(c);case W.ap:return olympe.dc.Hg.j(c);case W.fj:return new olympe.dc.vc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.Wq(a);const b={};this.db.zb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of sh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
854
+ d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Re(a)||(c.v=!0);this.F.set(a,c);return a}};const qk=olympe.dc.Request.j.Jg,rk=olympe.dc.Request.j.df,sk=olympe.dc.Request.j.dh,tk=olympe.dc.Request.j.Fi,uk=olympe.dc.Request.j.wo,vk=olympe.dc.Request.j.vr,wk=olympe.dc.Request.j.Sg,xk=olympe.dc.Request.j.Gk,yk=olympe.dc.Request.j.Kp,zk=olympe.dc.Request.j.uu,Ak=olympe.dc.Request.j.vu,Bk=olympe.dc.Request.j.wu,Ck=olympe.dc.Request.j.bg,Dk=olympe.dc.Request.j.dg,Ek=olympe.dc.Request.j.ng,Fk=olympe.dc.Request.j.jk,Gk=olympe.dc.Request.j.Rw,Hk=olympe.dc.Request.j.fw,Ik=olympe.dc.Request.j.Fp,Jk=
855
+ olympe.dc.Request.j.yh,Kk=olympe.dc.Request.j.Xt,Lk=olympe.dc.Request.j.oc;function Mk(a){return Nk(a,olympe.dc.Request.j.Jg).then(b=>{b=b.getData().p;const c=Vf(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 Ok(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1}),d=b.ac(),e=b.j;d.qc(c);return Pk(a,rk,{i:d.T(),r:b.th(),p:Wf(c),bd:e?!0:void 0}).then(f=>f.ct)}
856
+ function Qk(a,b){const c=b.ac(),d=new olympe.dc.transaction.He({wl:!0,le:!1,hi:!1});c.qc(d);b=b.j?'bd=true':'';return Nk(a,sk,Wf(d),b,olympe.net.va.ResponseType.Zr).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(()=>{Rk(a,Fk,{id:c.T(),finalize:olympe.dc.transaction.If.j.$i})})}
854
857
  function Sk(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1}),d=b.ac();d.qc(c);return Pk(a,tk,{i:d.T(),r:b.th(),p:Wf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Tk(a,b){const c=new olympe.dc.transaction.He({le:!1,hi:!1});b=b.ac();b.qc(c);return Pk(a,Jk,{i:b.T(),p:Wf(c)}).then(d=>d.ct)}
855
858
  function Uk(a,b){const c=encodeURI(ab(olympe.U.jf(),JSON.stringify(Vk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return Nk(a,wk,void 0,`query=${c}&v=${a.version}`,olympe.net.va.ResponseType.je).then(d=>Wk(a,d))}function Xk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=Vk(a,b);return vb(a.sa,()=>Nk(a,yk,d,void 0,olympe.net.va.ResponseType.je)).then(e=>Wk(a,e))}
856
- function Yk(a,b){if(!ye(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Vk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.fp;b=N(vj(a.j,olympe.dc.Ha.SERVER,uk),olympe.net.va.Rd.Sh,JSON.stringify(b),olympe.net.va.ResponseType.$h);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Tl.JSON});return wj(a.j,b).then(c=>c.getData())}
857
- function Zk(a,b,c,d){if(!ye(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=vj(a.j,olympe.dc.Ha.SERVER,vk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.va.Rd.Sh,b);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Tl.Xw});return wj(a.j,b).then(f=>f.getData())}
859
+ function Yk(a,b){if(!ye(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Vk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.gp;b=N(vj(a.j,olympe.dc.Ia.SERVER,uk),olympe.net.va.Rd.Sh,JSON.stringify(b),olympe.net.va.ResponseType.$h);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Ul.JSON});return wj(a.j,b).then(c=>c.getData())}
860
+ function Zk(a,b,c,d){if(!ye(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=vj(a.j,olympe.dc.Ia.SERVER,vk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.va.Rd.Sh,b);Fc(b,{[olympe.net.va.Headers.Ii]:olympe.net.va.Ul.ax});return wj(a.j,b).then(f=>f.getData())}
858
861
  function Pk(a,b,c,d=!0){const e=olympe.L.Ee.Gg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Be(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Be(a.F,e,f);return Promise.resolve()}
859
862
  function Vk(a,b){var c=ii(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ma.Od)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ma.Ce&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.da.bind(a,
860
- e))})}return b}function Rk(a,b,c){b=Qf(new olympe.dc.Request(b,olympe.dc.Ha.SELF,c),a.T());let d;null==(d=a.Jb)||d.cd(b)}
863
+ e))})}return b}function Rk(a,b,c){b=Qf(new olympe.dc.Request(b,olympe.dc.Ia.SELF,c),a.T());let d;null==(d=a.Jb)||d.cd(b)}
861
864
  function Nk(a,b,c,d,e){const f=vj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.va.Rd.Sh:olympe.net.va.Rd.GET,c&&JSON.stringify(c));Fc(b,{[olympe.net.va.Headers.Ii]:'application/json'});Hc(b,null!=e?e:olympe.net.va.ResponseType.JSON);return wj(a.j,b)}
862
- function Wk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:wb(e,d))?f:olympe.U.stream.zk.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Vf(g,a.T(),null,c))}}))})}
865
+ function Wk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ha)?void 0:wb(e,d))?f:olympe.U.stream.Ak.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Vf(g,a.T(),null,c))}}))})}
863
866
  function $k(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.lg){e=new olympe.dc.db.ec(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.R.j(b.p,d);return Mf(e,b.ct)})}
864
- olympe.dc.sources.Pr=class extends olympe.dc.sources.Ql{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.dj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.U.stream.Ww:null;this.sa=new olympe.U.promise.Tr(f);olympe.C.Gj(this.D.Vf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Ph('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ha.SERVER}X(a){var b=a.getType();const c=a.content,d=Sf(a);switch(b){case Lk:return a=
865
- olympe.dm.DataSource.oc.zb,b=olympe.dm.DataSource.oc.Vh,Promise.resolve(ye(this.F)?{s:b}:{s:a,r:'Disconnected'});case qk:return Mk(this);case rk:return Ok(this,c);case sk:return Qk(this,c);case tk:return Sk(this,c);case Jk:return Tk(this,c);case wk:return d.get(olympe.dc.la.j.eq)?Uk(this,c):Xk(this,c);case uk:return Yk(this,c);case vk:return Zk(this,c.zF,c.debug,c.optional);case Gk:case Hk:case Ik:case Kk:return Pk(this,b,{});case Dk:return this.j.downloadFileContent(a);case Ck:return this.j.deleteFileContent(a);
867
+ olympe.dc.sources.Sr=class extends olympe.dc.sources.Rl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.dj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ha=g?new olympe.U.stream.$w:null;this.sa=new olympe.U.promise.Wr(f);olympe.C.Gj(this.D.Vf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Ph('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}X(a){var b=a.getType();const c=a.content,d=Sf(a);switch(b){case Lk:return a=
868
+ olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Vh,Promise.resolve(ye(this.F)?{s:b}:{s:a,r:'Disconnected'});case qk:return Mk(this);case rk:return Ok(this,c);case sk:return Qk(this,c);case tk:return Sk(this,c);case Jk:return Tk(this,c);case wk:return d.get(olympe.dc.la.j.gq)?Uk(this,c):Xk(this,c);case uk:return Yk(this,c);case vk:return Zk(this,c.DF,c.debug,c.optional);case Gk:case Hk:case Ik:case Kk:return Pk(this,b,{});case Dk:return this.j.downloadFileContent(a);case Ck:return this.j.deleteFileContent(a);
866
869
  case Ek:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===xk){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=Vk(this,c);this.N.delete(d);this.H.set(d,e);Pk(this,zk,f).catch(g=>e.error(g))})).pipe(sb(olympe.error.Ph,(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);Pk(this,Ak,{i:d}).catch(e=>
867
- {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);we(this.F,olympe.L.Ee.Gg,this.ia.bind(this));return this}destroy(){return u(function*(){})}ia(a,b){const c=olympe.dc.Request.j.xo,d=olympe.dc.Request.j.Bm,e=a.c;if(e===olympe.dc.Request.j.bk)$k(this,a,b).then(f=>{Rk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
868
- b=Mf(b,a.ct),Rk(this,e,{rollback:b,error:a.error});else if(e===Bk){const f=a.i;$k(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Rk(this,Fk,{id:a.i,finalize:olympe.dc.transaction.If.j.Bm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.ma.Wh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.W(),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.Pr.ya=[olympe.dc.sources.ek];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.W()}`);b.bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.D).me().back().bb(olympe.dm.Ad.j).me().observe(d,{ld:c,Ac:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.W(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.bb(olympe.dm.hb.D).observe(d,{ld:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Hc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
869
- olympe.dc.sources.Rk=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.ea(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Qe(a){let b;return null!=(b=this.db.source(a))?b:this.N}ib(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ha.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.Nb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
870
- !0;var a=new olympe.dc.Ya;X(a.create(olympe.dm.DataSource,this.j).yi(this.j),olympe.dm.DataSource.gi,!0);a.Oa(olympe.dm.DataSource.Lj,this.j,this.j);a.nb(()=>{olympe.dc.la.from(this.j).observe(olympe.C.kh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',mm:'dc.sources.HTTPService',Gu:'dc.sources.IOService',qr:'dc.sources.RemoteProvider',Ir:'dc.sources.ServerProvider',nC:'dc.sources.OfflineProvider',af:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Yo:'dc.sources.cache.Cache',Zo:'dc.sources.cache.DATABASE',Ml:'dc.sources.cache.Logger'};
871
- olympe.dc.sources.Config={Ih:'data.httpHost',Af:'data.httpPort',Qi:'data.httpSSL',jm:'data.httpBasePath',Mm:'data.pollingFrequency',Ve:'data.communicationMode',Tm:'data.restrictedUse',VERSION:'version.version',Mr:'data.streamWorker',Sq:'data.queryConcurrencyLimit'};olympe.dc.sources.Kh={Sv:'olympe.internal.data.',Ih:'olympe.internal.data.httpHost',Af:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
872
- olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.xm),d=`-${olympe.host.Wg.Th}`;E(a,olympe.dc.sources.Config.Ih,null);E(a,olympe.dc.sources.Config.Af,null);E(a,olympe.dc.sources.Config.Qi,null);E(a,olympe.dc.sources.Config.jm,'runtime/data');E(a,olympe.dc.sources.Config.Mr,!1);E(a,olympe.dc.sources.Config.Sq,10);Ya(a,olympe.dc.sources.Kh.Ih,[olympe.host.Config.Ik,olympe.L.Config.Xl,olympe.dc.sources.Config.Ih],(e,f,g)=>{if(g)return g;e=e===olympe.host.Wg.Th;
873
- return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Kh.Af,[olympe.dc.sources.Kh.Ih,olympe.dc.sources.Config.Af],(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.Kh.Qi,[olympe.dc.sources.Kh.Af,olympe.dc.sources.Config.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.Config.Mm,null);E(a,olympe.dc.sources.Config.Ve,null);E(a,olympe.dc.sources.Config.Tm,null);D(a,olympe.dc.sources.P.Ca,[olympe.ha.P.Da],e=>e.ad('data'));
874
- C(a,olympe.dc.sources.P.Le,olympe.dc.sources.cc,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Le,olympe.dc.sources.P.Le);C(a,olympe.dc.sources.P.mm,olympe.dc.sources.vu,olympe.dc.sources.P.Ca,olympe.net.P.nj,olympe.L.P.km,olympe.auth.P.Da,olympe.dc.sources.P.af,olympe.L.P.Le,new olympe.V.oa(olympe.L.Config.Hl));C(a,olympe.dc.sources.P.Gu,olympe.dc.sources.cq,olympe.dc.sources.P.Ca,olympe.dc.P.Ug,olympe.net.P.Da,olympe.auth.P.Da);C(a,olympe.dc.sources.P.qr,olympe.dc.sources.Br,olympe.dc.sources.P.Ca,new olympe.V.oa(olympe.dc.Config.Xg),
875
- olympe.dc.sources.P.mm,olympe.L.P.uf,olympe.dc.P.Ch,olympe.dc.sources.P.af);C(a,olympe.dc.sources.P.Ir,olympe.dc.sources.Pr,olympe.dc.sources.P.Ca,olympe.L.P.Mk,olympe.L.P.uf,olympe.dc.sources.P.mm,new olympe.V.oa(olympe.dc.sources.Config.VERSION),new olympe.V.oa(olympe.dc.sources.Config.Sq),new olympe.V.oa(olympe.dc.sources.Config.Mr));C(a,olympe.dc.sources.P.af,olympe.dc.sources.Rk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Zl));D(a,olympe.dc.sources.P.Ml,
876
- [olympe.ha.P.Da],e=>e.ad('datacache'));C(a,olympe.dc.sources.P.Yo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Ml,olympe.dc.P.Ug,olympe.dc.sources.P.Zo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.uf,olympe.Db.P.ym,olympe.U.P.Dg,new olympe.V.oa(olympe.net.Config.Pq),new olympe.V.oa(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.Zo,olympe.dc.sources.cache.xk,olympe.Db.P.$g,olympe.dc.sources.P.Ml,olympe.Db.P.pk)},'olympe.dc.sources');
877
- olympe.V.run([olympe.dc.sources.P.af,olympe.dc.sources.P.Yo],(a,b)=>{olympe.dc.ee=()=>a;olympe.dc.sources.ce=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.$m=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.Yt=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Kw=class extends olympe.dc.sources.cache.errors.$m{};olympe.dc.sources.cache.errors.Tw=class extends olympe.dc.sources.cache.errors.$m{};function bl(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.Pb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.dj).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
878
- olympe.dc.sources.cache.Tp=class{fa(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.W()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.He;a.qc(b);
870
+ {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);we(this.F,olympe.L.Ee.Gg,this.ia.bind(this));return this}destroy(){return u(function*(){})}ia(a,b){const c=olympe.dc.Request.j.yo,d=olympe.dc.Request.j.Cm,e=a.c;if(e===olympe.dc.Request.j.ck)$k(this,a,b).then(f=>{Rk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
871
+ b=Mf(b,a.ct),Rk(this,e,{rollback:b,error:a.error});else if(e===Bk){const f=a.i;$k(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Rk(this,Fk,{id:a.i,finalize:olympe.dc.transaction.If.j.Cm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.ma.Wh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.W(),d:c.La()===olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.Sr.ya=[olympe.dc.sources.fk];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.W()}`);b.bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.D).me().back().bb(olympe.dm.Ad.j).me().observe(d,{ld:c,Bc:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.W(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.bb(olympe.dm.hb.D).observe(d,{ld:c,Bc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Ic())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
872
+ olympe.dc.sources.Sk=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.ea(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Qe(a){let b;return null!=(b=this.db.source(a))?b:this.N}jb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ia.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ja(a)&&this.db.Nb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
873
+ !0;var a=new olympe.dc.Ya;X(a.create(olympe.dm.DataSource,this.j).yi(this.j),olympe.dm.DataSource.gi,!0);a.Oa(olympe.dm.DataSource.Mj,this.j,this.j);a.lb(()=>{olympe.dc.la.from(this.j).observe(olympe.C.kh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',nm:'dc.sources.HTTPService',Ku:'dc.sources.IOService',tr:'dc.sources.RemoteProvider',Lr:'dc.sources.ServerProvider',rC:'dc.sources.OfflineProvider',af:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Zo:'dc.sources.cache.Cache',$o:'dc.sources.cache.DATABASE',Nl:'dc.sources.cache.Logger'};
874
+ olympe.dc.sources.Config={Ih:'data.httpHost',Af:'data.httpPort',Qi:'data.httpSSL',km:'data.httpBasePath',Nm:'data.pollingFrequency',Ve:'data.communicationMode',Um:'data.restrictedUse',VERSION:'version.version',Qr:'data.streamWorker',Vq:'data.queryConcurrencyLimit'};olympe.dc.sources.Kh={Wv:'olympe.internal.data.',Ih:'olympe.internal.data.httpHost',Af:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
875
+ olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.ym),d=`-${olympe.host.Wg.Th}`;E(a,olympe.dc.sources.Config.Ih,null);E(a,olympe.dc.sources.Config.Af,null);E(a,olympe.dc.sources.Config.Qi,null);E(a,olympe.dc.sources.Config.km,'runtime/data');E(a,olympe.dc.sources.Config.Qr,!1);E(a,olympe.dc.sources.Config.Vq,10);Ya(a,olympe.dc.sources.Kh.Ih,[olympe.host.Config.Jk,olympe.L.Config.Yl,olympe.dc.sources.Config.Ih],(e,f,g)=>{if(g)return g;e=e===olympe.host.Wg.Th;
876
+ return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Kh.Af,[olympe.dc.sources.Kh.Ih,olympe.dc.sources.Config.Af],(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.Kh.Qi,[olympe.dc.sources.Kh.Af,olympe.dc.sources.Config.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.Config.Nm,null);E(a,olympe.dc.sources.Config.Ve,null);E(a,olympe.dc.sources.Config.Um,null);D(a,olympe.dc.sources.P.Ca,[olympe.ha.P.Fa],e=>e.ad('data'));
877
+ C(a,olympe.dc.sources.P.Le,olympe.dc.sources.cc,olympe.dc.db.P.Fa);Wa(a,olympe.L.P.Le,olympe.dc.sources.P.Le);C(a,olympe.dc.sources.P.nm,olympe.dc.sources.zu,olympe.dc.sources.P.Ca,olympe.net.P.nj,olympe.L.P.mm,olympe.auth.P.Fa,olympe.dc.sources.P.af,olympe.L.P.Le,new olympe.V.oa(olympe.L.Config.Il));C(a,olympe.dc.sources.P.Ku,olympe.dc.sources.fq,olympe.dc.sources.P.Ca,olympe.dc.P.Ug,olympe.net.P.Fa,olympe.auth.P.Fa);C(a,olympe.dc.sources.P.tr,olympe.dc.sources.Er,olympe.dc.sources.P.Ca,new olympe.V.oa(olympe.dc.Config.Xg),
878
+ olympe.dc.sources.P.nm,olympe.L.P.uf,olympe.dc.P.Ch,olympe.dc.sources.P.af);C(a,olympe.dc.sources.P.Lr,olympe.dc.sources.Sr,olympe.dc.sources.P.Ca,olympe.L.P.Nk,olympe.L.P.uf,olympe.dc.sources.P.nm,new olympe.V.oa(olympe.dc.sources.Config.VERSION),new olympe.V.oa(olympe.dc.sources.Config.Vq),new olympe.V.oa(olympe.dc.sources.Config.Qr));C(a,olympe.dc.sources.P.af,olympe.dc.sources.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.$l));D(a,olympe.dc.sources.P.Nl,
879
+ [olympe.ha.P.Fa],e=>e.ad('datacache'));C(a,olympe.dc.sources.P.Zo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Nl,olympe.dc.P.Ug,olympe.dc.sources.P.$o,olympe.dc.db.P.Fa,olympe.net.P.Fa,olympe.L.P.uf,olympe.Db.P.zm,olympe.U.P.Dg,new olympe.V.oa(olympe.net.Config.Sq),new olympe.V.oa(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.$o,olympe.dc.sources.cache.yk,olympe.Db.P.$g,olympe.dc.sources.P.Nl,olympe.Db.P.qk)},'olympe.dc.sources');
880
+ olympe.V.run([olympe.dc.sources.P.af,olympe.dc.sources.P.Zo],(a,b)=>{olympe.dc.ee=()=>a;olympe.dc.sources.ce=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.an=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.bu=class extends olympe.dc.sources.cache.errors.an{};olympe.dc.sources.cache.errors.Ow=class extends olympe.dc.sources.cache.errors.an{};olympe.dc.sources.cache.errors.Xw=class extends olympe.dc.sources.cache.errors.an{};function bl(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.Pb(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.dj).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
881
+ olympe.dc.sources.cache.Up=class{fa(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.vc:return{t:17,v:a.W()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.He;a.qc(b);
879
882
  return{t:13,i:a.T(),v:Wf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function Uj(a,b,c){return u(function*(){cl(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(dl(a)));return el(a.j,b,c)})}function Vj(a,b){return u(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
880
- function Wj(a,b,c,d,e=!1){(()=>u(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.Z)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Tc()).filter(h=>!h.yd()).map(h=>h.tag()),yield fl(a.j)),yield gl(a.j,d,0<f.length?b:null),hl(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}`),
883
+ function Wj(a,b,c,d,e=!1){(()=>u(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.Z)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Uc()).filter(h=>!h.yd()).map(h=>h.tag()),yield fl(a.j)),yield gl(a.j,d,0<f.length?b:null),hl(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}`),
881
884
  a.vd.next(f)}finally{b&&il(a,'queries',b)}}))().then(()=>{})}function Xj(a,b,c,d,e=!1){return u(function*(){yield Vj(a,d);Wj(a,b,c,d,e)})}function jl(){var a=olympe.dc.sources.ce();a.Z=!0;a.yb=!0}function cl(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)}
882
885
  function il(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 kl(a){return u(function*(){a.F=new olympe.dc.db.ec;const b=yield ll(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
883
- function hl(a,b,c){return u(function*(){const d=ml(b),e=[];for(const g of d){const h=g.tag();if(!(yield nl(a.j,h)))if(cl(a,'files',h),!1===g.Qa(olympe.dm.File.j.W())&&g.Qa(olympe.dm.File.urlProp.W())){var f=g.Qa(olympe.dm.File.urlProp.W());f=N(f);Hc(f,olympe.net.va.ResponseType.Gl);e.push(Ic(a.Fd,f).then(k=>{k=k.Ic();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>il(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.W()))?k:
886
+ function hl(a,b,c){return u(function*(){const d=ml(b),e=[];for(const g of d){const h=g.tag();if(!(yield nl(a.j,h)))if(cl(a,'files',h),!1===g.Pa(olympe.dm.File.j.W())&&g.Pa(olympe.dm.File.urlProp.W())){var f=g.Pa(olympe.dm.File.urlProp.W());f=N(f);Hc(f,olympe.net.va.ResponseType.Hl);e.push(Ic(a.Fd,f).then(k=>{k=k.Jc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>il(a,'files',h)))}else{let k;const l=null!=(k=g.Pa(olympe.dm.File.mimeTypeProp.W()))?k:
884
887
  'application/octet-stream';f={tag:h,model:g.Ub(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.dg,c,f);f=vb(a.Md,()=>a.Jb.request(n).then(p=>ol(a.j,h,p,l))).finally(()=>il(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
885
- function ml(a){const b=[olympe.dc.ea(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.la.from(olympe.dm.File).ug(olympe.dc.CloudObject.extendedByRel).Cc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Sc(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Sc(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Sc(g));return c.concat(d)},[])}
888
+ function ml(a){const b=[olympe.dc.ea(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.la.from(olympe.dm.File).ug(olympe.dc.CloudObject.extendedByRel).Cc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Tc(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Tc(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Tc(g));return c.concat(d)},[])}
886
889
  function pl(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function dl(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function ql(a,b){return u(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 rl(a.j,b);a.N.next(dl(a));d.filter(f=>!e.has(f));yield fl(a.j)}else yield Promise.all(dl(a).map(f=>ql(a,f)))})}
887
890
  function sl(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])}
888
- function tl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.df;const e=olympe.dc.Request.j.bg,f=olympe.dc.Request.j.ng;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=ml(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>u(function*(){const k=h.tag();var l=h.Ub();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield ul(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!Qd(a.lb))throw Error('Lost connection, stop syncing');
889
- l=yield a.Jb.request(l);b.Xc(k,new Map([[olympe.dm.File.urlProp.W(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.lj(b,!1));if(!Qd(a.lb))throw Error('Lost connection, stop syncing');yield a.Jb.request(d)})}
890
- function vl(a,b,c){return c instanceof olympe.error.Uk||c instanceof olympe.error.To?(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.error.Ar?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Kw('The transaction has been rejected by the datasource',
891
- c.message)):new olympe.dc.sources.cache.errors.Tw('Synchronisation error',c.message)}
891
+ function tl(a,b,c){return u(function*(){var d=olympe.dc.Request.j.df;const e=olympe.dc.Request.j.bg,f=olympe.dc.Request.j.ng;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=ml(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>u(function*(){const k=h.tag();var l=h.Ub();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield ul(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!Qd(a.nb))throw Error('Lost connection, stop syncing');
892
+ l=yield a.Jb.request(l);b.Xc(k,new Map([[olympe.dm.File.urlProp.W(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.lj(b,!1));if(!Qd(a.nb))throw Error('Lost connection, stop syncing');yield a.Jb.request(d)})}
893
+ function vl(a,b,c){return c instanceof olympe.error.Vk||c instanceof olympe.error.Uo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.bu('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.error.Dr?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Ow('The transaction has been rejected by the datasource',
894
+ c.message)):new olympe.dc.sources.cache.errors.Xw('Synchronisation error',c.message)}
892
895
  function wl(){var a=olympe.dc.sources.ce();if(a.R)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.R=!0;a.G.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>u(function*(){yield a.init();const c=yield xl(a.j);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){sl(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield tl(a,
893
896
  h,f),yield yl(a.j,h)}catch(k){throw vl(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{kl(a).finally(()=>{a.R=!1})});return b.asObservable()}
894
897
  function zl(){const a=olympe.dc.sources.ce();return u(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=ml(a.F);for(const e of d)b.has(e.tag())||(d=yield ul(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.sa.j(d.content)}),b.add(e.tag()));b=yield Al(a.j);c.patches.push(...b);return JSON.stringify(c)})}
895
- function Bl(a){const b=olympe.dc.sources.ce();return u(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.sa.D(e.c),yield ol(b.j,e.t,d,e.m);yield Cl(b.j,c.patches);yield kl(b);b.Ga.md(Mf(b.F))})}
898
+ function Bl(a){const b=olympe.dc.sources.ce();return u(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.sa.D(e.c),yield ol(b.j,e.t,d,e.m);yield Cl(b.j,c.patches);yield kl(b);b.Ha.md(Mf(b.F))})}
896
899
  function Dl(){const a=olympe.dc.sources.ce();return u(function*(){yield El(a.j);yield kl(a)})}
897
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Jb=b;this.j=c;this.Ga=d;this.Fd=e;this.lb=f;this.Wa=g;this.sa=h;this.version=l;this.Z=this.version!==this.Wa.get('__code-as-data-version__');this.Yb=this.yb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.Oc=this.Gc=!1;this.ia=[];this.X=0;this.ke=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
898
- !1;this.vd=new rxjs.Subject;this.Md=new olympe.U.promise.Tr(k)}Ic(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Oc)yield new Promise(b=>{a.ia.push(b)});else{a.Oc=!0;(yield Fl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(dl(a));yield kl(a);a.Ga.md(Mf(a.F));for(const b of a.ia)b();a.Gc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return pl(b,a.T())&&ii(a).some(c=>c instanceof olympe.dc.query.ma.Od)?Gl(b.j,a).then(olympe.U.stream.Is):
899
- b.j.executeQuery(a).then(olympe.U.stream.Is)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.ac(),e=Array.from(d.Ab.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Ab.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Hl(c.j,d,b),c.H=new olympe.dc.sources.cache.Wt(d,b),c.da.next(!0)):(d.qc(c.H.j),yield Hl(c.j,c.H.j,b));d.qc(c.F);yield gl(c.j,d,'local-transaction')})}uploadFileContent(a,
900
- b,c){const d=this;return u(function*(){yield d.init();yield ol(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return ul(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Il(b.j,[a])})}};olympe.dc.sources.cache.Wt=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function Fl(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.Uq.Pb(b))})}function ll(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Rh.Pb(b);return bl(b.j)})})}function el(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function fl(a){return u(function*(){return a.db.D()})}
901
- function gl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Ab.keys());return a.db.D().then(()=>{null===c&&(b.Ab.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function nl(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
902
- function ol(a,b,c,d){c=new olympe.dc.sources.cache.Jm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function rl(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function xl(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Rh.Pb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(bl(c.j));b.set(d,f);return b},new Map)})}
903
- function yl(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function ul(a,b){return u(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Jm.Pb(c)})}function Al(a){return u(function*(){return a.db.F('pending-transactions')})}
900
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Jb=b;this.j=c;this.Ha=d;this.Fd=e;this.nb=f;this.Wa=g;this.sa=h;this.version=l;this.Z=this.version!==this.Wa.get('__code-as-data-version__');this.Yb=this.yb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.Qc=this.Gc=!1;this.ia=[];this.X=0;this.ke=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
901
+ !1;this.vd=new rxjs.Subject;this.Md=new olympe.U.promise.Wr(k)}Jc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Gc)if(a.Qc)yield new Promise(b=>{a.ia.push(b)});else{a.Qc=!0;(yield Fl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(dl(a));yield kl(a);a.Ha.md(Mf(a.F));for(const b of a.ia)b();a.Gc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return pl(b,a.T())&&ii(a).some(c=>c instanceof olympe.dc.query.ma.Od)?Gl(b.j,a).then(olympe.U.stream.Ls):
902
+ b.j.executeQuery(a).then(olympe.U.stream.Ls)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.ac(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Hl(c.j,d,b),c.H=new olympe.dc.sources.cache.$t(d,b),c.da.next(!0)):(d.qc(c.H.j),yield Hl(c.j,c.H.j,b));d.qc(c.F);yield gl(c.j,d,'local-transaction')})}uploadFileContent(a,
903
+ b,c){const d=this;return u(function*(){yield d.init();yield ol(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return ul(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Il(b.j,[a])})}};olympe.dc.sources.cache.$t=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function Fl(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.Xq.Pb(b))})}function ll(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Rh.Pb(b);return bl(b.j)})})}function el(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function fl(a){return u(function*(){return a.db.D()})}
904
+ function gl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function nl(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
905
+ function ol(a,b,c,d){c=new olympe.dc.sources.cache.Km(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function rl(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function xl(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Rh.Pb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(bl(c.j));b.set(d,f);return b},new Map)})}
906
+ function yl(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function ul(a,b){return u(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Km.Pb(c)})}function Al(a){return u(function*(){return a.db.F('pending-transactions')})}
904
907
  function Cl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Rh.Pb(d);e&&c.set(e.j.i,d)}yield a.db.da()})}function El(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
905
- function Gl(a,b){return u(function*(){const c=b.ib();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Dd.xj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Pg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.xk.Vb(f);const g=Jl(f.Kd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Zc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
906
- a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.ac().Ab.size,'instances',Array.from(d.ac().Id()).length,'relations');return d})}function Hl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Rh(c,b,Date.now())).toJSON())}function Kl(a){return u(function*(){return a.db.N('pending-transactions')})}function Il(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.Z()})}
908
+ function Gl(a,b){return u(function*(){const c=b.jb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Dd.xj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Pg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.yk.Vb(f);const g=Jl(f.Kd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Zc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
909
+ a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.ac().Bb.size,'instances',Array.from(d.ac().Id()).length,'relations');return d})}function Hl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Rh(c,b,Date.now())).toJSON())}function Kl(a){return u(function*(){return a.db.N('pending-transactions')})}function Il(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.Z()})}
907
910
  function Jl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,bl(d)),new Map)}
908
- olympe.dc.sources.cache.xk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.Tp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.U.Promise.uj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Kl(d))))if(0<d.db.X())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
909
- else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Vb(a){const b=new RegExp(`^(${olympe.dc.fc.Zc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.ib()}`);const d=olympe.dc.query.Dd.xj(a),e=a.ib();var f=
910
- yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Pg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.xk.Vb(g),Jl(g.Kd));for(const p of ii(a))if(p instanceof olympe.dc.query.ma.Wh){var k=p.relation;g=k.Ka()===olympe.dc.ua.ORIGIN;const q=k.W(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
911
- Promise.resolve([]);r.W();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Pg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ma.Ce&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ma.Ce&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.xk.Vb(A),d.create(l,n,Jl(A.Kd)));q===olympe.dc.fc.Zc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
912
- olympe.dc.query.ma.Od&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.ac().Ab.size,'instances',Array.from(d.ac().Id()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
913
- olympe.dc.sources.cache.Uq=class{constructor(a,b){this.name=a;this.j=b}static Pb(a){return a?new olympe.dc.sources.cache.Uq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
911
+ olympe.dc.sources.cache.yk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.Up;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.U.Promise.uj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Kl(d))))if(0<d.db.X())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
912
+ else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Vb(a){const b=new RegExp(`^(${olympe.dc.fc.Zc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.jb()}`);const d=olympe.dc.query.Dd.xj(a),e=a.jb();var f=
913
+ yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Pg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.yk.Vb(g),Jl(g.Kd));for(const p of ii(a))if(p instanceof olympe.dc.query.ma.Wh){var k=p.relation;g=k.La()===olympe.dc.ua.ORIGIN;const q=k.W(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
914
+ Promise.resolve([]);r.W();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Pg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ma.Ce&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ma.Ce&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.yk.Vb(A),d.create(l,n,Jl(A.Kd)));q===olympe.dc.fc.Zc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
915
+ olympe.dc.query.ma.Od&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.ac().Bb.size,'instances',Array.from(d.ac().Id()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
916
+ olympe.dc.sources.cache.Xq=class{constructor(a,b){this.name=a;this.j=b}static Pb(a){return a?new olympe.dc.sources.cache.Xq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
914
917
  olympe.dc.sources.cache.Pg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Kd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Pb(a){return a?new olympe.dc.sources.cache.Pg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Kd,relations:this.ob,queryIds:this.j}}};
915
918
  olympe.dc.sources.cache.Rh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Pb(a){return a?new olympe.dc.sources.cache.Rh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
916
- olympe.dc.sources.cache.Nv=class extends olympe.dc.sources.cache.Rh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Nv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
917
- olympe.dc.sources.cache.Jm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Pb(a){return a?new olympe.dc.sources.cache.Jm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Ll(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
918
- olympe.dc.sources.cache.zu=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.X=new Set;this.H=new olympe.dc.sources.cache.Tp;this.N=new Map}Tc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Qc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.fa(k[1]);return h},null!=(e=null==d?void 0:d.Kd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
919
+ olympe.dc.sources.cache.Rv=class extends olympe.dc.sources.cache.Rh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Rv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
920
+ olympe.dc.sources.cache.Km=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Pb(a){return a?new olympe.dc.sources.cache.Km(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Ll(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
921
+ olympe.dc.sources.cache.Du=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.X=new Set;this.H=new olympe.dc.sources.cache.Up;this.N=new Map}Uc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Rc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.fa(k[1]);return h},null!=(e=null==d?void 0:d.Kd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
919
922
  this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Pg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Xc(a,b){const c=this.j.get(a);if(c){var d;c.Kd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.fa(g);return e},null!=(d=c.Kd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Pg(b,
920
923
  'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Pg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Ll(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.ua.DESTINATION}${c}`;a=`${a}${olympe.dc.ua.ORIGIN}${b}`;b=(f,g)=>{const h=Ll(this,f.tag);if(h.has(g)){const k=
921
- f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.zu.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Jc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.yb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Wa=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.wo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ia)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&
922
- Nl(this,b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}Z(b,c,d){this.sa(b,c,d);this.yb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.Wa))}sa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}lb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.lb(d,e)!==g&&this.Z(d,e,g.valueOf())});
923
- this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ha.Xa('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Sn([d],g=>{this.R=!0;if(g instanceof olympe.dc.uc)olympe.ha.Xa('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
924
- h:null)}})}),this.D.Xd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}th(){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()));Nl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Gi.prototype.complete=olympe.dc.Gi.prototype.complete;olympe.dc.Gi.prototype.push=olympe.dc.Gi.prototype.push;olympe.dc.Mc=class{j(){}toString(){}};olympe.dc.Mc.j=1;olympe.dc.Mc.D=2;olympe.dc.Mc.H=3;olympe.dc.Mc.F=4;olympe.dc.Mc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ha.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.he.Xe+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,
925
- 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.Mc.j:b=a.j(d.p||{});let e;c.Qc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Mc.D:c.Xc(d.t,
926
- a.j(d.p),d.m);break;case olympe.dc.Mc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Mc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Mc.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 Ol(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Qe(b)}function Pl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Sc(b))?void 0:c.Ub())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Re(b)||!a.db.Ia(b)}function Ql(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Rl(a){return Array.from(a.j.Tc()).filter(b=>!b.yd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Tc()).filter(b=>b.yd()).map(b=>b.tag())}
927
- function Tl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ha.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function Ul(a,b,c){const d=Ol(a,b),e=Z(a,b),f=Pl(a,b);Tl(a,d,e,g=>{g.D(b,c,f)})}
928
- olympe.dc.transaction.Wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Jc();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}nf(){return 0===this.j.Ab.size}Qc(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);Tl(this,f,c,g=>{g.Qc(a,f,d,b)})}Xc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Xc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=Ol(this,b),e=
929
- Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ha.SELF&&e!==olympe.dc.Ha.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ga().name(g))?h:g},olympe.ha.Xa('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);Tl(this,d,f,g=>{g.Oa(a,b,c,Pl(this,b),Pl(this,c))})}hc(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
930
- Z(this,c)&&d!==olympe.dc.Ha.SELF&&e!==olympe.dc.Ha.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(olympe.ha.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Tl(this,d,f,g=>{g.hc(a,b,c,Pl(this,b),Pl(this,c))})}};function Vl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.hq.Zg)if(e===olympe.dc.Ha.SELF)d[g]=olympe.dc.ga().T();else{if(e===olympe.dc.Ha.SERVER)continue}else g.startsWith(olympe.dc.he.Xe)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function Wl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
924
+ f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Du.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Kc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.yb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Wa=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.xo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ia)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&
925
+ Nl(this,b,!1);this.H.clear()}da(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}Z(b,c,d){this.sa(b,c,d);this.yb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Wa))}sa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}nb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.nb(d,e)!==g&&this.Z(d,e,g.valueOf())});
926
+ this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ha.Xa('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Tn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ha.Xa('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
927
+ h:null)}})}),this.D.Xd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}th(){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()));Nl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Gi.prototype.complete=olympe.dc.Gi.prototype.complete;olympe.dc.Gi.prototype.push=olympe.dc.Gi.prototype.push;olympe.dc.Oc=class{j(){}toString(){}};olympe.dc.Oc.j=1;olympe.dc.Oc.D=2;olympe.dc.Oc.H=3;olympe.dc.Oc.F=4;olympe.dc.Oc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.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.he.Xe+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,
928
+ 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.vc(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.Oc.j:b=a.j(d.p||{});let e;c.Rc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Oc.D:c.Xc(d.t,
929
+ a.j(d.p),d.m);break;case olympe.dc.Oc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Oc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Oc.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 Ol(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Qe(b)}function Pl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Tc(b))?void 0:c.Ub())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Re(b)||!a.db.Ja(b)}function Ql(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Rl(a){return Array.from(a.j.Uc()).filter(b=>!b.yd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Uc()).filter(b=>b.yd()).map(b=>b.tag())}
930
+ function Tl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function Ul(a,b,c){const d=Ol(a,b),e=Z(a,b),f=Pl(a,b);Tl(a,d,e,g=>{g.D(b,c,f)})}
931
+ olympe.dc.transaction.$v=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Kc();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}nf(){return 0===this.j.Bb.size}Rc(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);Tl(this,f,c,g=>{g.Rc(a,f,d,b)})}Xc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Xc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=Ol(this,b),e=
932
+ Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ga().name(g))?h:g},olympe.ha.Xa('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);Tl(this,d,f,g=>{g.Oa(a,b,c,Pl(this,b),Pl(this,c))})}hc(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
933
+ Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.Zc&&(olympe.ha.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Tl(this,d,f,g=>{g.hc(a,b,c,Pl(this,b),Pl(this,c))})}};function Vl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.kq.Zg)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.ga().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.he.Xe)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function Wl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
931
934
  class Xl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ba||a instanceof olympe.C.$?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.C.Color?{c:7,r:a.oh().valueOf(),g:a.lh().valueOf(),b:a.hh().valueOf(),a:a.gh().valueOf()}:a&&'function'===
932
935
  typeof a.W?{c:8,t:a.W()}:a}}function Wf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
933
- olympe.dc.transaction.He=class{constructor({vl:a=!1,hi:b=!0,le:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.vl=null!=a?a:!1;this.le=null!=c?c:!0;this.hi=null!=b?b:!0;this.X=olympe.C?new Xl:new class extends Xl{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Wf(this))}Qc(a,b,c,d=null){c=Vl(this.X,null!=c?c:null,this.vl);c={o:olympe.dc.Mc.j,t:a,p:c};this.hi&&(c.s=b);this.le&&d&&(c.m=d);this.N.push(c);this.vl&&(b=Wl(this.X))&&this.j.push({o:olympe.dc.Mc.D,
934
- t:a,p:b})}Xc(a,b,c=null){b=Vl(this.X,b||null,!1);a={o:olympe.dc.Mc.D,t:a,p:b};this.le&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Mc.H,t:a,f:b};this.le&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Mc.F,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&
935
- e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Mc.N,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.ya=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Ya;b.X=a;return b}function Zl(a,b){b instanceof olympe.dc.Ya&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
936
- function $l(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',X(c,olympe.dc.CloudObject.nameProp.W(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();Zl(a,new olympe.dc.transaction.Fa.hp(e,b));Zl(a,new olympe.dc.transaction.Fa.Ul(e,b,d));return c}
936
+ olympe.dc.transaction.He=class{constructor({wl:a=!1,hi:b=!0,le:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.wl=null!=a?a:!1;this.le=null!=c?c:!0;this.hi=null!=b?b:!0;this.X=olympe.C?new Xl:new class extends Xl{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Wf(this))}Rc(a,b,c,d=null){c=Vl(this.X,null!=c?c:null,this.wl);c={o:olympe.dc.Oc.j,t:a,p:c};this.hi&&(c.s=b);this.le&&d&&(c.m=d);this.N.push(c);this.wl&&(b=Wl(this.X))&&this.j.push({o:olympe.dc.Oc.D,
937
+ t:a,p:b})}Xc(a,b,c=null){b=Vl(this.X,b||null,!1);a={o:olympe.dc.Oc.D,t:a,p:b};this.le&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Oc.H,t:a,f:b};this.le&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Oc.F,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&
938
+ e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Oc.N,m:a,l:b,r:c};this.le&&d&&(a.lm=d);this.le&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.ya=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Ya;b.X=a;return b}function Zl(a,b){b instanceof olympe.dc.Ya&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
939
+ function $l(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',X(c,olympe.dc.CloudObject.nameProp.W(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();Zl(a,new olympe.dc.transaction.Ga.ip(e,b));Zl(a,new olympe.dc.transaction.Ga.Vl(e,b,d));return c}
937
940
  function am(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
938
- olympe.dc.Ya=class{constructor(a){this.id=null!=a?a:olympe.U.Jc();this.Fa=[];this.F=new Map;this.X=!0;this.D=new Map;this.Z=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().Z]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ea(a)))?b:olympe.dc.ga().model(a)}j(a){Ql(a,this.D);for(const b of this.Fa)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Zl(this,new olympe.dc.transaction.Fa.Wo(a,b));const c=b.W();this.F.set(c,
939
- olympe.dc.ea(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.X);return b}persist(a,b=!0){const c=olympe.dc.ea(a);var d=olympe.dc.ga();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ee().fromModel(b);Zl(this,new olympe.dc.transaction.Fa.Xv(c,d))}else{if((e=d.Ia(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
940
- if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Zl(this,new olympe.dc.transaction.Fa.ip(a,b))}update(a,b,c){return Zl(this,new olympe.dc.transaction.Fa.Vw(a,b,c))}Oa(a,b,c){Zl(this,new olympe.dc.transaction.Fa.Ul(a,b,c))}hc(a,b,c){Zl(this,new olympe.dc.transaction.Fa.hu(a,b,c))}wn(a,b){Zl(this,new olympe.dc.transaction.Fa.hp(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
941
- f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.he.Xe+d.W(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Cs(a,b,c='',{JE:d=olympe.dm.Relation.H.Jv,VE:e=olympe.dm.Relation.j.cw,QE:f=olympe.dm.Relation.j.Kt,sF:g=olympe.dm.Relation.j.Vp,GE:h=olympe.dm.Cl.NONE,rF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Jc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
942
- c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.sa,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.Vp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.Kj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}th(){return!1}mn(a){this.Z.push(olympe.C.Za().rc(a))}nb(a,b){bm(olympe.dc.Fj(),this,am(this,a),b)}xn(a){a=
943
- am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Mc];function Ml(a){var b=olympe.dc.Fj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Xc(d,(new Map).set(e,f),b.db.model(d));b.j.md(Mf(g,Infinity))}}
944
- function Nl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.yh,h=a.T();a=a.th();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ha.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Xc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.lj(n,a)),b=e.Jb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.md(Mf(n,p));null==d||d(!0)})}
945
- function bm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);cm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else cm(a,b,c,!1)}function dm(a){const b=olympe.dc.Request.j.ik;Uf(a.Jb,olympe.dc.Request.j.xo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Yb(d));a.j.md(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Uf(a.Jb,b,c=>{c=c.content;em(a,c.id,c.finalize,c.error)})}
941
+ olympe.dc.Ya=class{constructor(a){this.id=null!=a?a:olympe.U.Kc();this.Ga=[];this.F=new Map;this.X=!0;this.D=new Map;this.Z=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().Z]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ea(a)))?b:olympe.dc.ga().model(a)}j(a){Ql(a,this.D);for(const b of this.Ga)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Zl(this,new olympe.dc.transaction.Ga.Xo(a,b));const c=b.W();this.F.set(c,
942
+ olympe.dc.ea(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.X);return b}persist(a,b=!0){const c=olympe.dc.ea(a);var d=olympe.dc.ga();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ee().fromModel(b);Zl(this,new olympe.dc.transaction.Ga.aw(c,d))}else{if((e=d.Ja(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
943
+ if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Zl(this,new olympe.dc.transaction.Ga.jp(a,b))}update(a,b,c){return Zl(this,new olympe.dc.transaction.Ga.Zw(a,b,c))}Oa(a,b,c){Zl(this,new olympe.dc.transaction.Ga.Vl(a,b,c))}hc(a,b,c){Zl(this,new olympe.dc.transaction.Ga.lu(a,b,c))}xn(a,b){Zl(this,new olympe.dc.transaction.Ga.ip(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
944
+ f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.he.Xe+d.W(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Fs(a,b,c='',{NE:d=olympe.dm.Relation.H.Nv,ZE:e=olympe.dm.Relation.j.gw,UE:f=olympe.dm.Relation.j.Ot,wF:g=olympe.dm.Relation.j.Wp,KE:h=olympe.dm.Dl.NONE,vF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Kc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
945
+ c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.sa,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.Lj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}th(){return!1}nn(a){this.Z.push(olympe.C.Za().rc(a))}lb(a,b){bm(olympe.dc.Fj(),this,am(this,a),b)}yn(a){a=
946
+ am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Oc];function Ml(a){var b=olympe.dc.Fj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Xc(d,(new Map).set(e,f),b.db.model(d));b.j.md(Mf(g,Infinity))}}
947
+ function Nl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.yh,h=a.T();a=a.th();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Xc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.lj(n,a)),b=e.Jb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.md(Mf(n,p));null==d||d(!0)})}
948
+ function bm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);cm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else cm(a,b,c,!1)}function dm(a){const b=olympe.dc.Request.j.jk;Uf(a.Jb,olympe.dc.Request.j.yo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Yb(d));a.j.md(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Uf(a.Jb,b,c=>{c=c.content;em(a,c.id,c.finalize,c.error)})}
946
949
  function fm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.sa.has(c)||a.Z.push(b);return a}
947
- function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.Wv(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Mq){q.j.then(()=>cm(a,b,c,d));return}c(!1,q.message);return}if(f.nf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Rl(f);a.j.ne(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Sl(f).filter(q=>a.db.Re(q)&&a.db.Nb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ha.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Pg(a.j,
950
+ function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.$v(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Pq){q.j.then(()=>cm(a,b,c,d));return}c(!1,q.message);return}if(f.nf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Rl(f);a.j.ne(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Sl(f).filter(q=>a.db.Re(q)&&a.db.Nb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Pg(a.j,
948
951
  f.j,g),n=olympe.C.Za().rc((q,r)=>c(null!==q,r)),p=[l,n];gm(a,f,g).then(q=>{p.splice(1,0,q);hm(a,e,h,f.D.size+1);return im(a,f.D,d,b.th(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.sa(r,t,v))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));em(a,e,olympe.dc.transaction.If.j.$i)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));jm(a,e)})}}
949
- function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Nb(n,olympe.dm.File)&&void 0!==(null==(p=d.Sc(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.jf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
950
- r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,Y)=>K||Y.Sc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.ln(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Xc(q,r);return p},
951
- new olympe.dc.db.ec);return Pg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.kh(),f=new olympe.async.Ck(e);0<a.R&&f.Zf(a.R);const g=olympe.dc.transaction.If.j.Ev;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});td(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);jm(a,b)});f.start()}
952
- function im(a,b,c,d,e){if(c&&olympe.C.Pa(a.da.state)!==olympe.auth.Ta.j.rf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.dh:olympe.dc.Request.j.df;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.lj(h,d,e));return a.Jb.request(g)})).then(g=>g[0])}
952
+ function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Nb(n,olympe.dm.File)&&void 0!==(null==(p=d.Tc(n))?void 0:p.Pa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.jf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
953
+ r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,Y)=>K||Y.Tc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.mn(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Xc(q,r);return p},
954
+ new olympe.dc.db.ec);return Pg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.kh(),f=new olympe.async.Dk(e);0<a.R&&f.Zf(a.R);const g=olympe.dc.transaction.If.j.Iv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});td(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);jm(a,b)});f.start()}
955
+ function im(a,b,c,d,e){if(c&&olympe.C.Qa(a.da.state)!==olympe.auth.Ta.j.rf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.dh:olympe.dc.Request.j.df;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.lj(h,d,e));return a.Jb.request(g)})).then(g=>g[0])}
953
956
  function em(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function jm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.If.j.$i,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.X)d();a.X=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
954
- olympe.dc.transaction.If=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.sa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.Zh(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ga=new olympe.U.promise.Sk;dm(this)}re(a){vb(this.Ga,()=>this.Jb.request(new olympe.dc.Request(olympe.dc.Request.j.Ep,olympe.dc.Ha.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
955
- b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.If.j={Bm:0,$i:1,Ev:2};olympe.dc.transaction.lj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}th(){return this.F}ac(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.Config={Aq:'dc.transaction.timeout',wo:'dc.transaction.burstInterval',am:'dc.transaction.disabledCompilers'};
956
- olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Aq,9E4);E(a,olympe.dc.transaction.Config.wo,30);E(a,olympe.dc.transaction.Config.am,[]);D(a,olympe.dc.transaction.P.Ca,[olympe.ha.P.Da],b=>b.ad('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.oa(olympe.dc.transaction.Config.Aq),new olympe.V.oa(olympe.dc.transaction.Config.am),new olympe.V.oa(olympe.dc.db.Config.Ol)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Da,
957
- olympe.dc.transaction.If,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ug,olympe.dc.sources.P.af,olympe.dc.P.gk,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function km(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.Cg=class{constructor(){this.ga=olympe.dc.ga()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Pa(a){a=olympe.C.Pa(a);return void 0===a||null===a?null:olympe.C.$s(a)?a.valueOf():a}};olympe.dc.transaction.Fa.Cg.ya=[olympe.dc.Mc];olympe.dc.transaction.Fa.oo=class extends olympe.dc.transaction.Fa.Cg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ga.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}Ka(){return this.relation.Ka()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function X(a,b,c){a.Kd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Fa.Wo=class extends olympe.dc.transaction.Fa.Cg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.hf();this.model=olympe.dc.ea(a);this.source=null;this.Kd=new Map}W(){return this.tag}Vb(){return this.model}yi(a){this.source=a;return this}j(a){const b=this.Vb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Qc(c,b,this.source,km(this,this.Kd))}toString(){return`CreateInstance(${this.Vb()}, ${this.W()})`}};
958
- olympe.dc.transaction.Fa.Wo.ya=[olympe.dc.Ye];olympe.dc.transaction.Fa.Ul=class extends olympe.dc.transaction.Fa.oo{constructor(a,b,c){super(a,b);this.D=this.ga.Ia(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
959
- 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.ea(this.origin),olympe.dc.ea(this.D)):a.Oa(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Fa.YA=class extends olympe.dc.transaction.Fa.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}j(a){for(const b of this.ga.Tc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Fa.ip(b,this.Ob)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Ob})`}};olympe.dc.transaction.Fa.hp=class extends olympe.dc.transaction.Fa.oo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ka(),e=this.ga.cb(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
960
- a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.ip=class extends olympe.dc.transaction.Fa.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ga.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ga.Ia(b)&&Ul(a,b,this.Ob)}toString(){return'DeleteInstance('+this.W()+', '+this.Ob+')'}};olympe.dc.transaction.Fa.hu=class extends olympe.dc.transaction.Fa.Ul{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
961
- 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.W()+', '+olympe.dc.ea(this.origin)+', '+olympe.dc.ea(this.D)+')'}};olympe.dc.transaction.Fa.Vw=class extends olympe.dc.transaction.Fa.Cg{constructor(a,b,c){super();this.tag=this.ga.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Kd=new Map;void 0!==b&&this.Kd.set(olympe.dc.ea(b),c)}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Sc(b))&&c.D()||this.ga.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Kd);
962
- for(const [e,f]of c){var d=this.ga.Qa(b,e,!0);d instanceof olympe.dc.uc&&Ul(a,d.W(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.W())&&(d=new olympe.dc.Ya,d.persist(f.W()),d.j(a))}a.Xc(b,c)}toString(){return'UpdateInstance('+this.W()+', '+km(this,this.Kd)+')'}};olympe.dc.transaction.Fa.Xv=class a extends olympe.dc.transaction.Fa.Cg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ga();if(Z(b,this.tag)&&c.Ia(this.tag)&&!c.Re(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Sc(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.Ia(g.W())&&(new a(g.W(),this.source)).j(b);d=c.model(this.tag);b.Qc(this.tag,d,this.source,e);for(const [g,h,k]of sh(c,this.tag))Z(b,
963
- 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.ea=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.W)&&(null==a||!a.fh))b=a.W();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.Vb(a))?d:''}else if(olympe.C.pf(a)){let d;b=olympe.dc.ea(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ea);olympe.dc.ga=function(){return olympe.dc.ly().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
964
- olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Cs=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.Fx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.tn=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.wb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.qn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.ba?a:null;olympe.dc.mb.sn=a=>'number'===typeof a||a instanceof Number?olympe.C.qa(a):'string'===typeof a||a instanceof String?olympe.C.qa(Number.parseFloat(a.valueOf())):a instanceof olympe.C.$?a:null;
965
- olympe.dc.mb.rn=a=>'number'===typeof a||a instanceof Number?nc(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.xs=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?rc(a.valueOf()):null};olympe.dc.mb.ys=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
966
- olympe.dc.mb.tj=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};
967
- olympe.dc.mb.Zx=a=>{switch(a){case olympe.C.ba:return olympe.dc.mb.qn;case olympe.C.Sa:return olympe.dc.mb.tn;case olympe.C.$:return olympe.dc.mb.sn;case olympe.C.eb:return olympe.dc.mb.rn;case olympe.C.Color:return olympe.dc.mb.xs;case olympe.dc.CloudObject:return olympe.dc.mb.ys;default:return olympe.dc.mb.tj}};olympe.dc.jc={};olympe.dc.wf=class{ka(){}F(){}compare(){}H(){}fa(){}toString(){}};function lm(a){let b=null;for(a=[...a.aa];null===b&&0<a.length;)b=a.pop().Mb();return b}function mm(a,b){a.N()||(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.ha.Xa('dc').warn(a))}
968
- olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ha.Xa('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.ea,String),this.aa=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Ac=void 0)}qe(){return olympe.dc.qe()}nb(){if(null===this.j){const a=olympe.dc.jc.By();this.j=nm(a,this,this.Ac);null!==this.valueType&&this.j.Qd(this.valueType);olympe.C.Za().Xd(()=>
969
- {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}Qd(a){this.valueType=a;null!==this.j&&this.j.Qd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}be(){return this.D}tm(){return this.aa}jd(a,b){return this.mc().jd(a,b)}sl(a){this.mc().sl(a)}Su(){return this.mc().Fd()}Ru(){return this.mc().N()}get(a){return this.mc().get(a)}si(){return this.mc().si()}oi(a){const b=
970
- this.mc();mm(b,'getCurrent');return b.oi(a)}has(a){return this.mc().has(a)}rh(a){const b=this.mc();mm(b,'hasCurrent');return b.rh(a)}pe(a){return this.mc().pe(a)}Bz(a){return this.pe(a).asObservable()}lf(a){const b=this.mc();mm(b,'getCurrentAt');return b.lf(a)}mf(a){return this.mc().mf(a)}Pf(a){const b=this.mc();mm(b,'getCurrentKeyAt');return b.Pf(a)}Hd(a){return this.mc().Hd(a)}Gz(a){return this.Hd(a).asObservable()}Qf(a){const b=this.mc();mm(b,'getCurrentRank');return b.Qf(a)}Hc(){return this.mc().Hc()}Cz(){return this.Hc().asObservable()}Rf(){return this.mc().Rf()}Bf(){return this.mc().Bf()}Hz(){return this.Bf().asObservable()}wg(){const a=
971
- this.mc();mm(a,'getCurrentSize');return a.wg()}forEach(a,b){this.mc().forEach(a,b)}oe(a){const b=this.mc();mm(b,'forEachCurrentValue');return b.oe(a)}wj(a,b,c,d){a=new olympe.dc.aa.Mh(a,b);(new olympe.dc.za(this.D,[...this.aa,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.aa];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
972
- 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.Qd(lm(b)||this.valueType||Object);return b}yl(a){return this.transform(new olympe.dc.aa.Kf(a))}filter(a){return this.transform(new olympe.dc.aa.yf(a))}al(){const a=new olympe.dc.qk(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);
973
- let b=this.aa;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.aa;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}Qu(){return this.mc().Lg()}Vc(){return olympe.C.ta([this.Bf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.lf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.wb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.yl;
974
- olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.oe;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.wg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Hz;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Cz;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Qf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Gz;
975
- olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.lf;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Bz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.sl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.jd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.be;olympe.dc.za.ya=[olympe.C.ud];m=olympe.dc.za.prototype;m.qe.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.jc.Subscription,[]);m.Qd.K=new olympe.C.J(()=>{},[]);
976
- m.be.K=new olympe.C.J(()=>String,[]);m.tm.K=new olympe.C.J(()=>Array,[]);m.jd.K=new olympe.C.J(()=>String,[]);m.sl.K=new olympe.C.J(()=>{},[]);m.Su.K=olympe.C.J.N;m.Ru.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.si.K=new olympe.C.J(()=>Array,[]);m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.lf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.Hd.K=olympe.C.J.F;
977
- m.Qf.K=olympe.C.J.j;m.Hc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.yl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.al.K=new olympe.C.J(()=>olympe.dc.qk,[]);m.toString.K=olympe.C.J.j;m.Qu.K=olympe.C.J.j;m.Vc.K=olympe.C.J.D;const om={pA:'append',fm:'filter_not',up:'filter_and',vp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.po(a,b)).D}
978
- olympe.dc.qk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ha.Xa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Fa=[];this.Ac=void 0}Xi(){const a=new olympe.dc.za(this.j,this.aa,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 rm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
979
- d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.aa.push(d)}return this}yl(a){this.aa.push(new olympe.dc.aa.Kf(a));return this}mA(a){this.aa.push(new olympe.dc.aa.Kf(qm(a)));return this}Uu(a){this.valueType=a;return this}bb(a){this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Tx(a){for(const b of a)this.aa.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Sx(a,
980
- b,c){a=new olympe.dc.aa.Ke(a,a.Ka(),b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Rx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.W());void 0===c&&(c=e.Ka())}a=new olympe.dc.aa.sk(b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Tu(){this.bb(olympe.dc.CloudObject.instancesRel);return this}gf(a){var b=this.Fa.pop();b===om.fm&&(a=new olympe.dc.Y.ie(a),b=this.Fa.pop());switch(b){case om.up:b=this.aa.pop().D;b instanceof
981
- olympe.dc.Y.Nd?(b=b.Y,b.push(a),a=new olympe.dc.Y.Nd(...b)):a=new olympe.dc.Y.Nd(b,a);b=this.Fa.pop();break;case om.vp:b=this.aa.pop().D,b instanceof olympe.dc.Y.Fe?(b=b.Y,b.push(a),a=new olympe.dc.Y.Fe(...b)):a=new olympe.dc.Y.Fe(b,a),b=this.Fa.pop()}b===om.fm&&(a=new olympe.dc.Y.ie(a),this.Fa.pop());this.aa.push(new olympe.dc.aa.yf(a));return this}Nx(a,b,c){return this.gf(new olympe.dc.Y.Be(pm(a,c),new olympe.dc.ab.We(b)))}contains(a,b,c=!1,d){return this.gf(new olympe.dc.Y.xf(pm(a,d),new olympe.dc.ab.We(b),
982
- c))}Nb(a){if(!(a instanceof Array))throw new rm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(qm(a[c]));return this.gf(new olympe.dc.Y.Ui(b))}nl(a){return this.gf(new olympe.dc.Y.Be(new olympe.dc.ab.kj,new olympe.dc.ab.We(qm(a))))}Ox(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.zd().nl(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().zd().nl(a[b])}return this}az(a,b){if(!(a instanceof
983
- Array))throw new rm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ka())});return this.gf(new olympe.dc.Y.Ri(c,d,b))}ml(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.lk(a,new olympe.dc.ab.We(b)))}Oj(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.Qk(a,new olympe.dc.ab.We(b)))}rz(a,b,c,d){a=pm(a,d);return this.gf(new olympe.dc.Y.Gf(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Bg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
984
- return this.gf(b)}zd(){this.Fa.push(om.fm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Fa.push(om.up);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Fa.push(om.vp);return this}wl(a,b,c){a=qm(a);let d=null;switch(olympe.dc.ga().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.vc.String(new olympe.dc.ab.jj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.vc.Number(new olympe.dc.ab.aj(a,c));break;case olympe.dm.DateTime.O.W():d=
985
- new olympe.dc.vc.DateTime(new olympe.dc.ab.Ji(a,c))}c=d;null!==c&&this.aa.push(new olympe.dc.aa.ah(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.vc.Bg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.aa.push(new olympe.dc.aa.ah(d,c));return this}Jx(){this.aa.push(new olympe.dc.aa.Ki);return this}Hj(a,b){this.aa.push(new olympe.dc.aa.Mh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
986
- function qm(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.Vb(a):olympe.C.gb(a)?a.di===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.wb(olympe.dc.ea(b)),olympe.C.Sa):a.W()}m=olympe.dc.qk.prototype;m.Xi.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=olympe.C.J.H();m.yl.K=olympe.C.J.H();m.mA.K=olympe.C.J.H();m.Uu.K=olympe.C.J.H();m.bb.K=olympe.C.J.H();m.Tx.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.Rx.K=olympe.C.J.H();m.Tu.K=olympe.C.J.H();m.gf.K=olympe.C.J.H();
987
- m.Nx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Nb.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Ox.K=olympe.C.J.H();m.az.K=olympe.C.J.H();m.ml.K=olympe.C.J.H();m.Oj.K=olympe.C.J.H();m.rz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.zd.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.wl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Jx.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function nm(a,b,c){const d=b.be();var e=new olympe.dc.query.Vv;let f;f=d;olympe.C.gb(f)&&(f=e.add(d));b=(b=b.tm())?Array.isArray(b)?b:[b]:null;e=olympe.dc.jc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.jc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
988
- function sm(a,b){if(b.N())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.kc.Ur(a.db,a.G),d=b.T();olympe.C.Uc([b.be()],e=>{const f=olympe.dc.ea(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.sg()||b.mi();Nf(a.db,f,tm(a,b,c),d);olympe.C.Za().Xd(()=>Lf(a.db,f,d));a.db.Ia(f.valueOf())||um(c);b.N()||(um(c),b.Oc([]))})}}
989
- function vm(a,b,c,d,e){const f=[b.be()],g=l=>l instanceof olympe.dc.aa.Kf;let h;const k=(null!=(h=b.ph())?h:[]).filter(g);for(const l of k){f.push(l.be());let n;k.push(...(null!=(n=l.ph())?n:[]).filter(g))}olympe.C.Uc(f,()=>{const l=b.ke(c);wm(a,l,b.T(),d,e)})}
990
- function wm(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Za(),g=new olympe.async.Ck(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Bi(a.H,h,f,olympe.dc.Ha.SELF,olympe.dc.la.nc.vf,{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}`))))})});td(g,(h,k)=>d(k));g.start()}
991
- function tm(a,b,c){const d=new olympe.dc.kc.Uj;let e=!1;const f=olympe.C.Za(),g=b.ph(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.hd()||f.fb()||(k?b.rh(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.Md(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.tg(n)),e||(xm(c,()=>{p.og();um(c)}),f.run(()=>p.qe().zg(b.Oc.bind(b))),
957
+ olympe.dc.transaction.If=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.sa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.Zh(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ha=new olympe.U.promise.Tk;dm(this)}re(a){vb(this.Ha,()=>this.Jb.request(new olympe.dc.Request(olympe.dc.Request.j.Fp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
958
+ b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.If.j={Cm:0,$i:1,Iv:2};olympe.dc.transaction.lj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}th(){return this.F}ac(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Fa:'dc.transaction.Manager'};olympe.dc.transaction.Config={Dq:'dc.transaction.timeout',xo:'dc.transaction.burstInterval',bm:'dc.transaction.disabledCompilers'};
959
+ olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Dq,9E4);E(a,olympe.dc.transaction.Config.xo,30);E(a,olympe.dc.transaction.Config.bm,[]);D(a,olympe.dc.transaction.P.Ca,[olympe.ha.P.Fa],b=>b.ad('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.oa(olympe.dc.transaction.Config.Dq),new olympe.V.oa(olympe.dc.transaction.Config.bm),new olympe.V.oa(olympe.dc.db.Config.Pl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Fa,
960
+ olympe.dc.transaction.If,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Fa,olympe.dc.P.Ug,olympe.dc.sources.P.af,olympe.dc.P.hk,olympe.auth.P.Fa,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ga={};function km(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ga.Cg=class{constructor(){this.ga=olympe.dc.ga()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.C.Qa(a);return void 0===a||null===a?null:olympe.C.et(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Cg.ya=[olympe.dc.Oc];olympe.dc.transaction.Ga.po=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ga.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}La(){return this.relation.La()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function X(a,b,c){a.Kd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ga.Xo=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.hf();this.model=olympe.dc.ea(a);this.source=null;this.Kd=new Map}W(){return this.tag}Vb(){return this.model}yi(a){this.source=a;return this}j(a){const b=this.Vb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Rc(c,b,this.source,km(this,this.Kd))}toString(){return`CreateInstance(${this.Vb()}, ${this.W()})`}};
961
+ olympe.dc.transaction.Ga.Xo.ya=[olympe.dc.Ye];olympe.dc.transaction.Ga.Vl=class extends olympe.dc.transaction.Ga.po{constructor(a,b,c){super(a,b);this.D=this.ga.Ja(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
962
+ if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.ua.DESTINATION?a.Oa(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.Oa(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ga.bB=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}j(a){for(const b of this.ga.Uc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ga.jp(b,this.Ob)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Ob})`}};olympe.dc.transaction.Ga.ip=class extends olympe.dc.transaction.Ga.po{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.La(),e=this.ga.cb(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
963
+ a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.jp=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ga.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ga.Ja(b)&&Ul(a,b,this.Ob)}toString(){return'DeleteInstance('+this.W()+', '+this.Ob+')'}};olympe.dc.transaction.Ga.lu=class extends olympe.dc.transaction.Ga.Vl{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
964
+ this.relation.La()===olympe.dc.ua.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.W()+', '+olympe.dc.ea(this.origin)+', '+olympe.dc.ea(this.D)+')'}};olympe.dc.transaction.Ga.Zw=class extends olympe.dc.transaction.Ga.Cg{constructor(a,b,c){super();this.tag=this.ga.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Kd=new Map;void 0!==b&&this.Kd.set(olympe.dc.ea(b),c)}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Tc(b))&&c.D()||this.ga.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Kd);
965
+ for(const [e,f]of c){var d=this.ga.Pa(b,e,!0);d instanceof olympe.dc.vc&&Ul(a,d.W(),olympe.dc.Lb.Dc);f instanceof olympe.dc.vc&&!Z(a,f.W())&&(d=new olympe.dc.Ya,d.persist(f.W()),d.j(a))}a.Xc(b,c)}toString(){return'UpdateInstance('+this.W()+', '+km(this,this.Kd)+')'}};olympe.dc.transaction.Ga.aw=class a extends olympe.dc.transaction.Ga.Cg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ga();if(Z(b,this.tag)&&c.Ja(this.tag)&&!c.Re(this.tag)){const e=c.zb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Tc(this.tag))?void 0:d.zb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ja(g.W())&&(new a(g.W(),this.source)).j(b);d=c.model(this.tag);b.Rc(this.tag,d,this.source,e);for(const [g,h,k]of sh(c,this.tag))Z(b,
966
+ 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.ea=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.W)&&(null==a||!a.fh))b=a.W();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.Vb(a))?d:''}else if(olympe.C.pf(a)){let d;b=olympe.dc.ea(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ea);olympe.dc.ga=function(){return olympe.dc.Ms().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
967
+ olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Fs=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.Jx=function(a){return a.$b()};olympe.dc.ib={};olympe.dc.ib.un=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.wb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.ib.rn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.ba?a:null;olympe.dc.ib.tn=a=>'number'===typeof a||a instanceof Number?olympe.C.qa(a):'string'===typeof a||a instanceof String?olympe.C.qa(Number.parseFloat(a.valueOf())):a instanceof olympe.C.$?a:null;
968
+ olympe.dc.ib.sn=a=>'number'===typeof a||a instanceof Number?nc(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.ib.As=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?rc(a.valueOf()):null};olympe.dc.ib.Bs=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
969
+ olympe.dc.ib.tj=a=>a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.ib.tc=a=>{a=a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.tc():a)?b:null};
970
+ olympe.dc.ib.ey=a=>{switch(a){case olympe.C.ba:return olympe.dc.ib.rn;case olympe.C.Sa:return olympe.dc.ib.un;case olympe.C.$:return olympe.dc.ib.tn;case olympe.C.eb:return olympe.dc.ib.sn;case olympe.C.Color:return olympe.dc.ib.As;case olympe.dc.CloudObject:return olympe.dc.ib.Bs;default:return olympe.dc.ib.tj}};olympe.dc.jc={};olympe.dc.wf=class{ka(){}F(){}compare(){}H(){}fa(){}toString(){}};function lm(a){let b=null;for(a=[...a.aa];null===b&&0<a.length;)b=a.pop().Mb();return b}function mm(a,b){a.N()||(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.ha.Xa('dc').warn(a))}
971
+ olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ha.Xa('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.ea,String),this.aa=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Bc=void 0)}qe(){return olympe.dc.qe()}lb(){if(null===this.j){const a=olympe.dc.jc.Ey();this.j=nm(a,this,this.Bc);null!==this.valueType&&this.j.Qd(this.valueType);olympe.C.Za().Xd(()=>
972
+ {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.lb();return this.j}Qd(a){this.valueType=a;null!==this.j&&this.j.Qd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}be(){return this.D}um(){return this.aa}jd(a,b){return this.mc().jd(a,b)}tl(a){this.mc().tl(a)}Wu(){return this.mc().Fd()}Vu(){return this.mc().N()}get(a){return this.mc().get(a)}si(){return this.mc().si()}oi(a){const b=
973
+ this.mc();mm(b,'getCurrent');return b.oi(a)}has(a){return this.mc().has(a)}rh(a){const b=this.mc();mm(b,'hasCurrent');return b.rh(a)}pe(a){return this.mc().pe(a)}Ez(a){return this.pe(a).asObservable()}lf(a){const b=this.mc();mm(b,'getCurrentAt');return b.lf(a)}mf(a){return this.mc().mf(a)}Pf(a){const b=this.mc();mm(b,'getCurrentKeyAt');return b.Pf(a)}Hd(a){return this.mc().Hd(a)}Jz(a){return this.Hd(a).asObservable()}Qf(a){const b=this.mc();mm(b,'getCurrentRank');return b.Qf(a)}Ic(){return this.mc().Ic()}Fz(){return this.Ic().asObservable()}Rf(){return this.mc().Rf()}Bf(){return this.mc().Bf()}Kz(){return this.Bf().asObservable()}wg(){const a=
974
+ this.mc();mm(a,'getCurrentSize');return a.wg()}forEach(a,b){this.mc().forEach(a,b)}oe(a){const b=this.mc();mm(b,'forEachCurrentValue');return b.oe(a)}wj(a,b,c,d){a=new olympe.dc.aa.Mh(a,b);(new olympe.dc.Aa(this.D,[...this.aa,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.aa];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
975
+ 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.Aa(this.D,a);b.Bc=this.Bc;b.Qd(lm(b)||this.valueType||Object);return b}zl(a){return this.transform(new olympe.dc.aa.Kf(a))}filter(a){return this.transform(new olympe.dc.aa.yf(a))}bl(){const a=new olympe.dc.rk(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);
976
+ let b=this.aa;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.aa;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}Uu(){return this.mc().Lg()}Wc(){return olympe.C.ta([this.Bf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.lf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.wb(b+']')},olympe.C.Sa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.zl;
977
+ olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.oe;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.wg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Kz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Fz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Qf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Jz;
978
+ olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.lf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Ez;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.tl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.jd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.be;olympe.dc.Aa.ya=[olympe.C.ud];m=olympe.dc.Aa.prototype;m.qe.K=olympe.C.J.j;m.lb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.jc.Subscription,[]);m.Qd.K=new olympe.C.J(()=>{},[]);
979
+ m.be.K=new olympe.C.J(()=>String,[]);m.um.K=new olympe.C.J(()=>Array,[]);m.jd.K=new olympe.C.J(()=>String,[]);m.tl.K=new olympe.C.J(()=>{},[]);m.Wu.K=olympe.C.J.N;m.Vu.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.si.K=new olympe.C.J(()=>Array,[]);m.oi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.rh.K=olympe.C.J.j;m.pe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.lf.K=olympe.C.J.j;m.mf.K=new olympe.C.J(()=>String,[]);m.Pf.K=olympe.C.J.j;m.Hd.K=olympe.C.J.F;
980
+ m.Qf.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Rf.K=new olympe.C.J(()=>String,[]);m.Bf.K=olympe.C.J.F;m.wg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.oe.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.zl.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.bl.K=new olympe.C.J(()=>olympe.dc.rk,[]);m.toString.K=olympe.C.J.j;m.Uu.K=olympe.C.J.j;m.Wc.K=olympe.C.J.D;const om={tA:'append',gm:'filter_not',vp:'filter_and',wp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.qo(a,b)).D}
981
+ olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ha.Xa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Ga=[];this.Bc=void 0}Xi(){const a=new olympe.dc.Aa(this.j,this.aa,this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new rm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
982
+ d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.aa.push(d)}return this}zl(a){this.aa.push(new olympe.dc.aa.Kf(a));return this}qA(a){this.aa.push(new olympe.dc.aa.Kf(qm(a)));return this}Yu(a){this.valueType=a;return this}bb(a){this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Xx(a){for(const b of a)this.aa.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Wx(a,
983
+ b,c){a=new olympe.dc.aa.Ke(a,a.La(),b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Vx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.W());void 0===c&&(c=e.La())}a=new olympe.dc.aa.tk(b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Xu(){this.bb(olympe.dc.CloudObject.instancesRel);return this}gf(a){var b=this.Ga.pop();b===om.gm&&(a=new olympe.dc.Y.ie(a),b=this.Ga.pop());switch(b){case om.vp:b=this.aa.pop().D;b instanceof
984
+ olympe.dc.Y.Nd?(b=b.Y,b.push(a),a=new olympe.dc.Y.Nd(...b)):a=new olympe.dc.Y.Nd(b,a);b=this.Ga.pop();break;case om.wp:b=this.aa.pop().D,b instanceof olympe.dc.Y.Fe?(b=b.Y,b.push(a),a=new olympe.dc.Y.Fe(...b)):a=new olympe.dc.Y.Fe(b,a),b=this.Ga.pop()}b===om.gm&&(a=new olympe.dc.Y.ie(a),this.Ga.pop());this.aa.push(new olympe.dc.aa.yf(a));return this}Rx(a,b,c){return this.gf(new olympe.dc.Y.Be(pm(a,c),new olympe.dc.ab.We(b)))}contains(a,b,c=!1,d){return this.gf(new olympe.dc.Y.xf(pm(a,d),new olympe.dc.ab.We(b),
985
+ c))}Nb(a){if(!(a instanceof Array))throw new rm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(qm(a[c]));return this.gf(new olympe.dc.Y.Ui(b))}ol(a){return this.gf(new olympe.dc.Y.Be(new olympe.dc.ab.kj,new olympe.dc.ab.We(qm(a))))}Sx(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.zd().ol(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().zd().ol(a[b])}return this}dz(a,b){if(!(a instanceof
986
+ Array))throw new rm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.gf(new olympe.dc.Y.Ri(c,d,b))}nl(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.mk(a,new olympe.dc.ab.We(b)))}Pj(a,b,c){a=pm(a,c);return this.gf(new olympe.dc.Y.Rk(a,new olympe.dc.ab.We(b)))}vz(a,b,c,d){a=pm(a,d);return this.gf(new olympe.dc.Y.Gf(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Bg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
987
+ return this.gf(b)}zd(){this.Ga.push(om.gm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Ga.push(om.vp);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.yf&&this.Ga.push(om.wp);return this}xl(a,b,c){a=qm(a);let d=null;switch(olympe.dc.ga().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.wc.String(new olympe.dc.ab.jj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.wc.Number(new olympe.dc.ab.aj(a,c));break;case olympe.dm.DateTime.O.W():d=
988
+ new olympe.dc.wc.DateTime(new olympe.dc.ab.Ji(a,c))}c=d;null!==c&&this.aa.push(new olympe.dc.aa.ah(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.Bg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.aa.push(new olympe.dc.aa.ah(d,c));return this}Nx(){this.aa.push(new olympe.dc.aa.Ki);return this}Hj(a,b){this.aa.push(new olympe.dc.aa.Mh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
989
+ function qm(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.Vb(a):olympe.C.gb(a)?a.di===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.wb(olympe.dc.ea(b)),olympe.C.Sa):a.W()}m=olympe.dc.rk.prototype;m.Xi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.zl.K=olympe.C.J.H();m.qA.K=olympe.C.J.H();m.Yu.K=olympe.C.J.H();m.bb.K=olympe.C.J.H();m.Xx.K=olympe.C.J.H();m.Wx.K=olympe.C.J.H();m.Vx.K=olympe.C.J.H();m.Xu.K=olympe.C.J.H();m.gf.K=olympe.C.J.H();
990
+ m.Rx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Nb.K=olympe.C.J.H();m.ol.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.dz.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Pj.K=olympe.C.J.H();m.vz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.zd.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.xl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Nx.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function nm(a,b,c){const d=b.be();var e=new olympe.dc.query.Zv;let f;f=d;olympe.C.gb(f)&&(f=e.add(d));b=(b=b.um())?Array.isArray(b)?b:[b]:null;e=olympe.dc.jc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.jc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
991
+ function sm(a,b){if(b.N())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.kc.Xr(a.db,a.G),d=b.T();olympe.C.Vc([b.be()],e=>{const f=olympe.dc.ea(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.sg()||b.mi();Nf(a.db,f,tm(a,b,c),d);olympe.C.Za().Xd(()=>Lf(a.db,f,d));a.db.Ja(f.valueOf())||um(c);b.N()||(um(c),b.Qc([]))})}}
992
+ function vm(a,b,c,d,e){const f=[b.be()],g=l=>l instanceof olympe.dc.aa.Kf;let h;const k=(null!=(h=b.ph())?h:[]).filter(g);for(const l of k){f.push(l.be());let n;k.push(...(null!=(n=l.ph())?n:[]).filter(g))}olympe.C.Vc(f,()=>{const l=b.ke(c);wm(a,l,b.T(),d,e)})}
993
+ function wm(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Za(),g=new olympe.async.Dk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Bi(a.H,h,f,olympe.dc.Ia.SELF,olympe.dc.la.nc.vf,{Bc: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}`))))})});td(g,(h,k)=>d(k));g.start()}
994
+ function tm(a,b,c){const d=new olympe.dc.kc.Vj;let e=!1;const f=olympe.C.Za(),g=b.ph(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.hd()||f.fb()||(k?b.rh(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.Md(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.tg(n)),e||(xm(c,()=>{p.og();um(c)}),f.run(()=>p.qe().zg(b.Qc.bind(b))),
992
995
  e=!0),ym(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,zm(p,k,l,n))}}
993
- olympe.dc.jc.uv=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.Wb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.jc.Cw(a),this.j.set(c,d));d.counter++;Am(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.ef(),b||this.D&&d===olympe.dc.Ha.SERVER||d===olympe.dc.Ha.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
996
+ olympe.dc.jc.yv=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.Wb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.jc.Gw(a),this.j.set(c,d));d.counter++;Am(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.ef(),b||this.D&&d===olympe.dc.Ia.SERVER||d===olympe.dc.Ia.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
994
997
  sm(this,a)):vm(this,a,d,e=>{e?this.G.error(e):sm(this,a)},b))}};function Bm(a){return olympe.C.gb(a)?'Node#'+a.Ba.T():String(a)}function Cm(a,b){return olympe.C.gb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
995
- olympe.dc.query.Vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.gb(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{ka(){}j(){}D(){}fa(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.C.Sj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Wb('context subscription '+b,e));this.id=b;this.vd=c;this.aa=d||null;this.state=this.H.run(()=>olympe.C.fe(olympe.dc.jc.Subscription.j.INIT));this.Gc=!1;this.X=this.Yb=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].fa(d);else e+='|null';e=olympe.U.tb(e)}catch(f){e=olympe.U.Jc()}return e}T(){return this.id}be(){return this.vd}ph(){return this.aa}ef(){const b=
996
- olympe.dc.ee(),c=olympe.C.Pa(this.be());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.aa)?void 0:d[0])?b.fromModel(c):b.Qe(c)}sg(){const b=olympe.C.Pa(this.state);return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Nr}mi(){if(this.state.Ba.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Yb;this.Yb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);kc(this.state,olympe.C.fe(olympe.dc.jc.Subscription.j.Nr))}Fd(){return olympe.C.ta([this.state],
997
- ()=>{},olympe.C.ba)}N(){const b=this.state.Ba.Eb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Vh}jd(b,c){this.N()?b(this):(null===this.X&&(this.X=new Map),void 0===c&&(c=olympe.U.Jc()),this.X.set(c,olympe.C.Za().rc(b)));return c||''}sl(b){null!==this.X&&b&&this.X.delete(b)}yb(){const b=olympe.dc.jc.Subscription.j.Vh;if(!this.state.Ba.fb()&&olympe.C.Pa(this.state)!==b&&(this.Mf(),kc(this.state,b),null!==this.X)){for(const c of this.X.values())c(this);this.X=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Oc(b){if(!this.state.Ba.fb()){for(let c=
998
- 0,d=b.length;c<d;c++)this.hn(b[c],c);if(this.N())this.Mf();else{this.Gc=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.yb()}}}Md(b,c){if(!this.state.Ba.fb()&&(this.$k(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Gc&&!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.yb()}}tg(b){this.state.Ba.fb()||
999
- (this.gn(b),this.pj(b,!this.N()))}Lg(){return this.N()?super.Lg():'Subscription is not ready!'}ke(b){const c=olympe.C.Pa(this.be());return olympe.dc.jc.Subscription.D(c,b,this.ph())}static D(b,c,d){var e=olympe.dc.la.from(b,c).me();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.aa.$e){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.bb(h,!0))}else if(e instanceof olympe.dc.aa.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ug(h,
1000
- !0,!0))}else if(e instanceof olympe.dc.aa.Kf)e=a.D(olympe.C.Pa(e.be()),c,e.ph()),b.push(...e);else if(e instanceof olympe.dc.aa.yf||e instanceof olympe.dc.aa.ah){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ug(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.jc.Subscription.j={INIT:0,Nr:1,Vh:2};olympe.dc.jc.Subscription.prototype.Lg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.jc.Cw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Jf=class{ka(){}Mb(){}j(){}fa(){}toString(){}};olympe.dc.fr=class{F(){}};olympe.dc.Xk=class{ka(){}getValue(){}j(){}fa(){}toString(){}};olympe.dc.vc={};let Dm=0;olympe.dc.vc.Bg=class{constructor(){this.id=Dm++}ka(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.vc.Bg.ya=[olympe.dc.wf];olympe.dc.vc.DateTime=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.vc.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}fa(a){return'{"c":"'+this.ka()+'",a:['+this.j.fa(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.vc.DateTime);olympe.dc.vc.DateTime.ya=[olympe.dc.wf];olympe.dc.vc.Number=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.vc.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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.vc.Number);olympe.dc.vc.Number.ya=[olympe.dc.wf];olympe.dc.vc.String=class{constructor(a){this.j=a}ka(){return Q(olympe.dc.vc.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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.vc.String);olympe.dc.vc.String.ya=[olympe.dc.wf];olympe.dc.Y={};let Em=0;olympe.dc.Y.Bg=class{constructor(){this.id=Em++}ka(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.Y.Bg.ya=[olympe.dc.Aa];olympe.dc.Y.Dl=class{constructor(a,b){this.F=a;this.H=b}ka(){}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.Rb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ba))}N(){}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return this.ka().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
1001
- olympe.dc.Y.Dl.ya=[olympe.dc.Aa];olympe.dc.Y.Nd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Nd)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
1002
- a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Y.Nd);olympe.dc.Y.Nd.ya=[olympe.dc.Aa];olympe.dc.Y.Jl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Rb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ba))}ka(){return Q(olympe.dc.Y.Jl)}D(){return[this.value.j()]}fa(a){const b=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();return'{"c":"'+this.ka()+'","a":['+b+','+this.value.fa(a)+']}'}toString(){const a=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();
1003
- return this.ka().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Y.Jl);olympe.dc.Y.Jl.ya=[olympe.dc.Aa];olympe.dc.Y.xf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}ka(){return Q(olympe.dc.Y.xf)}D(){return[this.source.j(),this.value.j()]}ib(){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.Rb(c.includes(d))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=this.value.fa(a);a=Cm(a,this.F);
1004
- return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Bm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Y.xf);olympe.dc.Y.xf.ya=[olympe.dc.Aa];olympe.dc.Y.Be=class{constructor(a,b){this.F=a;this.H=b}ka(){return Q(olympe.dc.Y.Be)}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.Jd?c.Jd(d):'object'===typeof d&&void 0!==d.Jd?d.Jd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ba,'Test equal predicate'))}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1005
- ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Y.Be);olympe.dc.Y.Be.ya=[olympe.dc.Aa];olympe.dc.Y.ju=class extends olympe.dc.Y.Be{constructor(a,b){super(a,new olympe.dc.ab.We(b))}};olympe.dc.Y.ju.ya=[olympe.dc.Aa];olympe.dc.Y.lk=class extends olympe.dc.Y.Dl{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.lk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Y.lk);olympe.dc.Y.Ri=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ea(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Fm(c.W(),c.Ka(),c.F,c.D)):this.ob.push(new Fm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.Ri)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.U.Jc(),e=olympe.dc.ga();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1006
- c.getContext().fb()||c.getContext().hd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=Gm(g[h],e,a,d+h);Nf(e,b,a,d);c.getContext().onDestroy(()=>{Lf(e,b,d)});return c.sb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Y.Ri);
1007
- function Gm(a,b,c,d){const e=Object.create(null);d+=olympe.U.ni();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 Fm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}fa(){return`${this.W()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Y.Ri.ya=[olympe.dc.Aa];olympe.dc.Y.nm=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ea):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Hm(c.W(),c.Ka(),c.F,c.D)):this.ob.push(new Hm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.nm)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ga(),e=olympe.U.ni();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1008
- const g=this.ob;for(let k=g.length-1;0<=k;k--)f=Im(g[k],d,f,e+k);let h=0;Nf(d,b,f.bind(null,k=>{c.getContext().hd()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Lf(d,b,e));return c.sb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.nm);
998
+ olympe.dc.query.Zv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.gb(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.za=class{ka(){}j(){}D(){}fa(){}toString(){}};olympe.dc.jc.Subscription=class a extends olympe.C.Tj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Wb('context subscription '+b,e));this.id=b;this.vd=c;this.aa=d||null;this.state=this.H.run(()=>olympe.C.fe(olympe.dc.jc.Subscription.j.INIT));this.Gc=!1;this.X=this.Yb=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].fa(d);else e+='|null';e=olympe.U.rb(e)}catch(f){e=olympe.U.Kc()}return e}T(){return this.id}be(){return this.vd}ph(){return this.aa}ef(){const b=
999
+ olympe.dc.ee(),c=olympe.C.Qa(this.be());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.aa)?void 0:d[0])?b.fromModel(c):b.Qe(c)}sg(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Rr}mi(){if(this.state.Ba.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Yb;this.Yb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);kc(this.state,olympe.C.fe(olympe.dc.jc.Subscription.j.Rr))}Fd(){return olympe.C.ta([this.state],
1000
+ ()=>{},olympe.C.ba)}N(){const b=this.state.Ba.Eb;return b&&b.valueOf()>=olympe.dc.jc.Subscription.j.Vh}jd(b,c){this.N()?b(this):(null===this.X&&(this.X=new Map),void 0===c&&(c=olympe.U.Kc()),this.X.set(c,olympe.C.Za().rc(b)));return c||''}tl(b){null!==this.X&&b&&this.X.delete(b)}yb(){const b=olympe.dc.jc.Subscription.j.Vh;if(!this.state.Ba.fb()&&olympe.C.Qa(this.state)!==b&&(this.Mf(),kc(this.state,b),null!==this.X)){for(const c of this.X.values())c(this);this.X=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Qc(b){if(!this.state.Ba.fb()){for(let c=
1001
+ 0,d=b.length;c<d;c++)this.jn(b[c],c);if(this.N())this.Mf();else{this.Gc=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.yb()}}}Md(b,c){if(!this.state.Ba.fb()&&(this.al(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Gc&&!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.yb()}}tg(b){this.state.Ba.fb()||
1002
+ (this.hn(b),this.pj(b,!this.N()))}Lg(){return this.N()?super.Lg():'Subscription is not ready!'}ke(b){const c=olympe.C.Qa(this.be());return olympe.dc.jc.Subscription.D(c,b,this.ph())}static D(b,c,d){var e=olympe.dc.la.from(b,c).me();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.aa.$e){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.bb(h,!0))}else if(e instanceof olympe.dc.aa.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ug(h,
1003
+ !0,!0))}else if(e instanceof olympe.dc.aa.Kf)e=a.D(olympe.C.Qa(e.be()),c,e.ph()),b.push(...e);else if(e instanceof olympe.dc.aa.yf||e instanceof olympe.dc.aa.ah){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ug(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.jc.Subscription.j={INIT:0,Rr:1,Vh:2};olympe.dc.jc.Subscription.prototype.Lg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.jc.Gw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Jf=class{ka(){}Mb(){}j(){}fa(){}toString(){}};olympe.dc.ir=class{F(){}};olympe.dc.Yk=class{ka(){}getValue(){}j(){}fa(){}toString(){}};olympe.dc.wc={};let Dm=0;olympe.dc.wc.Bg=class{constructor(){this.id=Dm++}ka(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.wc.Bg.ya=[olympe.dc.wf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}ka(){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}fa(a){return'{"c":"'+this.ka()+'",a:['+this.j.fa(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.ya=[olympe.dc.wf];olympe.dc.wc.Number=class{constructor(a){this.j=a}ka(){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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.ya=[olympe.dc.wf];olympe.dc.wc.String=class{constructor(a){this.j=a}ka(){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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.ya=[olympe.dc.wf];olympe.dc.Y={};let Em=0;olympe.dc.Y.Bg=class{constructor(){this.id=Em++}ka(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.Y.Bg.ya=[olympe.dc.za];olympe.dc.Y.El=class{constructor(a,b){this.F=a;this.H=b}ka(){}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.Rb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ba))}N(){}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return this.ka().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
1004
+ olympe.dc.Y.El.ya=[olympe.dc.za];olympe.dc.Y.Nd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Nd)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
1005
+ a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Y.Nd);olympe.dc.Y.Nd.ya=[olympe.dc.za];olympe.dc.Y.Kl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Rb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ba))}ka(){return Q(olympe.dc.Y.Kl)}D(){return[this.value.j()]}fa(a){const b=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();return'{"c":"'+this.ka()+'","a":['+b+','+this.value.fa(a)+']}'}toString(){const a=olympe.C.gb(this.F)?this.F.Ba.Eb.valueOf():this.F.valueOf();
1006
+ return this.ka().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Y.Kl);olympe.dc.Y.Kl.ya=[olympe.dc.za];olympe.dc.Y.xf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}ka(){return Q(olympe.dc.Y.xf)}D(){return[this.source.j(),this.value.j()]}jb(){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.Rb(c.includes(d))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=this.value.fa(a);a=Cm(a,this.F);
1007
+ return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Bm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Y.xf);olympe.dc.Y.xf.ya=[olympe.dc.za];olympe.dc.Y.Be=class{constructor(a,b){this.F=a;this.H=b}ka(){return Q(olympe.dc.Y.Be)}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.Jd?c.Jd(d):'object'===typeof d&&void 0!==d.Jd?d.Jd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ba,'Test equal predicate'))}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
1008
+ ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Y.Be);olympe.dc.Y.Be.ya=[olympe.dc.za];olympe.dc.Y.nu=class extends olympe.dc.Y.Be{constructor(a,b){super(a,new olympe.dc.ab.We(b))}};olympe.dc.Y.nu.ya=[olympe.dc.za];olympe.dc.Y.mk=class extends olympe.dc.Y.El{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.mk)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Y.mk);olympe.dc.Y.Ri=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ea(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Fm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Fm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.Ri)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.U.Kc(),e=olympe.dc.ga();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
1009
+ c.getContext().fb()||c.getContext().hd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=Gm(g[h],e,a,d+h);Nf(e,b,a,d);c.getContext().onDestroy(()=>{Lf(e,b,d)});return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Y.Ri);
1010
+ function Gm(a,b,c,d){const e=Object.create(null);d+=olympe.U.ni();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 Fm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.Ri.ya=[olympe.dc.za];olympe.dc.Y.om=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ea):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Ke?this.ob.push(new Hm(c.W(),c.La(),c.F,c.D)):this.ob.push(new Hm(olympe.dc.ea(c),b[d],1,1))}ka(){return Q(olympe.dc.Y.om)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ga(),e=olympe.U.ni();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
1011
+ const g=this.ob;for(let k=g.length-1;0<=k;k--)f=Im(g[k],d,f,e+k);let h=0;Nf(d,b,f.bind(null,k=>{c.getContext().hd()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Lf(d,b,e));return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.ob.map(a=>a.fa()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.fa())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.om);
1009
1012
  function Im(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.U.ni();if(q){const v=p+r,x=y=>{const z=f.get(r);if(g.has(v))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(v),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(v)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
1010
- {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 Hm 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}fa(){return`${this.W()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Y.nm.ya=[olympe.dc.Aa];olympe.dc.Y.Ui=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ea(b))}):this.F.add(olympe.dc.ea(a))}ka(){return Q(olympe.dc.Y.Ui)}D(){return[]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(olympe.C.ba),olympe.C.ba.j)),d=olympe.dc.ga();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.ea(olympe.dc.CloudObject))c.update(olympe.C.Rb(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})`);
1011
- this.F.has(k)?(c.update(olympe.C.ba.D),f()):(h=new Jm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new Jm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.sb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Jm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.ni()}}
1012
- P('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Ui);olympe.dc.Y.Ui.ya=[olympe.dc.Aa];olympe.dc.Y.ie=class{constructor(a){this.F=a}ka(){return Q(olympe.dc.Y.ie)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Rb(!c.valueOf()),olympe.C.ba))}fa(a){return`{"c":"${this.ka()}","a":[${this.F.fa(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Y.ie);olympe.dc.Y.ie.ya=[olympe.dc.Aa];olympe.dc.Y.Fe=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Fe)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
1013
- ')'}};P('olympe.dc.predicates.Or',olympe.dc.Y.Fe);olympe.dc.Y.Fe.ya=[olympe.dc.Aa];olympe.dc.Y.Gf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}ka(){return Q(olympe.dc.Y.Gf)}D(){return[this.source.j()]}ib(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb((new RegExp(d)).test(c))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=Cm(a,this.H);a=Cm(a,this.F);return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+
1014
- ']}'}toString(){const a=Bm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Y.Gf);olympe.dc.Y.Gf.ya=[olympe.dc.Aa];olympe.dc.Y.Qk=class extends olympe.dc.Y.Dl{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.Qk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Y.Qk);olympe.dc.kc={};olympe.dc.kc.Uj=class{constructor(){this.Z=this.H=this.R=this.D=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.kc.fk(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Z){const a=[];null!==this.H&&
1015
- (0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.Z(a)}}zg(a){this.Z=a}};olympe.dc.kc.Uj.ya=[olympe.dc.kc.Ta];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.kc.fk(a.j,a));return a.D}function Lm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Km(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.kc.fk=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}qe(){return this.j}og(){this.j.N()?this.j.F():this.j.X(this.depth-1)}};class Mm extends olympe.dc.kc.fk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.Z=this.X=this.H=!1;this.F=null}}
1013
+ {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 Hm 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}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.om.ya=[olympe.dc.za];olympe.dc.Y.Ui=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ea(b))}):this.F.add(olympe.dc.ea(a))}ka(){return Q(olympe.dc.Y.Ui)}D(){return[]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(olympe.C.ba),olympe.C.ba.j)),d=olympe.dc.ga();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.ea(olympe.dc.CloudObject))c.update(olympe.C.Rb(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})`);
1014
+ this.F.has(k)?(c.update(olympe.C.ba.D),f()):(h=new Jm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new Jm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.tb()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Jm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.ni()}}
1015
+ P('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Ui);olympe.dc.Y.Ui.ya=[olympe.dc.za];olympe.dc.Y.ie=class{constructor(a){this.F=a}ka(){return Q(olympe.dc.Y.ie)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Rb(!c.valueOf()),olympe.C.ba))}fa(a){return`{"c":"${this.ka()}","a":[${this.F.fa(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Y.ie);olympe.dc.Y.ie.ya=[olympe.dc.za];olympe.dc.Y.Fe=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return Q(olympe.dc.Y.Fe)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ba))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
1016
+ ')'}};P('olympe.dc.predicates.Or',olympe.dc.Y.Fe);olympe.dc.Y.Fe.ya=[olympe.dc.za];olympe.dc.Y.Gf=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}ka(){return Q(olympe.dc.Y.Gf)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb((new RegExp(d)).test(c))},olympe.C.ba))}fa(a){const b=this.source.fa(a),c=Cm(a,this.H);a=Cm(a,this.F);return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+
1017
+ ']}'}toString(){const a=Bm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Y.Gf);olympe.dc.Y.Gf.ya=[olympe.dc.za];olympe.dc.Y.Rk=class extends olympe.dc.Y.El{constructor(a,b){super(a,b)}ka(){return Q(olympe.dc.Y.Rk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Y.Rk);olympe.dc.kc={};olympe.dc.kc.Vj=class{constructor(){this.Z=this.H=this.R=this.D=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.kc.gk(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Z){const a=[];null!==this.H&&
1018
+ (0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.Z(a)}}zg(a){this.Z=a}};olympe.dc.kc.Vj.ya=[olympe.dc.kc.Ta];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.kc.gk(a.j,a));return a.D}function Lm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Km(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.kc.gk=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}qe(){return this.j}og(){this.j.N()?this.j.F():this.j.X(this.depth-1)}};class Mm extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.Z=this.X=this.H=!1;this.F=null}}
1016
1019
  function Nm(a,b,c,d,e){const f=Object.create(null),g=a.ia,h=a.H;let k,l,n;a.da=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.X&&(c.F=null,delete h[k]),delete f[k]);a.da=!1;null!==a.D&&a.F()}
1017
- olympe.dc.kc.zm=class{constructor(){this.H={};this.ia=[];this.D=null;this.da=!1;this.R=[];this.Z=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ia,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.Z){var f=e,g=this.D;f.Z=!0;f.F=Lm(f,g)}null!==
1018
- e.F&&Km(e.F,this.R)}}this.Z&&this.Z(this.R)}}zg(a){this.Z=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Mm(this,c,b),this.H[c]=d):(d.tag=b,d.X=!1):void 0!==d&&(d.X=!0);return d}};olympe.dc.kc.zm.ya=[olympe.dc.kc.Ta];olympe.dc.kc.Ta=class{constructor(){}j(){}N(){}X(){}F(){}zg(){}};function Om(a,b){olympe.C.pf(a.value)?(a.node=olympe.C.Rn(a.value,b),Sb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.pf(a.value)){const c=olympe.C.Za(),d=a.H;olympe.C.Uc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.Za().destroy())})}}
1019
- class Qm extends olympe.dc.kc.fk{constructor(a,b,c){super(a);this.X=b;this.value=c;this.H=this.Pa();this.position=this.node=null;this.R=!1;this.F=null}Pa(){const a=olympe.C.Pa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}fb(){return null===this.value}}
1020
- function Rm(a,b){if(!b.fb()){var c=a.D;var d=a.ia,e=b.Pa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Pa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
1021
- function Sm(a){const b=a.ia;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
1022
- olympe.dc.kc.Sr=class{constructor(a){this.ia=a;this.H=null;this.D=[];this.R=[];this.Z=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new Qm(this,c,d),this.da.set(b,f),this.N()?Om(f,()=>Rm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}X(a){if(null!==this.H)throw Error('Manager already activated (depth='+
1020
+ olympe.dc.kc.Am=class{constructor(){this.H={};this.ia=[];this.D=null;this.da=!1;this.R=[];this.Z=null}N(){return null!==this.D}X(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ia,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.Z){var f=e,g=this.D;f.Z=!0;f.F=Lm(f,g)}null!==
1021
+ e.F&&Km(e.F,this.R)}}this.Z&&this.Z(this.R)}}zg(a){this.Z=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Mm(this,c,b),this.H[c]=d):(d.tag=b,d.X=!1):void 0!==d&&(d.X=!0);return d}};olympe.dc.kc.Am.ya=[olympe.dc.kc.Ta];olympe.dc.kc.Ta=class{constructor(){}j(){}N(){}X(){}F(){}zg(){}};function Om(a,b){olympe.C.pf(a.value)?(a.node=olympe.C.Sn(a.value,b),Sb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.pf(a.value)){const c=olympe.C.Za(),d=a.H;olympe.C.Vc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.Za().destroy())})}}
1022
+ class Qm extends olympe.dc.kc.gk{constructor(a,b,c){super(a);this.X=b;this.value=c;this.H=this.Qa();this.position=this.node=null;this.R=!1;this.F=null}Qa(){const a=olympe.C.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}fb(){return null===this.value}}
1023
+ function Rm(a,b){if(!b.fb()){var c=a.D;var d=a.ia,e=b.Qa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Qa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
1024
+ function Sm(a){const b=a.ia;a.D.sort((c,d)=>b(c.Qa(),d.Qa()))}
1025
+ olympe.dc.kc.Vr=class{constructor(a){this.ia=a;this.H=null;this.D=[];this.R=[];this.Z=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new Qm(this,c,d),this.da.set(b,f),this.N()?Om(f,()=>Rm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}X(a){if(null!==this.H)throw Error('Manager already activated (depth='+
1023
1026
  this.H+')');this.H=a;Sm(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;Pm(d,()=>Rm(this,d))}this.F()}F(){if(null===this.H)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.D.length;this.R.length=0;for(let d=0;d<a;d++){let e=this.D[d];if(!e.R){var b=e,c=this.H;b.R=!0;b.F=Lm(b,c)}0>this.H?this.R.push(e.X):e.F&&Km(e.F,this.R)}this.Z&&this.Z(this.R)}zg(a){this.Z=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
1024
- c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.kc.Sr.ya=[olympe.dc.kc.Ta];function um(a){if(!a.D){for(let b in a.F)Tm(a.F[b]);a.D=!0}a.H=null;a.N=null}function xm(a,b,c){a.F[c||'root'].R=b}function ym(a,b,c){a.F[c||'root'].og(b)}function Um(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=uh(a.db,b,c,d),e[f]=g);return g}function Vm(a,b){a.D||a.j.og(b)}function Wm(a,b,c,d,e){if(!a.D){let f=Um(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=Um(a,c,d,olympe.dc.ua.ORIGIN));0===f&&Vm(a,b)}}
1027
+ c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.kc.Vr.ya=[olympe.dc.kc.Ta];function um(a){if(!a.D){for(let b in a.F)Tm(a.F[b]);a.D=!0}a.H=null;a.N=null}function xm(a,b,c){a.F[c||'root'].R=b}function ym(a,b,c){a.F[c||'root'].og(b)}function Um(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=uh(a.db,b,c,d),e[f]=g);return g}function Vm(a,b){a.D||a.j.og(b)}function Wm(a,b,c,d,e){if(!a.D){let f=Um(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=Um(a,c,d,olympe.dc.ua.ORIGIN));0===f&&Vm(a,b)}}
1025
1028
  function Xm(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 Ym(a){const b=String(++a.R),c=a.j;a.F[b]=new Zm(b,c);$m(c,b);c.H||(c.H=()=>Xm(a,c.T()));return b}function an(a,b){const c=a.j;a.j.H=()=>{Xm(a,c.T());b()}}function bn(a,b){Tm(b?a.F[b]:a.j)}
1026
- olympe.dc.kc.Ur=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 Zm('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=Um(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 $m(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function Tm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
1027
- class Zm{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}og(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&Tm(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.ab={};function cn(a,b,c,d){const e=olympe.dc.ga(),f=new olympe.dc.kc.Uj,g=new olympe.dc.kc.Ur(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,v)=>{a.hd()||a.fb()||(h||(xm(g,()=>{v.og();um(g)}),v.qe().zg(l),h=!0),q?k[t]=r:delete k[t],ym(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.U.Jc();Nf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,zm(t,q,b,p))},p);a.onDestroy(()=>{Lf(e,b,p)});e.Ia(b)||um(g)}
1029
+ olympe.dc.kc.Xr=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 Zm('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=Um(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 $m(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function Tm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
1030
+ class Zm{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}og(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&Tm(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.ab={};function cn(a,b,c,d){const e=olympe.dc.ga(),f=new olympe.dc.kc.Vj,g=new olympe.dc.kc.Xr(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,v)=>{a.hd()||a.fb()||(h||(xm(g,()=>{v.og();um(g)}),v.qe().zg(l),h=!0),q?k[t]=r:delete k[t],ym(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.U.Kc();Nf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,zm(t,q,b,p))},p);a.onDestroy(()=>{Lf(e,b,p)});e.Ja(b)||um(g)}
1028
1031
  function dn(a,b,c){const d=c.getContext(),e=olympe.dc.ga(),f=a.F(),g=fh(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>gh(e,b,a.H,g))}
1029
1032
  olympe.dc.ab.Di=class{constructor(a,b,c){this.H=a&&a.W?a.W():a;this.aa=b&&b.filter(d=>d instanceof olympe.dc.aa.$e||d instanceof olympe.dc.aa.Ke)||null;this.D=c||null;this.defaultValue=null}ka(){}Mb(){}F(){}j(){return(this.aa||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}wh(a){this.defaultValue=a;return this}ph(){return this.aa}be(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&lc(c,this.defaultValue);
1030
- b=this.D||b;null!==this.aa?cn(a,b,this.aa,d=>{dn(this,d,c)}):dn(this,b,c);return c.sb()}fa(a){const b=Cm(a,this.H),c=Cm(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Bm(this.H),b=this.D?','+Bm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Di.ya=[olympe.dc.Xk];olympe.dc.ab.po=class{constructor(a,b){if(olympe.C.pf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.W();var d=olympe.dc.ga();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.nh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.W():d=new olympe.dc.ab.jj(c,b);break;case olympe.dm.Number.O.W():d=new olympe.dc.ab.aj(c,
1031
- b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Vj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.Ji(c,b)}this.D=d}ka(){return this.D.ka()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}fa(a){return this.D.fa(a)}toString(){return this.D.toString()}};olympe.dc.ab.po.ya=[olympe.dc.Xk];olympe.dc.ab.Vj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Vj)}F(){return olympe.dc.mb.qn}Mb(){return olympe.C.ba}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Vj);olympe.dc.ab.We=class{constructor(a){this.value=a}ka(){return Q(olympe.dc.ab.We)}j(){return[]}getValue(){return this.value}fa(a){a=Cm(a,this.value);return`{"c":"${this.ka()}","a":[${a}]}`}toString(){return`Constant(${Bm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.ab.We);olympe.dc.ab.We.ya=[olympe.dc.Xk];olympe.dc.ab.Ji=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Ji)}F(){return olympe.dc.mb.rn}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Ji);olympe.dc.ab.aj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.aj)}F(){return olympe.dc.mb.sn}Mb(){return olympe.C.$}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.aj);olympe.dc.ab.jj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.jj)}F(){return olympe.dc.mb.tn}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.jj);olympe.dc.ab.kj=class{ka(){return Q(olympe.dc.ab.kj)}j(){return[]}getValue(a,b){return b}fa(){return'{"c":"'+this.ka()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.ab.kj);olympe.dc.ab.kj.ya=[olympe.dc.Xk];olympe.dc.aa={};olympe.dc.aa.Ki=class{Mb(){return null}ka(){return Q(olympe.dc.aa.Ki)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,zm(h,!0,f,f))):(d[f]++,Vm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,zm(h,!1,f,f)))}}fa(){return'{"c":"'+this.ka()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.aa.Ki);olympe.dc.aa.Ki.ya=[olympe.dc.Jf];olympe.dc.aa.yf=class{constructor(a){this.D=a}Mb(){return null}ka(){return Q(olympe.dc.aa.yf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Vm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,zm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.gb(n)&&(n=n.Ba);olympe.C.Uf(n)?(b.D||void 0!==olympe.C.Pa(n)||Vm(b,h),e[l]=n,a.run(()=>{olympe.C.Uc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
1032
- d(g,h,k,!1),delete e[h]}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.D.fa(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.aa.yf);olympe.dc.aa.yf.ya=[olympe.dc.Jf,olympe.dc.fr];olympe.dc.aa.gm=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ea(a),c||olympe.dc.ua.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ea(b),d||olympe.dc.ua.DESTINATION)}Mb(){return gg(this.D)}ka(){return Q(olympe.dc.aa.gm)}j(a,b,c){const d=olympe.dc.ga(),e={},f=this.D.W(),g=this.D.Ka(),h=this.F.W(),k=this.F.Ka();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.U.tb(v+g+(f+'_'+r)+z,20),K=zm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,zm(t,!1,z,A))};b.register(A,
1033
- v,x,f,g);c(!0,z,A,K)},y.Xs=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),Y=K.length,ya=0;ya<Y;ya++){let db=e[K[ya]];db.Xs<y&&(y=db.Xs,A=db)}A&&A()}},q=(r,t,v,x,y)=>{x?e[y]||(e[y]=!0,Wm(b,v,y,f,g),Wm(b,v,y,h,k),T(d,y,this.D,p.bind(this,r,t,v,y),v+'_val'),T(d,y,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.D(y,this.F,v+'_follow'),d.D(y,this.D,v+'_val'),delete e[y])};return(r,t,v,x)=>q(0,x,v,r,t)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.D.toString()+
1034
- '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.aa.gm);olympe.dc.aa.gm.ya=[olympe.dc.Jf];olympe.dc.aa.Mh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}ka(){return Q(olympe.dc.aa.Mh)}j(a,b,c){const d=new olympe.dc.kc.zm;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);Nm(d,e,f,n,c)}};a.run(()=>olympe.C.Uc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));an(b,k);const l=Ym(b);Xm(b,l);return(n,p,q,r)=>{h||(r.qe().zg(t=>{e=t;bn(b,l)}),xm(b,()=>r.og(),l),h=!0);d.j(n,p,q,null);ym(b,q,l)}}fa(a){return'{"c":"'+
1035
- this.ka()+'","a":['+Cm(a,this.start)+','+Cm(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.aa.Mh);olympe.dc.aa.Mh.ya=[olympe.dc.Jf];function en(a){return a.ob.map(b=>b.W())}
1036
- olympe.dc.aa.sk=class{constructor(a,b){this.direction=b||olympe.dc.ua.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ka(){return Q(olympe.dc.aa.sk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ga(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.W();p=olympe.U.tb(g+k.Ka()+p+n,20);const q=zm(h,l,n,p);l&&b.register(p,g,f,k.W(),k.Ka());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{Wm(b,h,g,l.W(),l.Ka());e(g,h,k,l)}):this.ob.forEach(l=>
1037
- {d.D(g,l,h)})}}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(en(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ka()+'['+en(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.aa.sk);olympe.dc.aa.sk.ya=[olympe.dc.Jf];olympe.dc.aa.Ke=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.ua.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.Ke)}j(a,b,c){const d=olympe.dc.ga(),e=Object.create(null),f=olympe.dc.ua.ORIGIN,g=olympe.dc.ua.DESTINATION,h=this.W(),k=this.Ka(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.cb(r,this);p+=1;for(let v=0,x=t.length;v<x;v++){if(void 0!==e[t[v]]||r===t[v])continue;const y=olympe.U.tb(q+k+(h+'_'+p)+t[v],20);b.register(y,
1038
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,v,x)=>{v&&!b.D&&l(p,t,x);p>=this.F?c(v,x,t,zm(r,v,x,t)):Wm(b,t,x,h,k);0<=this.D&&p>=this.D||(v?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.U.tb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.W()+'","'+this.Ka()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ka()+this.W()+'['+this.F+'..'+this.D+'])'}};
1039
- P('olympe.dc.transformers.RecursiveRelated',olympe.dc.aa.Ke);olympe.dc.aa.Ke.ya=[olympe.dc.Jf];olympe.dc.aa.$e=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.$e)}$b(){return new olympe.dc.aa.$e(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}j(a,b,c){const d=olympe.dc.ga(),e=this.W(),f=this.Ka();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.U.tb(k+f+e+p,20),r=zm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}fa(){return'{"c":"'+
1040
- this.ka()+'","a":["'+this.W()+'","'+this.Ka()+'"]}'}toString(){return'Related('+this.Ka()+this.W()+')'}};P('olympe.dc.transformers.Related',olympe.dc.aa.$e);olympe.dc.aa.$e.ya=[olympe.dc.Jf];olympe.dc.aa.ah=class{constructor(a,b){this.Gb=a;this.D=void 0===b?!0:!!b}Mb(){return null}ka(){return Q(olympe.dc.aa.ah)}jh(){return this.Gb}F(){return[this.Gb.H()]}j(a,b,c){const d=new olympe.dc.kc.Sr(a.rc(this.D?this.Gb.compare.bind(this.Gb):(e,f)=>this.Gb.compare(f,e)));return(e,f,g)=>{var h=e?this.Gb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.Gb.fa(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Gb.toString()+','+JSON.stringify(this.D)+
1041
- ')'}};P('olympe.dc.transformers.Sort',olympe.dc.aa.ah);olympe.dc.aa.ah.ya=[olympe.dc.Jf,olympe.dc.fr];function fn(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,zm(q,n,p,h))}const h=olympe.U.Jc(),k=olympe.dc.ga(),l=a.aa;b.run(()=>olympe.C.Uc([a.D],n=>{gn(k,n,g,h);void 0===k.model(n)&&um(e)}))}function gn(a,b,c,d){const e=b&&b.valueOf();e&&(Nf(a,e,c,d),olympe.C.Za().Xd(()=>Lf(a,e,d)))}
1042
- olympe.dc.aa.Kf=class{constructor(a,b){this.aa=this.D=null;a instanceof olympe.dc.za?(this.D=a.be(),this.aa=a.tm()):(this.D=a,b&&(this.aa=b))}Mb(){return null}ka(){return Q(olympe.dc.aa.Kf)||''}ph(){return this.aa}be(){return this.D}j(a,b,c){const d=new olympe.dc.kc.zm,e=new olympe.dc.kc.Uj;let f=[],g=[],h=!1,k=!1;const l=Ym(b),n=Ym(b);an(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):bn(b);Nm(d,p,0,p.length,c)});Xm(b,n);fn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.Za();v.hd()||
1033
+ b=this.D||b;null!==this.aa?cn(a,b,this.aa,d=>{dn(this,d,c)}):dn(this,b,c);return c.tb()}fa(a){const b=Cm(a,this.H),c=Cm(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Bm(this.H),b=this.D?','+Bm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Di.ya=[olympe.dc.Yk];olympe.dc.ab.qo=class{constructor(a,b){if(olympe.C.pf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.W();var d=olympe.dc.ga();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.nh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.W():d=new olympe.dc.ab.jj(c,b);break;case olympe.dm.Number.O.W():d=new olympe.dc.ab.aj(c,
1034
+ b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Wj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.Ji(c,b)}this.D=d}ka(){return this.D.ka()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}fa(a){return this.D.fa(a)}toString(){return this.D.toString()}};olympe.dc.ab.qo.ya=[olympe.dc.Yk];olympe.dc.ab.Wj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Wj)}F(){return olympe.dc.ib.rn}Mb(){return olympe.C.ba}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Wj);olympe.dc.ab.We=class{constructor(a){this.value=a}ka(){return Q(olympe.dc.ab.We)}j(){return[]}getValue(){return this.value}fa(a){a=Cm(a,this.value);return`{"c":"${this.ka()}","a":[${a}]}`}toString(){return`Constant(${Bm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.ab.We);olympe.dc.ab.We.ya=[olympe.dc.Yk];olympe.dc.ab.Ji=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.Ji)}F(){return olympe.dc.ib.sn}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Ji);olympe.dc.ab.aj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.aj)}F(){return olympe.dc.ib.tn}Mb(){return olympe.C.$}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.aj);olympe.dc.ab.jj=class extends olympe.dc.ab.Di{constructor(a,b,c){super(a,b,c)}ka(){return Q(olympe.dc.ab.jj)}F(){return olympe.dc.ib.un}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.jj);olympe.dc.ab.kj=class{ka(){return Q(olympe.dc.ab.kj)}j(){return[]}getValue(a,b){return b}fa(){return'{"c":"'+this.ka()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.ab.kj);olympe.dc.ab.kj.ya=[olympe.dc.Yk];olympe.dc.aa={};olympe.dc.aa.Ki=class{Mb(){return null}ka(){return Q(olympe.dc.aa.Ki)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,zm(h,!0,f,f))):(d[f]++,Vm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,zm(h,!1,f,f)))}}fa(){return'{"c":"'+this.ka()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.aa.Ki);olympe.dc.aa.Ki.ya=[olympe.dc.Jf];olympe.dc.aa.yf=class{constructor(a){this.D=a}Mb(){return null}ka(){return Q(olympe.dc.aa.yf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Vm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,zm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.gb(n)&&(n=n.Ba);olympe.C.Uf(n)?(b.D||void 0!==olympe.C.Qa(n)||Vm(b,h),e[l]=n,a.run(()=>{olympe.C.Vc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
1035
+ d(g,h,k,!1),delete e[h]}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.D.fa(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.aa.yf);olympe.dc.aa.yf.ya=[olympe.dc.Jf,olympe.dc.ir];olympe.dc.aa.hm=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ea(a),c||olympe.dc.ua.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ea(b),d||olympe.dc.ua.DESTINATION)}Mb(){return gg(this.D)}ka(){return Q(olympe.dc.aa.hm)}j(a,b,c){const d=olympe.dc.ga(),e={},f=this.D.W(),g=this.D.La(),h=this.F.W(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.U.rb(v+g+(f+'_'+r)+z,20),K=zm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,zm(t,!1,z,A))};b.register(A,
1036
+ v,x,f,g);c(!0,z,A,K)},y.at=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),Y=K.length,ya=0;ya<Y;ya++){let db=e[K[ya]];db.at<y&&(y=db.at,A=db)}A&&A()}},q=(r,t,v,x,y)=>{x?e[y]||(e[y]=!0,Wm(b,v,y,f,g),Wm(b,v,y,h,k),T(d,y,this.D,p.bind(this,r,t,v,y),v+'_val'),T(d,y,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.D(y,this.F,v+'_follow'),d.D(y,this.D,v+'_val'),delete e[y])};return(r,t,v,x)=>q(0,x,v,r,t)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.D.toString()+
1037
+ '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.aa.hm);olympe.dc.aa.hm.ya=[olympe.dc.Jf];olympe.dc.aa.Mh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}ka(){return Q(olympe.dc.aa.Mh)}j(a,b,c){const d=new olympe.dc.kc.Am;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);Nm(d,e,f,n,c)}};a.run(()=>olympe.C.Vc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));an(b,k);const l=Ym(b);Xm(b,l);return(n,p,q,r)=>{h||(r.qe().zg(t=>{e=t;bn(b,l)}),xm(b,()=>r.og(),l),h=!0);d.j(n,p,q,null);ym(b,q,l)}}fa(a){return'{"c":"'+
1038
+ this.ka()+'","a":['+Cm(a,this.start)+','+Cm(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Qa(this.start)},${olympe.C.Qa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.aa.Mh);olympe.dc.aa.Mh.ya=[olympe.dc.Jf];function en(a){return a.ob.map(b=>b.W())}
1039
+ olympe.dc.aa.tk=class{constructor(a,b){this.direction=b||olympe.dc.ua.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ka(){return Q(olympe.dc.aa.tk)}La(){return this.direction}j(a,b,c){const d=olympe.dc.ga(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.W();p=olympe.U.rb(g+k.La()+p+n,20);const q=zm(h,l,n,p);l&&b.register(p,g,f,k.W(),k.La());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{Wm(b,h,g,l.W(),l.La());e(g,h,k,l)}):this.ob.forEach(l=>
1040
+ {d.D(g,l,h)})}}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(en(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.La()+'['+en(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.aa.tk);olympe.dc.aa.tk.ya=[olympe.dc.Jf];olympe.dc.aa.Ke=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.ua.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.Ke)}j(a,b,c){const d=olympe.dc.ga(),e=Object.create(null),f=olympe.dc.ua.ORIGIN,g=olympe.dc.ua.DESTINATION,h=this.W(),k=this.La(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.cb(r,this);p+=1;for(let v=0,x=t.length;v<x;v++){if(void 0!==e[t[v]]||r===t[v])continue;const y=olympe.U.rb(q+k+(h+'_'+p)+t[v],20);b.register(y,
1041
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,v,x)=>{v&&!b.D&&l(p,t,x);p>=this.F?c(v,x,t,zm(r,v,x,t)):Wm(b,t,x,h,k);0<=this.D&&p>=this.D||(v?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.U.rb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.W()+'","'+this.La()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.La()+this.W()+'['+this.F+'..'+this.D+'])'}};
1042
+ P('olympe.dc.transformers.RecursiveRelated',olympe.dc.aa.Ke);olympe.dc.aa.Ke.ya=[olympe.dc.Jf];olympe.dc.aa.$e=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Mb(){return gg(this)}ka(){return Q(olympe.dc.aa.$e)}$b(){return new olympe.dc.aa.$e(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}j(a,b,c){const d=olympe.dc.ga(),e=this.W(),f=this.La();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.U.rb(k+f+e+p,20),r=zm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}fa(){return'{"c":"'+
1043
+ this.ka()+'","a":["'+this.W()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.W()+')'}};P('olympe.dc.transformers.Related',olympe.dc.aa.$e);olympe.dc.aa.$e.ya=[olympe.dc.Jf];olympe.dc.aa.ah=class{constructor(a,b){this.Gb=a;this.D=void 0===b?!0:!!b}Mb(){return null}ka(){return Q(olympe.dc.aa.ah)}jh(){return this.Gb}F(){return[this.Gb.H()]}j(a,b,c){const d=new olympe.dc.kc.Vr(a.rc(this.D?this.Gb.compare.bind(this.Gb):(e,f)=>this.Gb.compare(f,e)));return(e,f,g)=>{var h=e?this.Gb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.Gb.fa(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Gb.toString()+','+JSON.stringify(this.D)+
1044
+ ')'}};P('olympe.dc.transformers.Sort',olympe.dc.aa.ah);olympe.dc.aa.ah.ya=[olympe.dc.Jf,olympe.dc.ir];function fn(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,zm(q,n,p,h))}const h=olympe.U.Kc(),k=olympe.dc.ga(),l=a.aa;b.run(()=>olympe.C.Vc([a.D],n=>{gn(k,n,g,h);void 0===k.model(n)&&um(e)}))}function gn(a,b,c,d){const e=b&&b.valueOf();e&&(Nf(a,e,c,d),olympe.C.Za().Xd(()=>Lf(a,e,d)))}
1045
+ olympe.dc.aa.Kf=class{constructor(a,b){this.aa=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.be(),this.aa=a.um()):(this.D=a,b&&(this.aa=b))}Mb(){return null}ka(){return Q(olympe.dc.aa.Kf)||''}ph(){return this.aa}be(){return this.D}j(a,b,c){const d=new olympe.dc.kc.Am,e=new olympe.dc.kc.Vj;let f=[],g=[],h=!1,k=!1;const l=Ym(b),n=Ym(b);an(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):bn(b);Nm(d,p,0,p.length,c)});Xm(b,n);fn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.Za();v.hd()||
1043
1046
  v.fb()||(k||(t.qe().zg(x=>{g=x;bn(b,n)}),xm(b,()=>t.og(),n),k=!0),d.j(p,q,r),ym(b,r,n))});Xm(b,l);return(p,q,r,t)=>{h||(t.qe().zg(v=>{f=v;bn(b,l)}),xm(b,()=>t.og(),l),h=!0);d.j(p,q,r,l);ym(b,r,l)}}fa(a){const b=this.aa?'['+this.aa.map(c=>c.fa(a)).join(',')+']':'null';return'{"c":"'+this.ka()+'","a":['+Cm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.gb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.aa?','+this.aa.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
1044
- P('olympe.dc.transformers.Union',olympe.dc.aa.Kf);olympe.dc.aa.Kf.ya=[olympe.dc.Jf];olympe.dc.aa.zr={IB:1,Bu:-1,Au:0};olympe.dc.aa.lD={qA:!0,RA:!1};olympe.dc.jc.P={oq:'dc.legacy.listdefProcessor'};olympe.dc.jc.Config={nq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.jc.Config.nq,!1);C(a,olympe.dc.jc.P.oq,olympe.dc.jc.uv,olympe.dc.query.P.Ca,olympe.dc.P.Ch,olympe.dc.transaction.P.Da,olympe.dc.query.P.Ek,new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.dc.jc.Config.nq))});olympe.V.run([olympe.dc.jc.P.oq],a=>{olympe.dc.jc.By=()=>a});function hn(a){const b=olympe.dc.ga(),c=new Map;b.Ls(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
1045
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ga();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Qc(a,b,c,...d){b=olympe.dc.ea(b);var e=Pf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&X(a,olympe.dc.CloudObject.nameProp,c);return a.W()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Os();a=olympe.dc.ea(a);var c=b.db.model(a);c=Of(b,c);if(null===
1046
- c)throw new olympe.dc.Tq(a);c=c.instantiate(a,b.D);b.j.ne([a],olympe.dc.db.Instance.j.Yp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ga().Ia(olympe.dc.ea(a))}static Ex(a,b,c){const d=olympe.dc.ga();let e=null;const f=k=>{null===e&&(e=hn(b||this));return e.has(k)?e.get(k):null},g=Yl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.yi(c);a.forEach((k,l)=>{d.Ia(olympe.dc.ea(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.nb((k,l)=>{k||olympe.ha.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1047
- return this.get(h)}static nx(){return this.get(this)}static ol(a){return olympe.dc.la.ol(a)}static Cb(){return olympe.dc.ga().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Id(){const a=olympe.dc.ga();return a.cb(this,olympe.dc.CloudObject.Kj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Es).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ua.ORIGIN)))}static Sc(a){return olympe.dc.CloudObject.get(a)}static Ps(a){var b=Of(olympe.dc.Os(),
1048
- olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.vb(olympe.dc.CloudObject.nameProp)}Ub(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Re(){return this.db.Re(this)}ib(){return this.db.source(this)}yy(){return this.db.vi(this)?olympe.dc.ee().fromModel(this):null}Ks(){return olympe.C.ta([this.ka()],
1049
- a=>olympe.C.wb(a),olympe.C.Sa,'getDisplayName',olympe.C.wb('('+this.toString()+')'))}Vb(){return this.model?this.model.W():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Bb?a.Bb():a;return new rxjs.Observable(e=>{const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=fh(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Xd(()=>{e.complete();gh(this.db,this.tag,b,g)});return()=>gh(this.db,this.tag,b,g)})}Ez(a){const b='function'===typeof a.Bb?a.Bb():
1050
- a;return new rxjs.Observable(c=>{const d=hh(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.Xd(()=>{c.complete();ih(this.db,this.tag,d)});return()=>ih(this.db,this.tag,d)})}Fz(a){return this.observe(olympe.C.Za(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}bb(a){return olympe.dc.la.from(this).bb(a)}vg(a){return olympe.dc.rd.from(this).bb(a)}Bc(){return this}gy(){return this.Rc(olympe.dc.CloudObject.Ax,
1051
- olympe.dc.CloudObject)}Cn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Sf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=fh(this.db,this.tag,a,olympe.C.Za().rc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>gh(this.db,this.tag,a,e));return d.getContext()}vb(a){return M(this.Sf(a,olympe.dc.mb.tn,olympe.C.Sa))}xd(a){return M(this.Sf(a,olympe.dc.mb.sn,olympe.C.$))}mh(a){return M(this.Sf(a,olympe.dc.mb.qn,
1052
- olympe.C.ba))}Dj(a){return M(this.Sf(a,olympe.dc.mb.rn,olympe.C.eb))}Ts(){return M(this.Sf(olympe.dm.Color.valueProp,olympe.dc.mb.xs,olympe.C.Color))}Us(){return M(this.Sf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.mb.ys,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.aa.$e?a:new olympe.dc.aa.$e(a.W(),a.Ka());return new olympe.dc.za(this.W(),a,b)}Rc(a,b){return this.cb(a,b).Hc()}Hs(a,b){const c=this.db,d=olympe.U.Jc(),e=olympe.C.Za(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1053
- 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)})}iA(){return new olympe.dc.za(this.W(),[],eg(this.W()))}transform(...a){return(new olympe.dc.za(this.W(),[],this.constructor)).transform(...a)}Vc(){return this.Ks()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ia(this.tag)?Object.assign({'#tag':this.W(),'#type':this.Ub().name()},this.Wc(!0,!0)):{'#tag':this.W(),'#error':'The object does not exist in the local database.'}}Wc(a=
1054
- !1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ia(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.W()===a.W():'function'===typeof a?olympe.dc.na.Vb(a)===this.W():!1}Jd(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Hx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of sh(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.W()&&
1055
- 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.Wc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.vg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.bb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1056
- olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Fz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Ez;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Vb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.ib;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
1057
- olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Ub;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.W;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ps;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Sc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Id;
1058
- olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.ol;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.nx;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.xF=olympe.dc.CloudObject.O.ja(olympe.dc.hq.VERSION);
1059
- olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.iF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Kj=olympe.dc.CloudObject.O.ra('ff02200000000000000a');olympe.dc.CloudObject.Es=olympe.dc.CloudObject.O.ra('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.SE=olympe.dc.CloudObject.O.ra('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.IE=olympe.dc.CloudObject.O.ra('017ea013caf8e89cedb2');
1060
- olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.ra('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.ra('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);
1061
- w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Li);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Yj);
1062
- w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ax=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Gx=olympe.dc.CloudObject.O.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Gx);olympe.dc.nD=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ye];m=olympe.dc.CloudObject.prototype;m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;
1063
- m.Ub.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ib.K=new olympe.C.J(()=>String,[]);m.yy.K=new olympe.C.J(()=>String,[]);m.Ks.K=olympe.C.J.D;m.Vb.K=new olympe.C.J(()=>String,[]);m.gy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Cn.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.vb.K=olympe.C.J.D;m.xd.K=olympe.C.J.F;m.mh.K=olympe.C.J.N;m.Dj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ts.K=new olympe.C.J(()=>olympe.C.Color,[]);
1064
- m.Us.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Rc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Hs.K=new olympe.C.J(()=>Function,[]);m.iA.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Vc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=olympe.C.J.N;m.Hx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Ch:'dc.DBView',aq:'dc.InstanceManager',Ca:'dc.Logger',Hw:'dc.TransactionLogger',gk:'dc.FileServiceManager',Ug:'dc.Router'};olympe.dc.Config={Xg:'dc.tag',ag:'dc.debug',Yh:'dc.subscribeAll',Zl:'dc.defaultSource',tp:'dc.fileCache',Xo:'dc.dataConsumerOnly',op:'dc.errorOnAbstractInstantiation'};
1065
- olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.ag,!1);E(a,olympe.dc.Config.Yh,!1);E(a,olympe.dc.Config.Zl,olympe.dc.Ha.SERVER);E(a,olympe.dc.Config.Xo,b);E(a,olympe.dc.Config.tp,b);E(a,olympe.dc.Config.op,!0);E(a,olympe.dc.Config.Xg,olympe.U.Jc());D(a,olympe.dc.P.Ca,[olympe.ha.P.Da],c=>c.ad('dc'));Wa(a,olympe.dc.P.Hw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.Ch,olympe.dc.db.P.Wl);C(a,olympe.dc.P.gk,olympe.dc.ou,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,
1066
- olympe.dc.P.Ug,olympe.U.P.Dg,new olympe.V.oa(olympe.dc.Config.tp));C(a,olympe.dc.P.Ug,olympe.dc.gw,olympe.dc.P.Ca,olympe.dc.sources.P.qr,olympe.dc.sources.P.Ir,olympe.dc.P.Ch,olympe.host.P.Ge,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Xo));C(a,olympe.dc.P.aq,olympe.dc.Hu,olympe.dc.db.P.im,olympe.dc.db.P.Da,olympe.V.P.Eg)},'olympe.dc');
1067
- olympe.V.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.aq,olympe.dc.P.gk,new olympe.V.oa(olympe.dc.Config.Xg)],(a,b,c,d,e)=>{olympe.dc.ly=()=>a;olympe.dc.Fj=()=>b;olympe.dc.Os=()=>c;olympe.dc.Ms=()=>d;olympe.dc.Ha.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ud=class extends olympe.dc.CloudObject{ka(){return this.vb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ba.j}};olympe.dm.Ud.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Ud);olympe.dm.Ud.N=olympe.dm.Ud.O.ja('ff023000000000000035');olympe.dm.Ud.j=olympe.dm.Ud.O.ra('ff022000000000000005');olympe.dm.Ud.F=dg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ud.H=dg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1068
- olympe.dm.Ud.D=dg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ud.prototype.ka.K=olympe.C.J.D;olympe.dm.Ud.prototype.j.K=olympe.C.J.D;olympe.dm.Ud.prototype.D.K=olympe.C.J.N;olympe.dm.Cl={NONE:0,VA:1,bu:2,WA:4,SA:8,UA:16,TA:31,sC:32,pC:64,tC:128,qC:256,Lv:512,rC:992,JB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{vy(){return this.Gn()}ka(){return this.Gn()}Gn(){return this.vb(olympe.dm.User.loginProp)}Wu(){return this.vb(olympe.dm.User.D)}Vu(){return olympe.C.Sa.EMPTY}Qy(){return this.vb(olympe.dm.User.saltProp)}Zy(){return this.vb(olympe.dm.User.verifierProp)}Oy(){return this.cb(olympe.dm.User.F,olympe.dm.Ud)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ja('ff023000000000000001');
1047
+ P('olympe.dc.transformers.Union',olympe.dc.aa.Kf);olympe.dc.aa.Kf.ya=[olympe.dc.Jf];olympe.dc.aa.Cr={MB:1,Fu:-1,Eu:0};olympe.dc.aa.pD={uA:!0,VA:!1};olympe.dc.jc.P={rq:'dc.legacy.listdefProcessor'};olympe.dc.jc.Config={qq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.jc.Config.qq,!1);C(a,olympe.dc.jc.P.rq,olympe.dc.jc.yv,olympe.dc.query.P.Ca,olympe.dc.P.Ch,olympe.dc.transaction.P.Fa,olympe.dc.query.P.Fk,new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.dc.jc.Config.qq))});olympe.V.run([olympe.dc.jc.P.rq],a=>{olympe.dc.jc.Ey=()=>a});function hn(a){const b=olympe.dc.ga(),c=new Map;b.Ps(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
1048
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ga();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Rc(a,b,c,...d){b=olympe.dc.ea(b);var e=Pf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&X(a,olympe.dc.CloudObject.nameProp,c);return a.W()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Ss();a=olympe.dc.ea(a);var c=b.db.model(a);c=Of(b,c);if(null===
1049
+ c)throw new olympe.dc.Wq(a);c=c.instantiate(a,b.D);b.j.ne([a],olympe.dc.db.Instance.j.$p);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ga().Ja(olympe.dc.ea(a))}static Kj(...a){olympe.dc.Ms().Kj(...a)}static Ix(a,b,c){const d=olympe.dc.ga();let e=null;const f=k=>{null===e&&(e=hn(b||this));return e.has(k)?e.get(k):null},g=Yl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.yi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.ea(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.lb((k,l)=>{k||olympe.ha.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
1050
+ return this.get(h)}static sx(){return this.get(this)}static pl(a){return olympe.dc.la.pl(a)}static zb(){return olympe.dc.ga().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Id(){const a=olympe.dc.ga();return a.cb(this,olympe.dc.CloudObject.Lj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Hs).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.ua.ORIGIN)))}static Tc(a){return olympe.dc.CloudObject.get(a)}static Ts(a){var b=Of(olympe.dc.Ss(),
1051
+ olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.vb(olympe.dc.CloudObject.nameProp)}Ub(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Re(){return this.db.Re(this)}jb(){return this.db.source(this)}By(){return this.db.vi(this)?olympe.dc.ee().fromModel(this):null}Os(){return olympe.C.ta([this.ka()],
1052
+ a=>olympe.C.wb(a),olympe.C.Sa,'getDisplayName',olympe.C.wb('('+this.toString()+')'))}Vb(){return this.model?this.model.W():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>{const f=olympe.dc.ib.tc(this.db.Pa(this.tag,b));c||null!==f||e.next(f);const g=fh(this.db,this.tag,b,h=>{e.next(olympe.dc.ib.tc(h))});d.Xd(()=>{e.complete();gh(this.db,this.tag,b,g)});return()=>gh(this.db,this.tag,b,g)})}Hz(a){const b='function'===typeof a.Cb?a.Cb():
1053
+ a;return new rxjs.Observable(c=>{const d=hh(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.Xd(()=>{c.complete();ih(this.db,this.tag,d)});return()=>ih(this.db,this.tag,d)})}Iz(a){return this.observe(olympe.C.Za(),a)}get(a){return olympe.dc.ib.tc(this.db.Pa(this.tag,a))}Pa(a){return this.get(a)}bb(a){return olympe.dc.la.from(this).bb(a)}vg(a){return olympe.dc.rd.from(this).bb(a)}tc(){return this}ky(){return this.Sc(olympe.dc.CloudObject.Ex,
1054
+ olympe.dc.CloudObject)}Dn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Sf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=fh(this.db,this.tag,a,olympe.C.Za().rc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>gh(this.db,this.tag,a,e));return d.getContext()}vb(a){return M(this.Sf(a,olympe.dc.ib.un,olympe.C.Sa))}xd(a){return M(this.Sf(a,olympe.dc.ib.tn,olympe.C.$))}mh(a){return M(this.Sf(a,olympe.dc.ib.rn,
1055
+ olympe.C.ba))}Dj(a){return M(this.Sf(a,olympe.dc.ib.sn,olympe.C.eb))}Xs(){return M(this.Sf(olympe.dm.Color.valueProp,olympe.dc.ib.As,olympe.C.Color))}Ys(){return M(this.Sf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.ib.Bs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.aa.$e?a:new olympe.dc.aa.$e(a.W(),a.La());return new olympe.dc.Aa(this.W(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Ks(a,b){const c=this.db,d=olympe.U.Kc(),e=olympe.C.Za(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
1056
+ 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)})}mA(){return new olympe.dc.Aa(this.W(),[],eg(this.W()))}transform(...a){return(new olympe.dc.Aa(this.W(),[],this.constructor)).transform(...a)}Wc(){return this.Os()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.W(),'#type':this.Ub().name()},this.Mc(!0,!0)):{'#tag':this.W(),'#error':'The object does not exist in the local database.'}}Mc(a=
1057
+ !1,b=!0){const c={};this.db.zb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.ib.tc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.W()===a.W():'function'===typeof a?olympe.dc.na.Vb(a)===this.W():!1}Jd(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ba)}Lx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of sh(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.W()&&
1058
+ a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.lb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Mc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.vg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.bb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Pa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
1059
+ olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Iz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Hz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Vb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.jb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
1060
+ olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Ub;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.W;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ts;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Tc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Id;
1061
+ olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.zb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.pl;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.sx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Ix;olympe.dc.CloudObject.markObsolete=olympe.dc.CloudObject.Kj;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);
1062
+ olympe.dc.CloudObject.BF=olympe.dc.CloudObject.O.ja(olympe.dc.kq.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.mF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Lj=olympe.dc.CloudObject.O.ra('ff02200000000000000a');olympe.dc.CloudObject.Hs=olympe.dc.CloudObject.O.ra('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.WE=olympe.dc.CloudObject.O.ra('017e9c4ba4c847d71cbf');
1063
+ olympe.dc.CloudObject.ME=olympe.dc.CloudObject.O.ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.ra('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.ra('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
1064
+ olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Li);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
1065
+ olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.ra(olympe.dc.fc.Zj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ex=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Kx=olympe.dc.CloudObject.O.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Kx);olympe.dc.rD=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ye];m=olympe.dc.CloudObject.prototype;
1066
+ m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;m.Ub.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.By.K=new olympe.C.J(()=>String,[]);m.Os.K=olympe.C.J.D;m.Vb.K=new olympe.C.J(()=>String,[]);m.ky.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Dn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Sf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.vb.K=olympe.C.J.D;m.xd.K=olympe.C.J.F;m.mh.K=olympe.C.J.N;
1067
+ m.Dj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Xs.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ys.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Sc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ks.K=new olympe.C.J(()=>Function,[]);m.mA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Jd.K=olympe.C.J.N;m.Lx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Ch:'dc.DBView',cq:'dc.InstanceManager',Ca:'dc.Logger',Lw:'dc.TransactionLogger',hk:'dc.FileServiceManager',Ug:'dc.Router'};olympe.dc.Config={Xg:'dc.tag',ag:'dc.debug',Yh:'dc.subscribeAll',$l:'dc.defaultSource',up:'dc.fileCache',Yo:'dc.dataConsumerOnly',pp:'dc.errorOnAbstractInstantiation'};
1068
+ olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.ag,!1);E(a,olympe.dc.Config.Yh,!1);E(a,olympe.dc.Config.$l,olympe.dc.Ia.SERVER);E(a,olympe.dc.Config.Yo,b);E(a,olympe.dc.Config.up,b);E(a,olympe.dc.Config.pp,!0);E(a,olympe.dc.Config.Xg,olympe.U.Kc());D(a,olympe.dc.P.Ca,[olympe.ha.P.Fa],c=>c.ad('dc'));Wa(a,olympe.dc.P.Lw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.Ch,olympe.dc.db.P.Xl);C(a,olympe.dc.P.hk,olympe.dc.su,olympe.dc.P.Ca,olympe.dc.db.P.Fa,olympe.net.P.Fa,
1069
+ olympe.dc.P.Ug,olympe.U.P.Dg,new olympe.V.oa(olympe.dc.Config.up));C(a,olympe.dc.P.Ug,olympe.dc.kw,olympe.dc.P.Ca,olympe.dc.sources.P.tr,olympe.dc.sources.P.Lr,olympe.dc.P.Ch,olympe.host.P.Ge,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Yo));C(a,olympe.dc.P.cq,olympe.dc.Lu,olympe.dc.db.P.jm,olympe.dc.db.P.Fa,olympe.V.P.Eg)},'olympe.dc');
1070
+ olympe.V.run([olympe.dc.db.P.Fa,olympe.dc.transaction.P.Fa,olympe.dc.P.cq,olympe.dc.P.hk,new olympe.V.oa(olympe.dc.Config.Xg)],(a,b,c,d,e)=>{olympe.dc.Ms=()=>a;olympe.dc.Fj=()=>b;olympe.dc.Ss=()=>c;olympe.dc.Qs=()=>d;olympe.dc.Ia.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ud=class extends olympe.dc.CloudObject{ka(){return this.vb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ba.j}};olympe.dm.Ud.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Ud);olympe.dm.Ud.N=olympe.dm.Ud.O.ja('ff023000000000000035');olympe.dm.Ud.j=olympe.dm.Ud.O.ra('ff022000000000000005');olympe.dm.Ud.F=dg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ud.H=dg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1071
+ olympe.dm.Ud.D=dg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ud.prototype.ka.K=olympe.C.J.D;olympe.dm.Ud.prototype.j.K=olympe.C.J.D;olympe.dm.Ud.prototype.D.K=olympe.C.J.N;olympe.dm.Dl={NONE:0,ZA:1,fu:2,$A:4,WA:8,YA:16,XA:31,wC:32,tC:64,xC:128,uC:256,Pv:512,vC:992,NB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{yy(){return this.Hn()}ka(){return this.Hn()}Hn(){return this.vb(olympe.dm.User.loginProp)}$u(){return this.vb(olympe.dm.User.D)}Zu(){return olympe.C.Sa.EMPTY}Ty(){return this.vb(olympe.dm.User.saltProp)}bz(){return this.vb(olympe.dm.User.verifierProp)}Ry(){return this.cb(olympe.dm.User.F,olympe.dm.Ud)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ja('ff023000000000000001');
1069
1072
  w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ja('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ja('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ja('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ja('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ja('ff023000000000000020');
1070
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ja('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Ud.j);olympe.dm.User.X=olympe.dm.User.O.ra('ff022000000000000002');olympe.dm.User.j=dg('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=dg('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.vy.K=olympe.C.J.D;m.ka.K=olympe.C.J.D;m.Gn.K=olympe.C.J.D;m.Wu.K=olympe.C.J.D;m.Vu.K=olympe.C.J.D;m.Qy.K=olympe.C.J.D;
1071
- m.Zy.K=olympe.C.J.D;m.Oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.eg=class extends olympe.dc.CloudObject{X(){return this.Cn()}Ga(){return this.vb(olympe.dm.eg.sa)}};olympe.dm.eg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.eg);olympe.dm.eg.sa=olympe.dm.eg.O.ja('01609de3f292e3c2c6ff');olympe.dm.eg.prototype.X.K=new olympe.C.J(()=>olympe.C.ud,[]);olympe.dm.eg.prototype.Ga.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.eg{$y(){return this.vb(olympe.dm.BrickMetadata.Gc)}Ic(){return this.vb(olympe.dm.BrickMetadata.da)}getType(){return this.vb(olympe.dm.BrickMetadata.Yb)}jz(){return this.mh(olympe.dm.BrickMetadata.yb)}ue(){return null}ay(){return this.cb(olympe.sc.ui.zx.Comment.LE.$b(),olympe.sc.ui.zx.Comment)}jl(){return this.vg(olympe.dm.BrickMetadata.Ga).Cc().jl()}};olympe.dm.BrickMetadata.O=ig(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1072
- olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.O.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ke={BC:'private',DC:'public'};
1073
- olympe.dm.BrickMetadata.Tb={cB:'experimental',TC:'stable',QA:'deprecated'};olympe.dm.BrickMetadata.Md={CA:'business',oD:'technical'};m=olympe.dm.BrickMetadata.prototype;m.$y.K=olympe.C.J.D;m.Ic.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.jz.K=olympe.C.J.N;m.ue.K=new olympe.C.J(()=>String,[]);m.ay.K=new olympe.C.J(()=>olympe.dc.za,[]);m.jl.K=olympe.C.J.R;function uj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${a}.${b}`))?c:olympe.V.getParameter(`${'data.'}${b}`))?d:olympe.V.getParameter(`${olympe.dc.sources.Kh.Sv}${b}`)}
1074
- function Oj(a,b){const c=a.query().bb(olympe.dm.Ad.j.$b()).bb(olympe.dm.Ad.D);a=a.query().bb(olympe.dm.hb.D.$b()).ug(olympe.dm.hb.F,!0).bb(olympe.sc.zc.j.$b());const d=e=>e.me().ug(olympe.dc.CloudObject.extendRel,!0).bb(olympe.dc.CloudObject.Kj,!0).bb(olympe.dm.Relation.destinationModelRel).back(2).bb(olympe.dc.CloudObject.propertyRel,!0).bb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1075
- function ok(a,b){return a.observe(b,olympe.dm.DataSource.zs).pipe(rxjs.operators.map(()=>a.Of(olympe.dc.sources.Config.Ve)),rxjs.operators.distinctUntilChanged())}
1076
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Jb=c;this.Bs=new Map([[olympe.dc.sources.Config.Mm,olympe.dm.DataSource.Rz],[olympe.dc.sources.Config.Ve,olympe.dm.DataSource.zs],[olympe.dc.sources.Config.Tm,olympe.dm.DataSource.Xz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ha.SERVER:this.tag}Of(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1077
- '_')}.${b}`))?d:uj(this.W(),a))?e:this.Bs.has(c)?this.get(this.Bs.get(c)):null}Ic(){const a=this;return u(function*(){const b=olympe.dm.DataSource.oc.eu,c=olympe.dm.DataSource.oc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Jb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ha.Xa('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Uk||e instanceof olympe.error.Dm?
1073
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ja('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Ud.j);olympe.dm.User.X=olympe.dm.User.O.ra('ff022000000000000002');olympe.dm.User.j=dg('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=dg('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.yy.K=olympe.C.J.D;m.ka.K=olympe.C.J.D;m.Hn.K=olympe.C.J.D;m.$u.K=olympe.C.J.D;m.Zu.K=olympe.C.J.D;m.Ty.K=olympe.C.J.D;
1074
+ m.bz.K=olympe.C.J.D;m.Ry.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.eg=class extends olympe.dc.CloudObject{X(){return this.Dn()}Ha(){return this.vb(olympe.dm.eg.sa)}};olympe.dm.eg.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.eg);olympe.dm.eg.sa=olympe.dm.eg.O.ja('01609de3f292e3c2c6ff');olympe.dm.eg.prototype.X.K=new olympe.C.J(()=>olympe.C.ud,[]);olympe.dm.eg.prototype.Ha.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.eg{cz(){return this.vb(olympe.dm.BrickMetadata.Gc)}Jc(){return this.vb(olympe.dm.BrickMetadata.da)}getType(){return this.vb(olympe.dm.BrickMetadata.Yb)}mz(){return this.mh(olympe.dm.BrickMetadata.yb)}ue(){return null}hy(){return this.cb(olympe.sc.ui.Dx.Comment.PE.$b(),olympe.sc.ui.Dx.Comment)}kl(){return this.vg(olympe.dm.BrickMetadata.Ha).Cc().kl()}};olympe.dm.BrickMetadata.O=ig(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1075
+ olympe.dm.BrickMetadata.Gc=olympe.dm.BrickMetadata.O.ja('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.O.ja('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ha=olympe.dm.BrickMetadata.O.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ke={FC:'private',HC:'public'};
1076
+ olympe.dm.BrickMetadata.Tb={gB:'experimental',XC:'stable',UA:'deprecated'};olympe.dm.BrickMetadata.Md={GA:'business',sD:'technical'};m=olympe.dm.BrickMetadata.prototype;m.cz.K=olympe.C.J.D;m.Jc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.mz.K=olympe.C.J.N;m.ue.K=new olympe.C.J(()=>String,[]);m.hy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.kl.K=olympe.C.J.R;function uj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.V.getParameter(`${'data.'}${a}.${b}`))?c:olympe.V.getParameter(`${'data.'}${b}`))?d:olympe.V.getParameter(`${olympe.dc.sources.Kh.Wv}${b}`)}
1077
+ function Oj(a,b){const c=a.query().bb(olympe.dm.Ad.j.$b()).bb(olympe.dm.Ad.D);a=a.query().bb(olympe.dm.hb.D.$b()).ug(olympe.dm.hb.F,!0).bb(olympe.sc.Ac.j.$b());const d=e=>e.me().ug(olympe.dc.CloudObject.extendRel,!0).bb(olympe.dc.CloudObject.Lj,!0).bb(olympe.dm.Relation.destinationModelRel).back(2).bb(olympe.dc.CloudObject.propertyRel,!0).bb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1078
+ function ok(a,b){return a.observe(b,olympe.dm.DataSource.Cs).pipe(rxjs.operators.map(()=>a.Of(olympe.dc.sources.Config.Ve)),rxjs.operators.distinctUntilChanged())}
1079
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Jb=c;this.Es=new Map([[olympe.dc.sources.Config.Nm,olympe.dm.DataSource.Uz],[olympe.dc.sources.Config.Ve,olympe.dm.DataSource.Cs],[olympe.dc.sources.Config.Um,olympe.dm.DataSource.aA]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ia.SERVER:this.tag}Of(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.V.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1080
+ '_')}.${b}`))?d:uj(this.W(),a))?e:this.Es.has(c)?this.get(this.Es.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.oc.iu,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Jb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ha.Xa('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Em?
1078
1081
  b:c)})}init(){const a=this;return u(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return u(function*(){})}healthCheck(){return u(function*(){})}executeQuery(a){return u(function*(){return olympe.dc.query.Dd.xj(a)})}applyTransaction(){return u(function*(){})}uploadFileContent(){return u(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return u(function*(){throw Error('Should not try to download files with SELF source');
1079
1082
  })}deleteFileContent(){return u(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
1080
1083
  olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Of;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.na.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Ug);
1081
- olympe.dm.DataSource.gi=olympe.dm.DataSource.O.ja('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.gi);olympe.dm.DataSource.OE=olympe.dm.DataSource.O.ja('ff023000000000000061');olympe.dm.DataSource.Rz=olympe.dm.DataSource.O.ja('ff023000000000000062');olympe.dm.DataSource.zs=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Fs=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.Xz=olympe.dm.DataSource.O.ja('ff023000000000000065');
1082
- olympe.dm.DataSource.Lj=olympe.dm.DataSource.O.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=dg('00000000000000000060','Server source');olympe.dm.DataSource.Ve={NB:'hybrid',yo:'bus',Pp:'http'};olympe.dm.DataSource.oc={Vh:'ready',zb:'error',eu:'down',Df:'offline'};olympe.dm.Ad=class extends olympe.dc.CloudObject{};olympe.dm.Ad.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Ad);olympe.dm.Ad.j=olympe.dm.Ad.O.ra('ff023000000000000071');olympe.dm.Ad.D=olympe.dm.Ad.O.ra('ff023000000000000072');olympe.dm.Ad.F=olympe.dm.Ad.O.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.za(this.W(),[new olympe.dc.aa.Ke(olympe.dm.Kb.j.W(),olympe.dc.ua.DESTINATION,olympe.dc.aa.zr.Au,olympe.dc.aa.zr.Bu),olympe.dm.Kb.H])}ue(){return olympe.sc.we.Ne.nu}j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.cb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.ra('016a697ef00ce7554691');olympe.dm.Kb.ia=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1083
- olympe.dm.Kb.H=olympe.dm.Kb.O.ra('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.Nc=class extends olympe.dm.Kb{j(){return this.W()===olympe.dm.Nc.Z?this.cb(olympe.dm.Nc.N,olympe.dm.Kb):this.cb(olympe.dm.Nc.R,olympe.dm.Kb)}};olympe.dm.Nc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Nc);olympe.dm.Nc.R=olympe.dm.Nc.O.ra('017e9c34cf48bd6965c1');olympe.dm.Nc.N=olympe.dm.Nc.O.ra('017e9c2e013e06bfffd9');olympe.dm.Nc.mi=olympe.dm.Nc.O.ra('01811f12ad77673770d4');olympe.dm.Nc.Z=dg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Nc.vd=dg('10000000000000000001','OLYMPE_FOLDER');
1084
- olympe.dm.Nc.Oc=dg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Nc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{uy(){return this.vb(olympe.dm.Module.N)}Fy(){return this.xd(olympe.dm.Module.R)}Xu(){return this.vb(olympe.dm.Module.D)}Jy(){return this.vb(olympe.dm.Module.X)}by(){return this.vb(olympe.dm.Module.F)}Gy(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Ry(){return this.cb(olympe.dm.Module.j,olympe.dm.Pd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ja('ff023000000000000042');
1084
+ olympe.dm.DataSource.gi=olympe.dm.DataSource.O.ja('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.gi);olympe.dm.DataSource.SE=olympe.dm.DataSource.O.ja('ff023000000000000061');olympe.dm.DataSource.Uz=olympe.dm.DataSource.O.ja('ff023000000000000062');olympe.dm.DataSource.Cs=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Is=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.aA=olympe.dm.DataSource.O.ja('ff023000000000000065');
1085
+ olympe.dm.DataSource.Mj=olympe.dm.DataSource.O.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=dg('00000000000000000060','Server source');olympe.dm.DataSource.Ve={RB:'hybrid',zo:'bus',Qp:'http'};olympe.dm.DataSource.oc={Vh:'ready',Ab:'error',iu:'down',Df:'offline'};olympe.dm.Ad=class extends olympe.dc.CloudObject{};olympe.dm.Ad.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.Ad);olympe.dm.Ad.j=olympe.dm.Ad.O.ra('ff023000000000000071');olympe.dm.Ad.D=olympe.dm.Ad.O.ra('ff023000000000000072');olympe.dm.Ad.F=olympe.dm.Ad.O.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.W(),[new olympe.dc.aa.Ke(olympe.dm.Kb.j.W(),olympe.dc.ua.DESTINATION,olympe.dc.aa.Cr.Eu,olympe.dc.aa.Cr.Fu),olympe.dm.Kb.H])}ue(){return olympe.sc.we.Ne.ru}j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.cb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.ra('016a697ef00ce7554691');olympe.dm.Kb.ia=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1086
+ olympe.dm.Kb.H=olympe.dm.Kb.O.ra('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Pc=class extends olympe.dm.Kb{j(){return this.W()===olympe.dm.Pc.Z?this.cb(olympe.dm.Pc.N,olympe.dm.Kb):this.cb(olympe.dm.Pc.R,olympe.dm.Kb)}};olympe.dm.Pc.O=olympe.dc.na.j('ff021000000000000020',olympe.dm.Pc);olympe.dm.Pc.R=olympe.dm.Pc.O.ra('017e9c34cf48bd6965c1');olympe.dm.Pc.N=olympe.dm.Pc.O.ra('017e9c2e013e06bfffd9');olympe.dm.Pc.mi=olympe.dm.Pc.O.ra('01811f12ad77673770d4');olympe.dm.Pc.Z=dg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Pc.vd=dg('10000000000000000001','OLYMPE_FOLDER');
1087
+ olympe.dm.Pc.Qc=dg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Pc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{xy(){return this.vb(olympe.dm.Module.N)}Iy(){return this.xd(olympe.dm.Module.R)}av(){return this.vb(olympe.dm.Module.D)}My(){return this.vb(olympe.dm.Module.X)}iy(){return this.vb(olympe.dm.Module.F)}Jy(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Uy(){return this.cb(olympe.dm.Module.j,olympe.dm.Pd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ja('ff023000000000000042');
1085
1088
  olympe.dm.Module.R=olympe.dm.Module.O.ja('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ja('ff023000000000000044');olympe.dm.Module.X=olympe.dm.Module.O.ja('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ja('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ja('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.ra('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.ra('ff022000000000000014');
1086
- olympe.dm.Module.Z=dg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.uy.K=olympe.C.J.D;m.Fy.K=olympe.C.J.F;m.Xu.K=olympe.C.J.D;m.Jy.K=olympe.C.J.D;m.by.K=olympe.C.J.D;m.Gy.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Ry.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.ee().fromModel(a);a=b.create(a,f).yi(g);b=olympe.C.eb.now();X(X(X(X(X(X(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.W()}constructor(a,b,c,d,e){super(a,
1087
- b);this.j=c;this.F=d;this.D=e}Qs(){return this.vb(olympe.dm.File.mimeTypeProp)}fl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().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;})}Bn(a,b){void 0===a&&
1088
- void 0===b||olympe.ha.Xa('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.fl().then(e=>{e=bb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}gl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1089
+ olympe.dm.Module.Z=dg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.xy.K=olympe.C.J.D;m.Iy.K=olympe.C.J.F;m.av.K=olympe.C.J.D;m.My.K=olympe.C.J.D;m.iy.K=olympe.C.J.D;m.Jy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Uy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);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.ee().fromModel(a);a=b.create(a,f).yi(g);b=olympe.C.eb.now();X(X(X(X(X(X(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.W()}constructor(a,b,c,d,e){super(a,
1090
+ b);this.j=c;this.F=d;this.D=e}Us(){return this.vb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().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;})}Cn(a,b){void 0===a&&
1091
+ void 0===b||olympe.ha.Xa('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=bb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}hl(a,b){void 0===a&&void 0===b||olympe.ha.Xa('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
1089
1092
  olympe.C.Za().rc(a),d=b&&olympe.C.Za().rc(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.j);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.j.H(this).then(g=>{g=`data:${f};base64,${this.D.j(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.W()}`;
1090
- null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Za().rc(b);olympe.C.jt([a],d=>{const e=new olympe.dc.Ya;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}pt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.X(this.tag).then(()=>this.pt(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}kq(){return this.vb(olympe.dm.File.urlProp)}jq(){return this.vb(olympe.dm.File.fileNameProp)}iy(){return this.Dj(olympe.dm.File.creationDateProp)}Ey(){return this.Dj(olympe.dm.File.modificationDateProp)}iz(){return this.mh(olympe.dm.File.j)}};
1091
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.pt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.gl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Bn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.fl;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.gk,olympe.net.P.Da,olympe.U.P.Dg);olympe.dm.File.nameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1093
+ null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Za().rc(b);olympe.C.nt([a],d=>{const e=new olympe.dc.Ya;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.lb(f=>{c&&c(f)})})}tt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.X(this.tag).then(()=>this.tt(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}nq(){return this.vb(olympe.dm.File.urlProp)}mq(){return this.vb(olympe.dm.File.fileNameProp)}my(){return this.Dj(olympe.dm.File.creationDateProp)}Hy(){return this.Dj(olympe.dm.File.modificationDateProp)}lz(){return this.mh(olympe.dm.File.j)}};
1094
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.tt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.hl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Cn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.gl;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.hk,olympe.net.P.Fa,olympe.U.P.Dg);olympe.dm.File.nameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1092
1095
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ja('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ja('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ja('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ja('ff023000000000000052');
1093
- w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ja('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ja('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.ya=[olympe.C.File];m=olympe.dm.File.prototype;m.Qs.K=olympe.C.J.D;m.fl.K=olympe.C.J.j;m.Bn.K=olympe.C.J.j;m.gl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1094
- m.kq.K=olympe.C.J.D;m.jq.K=olympe.C.J.D;m.iy.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ey.K=new olympe.C.J(()=>olympe.C.eb,[]);m.iz.K=olympe.C.J.N;olympe.dm.Pd=class extends olympe.dc.CloudObject{j(){return this.vb(olympe.dm.Pd.D)}F(){return this.xd(olympe.dm.Pd.F)}D(){return this.cb(olympe.dm.Pd.j,olympe.dm.Module)}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Pd);olympe.dm.Pd.D=olympe.dm.Pd.O.ja('ff023000000000000047');olympe.dm.Pd.F=olympe.dm.Pd.O.ja('ff023000000000000048');olympe.dm.Pd.j=olympe.dm.Module.j.$b();olympe.dm.Pd.prototype.j.K=olympe.C.J.D;olympe.dm.Pd.prototype.F.K=olympe.C.J.F;
1095
- olympe.dm.Pd.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.hb=class extends olympe.dm.Nc{j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.vb(olympe.dm.hb.X)}R(){return this.vb(olympe.dm.hb.lb)}D(){return this.cb(olympe.dm.hb.F,olympe.dm.hb)}};olympe.dm.hb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.hb);olympe.dm.hb.X=olympe.dm.hb.O.ja('017869c7d2833c9492c1');olympe.dm.hb.dt=olympe.dm.hb.O.ja('017869c7d2833c9492c2');olympe.dm.hb.Pe=olympe.dm.hb.O.ja('017869c7d2833c9492c3');olympe.dm.hb.lb=olympe.dm.hb.O.ja('017869c80bb9929c76d0');
1096
- olympe.dm.hb.Wa=olympe.dm.hb.O.ra('ff02200000000000002a');olympe.dm.hb.F=olympe.dm.hb.O.ra('ff02200000000000002b');olympe.dm.hb.sg=R(olympe.dm.hb.O,olympe.dm.hb.F);olympe.dm.hb.D=olympe.dm.hb.O.ra('ff02200000000000002c');olympe.dm.hb.tg=olympe.dm.hb.O.ra('017e9c412e2b944bc48f');olympe.dm.hb.ef=olympe.dm.hb.O.ra('017e9c412e2b944bd590');olympe.dm.hb.Ys=olympe.dm.hb.O.ra('017e9c416872a89d3415');olympe.dm.hb.Ws=olympe.dm.hb.O.ra('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.hb.Wa);
1097
- olympe.dm.hb.Fd=dg('100000000000000000dd','PRIMORDIAL');olympe.dm.hb.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.hb.prototype.F.K=olympe.C.J.D;olympe.dm.hb.prototype.R.K=olympe.C.J.D;olympe.dm.hb.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Rc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Rc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.vg(olympe.dm.Property.typeRel).Cc()}Vc(){return this.j().ka().As(this.ka())}};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);
1098
- w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);w('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)}Ay(){return olympe.C.Sa.EMPTY}Yx(){return this.xd(olympe.dm.Relation.D)}Ky(){return this.xd(olympe.dm.Relation.F)}Js(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Hc()}Ss(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Hc()}Vc(){return this.Ss().ka().concat(['-',this.ka(),'->',this.Js().ka()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1099
- olympe.dm.Relation.F=olympe.dm.Relation.O.ja('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ja(olympe.dc.Lb.fp);olympe.dm.Relation.X=olympe.dm.Relation.O.ja(olympe.dc.Lb.Dc);olympe.dm.Relation.ia=olympe.dm.Relation.O.ja(olympe.dc.Lb.jg);olympe.dm.Relation.sa=olympe.dm.Relation.O.ja(olympe.dc.Lb.tw);olympe.dm.Relation.Z=olympe.dm.Relation.O.ja(olympe.dc.Lb.fu);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ja(olympe.dc.Lb.Qw);
1100
- olympe.dm.Relation.R=olympe.dm.Relation.O.ja('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Kj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Es);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={Vp:0,Kt:5,cw:1,NC:4,$r:2,ur:8,bB:10,KC:6,LC:9,Xe:6,MC:9};
1101
- olympe.dm.Relation.H={oC:3,Jv:4,$B:5,ZB:6};olympe.dm.Relation.N=olympe.dm.Cl.Lv+olympe.dm.Cl.bu;m=olympe.dm.Relation.prototype;m.Ay.K=olympe.C.J.D;m.Yx.K=olympe.C.J.F;m.Ky.K=olympe.C.J.F;m.Js.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function jn(a){a=olympe.dc.ea(a);if(olympe.dc.ga().Tf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.W():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.W():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.W():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.W():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Ie=class extends olympe.dc.CloudObject{getValue(){}};
1102
- olympe.dm.Ie.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Ie);olympe.dm.String=class extends olympe.dm.Ie{getValue(){return this.vb(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.ja('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1103
- olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.mh(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.ja('ff023000000000000027');w('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.Ie{getValue(){return this.Ts()}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.ja('ff023000000000000032');w('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.Ie{getValue(){return this.Dj(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.ja('ff023000000000000029');w('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{ka(){return olympe.C.ta([super.ka(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Hd(){return this.xd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Hd.K=olympe.C.J.F;olympe.dm.fg=class extends olympe.dm.BrickMetadata{Yy(){return this.bb(olympe.dc.CloudObject.instancesRel).wl(olympe.dm.Enum.rankProp,olympe.dc.query.Ak.ASC).Cc()}static create(a,b){b=a.create(olympe.dm.fg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.fg.create=olympe.dm.fg.create;olympe.dm.fg.prototype.getValues=olympe.dm.fg.prototype.Yy;olympe.dm.fg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.fg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.xd(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.ja('ff023000000000000028');w('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',Jk:'sc.RootContext',Le:'sc.Serializer'};olympe.sc.Config={ye:'sc.app',ag:'sc.debug',jo:'sc.autostartProfiler',bp:'sc.debugger',cu:'sc.disableTheme',PRODUCTION:'sc.production',Kv:'sc.onstartTimeout',nr:'sc.remoteActionTimeout'};
1104
- olympe.V.config(a=>{E(a,olympe.sc.Config.ye,'');E(a,olympe.sc.Config.ag,!1);E(a,olympe.sc.Config.cu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Kv,2E4);E(a,olympe.sc.Config.nr,3E4);E(a,olympe.sc.Config.jo,!1);D(a,olympe.sc.P.Ca,[olympe.ha.P.Da],b=>b.ad('sc'));C(a,olympe.sc.P.Le,olympe.sc.cc,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Jk,[new olympe.V.oa(olympe.sc.Config.PRODUCTION)],b=>{const c=new olympe.sc.Fg('root','root',null);olympe.sc.Tn=c;
1105
- c.set(olympe.sc.xa.j.PRODUCTION,b);return new olympe.sc.xa(c)})},'olympe.sc');olympe.V.run([olympe.sc.P.Jk,new olympe.V.oa(olympe.L.Config.Nl)],(a,b)=>{olympe.de().ctx=a;olympe.de().oVersion=()=>b});olympe.sc.Nn=()=>null!==olympe.dc.ga().Ib(void 0,olympe.sc.Runnable.j.$b());olympe.sc.ME=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.gd),olympe.sc.gd.j,c||null),olympe.sc.gd.F,d||null);a.Oa(olympe.sc.gd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.W()};olympe.sc.tj=(a,b)=>{a=olympe.dc.mb.Zx(b)(a);return a instanceof olympe.sc.Td?a.j():a};
1106
- olympe.sc.dF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.ea(a);if(void 0===c)return[];a=olympe.dc.ga();const d=[];let e=[];const f=new Set;for(;!a.Nb(c,olympe.dm.Kb);){f.add(c);const g=a.Ib(c,b);if(null===g)return olympe.ha.Xa('sc').warn(`Object ${c} has no container`),[];a.Nb(c,olympe.sc.logic.pb)||g===a.Ib(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.nh(e[0],
1107
- olympe.dm.Kb.ia));e=e.concat(a.nh(e[e.length-1],olympe.dm.Nc.R.$b()));e=e.concat(a.nh(e[e.length-1],olympe.dm.Nc.N.$b()));return[...d,...e].reverse()};olympe.sc.eF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Kg:a.startsWith('video/')?olympe.sc.bi:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Lc:olympe.dm.File};
1108
- olympe.sc.cF=a=>a instanceof olympe.sc.Kg?'image/*':a instanceof olympe.sc.bi?'video/*':a instanceof olympe.sc.Lc?'font/*,application/font-woff':null;olympe.sc.$a={};function kn(a,b){var c=olympe.sc.xa,d=a.state;a=a.Bb();b=olympe.dc.ea(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ji(a,void 0,b);for(d=f.getParent();d&&d.ia&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||ln(g,b,f)}return new c(f)}function mn(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.ea(b)))?d:null)?new olympe.sc.xa(a):null}function nn(a){let b;return null!=(b=a.Pa(olympe.sc.xa.j.PRODUCTION))?b:!1}
1109
- olympe.sc.xa=class{constructor(a=olympe.sc.Tn){this.state=a;this.G=olympe.ha.Xa('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.xa(a)}return this.j}$x(a){const b=olympe.dc.ga();let c=this.getParent();if(!c)return this;const d=e=>{e=e.kf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.Z)||a.modelTag&&!b.Nb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1110
- c=e}return c}kf(){return this.state.kf()}Bb(){return this.state.Bb()}set(a,b){this.state.set(a,b);return this}co(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}sb(a,b,c=!1){const d=olympe.dc.ea(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.state.T():void 0));return e.sb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
1111
- !1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=on(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.vh(a.unsubscribe.bind(a));return this}Zz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ji(`Runner ${a.name()}`);a.run(b);return b}zt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
1096
+ w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ja('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ja('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.ya=[olympe.C.File];m=olympe.dm.File.prototype;m.Us.K=olympe.C.J.D;m.gl.K=olympe.C.J.j;m.Cn.K=olympe.C.J.j;m.hl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
1097
+ m.nq.K=olympe.C.J.D;m.mq.K=olympe.C.J.D;m.my.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Hy.K=new olympe.C.J(()=>olympe.C.eb,[]);m.lz.K=olympe.C.J.N;olympe.dm.Pd=class extends olympe.dc.CloudObject{j(){return this.vb(olympe.dm.Pd.D)}F(){return this.xd(olympe.dm.Pd.F)}D(){return this.cb(olympe.dm.Pd.j,olympe.dm.Module)}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Pd);olympe.dm.Pd.D=olympe.dm.Pd.O.ja('ff023000000000000047');olympe.dm.Pd.F=olympe.dm.Pd.O.ja('ff023000000000000048');olympe.dm.Pd.j=olympe.dm.Module.j.$b();olympe.dm.Pd.prototype.j.K=olympe.C.J.D;olympe.dm.Pd.prototype.F.K=olympe.C.J.F;
1098
+ olympe.dm.Pd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb=class extends olympe.dm.Pc{j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.vb(olympe.dm.hb.X)}R(){return this.vb(olympe.dm.hb.nb)}D(){return this.cb(olympe.dm.hb.F,olympe.dm.hb)}};olympe.dm.hb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.hb);olympe.dm.hb.X=olympe.dm.hb.O.ja('017869c7d2833c9492c1');olympe.dm.hb.ht=olympe.dm.hb.O.ja('017869c7d2833c9492c2');olympe.dm.hb.Pe=olympe.dm.hb.O.ja('017869c7d2833c9492c3');olympe.dm.hb.nb=olympe.dm.hb.O.ja('017869c80bb9929c76d0');
1099
+ olympe.dm.hb.Wa=olympe.dm.hb.O.ra('ff02200000000000002a');olympe.dm.hb.F=olympe.dm.hb.O.ra('ff02200000000000002b');olympe.dm.hb.sg=R(olympe.dm.hb.O,olympe.dm.hb.F);olympe.dm.hb.D=olympe.dm.hb.O.ra('ff02200000000000002c');olympe.dm.hb.tg=olympe.dm.hb.O.ra('017e9c412e2b944bc48f');olympe.dm.hb.ef=olympe.dm.hb.O.ra('017e9c412e2b944bd590');olympe.dm.hb.bt=olympe.dm.hb.O.ra('017e9c416872a89d3415');olympe.dm.hb.$s=olympe.dm.hb.O.ra('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.hb.Wa);
1100
+ olympe.dm.hb.Fd=dg('100000000000000000dd','PRIMORDIAL');olympe.dm.hb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.hb.prototype.F.K=olympe.C.J.D;olympe.dm.hb.prototype.R.K=olympe.C.J.D;olympe.dm.hb.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Sc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Sc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.vg(olympe.dm.Property.typeRel).Cc()}Wc(){return this.j().ka().Ds(this.ka())}};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);
1101
+ w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);w('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)}Dy(){return olympe.C.Sa.EMPTY}by(){return this.xd(olympe.dm.Relation.D)}Ny(){return this.xd(olympe.dm.Relation.F)}Ns(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Ic()}Ws(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Ic()}Wc(){return this.Ws().ka().concat(['-',this.ka(),'->',this.Ns().ka()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1102
+ olympe.dm.Relation.F=olympe.dm.Relation.O.ja('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ja('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ja(olympe.dc.Lb.gp);olympe.dm.Relation.X=olympe.dm.Relation.O.ja(olympe.dc.Lb.Dc);olympe.dm.Relation.ia=olympe.dm.Relation.O.ja(olympe.dc.Lb.jg);olympe.dm.Relation.sa=olympe.dm.Relation.O.ja(olympe.dc.Lb.xw);olympe.dm.Relation.Z=olympe.dm.Relation.O.ja(olympe.dc.Lb.ju);olympe.dm.Relation.Ha=olympe.dm.Relation.O.ja(olympe.dc.Lb.Uw);
1103
+ olympe.dm.Relation.R=olympe.dm.Relation.O.ja('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Lj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Hs);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={Wp:0,Ot:5,gw:1,RC:4,ds:2,xr:8,fB:10,OC:6,PC:9,Xe:6,QC:9};
1104
+ olympe.dm.Relation.H={sC:3,Nv:4,dC:5,cC:6};olympe.dm.Relation.N=olympe.dm.Dl.Pv+olympe.dm.Dl.fu;m=olympe.dm.Relation.prototype;m.Dy.K=olympe.C.J.D;m.by.K=olympe.C.J.F;m.Ny.K=olympe.C.J.F;m.Ns.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ws.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function jn(a){a=olympe.dc.ea(a);if(olympe.dc.ga().Tf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.W():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.W():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.W():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.W():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Ie=class extends olympe.dc.CloudObject{getValue(){}};
1105
+ olympe.dm.Ie.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Ie);olympe.dm.String=class extends olympe.dm.Ie{getValue(){return this.vb(olympe.dm.String.valueProp)}tc(){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.ja('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
1106
+ olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.mh(olympe.dm.Boolean.valueProp)}tc(){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.ja('ff023000000000000027');w('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.Ie{getValue(){return this.Xs()}tc(){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.ja('ff023000000000000032');w('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.Ie{getValue(){return this.Dj(olympe.dm.DateTime.valueProp)}tc(){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.ja('ff023000000000000029');w('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{ka(){return olympe.C.ta([super.ka(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Hd(){return this.xd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Hd.K=olympe.C.J.F;olympe.dm.fg=class extends olympe.dm.BrickMetadata{az(){return this.bb(olympe.dc.CloudObject.instancesRel).xl(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Cc()}static create(a,b){b=a.create(olympe.dm.fg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.fg.create=olympe.dm.fg.create;olympe.dm.fg.prototype.getValues=olympe.dm.fg.prototype.az;olympe.dm.fg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.fg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.xd(olympe.dm.Number.valueProp)}tc(){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.ja('ff023000000000000028');w('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',Kk:'sc.RootContext',Le:'sc.Serializer'};olympe.sc.Config={ye:'sc.app',ag:'sc.debug',ko:'sc.autostartProfiler',cp:'sc.debugger',gu:'sc.disableTheme',PRODUCTION:'sc.production',Ov:'sc.onstartTimeout',sr:'sc.remoteActionTimeout'};
1107
+ olympe.V.config(a=>{E(a,olympe.sc.Config.ye,'');E(a,olympe.sc.Config.ag,!1);E(a,olympe.sc.Config.gu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Ov,2E4);E(a,olympe.sc.Config.sr,3E4);E(a,olympe.sc.Config.ko,!1);D(a,olympe.sc.P.Ca,[olympe.ha.P.Fa],b=>b.ad('sc'));C(a,olympe.sc.P.Le,olympe.sc.cc,olympe.dc.db.P.Fa);Wa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Kk,[new olympe.V.oa(olympe.sc.Config.PRODUCTION)],b=>{const c=new olympe.sc.Fg('root','root',null);olympe.sc.Un=c;
1108
+ c.set(olympe.sc.xa.j.PRODUCTION,b);return new olympe.sc.xa(c)})},'olympe.sc');olympe.V.run([olympe.sc.P.Kk,new olympe.V.oa(olympe.L.Config.Ol)],(a,b)=>{olympe.de().ctx=a;olympe.de().oVersion=()=>b});olympe.sc.On=()=>null!==olympe.dc.ga().Ib(void 0,olympe.sc.Runnable.j.$b());olympe.sc.QE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.gd),olympe.sc.gd.j,c||null),olympe.sc.gd.F,d||null);a.Oa(olympe.sc.gd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.W()};olympe.sc.tj=(a,b)=>{a=olympe.dc.ib.ey(b)(a);return a instanceof olympe.sc.Td?a.j():a};
1109
+ olympe.sc.hF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.ea(a);if(void 0===c)return[];a=olympe.dc.ga();const d=[];let e=[];const f=new Set;for(;!a.Nb(c,olympe.dm.Kb);){f.add(c);const g=a.Ib(c,b);if(null===g)return olympe.ha.Xa('sc').warn(`Object ${c} has no container`),[];a.Nb(c,olympe.sc.logic.pb)||g===a.Ib(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.nh(e[0],
1110
+ olympe.dm.Kb.ia));e=e.concat(a.nh(e[e.length-1],olympe.dm.Pc.R.$b()));e=e.concat(a.nh(e[e.length-1],olympe.dm.Pc.N.$b()));return[...d,...e].reverse()};olympe.sc.iF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Kg:a.startsWith('video/')?olympe.sc.bi:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Nc:olympe.dm.File};
1111
+ olympe.sc.gF=a=>a instanceof olympe.sc.Kg?'image/*':a instanceof olympe.sc.bi?'video/*':a instanceof olympe.sc.Nc?'font/*,application/font-woff':null;olympe.sc.$a={};function kn(a,b){var c=olympe.sc.xa,d=a.state;a=a.Cb();b=olympe.dc.ea(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ji(a,void 0,b);for(d=f.getParent();d&&d.ia&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||ln(g,b,f)}return new c(f)}function mn(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.ea(b)))?d:null)?new olympe.sc.xa(a):null}function nn(a){let b;return null!=(b=a.Qa(olympe.sc.xa.j.PRODUCTION))?b:!1}
1112
+ olympe.sc.xa=class{constructor(a=olympe.sc.Un){this.state=a;this.G=olympe.ha.Xa('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.xa(a)}return this.j}gy(a){const b=olympe.dc.ga();let c=this.getParent();if(!c)return this;const d=e=>{e=e.kf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Pa(f,olympe.sc.Ua.Z)||a.modelTag&&!b.Nb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
1113
+ c=e}return c}kf(){return this.state.kf()}Cb(){return this.state.Cb()}set(a,b){this.state.set(a,b);return this}eo(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.ea(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.state.T():void 0));return e.tb()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
1114
+ !1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=on(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.vh(a.unsubscribe.bind(a));return this}cA(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ji(`Runner ${a.name()}`);a.run(b);return b}Dt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
1112
1115
  b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ea(a)})\``+`on the context ${this.T()}:\nStack: ${this.re()}\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.ea(a)})\` `+`has never received any value:\nStack: ${this.re()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;
1113
- const d=(null==(c=a.re)?void 0:c.call(a))||this.re();let e,f;c=null!=(f=null==(e=a.Aj)?void 0:e.call(a))?f:0;b=pn(b,c,d);b.stack=a.stack}else b=pn(b,0,this.re());qn(this.state,b);return this}$z(a){this.set(olympe.sc.xa.j.Eg,a);return this}Pa(a,b=!0){return this.state.Pa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}ji(a){return new olympe.sc.xa(this.state.ji(this.Bb(),a))}tl(a,b){return this.state.tl(a,c=>{b(new olympe.sc.xa(c))})}Iy(a){a=rn(this.state,a);return a===this.state?this:a&&new olympe.sc.xa(a)}destroy(){this.state.destroy()}vh(a,
1114
- b){return this.state.vh(a,b)}rl(a){this.state.rl(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.Bb().onDestroy(a)}Wf(a){this.fb()||this.Bb().Wf(a)}clear(){this.state.clear()}fb(){return this.Bb().fb()||this.Bb().hd()}Qa(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.JA(a,this):null}ty(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.IA(a,this):null}Dz(...a){return rxjs.combineLatest(a.map(b=>{b=sn(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==
1115
- a?void 0:a.constructor)!==this.constructor?!1:this.state===a.state}re(){const a=olympe.dc.ga();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.state!==olympe.sc.Tn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.kf();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.xa.prototype.observeMany=olympe.sc.xa.prototype.Dz;
1116
- olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.ty;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Qa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Wf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.rl;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.vh;
1117
- olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Iy;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.tl;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.ji;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.$z;olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.zt;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.Zz;
1118
- olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.co;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.$x;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;
1119
- olympe.sc.xa.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Eg:'__htmlContainer',XA:'__dockableElement',ho:'__appHasStarted'};olympe.sc.Uw=class extends olympe.sc.xa{constructor(a){super(a);this.D=new olympe.C.Wb('SC Update Context',super.Bb());const b=a.vh(()=>{b&&a.rl(b);this.D.destroy()})}Bb(){return this.D}vh(a,b){return this.Bb().onDestroy(a,null!=b?b:olympe.U.Jc())}};let tn=0;function on(a,b){b=olympe.dc.ea(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function qn(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da&&olympe.dc.ga().Ia(a.da)){var c=un(olympe.dc.CloudObject.get(a.da));null!==c&&vn(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):qn(a.H,b)}else qn(a.H,b)}
1120
- function rn(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=wn(a.j,b);if(c)return c;a=a.getParent()}return null}function xn(a,b,c=0){null===a.$a&&(a.$a=new Map);a.$a.has(b.T())||(a.$a.set(b.T(),{ul:b,depth:c}),yn(a,d=>{(-1===b.F||c<b.F)&&xn(d,b,c+1)}),a.onDestroy(()=>{zn(a,b.T())}));return b.T()}
1121
- function zn(a,b){if(null===a.$a||!a.$a.has(b))return!1;const {ul:c,depth:d}=a.$a.get(b);yn(a,f=>{zn(f,b)});0===d&&c.D();const e=a.$a.delete(b);0===a.$a.size&&(a.$a=null);return e}function sn(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
1122
- function An(a){a.D.Xd(()=>{yn(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Pa(olympe.sc.xa.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)}
1123
- function wn(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ia&&!c.id.startsWith('_')&&(a=wn(c.j,b)))return a;return null}function Cn(a,b,...c){if(null!==a.$a)for(const {ul:d,depth:e}of a.$a.values())d.process(a,b,e,...c)}function Dn(a,b){a.da=olympe.dc.ea(b);a.ia=b.wd().Nn();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.Z=b.D();Cn(a,olympe.sc.$a.pc.j.INIT)}function En(a){a.sa=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
1116
+ const d=(null==(c=a.re)?void 0:c.call(a))||this.re();let e,f;c=null!=(f=null==(e=a.Aj)?void 0:e.call(a))?f:0;b=pn(b,c,d);b.stack=a.stack}else b=pn(b,0,this.re());qn(this.state,b);return this}dA(a){this.set(olympe.sc.xa.j.Eg,a);return this}Qa(a,b=!0){return this.state.Qa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}ji(a){return new olympe.sc.xa(this.state.ji(this.Cb(),a))}ul(a,b){return this.state.ul(a,c=>{b(new olympe.sc.xa(c))})}Ly(a){a=rn(this.state,a);return a===this.state?this:a&&new olympe.sc.xa(a)}destroy(){this.state.destroy()}vh(a,
1117
+ b){return this.state.vh(a,b)}sl(a){this.state.sl(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.Cb().onDestroy(a)}Wf(a){this.fb()||this.Cb().Wf(a)}clear(){this.state.clear()}fb(){return this.Cb().fb()||this.Cb().hd()}Pa(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.NA(a,this):null}wy(a){a=sn(this.state,a);return null!==a?new olympe.sc.ui.MA(a,this):null}Gz(...a){return rxjs.combineLatest(a.map(b=>{b=sn(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==
1118
+ a?void 0:a.constructor)!==this.constructor?!1:this.state===a.state}re(){const a=olympe.dc.ga();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.state!==olympe.sc.Un;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.kf();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.xa.prototype.observeMany=olympe.sc.xa.prototype.Gz;
1119
+ olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.wy;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Pa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Wf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.sl;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.vh;
1120
+ olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Ly;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.ul;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.ji;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.dA;olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Dt;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.cA;
1121
+ olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.eo;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.gy;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;
1122
+ olympe.sc.xa.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Eg:'__htmlContainer',aB:'__dockableElement',io:'__appHasStarted'};olympe.sc.Yw=class extends olympe.sc.xa{constructor(a){super(a);this.D=new olympe.C.Wb('SC Update Context',super.Cb());const b=a.vh(()=>{b&&a.sl(b);this.D.destroy()})}Cb(){return this.D}vh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.U.Kc())}};let tn=0;function on(a,b){b=olympe.dc.ea(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function qn(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da&&olympe.dc.ga().Ja(a.da)){var c=un(olympe.dc.CloudObject.get(a.da));null!==c&&vn(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):qn(a.H,b)}else qn(a.H,b)}
1123
+ function rn(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=wn(a.j,b);if(c)return c;a=a.getParent()}return null}function xn(a,b,c=0){null===a.$a&&(a.$a=new Map);a.$a.has(b.T())||(a.$a.set(b.T(),{vl:b,depth:c}),yn(a,d=>{(-1===b.F||c<b.F)&&xn(d,b,c+1)}),a.onDestroy(()=>{zn(a,b.T())}));return b.T()}
1124
+ function zn(a,b){if(null===a.$a||!a.$a.has(b))return!1;const {vl:c,depth:d}=a.$a.get(b);yn(a,f=>{zn(f,b)});0===d&&c.D();const e=a.$a.delete(b);0===a.$a.size&&(a.$a=null);return e}function sn(a,b){let c;return(null==(c=a.Z)?void 0:c.get('IO#'+b))||null}
1125
+ function An(a){a.D.Xd(()=>{yn(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Qa(olympe.sc.xa.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)}
1126
+ function wn(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ia&&!c.id.startsWith('_')&&(a=wn(c.j,b)))return a;return null}function Cn(a,b,...c){if(null!==a.$a)for(const {vl:d,depth:e}of a.$a.values())d.process(a,b,e,...c)}function Dn(a,b){a.da=olympe.dc.ea(b);a.ia=b.wd().On();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.Z=b.D();Cn(a,olympe.sc.$a.pc.j.INIT)}function En(a){a.sa=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
1124
1127
  function Fn(a){a.sa=!1;let b;null==(b=a.j)||b.forEach(c=>{Fn(c)})}function vn(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.sa&&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));tn++;const e=tn;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1125
- function ln(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});yn(a,f=>{f.N.has(b)||ln(f,b,c)});a.N.delete(b)}function yn(a,b){let c;null==(c=a.j)||c.forEach(b)}function In(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Jn(a){var b=olympe.sc.$a.pc.D.Ze;const c=[];if(null!==a.$a)for(const {ul:d}of a.$a.values())d.getType()===b&&(c.push(d.T()),d.D(),zn(a,d.T()))}function Bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1126
- olympe.sc.Fg=class{constructor(a,b='no name',c=olympe.sc.Tn){this.id=a;this.$c=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.da=this.X=this.j=this.F=null;this.ia=!1;this.N=new Set;this.sa=!1;this.Z=null;this.G=olympe.ha.Xa('sc');this.$a=null;An(this)}T(){return this.id}getParent(){return this.H}kf(){return this.da}set(a,b){if(!this.D.hd()&&!this.D.fb()){const g=olympe.dc.ea(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.Z)?void 0:c.get('O#'+g))?h:null==
1128
+ function ln(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});yn(a,f=>{f.N.has(b)||ln(f,b,c)});a.N.delete(b)}function yn(a,b){let c;null==(c=a.j)||c.forEach(b)}function In(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Jn(a){var b=olympe.sc.$a.pc.D.Ze;const c=[];if(null!==a.$a)for(const {vl:d}of a.$a.values())d.getType()===b&&(c.push(d.T()),d.D(),zn(a,d.T()))}function Bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
1129
+ olympe.sc.Fg=class{constructor(a,b='no name',c=olympe.sc.Un){this.id=a;this.$c=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.da=this.X=this.j=this.F=null;this.ia=!1;this.N=new Set;this.sa=!1;this.Z=null;this.G=olympe.ha.Xa('sc');this.$a=null;An(this)}T(){return this.id}getParent(){return this.H}kf(){return this.da}set(a,b){if(!this.D.hd()&&!this.D.fb()){const g=olympe.dc.ea(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.Z)?void 0:c.get('O#'+g))?h:null==
1127
1130
  (d=this.Z)?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.$a&&0<this.$a.size&&Cn(this,olympe.sc.$a.pc.j.Yg,a,b),f=vn(this,a),this.N.add(c),Gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.fb()||this.D.hd())return()=>{};const e=on(this,a),f=c?olympe.dc.ea(c):
1128
- '*';a=Hn(this,'@'+f+'.'+e,b);c=c?(c=rn(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+on(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}ji(a,b,c){const d=null!=c?c:'_'+olympe.U.Jc();if(a.fb()||a.hd())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.Fg(d,
1129
- b,this));null!==this.$a&&0<this.$a.size&&this.$a.forEach(({ul:f,depth:g})=>{(-1===f.F||g<f.F)&&xn(e,f,g+1)});return e}tl(a,b){const c=rn(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='$'+on(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.hd()||this.D.fb()||(Cn(this,olympe.sc.$a.pc.j.ck),this.D.destroy(),Cn(this,olympe.sc.$a.pc.j.Zd))}vh(a,b){if(this.D.fb())a();
1130
- else return tn++,b=null!=b?b:String(tn),null===this.X&&(this.X=new Map),this.X.set(b,a),b;return b||'noId'}rl(a){null!==this.X&&this.X.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.fb()){Cn(this,olympe.sc.$a.pc.j.Wj);let a;null==(a=this.X)||a.forEach(b=>b());Cn(this,olympe.sc.$a.pc.j.Xj)}}fb(){return this.D.fb()}Bb(){return this.D}};olympe.sc.Fg.prototype.getParent=olympe.sc.Fg.prototype.getParent;olympe.sc.Fg.j={pm:'I#',Hm:'O#',QB:'IO#'};function Kn(a,b,c){return(c=c.kf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.pc=class{constructor(a=-1){this.id=olympe.U.hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.pc.j={INIT:'INIT',Yg:'SET',Wj:'CLEAR',Xj:'CLEARED',ck:'DESTROY',Zd:'DESTROYED'};olympe.sc.$a.pc.D={Ze:'REMOTE',nv:'LOCAL',ig:'PROFILER'};olympe.sc.$d=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.U.bn(1E4);gb(this.j,b=>{Jn(b)})}Z(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.$d.j.Pv:c=this.F.get(e.f);b.cd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.$d.j.Qv:const h=f+c,k=(l,n,p=0)=>{In(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.kf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1131
- t])})};b.Qn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.qb.kd(h,{t:olympe.sc.$d.j.Eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.fw(h);xn(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.$d.j.Rv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.$d.j.Eh:void 0!==g&&(this.j.delete(g),Jn(g))}}da(b,c,d){this.N=new olympe.L.qb('discovery_debug_id',
1132
- c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.$d.j.du){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.X(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.U.hf(),f=new olympe.C.Wb(this.D,c.Bb()),this.H=new olympe.L.qb(this.D,f),this.H.listen().subscribe(g=>{this.Z(g,b,d)}));olympe.L.qb.kd(e,{t:olympe.sc.$d.j.At,n:olympe.V.getParameter(olympe.sc.Config.bp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}X(b,c,
1133
- d){const e=[],f=olympe.dc.ga(),g=(h,k)=>{yn(h,l=>{if(null!==l.kf()){const n=olympe.dc.CloudObject.get(l.kf()).vg(olympe.sc.Runnable.D).Cc();if(null!==n){const p=k+'/'+f.name(n);n.W()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.qb.kd(b,{t:olympe.sc.$d.j.Wk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ha.Xa('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1134
- b||void 0===b)return'<null>';const c=olympe.dc.ga();if(b instanceof olympe.dc.CloudObject){var d=b.Vb();if(!c.Nb(d,olympe.sc.zc))return b.toString();let f=`${b.Ub().name()} (${b.W()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.propertyRel).me().Cc();e=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.Kj).me().Cc();d=d.filter(([g])=>g instanceof olympe.sc.zc);0!==d.length&&(f+=
1135
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.W(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.zc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.$d.H='discovery_debug_id';olympe.sc.$d.j={du:0,At:1,Pv:2,Qv:3,Eu:4,Wk:5,Rv:6,Eh:7};olympe.sc.$a.YB=class extends olympe.sc.$a.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.$a.pc.D.nv}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg){a=Kn(c,on(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 Ln(a,b,c,d=new Map){for(var e=[];b;){const n=b.kf();if(!n)break;e.push(n);b=b.getParent()}rb(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.ga||(e.ga=olympe.dc.ga());d=e.ga.name(f);e=(f=e.ga.model(f))?e.ga.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,
1131
+ '*';a=Hn(this,'@'+f+'.'+e,b);c=c?(c=rn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+on(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}ji(a,b,c){const d=null!=c?c:'_'+olympe.U.Kc();if(a.fb()||a.hd())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.Fg(d,
1132
+ b,this));null!==this.$a&&0<this.$a.size&&this.$a.forEach(({vl:f,depth:g})=>{(-1===f.F||g<f.F)&&xn(e,f,g+1)});return e}ul(a,b){const c=rn(this,a);if(c)return b(c),()=>{};const d=Hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+on(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.hd()||this.D.fb()||(Cn(this,olympe.sc.$a.pc.j.dk),this.D.destroy(),Cn(this,olympe.sc.$a.pc.j.Zd))}vh(a,b){if(this.D.fb())a();
1133
+ else return tn++,b=null!=b?b:String(tn),null===this.X&&(this.X=new Map),this.X.set(b,a),b;return b||'noId'}sl(a){null!==this.X&&this.X.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.fb()){Cn(this,olympe.sc.$a.pc.j.Xj);let a;null==(a=this.X)||a.forEach(b=>b());Cn(this,olympe.sc.$a.pc.j.Yj)}}fb(){return this.D.fb()}Cb(){return this.D}};olympe.sc.Fg.prototype.getParent=olympe.sc.Fg.prototype.getParent;olympe.sc.Fg.j={qm:'I#',Im:'O#',UB:'IO#'};function Kn(a,b,c){return(c=c.kf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.pc=class{constructor(a=-1){this.id=olympe.U.hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.pc.j={INIT:'INIT',Yg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',Zd:'DESTROYED'};olympe.sc.$a.pc.D={Ze:'REMOTE',rv:'LOCAL',ig:'PROFILER'};olympe.sc.$d=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.U.cn(1E4);gb(this.j,b=>{Jn(b)})}Z(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.$d.j.Tv:c=this.F.get(e.f);b.cd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.$d.j.Uv:const h=f+c,k=(l,n,p=0)=>{In(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.kf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1134
+ t])})};b.Rn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.qb.kd(h,{t:olympe.sc.$d.j.Iu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.jw(h);xn(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.$d.j.Vv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.$d.j.Eh:void 0!==g&&(this.j.delete(g),Jn(g))}}da(b,c,d){this.N=new olympe.L.qb('discovery_debug_id',
1135
+ c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.$d.j.hu){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.X(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.U.hf(),f=new olympe.C.Wb(this.D,c.Cb()),this.H=new olympe.L.qb(this.D,f),this.H.listen().subscribe(g=>{this.Z(g,b,d)}));olympe.L.qb.kd(e,{t:olympe.sc.$d.j.Et,n:olympe.V.getParameter(olympe.sc.Config.cp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}X(b,c,
1136
+ d){const e=[],f=olympe.dc.ga(),g=(h,k)=>{yn(h,l=>{if(null!==l.kf()){const n=olympe.dc.CloudObject.get(l.kf()).vg(olympe.sc.Runnable.D).Cc();if(null!==n){const p=k+'/'+f.name(n);n.W()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.qb.kd(b,{t:olympe.sc.$d.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ha.Xa('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1137
+ b||void 0===b)return'<null>';const c=olympe.dc.ga();if(b instanceof olympe.dc.CloudObject){var d=b.Vb();if(!c.Nb(d,olympe.sc.Ac))return b.toString();let f=`${b.Ub().name()} (${b.W()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.propertyRel).me().Cc();e=olympe.dc.la.from(e).ug(olympe.dc.CloudObject.extendRel,!0).me().bb(olympe.dc.CloudObject.Lj).me().Cc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=
1138
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Pa(b.W(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.$d.H='discovery_debug_id';olympe.sc.$d.j={hu:0,Et:1,Tv:2,Uv:3,Iu:4,Xk:5,Vv:6,Eh:7};olympe.sc.$a.bC=class extends olympe.sc.$a.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.$a.pc.D.rv}process(a,b,c,...d){if(this.active&&b===olympe.sc.$a.pc.j.Yg){a=Kn(c,on(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 Ln(a,b,c,d=new Map){for(var e=[];b;){const n=b.kf();if(!n)break;e.push(n);b=b.getParent()}rb(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.ga||(e.ga=olympe.dc.ga());d=e.ga.name(f);e=(f=e.ga.model(f))?e.ga.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,
1136
1139
  q)}}
1137
- olympe.sc.$a.Zv=class extends olympe.sc.$a.pc{constructor(a){super();this.j=a;this.ga=olympe.dc.ga();this.H=new Set}getType(){return olympe.sc.$a.pc.D.ig}process(a,b,c,...d){var e=Mn.pm,f=Mn.Hm,g=Mn.Uv;const h=Mn.INIT,k=Mn.Wj,l=Mn.Xj,n=Mn.ck,p=Mn.Zd;c=Mn.Mv;if(b===olympe.sc.$a.pc.j.Yg){const [q,r]=d;b=(d=a.kf())?olympe.dc.ga().Nb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ga().Nb(d,olympe.sc.ui.PC):!1;b?(g=this.ga.Ib(q,olympe.dm.Property.typeRel),b=this.ga.Nb(q,olympe.sc.logic.ub),d=this.ga.Nb(q,olympe.sc.logic.Fb),
1138
- Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ga.Nb(q,olympe.dm.Property),f=this.ga.Ib(q,olympe.dm.Property.typeRel),Ln(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.pc.j.INIT?Ln(this,a,h):b===olympe.sc.$a.pc.j.Wj?Ln(this,a,k):b===olympe.sc.$a.pc.j.Xj?Ln(this,a,l):b===olympe.sc.$a.pc.j.ck?Ln(this,a,n):b===olympe.sc.$a.pc.j.Zd&&Ln(this,a,p)}};
1139
- const Mn={pm:'input',Hm:'output',Uv:'prop',INIT:'init',Wj:'clear',Xj:'cleared',ck:'destroy',Zd:'destroyed',Mv:'other'};olympe.sc.$a.fw=class extends olympe.sc.$a.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ga()}getType(){return olympe.sc.$a.pc.D.Ze}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.$a.pc.j.Yg&&void 0!==d[0]&&null!==d[0]){const e=Kn(c,on(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.Ub()instanceof olympe.sc.zc){const h=hh(this.db,f,()=>{olympe.sc.$d.D(this.H,
1140
- e,f)});this.j.set(e,()=>{ih(this.db,f,h)})}olympe.sc.$d.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Yu(){return this.xd(this.In())}Zu(){return this.xd(this.Jn())}jl(){return new olympe.C.Zb(this.xd(this.In()),this.xd(this.Jn()))}In(){}Jn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.Yu.K=olympe.C.J.F;m.Zu.K=olympe.C.J.F;m.jl.K=olympe.C.J.R;m.In.K=olympe.C.J.j;m.Jn.K=olympe.C.J.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.vb(olympe.sc.gd.F)}j(){return this.vb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ja('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ja('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.ra('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.J.D;olympe.sc.gd.prototype.j.K=olympe.C.J.D;olympe.sc.we={};olympe.sc.we.Ne={nu:'folders',jw:'screenflow',Lw:'ui-design',Lr:'software-intelligence',Bh:'data-management',CC:'projects'};olympe.sc.Ff=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Hd(){return this.xd(olympe.sc.Ff.D)}};olympe.sc.Ff.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Ff);olympe.sc.Ff.D=olympe.sc.Ff.O.ja('016d1bb681929c2cc3f1');olympe.sc.Ff.j=olympe.sc.Ff.O.ra('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Ff.j);olympe.sc.Ff.prototype.Hd.K=olympe.C.J.F;olympe.sc.sd=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Lr}j(){return this.cb(olympe.sc.sd.j,olympe.sc.logic.Uh)}D(){return this.cb(olympe.sc.sd.D,olympe.sc.logic.Rg)}};olympe.sc.sd.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.sd);olympe.sc.sd.j=olympe.sc.sd.O.ra('016ac4f59a2917fdef01');olympe.sc.sd.D=olympe.sc.sd.O.ra('016ac4f59a2917fdef02');olympe.sc.sd.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.sd,olympe.sc.logic.Bd).W();
1141
- olympe.sc.sd.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.sd.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function Nn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function On(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Nb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Sb.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Sb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.D))}
1142
- olympe.sc.Ua=class extends olympe.dm.BrickMetadata{av(a,b,c,d,e=!0){e||olympe.ha.Xa('sc').error('parameter own= false ignored, investigate');return olympe.C.wh(M(this.Sf(a,olympe.dc.mb.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Py(){return this.cb(olympe.sc.Ua.H,olympe.sc.Runnable)}ey(){return this.cb(olympe.sc.Ua.R,olympe.sc.Runnable)}ti(){return this.db.Qa(this,olympe.sc.Ua.Z)}Nn(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.j.$b())}$u(){return this.cb(olympe.sc.Ua.F,olympe.sc.logic.ub)}lq(){return this.cb(olympe.sc.Ua.D,
1143
- olympe.sc.logic.Fb)}N(){return[olympe.sc.Ua.Wa]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.Z=olympe.sc.Ua.O.ja('01692aa71f3108454479');olympe.sc.Ua.lb=olympe.sc.Ua.O.ja('0166446c1f128ebc903a');olympe.sc.Ua.Wa=olympe.sc.Ua.O.ja('0166446c1f128ebc904e');olympe.sc.Ua.H=olympe.sc.Ua.O.ra('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.ra('01692a4af82e8984742d');olympe.sc.Ua.X=olympe.sc.Ua.O.ra('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.ra('01621fb84e320000f00a');
1144
- olympe.sc.Ua.D=olympe.sc.Ua.O.ra('01621fb84e320000f00b');olympe.sc.Ua.Fd=olympe.sc.Ua.O.ra('0171838bcfed0000e00e');olympe.sc.Ua.vd=olympe.sc.Ua.O.ra('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.av.K=olympe.C.J.j;m.Py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ey.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ti.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;m.$u.K=new olympe.C.J(()=>olympe.dc.za,[]);m.lq.K=new olympe.C.J(()=>olympe.dc.za,[]);function un(a){let b;return null!=(b=a.wd().N().map(olympe.dc.ea)[0])?b:null}function Rn(a){const b=new olympe.dc.Ya;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ha.Xa('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Za().onDestroy(()=>{const d=new olympe.dc.Ya;d.delete(c);d.nb()});return c}
1140
+ olympe.sc.$a.cw=class extends olympe.sc.$a.pc{constructor(a){super();this.j=a;this.ga=olympe.dc.ga();this.H=new Set}getType(){return olympe.sc.$a.pc.D.ig}process(a,b,c,...d){var e=Mn.qm,f=Mn.Im,g=Mn.Yv;const h=Mn.INIT,k=Mn.Xj,l=Mn.Yj,n=Mn.dk,p=Mn.Zd;c=Mn.Qv;if(b===olympe.sc.$a.pc.j.Yg){const [q,r]=d;b=(d=a.kf())?olympe.dc.ga().Nb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ga().Nb(d,olympe.sc.ui.TC):!1;b?(g=this.ga.Ib(q,olympe.dm.Property.typeRel),b=this.ga.Nb(q,olympe.sc.logic.ub),d=this.ga.Nb(q,olympe.sc.logic.Fb),
1141
+ Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ga.Nb(q,olympe.dm.Property),f=this.ga.Ib(q,olympe.dm.Property.typeRel),Ln(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.pc.j.INIT?Ln(this,a,h):b===olympe.sc.$a.pc.j.Xj?Ln(this,a,k):b===olympe.sc.$a.pc.j.Yj?Ln(this,a,l):b===olympe.sc.$a.pc.j.dk?Ln(this,a,n):b===olympe.sc.$a.pc.j.Zd&&Ln(this,a,p)}};
1142
+ const Mn={qm:'input',Im:'output',Yv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',Zd:'destroyed',Qv:'other'};olympe.sc.$a.jw=class extends olympe.sc.$a.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ga()}getType(){return olympe.sc.$a.pc.D.Ze}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.$a.pc.j.Yg&&void 0!==d[0]&&null!==d[0]){const e=Kn(c,on(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.Ub()instanceof olympe.sc.Ac){const h=hh(this.db,f,()=>{olympe.sc.$d.D(this.H,
1143
+ e,f)});this.j.set(e,()=>{ih(this.db,f,h)})}olympe.sc.$d.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{bv(){return this.xd(this.Jn())}dv(){return this.xd(this.Kn())}kl(){return new olympe.C.Zb(this.xd(this.Jn()),this.xd(this.Kn()))}Jn(){}Kn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.bv.K=olympe.C.J.F;m.dv.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.Jn.K=olympe.C.J.j;m.Kn.K=olympe.C.J.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.vb(olympe.sc.gd.F)}j(){return this.vb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ja('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ja('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.ra('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.J.D;olympe.sc.gd.prototype.j.K=olympe.C.J.D;olympe.sc.we={};olympe.sc.we.Ne={ru:'folders',nw:'screenflow',Pw:'ui-design',Pr:'software-intelligence',Bh:'data-management',GC:'projects'};olympe.sc.Ff=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Hd(){return this.xd(olympe.sc.Ff.D)}};olympe.sc.Ff.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Ff);olympe.sc.Ff.D=olympe.sc.Ff.O.ja('016d1bb681929c2cc3f1');olympe.sc.Ff.j=olympe.sc.Ff.O.ra('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Ff.j);olympe.sc.Ff.prototype.Hd.K=olympe.C.J.F;olympe.sc.sd=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Pr}j(){return this.cb(olympe.sc.sd.j,olympe.sc.logic.Uh)}D(){return this.cb(olympe.sc.sd.D,olympe.sc.logic.Rg)}};olympe.sc.sd.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.sd);olympe.sc.sd.j=olympe.sc.sd.O.ra('016ac4f59a2917fdef01');olympe.sc.sd.D=olympe.sc.sd.O.ra('016ac4f59a2917fdef02');olympe.sc.sd.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.sd,olympe.sc.logic.Bd).W();
1144
+ olympe.sc.sd.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.sd.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function Nn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function On(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Nb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Pa(c,olympe.sc.logic.Sb.j,!0))?e:0;let f;d=null!=(f=a.db.Pa(d,olympe.sc.logic.Sb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Ua.D))}
1145
+ olympe.sc.Ua=class extends olympe.dm.BrickMetadata{fv(a,b,c,d,e=!0){e||olympe.ha.Xa('sc').error('parameter own= false ignored, investigate');return olympe.C.wh(M(this.Sf(a,olympe.dc.ib.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Sy(){return this.cb(olympe.sc.Ua.H,olympe.sc.Runnable)}jy(){return this.cb(olympe.sc.Ua.R,olympe.sc.Runnable)}ti(){return this.db.Pa(this,olympe.sc.Ua.Z)}On(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.j.$b())}ev(){return this.cb(olympe.sc.Ua.F,olympe.sc.logic.ub)}oq(){return this.cb(olympe.sc.Ua.D,
1146
+ olympe.sc.logic.Fb)}N(){return[olympe.sc.Ua.Wa]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.Z=olympe.sc.Ua.O.ja('01692aa71f3108454479');olympe.sc.Ua.nb=olympe.sc.Ua.O.ja('0166446c1f128ebc903a');olympe.sc.Ua.Wa=olympe.sc.Ua.O.ja('0166446c1f128ebc904e');olympe.sc.Ua.H=olympe.sc.Ua.O.ra('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.ra('01692a4af82e8984742d');olympe.sc.Ua.X=olympe.sc.Ua.O.ra('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.ra('01621fb84e320000f00a');
1147
+ olympe.sc.Ua.D=olympe.sc.Ua.O.ra('01621fb84e320000f00b');olympe.sc.Ua.Fd=olympe.sc.Ua.O.ra('0171838bcfed0000e00e');olympe.sc.Ua.vd=olympe.sc.Ua.O.ra('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.fv.K=olympe.C.J.j;m.Sy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.jy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ti.K=olympe.C.J.j;m.On.K=olympe.C.J.j;m.ev.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.oq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.wd().N().map(olympe.dc.ea)[0])?b:null}function Rn(a){const b=new olympe.dc.Ya;a=b.create(a);b.persist(a,!1);b.lb((d,e)=>{d||olympe.ha.Xa('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Za().onDestroy(()=>{const d=new olympe.dc.Ya;d.delete(c);d.lb()});return c}
1145
1148
  function Sn(a,b){Dn(b.state,a);Nn(a.wd(),b);const c=a.R(),d=Tn(b,c),e=[];c.forEach((f,g)=>{f===a.da?e[0]=g:f===a.Z&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Un(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])})}
1146
- function Vn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.Vb()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=Wn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Uw(b.state);l.Bb().run(()=>u(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`)));
1147
- b.onDestroy(g.unsubscribe.bind(g))}function Xn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=kn(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=mn(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Bb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Wn(a,b){return a.wd().H(b)}
1148
- function Tn(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 Un(a,b,c,d){b=b.Bb();const e=hh(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(()=>{ih(a.db,a.tag,e)})}
1149
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Bb().run(()=>{Sn(this,a);this.init(a);a.vh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Vn(this,a);this.F(a)})}wd(){return this.Ub()}init(a){this.onInit(a)}update(a,b,c){const d=this.wd();if(d.ti())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),Xn(this,d,olympe.sc.Ua.H,a),this.ia()&&Xn(this,
1150
- d,olympe.sc.Ua.X,a)}F(a){a.co(olympe.sc.Ua.lb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.wd().F(a)}onInit(){}onUpdate(){const a=this.Vb(),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 Pn(this.wd())}getOutputs(){return Qn(this.wd())}H(){return[]}D(){return null}ia(){return!1}N(a,
1151
- b,c,d){a=b.sb(a,c,!0);void 0!==d&&olympe.C.wh(a,d);return a}Wa(a,b,c,d,e){olympe.C.Sn([d],f=>{b.set(a,olympe.C.$s(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.da,this.Z]}da(a,b){Un(this,a,b,null)}Z(a,b){Un(this,a,null,b)}lb(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.Hs(d,g=>{var h=g.W();if(h=c.Ib(h,e)||c.Ib(h,f))return Yn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=ig(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1149
+ function Vn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.Vb()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=Wn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Yw(b.state);l.Cb().run(()=>u(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`)));
1150
+ b.onDestroy(g.unsubscribe.bind(g))}function Xn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=kn(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=mn(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Wn(a,b){return a.wd().H(b)}
1151
+ function Tn(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 Un(a,b,c,d){b=b.Cb();const e=hh(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.ib.tc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{ih(a.db,a.tag,e)})}
1152
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{Sn(this,a);this.init(a);a.vh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Vn(this,a);this.F(a)})}wd(){return this.Ub()}init(a){this.onInit(a)}update(a,b,c){const d=this.wd();if(d.ti())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),Xn(this,d,olympe.sc.Ua.H,a),this.ia()&&Xn(this,
1153
+ d,olympe.sc.Ua.X,a)}F(a){a.eo(olympe.sc.Ua.nb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.wd().F(a)}onInit(){}onUpdate(){const a=this.Vb(),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 Pn(this.wd())}getOutputs(){return Qn(this.wd())}H(){return[]}D(){return null}ia(){return!1}N(a,
1154
+ b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.wh(a,d);return a}Wa(a,b,c,d,e){olympe.C.Tn([d],f=>{b.set(a,olympe.C.et(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.da,this.Z]}da(a,b){Un(this,a,b,null)}Z(a,b){Un(this,a,null,b)}nb(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.Ks(d,g=>{var h=g.W();if(h=c.Ib(h,e)||c.Ib(h,f))return Yn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=ig(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1152
1155
  olympe.sc.Runnable.D=olympe.sc.Runnable.O.ra('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.ra('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.H);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.X=R(olympe.sc.Runnable.O,olympe.sc.Ua.X);R(olympe.sc.Ua.O,olympe.sc.Runnable.D);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.wd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
1153
- olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Wa.K=olympe.C.J.j;function Zn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Td)return(a=a.D())?a.valueOf():null;if('function'===typeof a.W)return a.W()}return null}olympe.sc.Td=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Td.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}Bc(){return this.j().Bc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Td.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Td);
1154
- olympe.sc.Td.j=olympe.sc.Td.O.ra('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Td.j);olympe.sc.Td.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Td.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.gp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.gp.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.gp);olympe.sc.zc=class extends olympe.dm.BrickMetadata{};olympe.sc.zc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.zc);olympe.sc.zc.j=olympe.sc.zc.O.ra('016324fde11a836087c2');olympe.sc.zc.O.j=function(a,b){return $l(a,null!=b?b:'New type',olympe.sc.zc).W()};let $n=null,ao=null,bo=[];
1155
- function co(a,b){$n=a;const c=olympe.C.Za();return olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).nb({ii:'__code-as-data__'}).then(d=>{let e;null==(e=bo)||e.forEach(f=>f());bo=null;ao=d;if(null!==d){if(b){const f=olympe.dc.ga();return new Promise(g=>{xi(c,d,h=>{h=f.vi(h)?h:f.model(h);return null!==h&&f.Nb(h,olympe.sc.zc)},{$n:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ha.Xa('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1156
+ olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Wa.K=olympe.C.J.j;function Zn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Td)return(a=a.D())?a.valueOf():null;if('function'===typeof a.W)return a.W()}return null}olympe.sc.Td=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Td.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}tc(){return this.j().tc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Td.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Td);
1157
+ olympe.sc.Td.j=olympe.sc.Td.O.ra('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Td.j);olympe.sc.Td.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Td.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.hp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.hp.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.hp);olympe.sc.Ac=class extends olympe.dm.BrickMetadata{};olympe.sc.Ac.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.Ac);olympe.sc.Ac.j=olympe.sc.Ac.O.ra('016324fde11a836087c2');olympe.sc.Ac.O.j=function(a,b){return $l(a,null!=b?b:'New type',olympe.sc.Ac).W()};let $n=null,ao=null,bo=[];
1158
+ function co(a,b){$n=a;const c=olympe.C.Za();return olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).lb({ii:'__code-as-data__'}).then(d=>{let e;null==(e=bo)||e.forEach(f=>f());bo=null;ao=d;if(null!==d){if(b){const f=olympe.dc.ga();return new Promise(g=>{xi(c,d,h=>{h=f.vi(h)?h:f.model(h);return null!==h&&f.Nb(h,olympe.sc.Ac)},{ao:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ha.Xa('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1156
1159
  g()}))})}olympe.ha.Xa('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ha.Xa('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{bo=null;throw d;})}function Kf(){return null===bo?Promise.resolve():new Promise(a=>{bo.push(()=>a())})}olympe.sc.sf=class extends olympe.dc.CloudObject{};olympe.sc.sf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.sf);olympe.sc.sf.j=olympe.sc.sf.O.ra('017b3aa8fd1659291b92');
1157
- olympe.sc.sf.D=olympe.sc.sf.O.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Og=class extends olympe.sc.Map{};olympe.sc.Og.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Og);olympe.sc.File=class extends olympe.dm.File{static Bx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.rt(a,e,b,c,d);return e}static Cx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Zn(a,e,b,c,d);return e}static rt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Zn(a,b,c,d,e)}static Zn(a,b,c,d,e){const f=olympe.dc.ga(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Tf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1158
- 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.ht(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Zn;olympe.sc.File.setContent=olympe.sc.File.rt;olympe.sc.File.createFromURL=olympe.sc.File.Cx;olympe.sc.File.createFromContent=olympe.sc.File.Bx;
1159
- olympe.sc.File.O=cg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Kg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.gl(b=>{a.update(olympe.C.wb(b))});return a.sb()}};olympe.sc.Kg.O=cg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Kg);olympe.sc.Kg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Kg);olympe.sc.Kg.prototype.H.K=olympe.C.J.D;olympe.sc.Lc=class extends olympe.sc.File{H(){return this.vb(olympe.sc.Lc.fontFamilyProp)}N(){return this.vb(olympe.sc.Lc.F)}R(){return this.xd(olympe.sc.Lc.H)}};olympe.sc.Lc.O=cg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Lc);olympe.sc.Lc.fontFamilyProp=olympe.sc.Lc.O.ja('01647e35ecd24ef0b88d');olympe.sc.Lc.F=olympe.sc.Lc.O.ja('01647e677f5d1cfbdf42');olympe.sc.Lc.H=olympe.sc.Lc.O.ja('01647e6780999bf8bd25');
1160
- olympe.sc.Lc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Lc,a,b,c,d);a.update(c,olympe.sc.Lc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Lc.prototype.H.K=olympe.C.J.D;olympe.sc.Lc.prototype.N.K=olympe.C.J.D;olympe.sc.Lc.prototype.R.K=olympe.C.J.F;olympe.sc.bi=class extends olympe.sc.File{};olympe.sc.bi.O=cg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.bi);olympe.sc.bi.O.j=olympe.sc.File.D.bind(null,olympe.sc.bi);olympe.sc.ks=class extends olympe.dc.CloudObject{};olympe.sc.ks.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.ks);olympe.sc.logic={};olympe.sc.logic.Lp=(a,b)=>a===b?0:a>b?1:-1;
1161
- olympe.sc.logic.XB=(a,b,c,d,e,f,g)=>{const h=b.W();b=olympe.C.Pa(b.getType().W());let k,l;if(b===olympe.dc.ea(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.vb(h).toLowerCase();else if(b===olympe.dc.ea(olympe.dm.Number))k=c.valueOf(),l=p=>p.xd(h);else if(b===olympe.dc.ea(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.Dj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ga().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1162
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Lp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Lp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.al().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Rb(d.valueOf()?1===q:0<=q)},olympe.C.ba,'FilterList ListDefBuilder Filter TransformFlows')).Xi())};
1163
- olympe.sc.logic.KE=(a,b)=>{if(a instanceof olympe.C.$)return a;if(a instanceof olympe.C.Sa)return a.vt();if(a instanceof olympe.C.ba)return a.Rs();if('string'===typeof a||'number'===typeof a)return olympe.C.qa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.$.xq};olympe.sc.logic.Ra={};function eo(a){hg(a.O,(b,c)=>{b=b.create(a.O.D);X(b,olympe.dc.CloudObject.nameProp,c);return b.W()})}olympe.sc.logic.Ra.zp=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);eo(this)}W(){return this.O.W()}};olympe.sc.logic.Ra.zp.ya=[olympe.dc.Ye];const fo=Object.create(null),go=new Map;function ho(a){if(void 0===fo[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return eg(a)}function io(a,b,c=olympe.sc.logic.Function){if(go.has(a))throw c=ho(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);go.set(a,{O:d,aF:b,HE:c});return d}
1164
- olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(fo[a])throw c=ho(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.zp(a,b,[olympe.sc.P.Ca].concat(c));return fo[a]=b}};olympe.sc.logic.MA=class{};olympe.sc.logic.$j=class extends olympe.dc.CloudObject{};olympe.sc.logic.$j.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.$j);function pn(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)}Dy(){return this.message}Aj(){return this.code}re(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.re()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.re;
1165
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Aj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Dy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ni=class extends olympe.sc.logic.$j{};olympe.sc.logic.Ni.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ni);olympe.sc.logic.qd=class extends olympe.dc.CloudObject{j(){return this.Rc(olympe.sc.logic.qd.j,olympe.dc.CloudObject)}};olympe.sc.logic.qd.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.qd);olympe.sc.logic.qd.D=olympe.sc.logic.qd.O.ja('017bc044aeacce7ffc8f');olympe.sc.logic.qd.j=olympe.sc.logic.qd.O.ra('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.qd.j);olympe.sc.logic.qd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Uh=class extends olympe.sc.logic.qd{};olympe.sc.logic.Uh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Uh);olympe.sc.logic.Uh.F=olympe.sc.sd.j.$b();olympe.sc.logic.Uh.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Input',olympe.sc.logic.Uh,olympe.sc.logic.ub);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.j,d,b);return b.W()};olympe.sc.logic.Rg=class extends olympe.sc.logic.qd{};olympe.sc.logic.Rg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Rg);olympe.sc.logic.Rg.F=R(olympe.sc.logic.Rg.O,olympe.sc.sd.D);olympe.sc.logic.Rg.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Output',olympe.sc.logic.Rg,olympe.sc.logic.Fb);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.D,d,b);return b.W()};olympe.sc.logic.Bd=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.Lr}X(){return this.Cn().al().Nb([olympe.sc.logic.Function]).and().zd().Nb([olympe.sc.logic.nd,olympe.sc.logic.ed]).Xi()}N(){const a=olympe.dc.ea(olympe.sc.logic.Ni);return this.db.cb(this,olympe.sc.logic.Bd.D).filter(b=>this.db.Ib(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.zn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.zn(this,[olympe.sc.Ua.D],
1166
- c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ti())return super.H(a);const b=olympe.dc.ea(olympe.sc.logic.$j),c=olympe.dc.ea(olympe.sc.logic.Ni);return Qn(this).map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Sb.typeRel)){case b:return a.co.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ti())return super.F(a);const b=Pn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1160
+ olympe.sc.sf.D=olympe.sc.sf.O.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Og=class extends olympe.sc.Map{};olympe.sc.Og.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Og);olympe.sc.File=class extends olympe.dm.File{static Fx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.vt(a,e,b,c,d);return e}static Gx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.$n(a,e,b,c,d);return e}static vt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.$n(a,b,c,d,e)}static $n(a,b,c,d,e){const f=olympe.dc.ga(),g=f.Ja(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Tf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1161
+ 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.Pa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.lt(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.$n;olympe.sc.File.setContent=olympe.sc.File.vt;olympe.sc.File.createFromURL=olympe.sc.File.Gx;olympe.sc.File.createFromContent=olympe.sc.File.Fx;
1162
+ olympe.sc.File.O=cg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Kg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.hl(b=>{a.update(olympe.C.wb(b))});return a.tb()}};olympe.sc.Kg.O=cg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Kg);olympe.sc.Kg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Kg);olympe.sc.Kg.prototype.H.K=olympe.C.J.D;olympe.sc.Nc=class extends olympe.sc.File{H(){return this.vb(olympe.sc.Nc.fontFamilyProp)}N(){return this.vb(olympe.sc.Nc.F)}R(){return this.xd(olympe.sc.Nc.H)}};olympe.sc.Nc.O=cg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Nc);olympe.sc.Nc.fontFamilyProp=olympe.sc.Nc.O.ja('01647e35ecd24ef0b88d');olympe.sc.Nc.F=olympe.sc.Nc.O.ja('01647e677f5d1cfbdf42');olympe.sc.Nc.H=olympe.sc.Nc.O.ja('01647e6780999bf8bd25');
1163
+ olympe.sc.Nc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Nc,a,b,c,d);a.update(c,olympe.sc.Nc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Nc.prototype.H.K=olympe.C.J.D;olympe.sc.Nc.prototype.N.K=olympe.C.J.D;olympe.sc.Nc.prototype.R.K=olympe.C.J.F;olympe.sc.bi=class extends olympe.sc.File{};olympe.sc.bi.O=cg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.bi);olympe.sc.bi.O.j=olympe.sc.File.D.bind(null,olympe.sc.bi);olympe.sc.ns=class extends olympe.dc.CloudObject{};olympe.sc.ns.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.ns);olympe.sc.logic={};olympe.sc.logic.Mp=(a,b)=>a===b?0:a>b?1:-1;
1164
+ olympe.sc.logic.aC=(a,b,c,d,e,f,g)=>{const h=b.W();b=olympe.C.Qa(b.getType().W());let k,l;if(b===olympe.dc.ea(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.vb(h).toLowerCase();else if(b===olympe.dc.ea(olympe.dm.Number))k=c.valueOf(),l=p=>p.xd(h);else if(b===olympe.dc.ea(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.Dj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ga().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1165
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Mp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Mp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.bl().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Rb(d.valueOf()?1===q:0<=q)},olympe.C.ba,'FilterList ListDefBuilder Filter TransformFlows')).Xi())};
1166
+ olympe.sc.logic.OE=(a,b)=>{if(a instanceof olympe.C.$)return a;if(a instanceof olympe.C.Sa)return a.zt();if(a instanceof olympe.C.ba)return a.Vs();if('string'===typeof a||'number'===typeof a)return olympe.C.qa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.$.Aq};olympe.sc.logic.Ra={};function eo(a){hg(a.O,(b,c)=>{b=b.create(a.O.D);X(b,olympe.dc.CloudObject.nameProp,c);return b.W()})}olympe.sc.logic.Ra.Ap=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);eo(this)}W(){return this.O.W()}};olympe.sc.logic.Ra.Ap.ya=[olympe.dc.Ye];const fo=Object.create(null),go=new Map;function ho(a){if(void 0===fo[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return eg(a)}function io(a,b,c=olympe.sc.logic.Function){if(go.has(a))throw c=ho(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);go.set(a,{O:d,eF:b,LE:c});return d}
1167
+ olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(fo[a])throw c=ho(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Ap(a,b,[olympe.sc.P.Ca].concat(c));return fo[a]=b}};olympe.sc.logic.QA=class{};olympe.sc.logic.ak=class extends olympe.dc.CloudObject{};olympe.sc.logic.ak.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.ak);function pn(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)}Gy(){return this.message}Aj(){return this.code}re(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.re()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.re;
1168
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Aj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Gy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ni=class extends olympe.sc.logic.ak{};olympe.sc.logic.Ni.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Ni);olympe.sc.logic.qd=class extends olympe.dc.CloudObject{j(){return this.Sc(olympe.sc.logic.qd.j,olympe.dc.CloudObject)}};olympe.sc.logic.qd.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.qd);olympe.sc.logic.qd.D=olympe.sc.logic.qd.O.ja('017bc044aeacce7ffc8f');olympe.sc.logic.qd.j=olympe.sc.logic.qd.O.ra('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.qd.j);olympe.sc.logic.qd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Uh=class extends olympe.sc.logic.qd{};olympe.sc.logic.Uh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Uh);olympe.sc.logic.Uh.F=olympe.sc.sd.j.$b();olympe.sc.logic.Uh.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Input',olympe.sc.logic.Uh,olympe.sc.logic.ub);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.j,d,b);return b.W()};olympe.sc.logic.Rg=class extends olympe.sc.logic.qd{};olympe.sc.logic.Rg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Rg);olympe.sc.logic.Rg.F=R(olympe.sc.logic.Rg.O,olympe.sc.sd.D);olympe.sc.logic.Rg.O.j=(a,b,c,d,e)=>{b=$l(a,b||'New Predefined Output',olympe.sc.logic.Rg,olympe.sc.logic.Fb);X(b,olympe.sc.logic.qd.D,e);a.Oa(olympe.sc.logic.qd.j,b,c);a.Oa(olympe.sc.sd.D,d,b);return b.W()};olympe.sc.logic.Bd=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.Pr}X(){return this.Dn().bl().Nb([olympe.sc.logic.Function]).and().zd().Nb([olympe.sc.logic.nd,olympe.sc.logic.ed]).Xi()}N(){const a=olympe.dc.ea(olympe.sc.logic.Ni);return this.db.cb(this,olympe.sc.logic.Bd.D).filter(b=>this.db.Ib(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.An(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.An(this,[olympe.sc.Ua.D],
1169
+ c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ti())return super.H(a);const b=olympe.dc.ea(olympe.sc.logic.ak),c=olympe.dc.ea(olympe.sc.logic.Ni);return Qn(this).map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Sb.typeRel)){case b:return a.eo.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ti())return super.F(a);const b=Pn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1167
1170
  c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Bd.O=io('01621fb84e320000f000',olympe.sc.logic.Bd,olympe.sc.logic.Function);olympe.sc.logic.Bd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Bd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);let jo=null;function ko(){if(null===jo){let a;jo=null!=(a=olympe.V.getParameter('sc.action.experimental'))?a:!1}return jo}
1168
- olympe.sc.logic.$f=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63229782039429f')}Z(){return this.D('016ac6322acf67eebfe7')}da(){return this.lq().al().bb(olympe.sc.logic.Sb.typeRel).nl(olympe.sc.logic.Ni).Xi().Bf().On(olympe.C.$.ZERO)}F(a){if(this.ti()||ko()){const b=this.R().W();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:Pn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.$f.j='016ac63229782039429f';olympe.sc.logic.$f.N='016ac6322acf67eebfe7';
1169
- olympe.sc.logic.$f.O=io('01621fb84e320000a000',olympe.sc.logic.$f,olympe.sc.logic.Action);olympe.sc.logic.$f.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.$f.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.$f.prototype.da.K=olympe.C.J.N;olympe.sc.logic.Ro=class extends olympe.sc.logic.Bd{};olympe.sc.logic.Ro.O=io('01621fb84e320000f011',olympe.sc.logic.Ro);olympe.sc.logic.Qo=class extends olympe.sc.logic.$f{};olympe.sc.logic.Qo.O=io('01621fb84e320000f012',olympe.sc.logic.Qo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.lb]}D(){if(!this.wd().ti())return super.D();const a=olympe.sc.Fg.j.pm,b=olympe.sc.Fg.j.Hm,c=this.db,d=new Map,e=this.Vb();c.cb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(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.Sb=class extends olympe.dc.CloudObject{getType(){return this.Rc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.xd(olympe.sc.logic.Sb.j)}};olympe.sc.logic.Sb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.j=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.ra('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1171
+ olympe.sc.logic.$f=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63229782039429f')}Z(){return this.D('016ac6322acf67eebfe7')}da(){return this.oq().bl().bb(olympe.sc.logic.Sb.typeRel).ol(olympe.sc.logic.Ni).Xi().Bf().Pn(olympe.C.$.ZERO)}F(a){if(this.ti()||ko()){const b=this.R().W();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:Pn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.$f.j='016ac63229782039429f';olympe.sc.logic.$f.N='016ac6322acf67eebfe7';
1172
+ olympe.sc.logic.$f.O=io('01621fb84e320000a000',olympe.sc.logic.$f,olympe.sc.logic.Action);olympe.sc.logic.$f.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.$f.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.$f.prototype.da.K=olympe.C.J.N;olympe.sc.logic.So=class extends olympe.sc.logic.Bd{};olympe.sc.logic.So.O=io('01621fb84e320000f011',olympe.sc.logic.So);olympe.sc.logic.Ro=class extends olympe.sc.logic.$f{};olympe.sc.logic.Ro.O=io('01621fb84e320000f012',olympe.sc.logic.Ro);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.nb]}D(){if(!this.wd().ti())return super.D();const a=olympe.sc.Fg.j.qm,b=olympe.sc.Fg.j.Im,c=this.db,d=new Map,e=this.Vb();c.cb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(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.Sb=class extends olympe.dc.CloudObject{getType(){return this.Sc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.xd(olympe.sc.logic.Sb.j)}};olympe.sc.logic.Sb.O=olympe.dc.na.j('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.j=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.ra('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1170
1173
  olympe.sc.logic.Sb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.ub=class extends olympe.sc.logic.Sb{};olympe.sc.logic.ub.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.R=olympe.sc.logic.Sb.O.ja('01740c5d4ae4b520dd02');olympe.sc.logic.ub.N=R(olympe.sc.logic.ub.O,olympe.sc.Ua.F);olympe.sc.logic.ub.D=olympe.sc.logic.ub.O.ra('0168a431d91f2578000b',olympe.dc.ua.ORIGIN);olympe.sc.logic.ub.F=olympe.sc.logic.ub.O.ra('01621fb84e32000000a1',olympe.dc.ua.ORIGIN);
1171
1174
  olympe.sc.logic.ub.H=olympe.sc.logic.ub.O.ra('01621fb84e32000000d1',olympe.dc.ua.ORIGIN);olympe.sc.logic.ub.O.j=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.W()};olympe.sc.logic.Fb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.Fb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Fb);olympe.sc.logic.Fb.N=R(olympe.sc.logic.Fb.O,olympe.sc.Ua.D);olympe.sc.logic.Fb.D=olympe.sc.logic.Fb.O.ra('0168a431d91f25780003',olympe.dc.ua.ORIGIN);olympe.sc.logic.Fb.H=olympe.sc.logic.Fb.O.ra('01621fb84e32000000a2',olympe.dc.ua.ORIGIN);olympe.sc.logic.Fb.F=olympe.sc.logic.Fb.O.ra('01621fb84e32000000d2',olympe.dc.ua.ORIGIN);
1172
1175
  olympe.sc.logic.Fb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Fb){f=a.create(f);X(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&X(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.W()};olympe.sc.logic.nd=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.nd.H),d=this.db.Ib(this,olympe.sc.logic.nd.F);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.vg(olympe.sc.logic.nd.H).Cc()}sa(){return this.vg(olympe.sc.logic.nd.F).Cc()}};olympe.sc.logic.nd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.nd,olympe.sc.P.Ca);olympe.sc.logic.nd.H=R(olympe.sc.logic.nd.O,olympe.sc.logic.ub.F);
1173
1176
  olympe.sc.logic.nd.F=R(olympe.sc.logic.nd.O,olympe.sc.logic.Fb.H);olympe.sc.logic.nd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.nd);a.Oa(olympe.sc.logic.nd.F,b,c);return b.W()};olympe.sc.logic.nd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.nd.prototype.sa.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.ed.F),d=this.db.Ib(this,olympe.sc.logic.ed.H);b.on(c,e=>a.set(d,e),b.T())}sa(){return this.vg(olympe.sc.logic.ed.F).Cc()}j(){return this.vg(olympe.sc.logic.ed.H).Cc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Ca);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.ub.H);olympe.sc.logic.ed.H=R(olympe.sc.logic.ed.O,olympe.sc.logic.Fb.F);
1174
- olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.F,b,c);return b.W()};olympe.sc.logic.ed.prototype.sa.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);function Yn(a,b,c){var d;const e=null!=(d=a.db.Ib(a,olympe.sc.logic.pb.R))?d:a.db.Ib(a,olympe.sc.logic.pb.H),f=a.db.Ib(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Tf(lo(a),olympe.dm.Ie)?new olympe.C.Wb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.tl(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=fh(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);gh(a.db,a,olympe.sc.logic.pb.valueProp,
1177
+ olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.F,b,c);return b.W()};olympe.sc.logic.ed.prototype.sa.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);function Yn(a,b,c){var d;const e=null!=(d=a.db.Ib(a,olympe.sc.logic.pb.R))?d:a.db.Ib(a,olympe.sc.logic.pb.H),f=a.db.Ib(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Tf(lo(a),olympe.dm.Ie)?new olympe.C.Wb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.ul(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.ib.tc(k)),h=fh(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);gh(a.db,a,olympe.sc.logic.pb.valueProp,
1175
1178
  h)}}function lo(a){let b=null,c=a.db.Ib(a,olympe.sc.logic.pb.D);c?b=a.db.Ib(c,olympe.dm.Property.typeRel):(c=a.db.Ib(a,olympe.sc.logic.pb.j))&&(b=a.db.Ib(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ea(olympe.dc.CloudObject)}
1176
- 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.tj(c);null==b||b.rg();b&&d instanceof olympe.dm.Ie?null==b||b.run(()=>{olympe.C.Uc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Sf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.tj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Qd(olympe.dc.CloudObject);return a.Hc()}Vy(){return this.Rc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}Ty(){return this.Rc(olympe.sc.logic.pb.R,
1177
- olympe.sc.logic.Fb)}Uy(){return this.Rc(olympe.sc.logic.pb.H,olympe.dm.Property)}py(){return this.Rc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}ny(){return this.Rc(olympe.sc.logic.pb.j,olympe.sc.logic.ub)}oy(){return this.Rc(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.ja('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.ra('0168a431d91f25780002');
1179
+ 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.tj(c);null==b||b.rg();b&&d instanceof olympe.dm.Ie?null==b||b.run(()=>{olympe.C.Vc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Sf(olympe.sc.logic.pb.valueProp,a||olympe.dc.ib.tj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Qd(olympe.dc.CloudObject);return a.Ic()}Yy(){return this.Sc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}Wy(){return this.Sc(olympe.sc.logic.pb.R,
1180
+ olympe.sc.logic.Fb)}Xy(){return this.Sc(olympe.sc.logic.pb.H,olympe.dm.Property)}ty(){return this.Sc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}qy(){return this.Sc(olympe.sc.logic.pb.j,olympe.sc.logic.ub)}sy(){return this.Sc(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.ja('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.ra('0168a431d91f25780002');
1178
1181
  olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Fb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.ra('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.ra('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.ub.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.ra('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);
1179
- 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.Vy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ty.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.Uy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.py.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ny.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.oy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function mo(a,b){const c=a.wd(),d=c.um().W(),e=c.vm().W(),f=c.wm().W();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.qb.get(a.Vb(),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=pn(k.message,k.Aj(),k.re()+'\n===== Remote Call =====\n'+b.re()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Ub().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1182
+ 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.Yy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Wy.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.Xy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.ty.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.qy.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.sy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function mo(a,b){const c=a.wd(),d=c.vm().W(),e=c.wm().W(),f=c.xm().W();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.qb.get(a.Vb(),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=pn(k.message,k.Aj(),k.re()+'\n===== Remote Call =====\n'+b.re()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Ub().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1180
1183
  400))})}},b.T())}function no(a,b){const c=a.j.ia(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.F(c))}
1181
1184
  function oo(a,b,c,d,e,f){const g=n=>u(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.cd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Ub().name()} (${a.Vb()}): ${r}`);f.li(t).catch(v=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Ub().name()} (${a.Vb()}): ${v}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1182
- olympe.sc.logic.Xh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e,f){super(a,b,c);this.timeout=e;this.j=d;this.sa=f}run(a){let b;null!=(b=a.Pa(olympe.sc.xa.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Xh.F)?(Dn(a.state,this),this.yb(a)):0<olympe.dc.la.from(this.sa).bb(olympe.sc.Ua.H).bb(olympe.sc.Runnable.D).filter(olympe.dc.query.Aa.Zs(this.Vb())).Cc().size()?super.run(a):(Sn(this,a),mo(this,a)))}yb(a){const b=this.Vb(),c=this.wd(),d=c.mq().W(),e=c.um().W(),f=c.vm().W(),g=c.wm().W(),
1185
+ olympe.sc.logic.Xh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e,f){super(a,b,c);this.timeout=e;this.j=d;this.sa=f}run(a){let b;null!=(b=a.Qa(olympe.sc.xa.j.EDITION))&&b||(this.db.Pa(this,olympe.sc.logic.Xh.F)?(Dn(a.state,this),this.yb(a)):0<olympe.dc.la.from(this.sa).bb(olympe.sc.Ua.H).bb(olympe.sc.Runnable.D).filter(olympe.dc.query.za.dt(this.Vb())).Cc().size()?super.run(a):(Sn(this,a),mo(this,a)))}yb(a){const b=this.Vb(),c=this.wd(),d=c.pq().W(),e=c.vm().W(),f=c.wm().W(),g=c.xm().W(),
1183
1186
  h=new olympe.L.qb(b,a);this.j.ia(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=a.ji('remote call'),n=k.body();l.set(olympe.sc.xa.j.REDELIVERED,k.wi());no(this,l);const p=Bc(()=>{k.li(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`)).catch();l.destroy()},this.timeout);oo(this,l,f,g,p,k);super.run(l);for(const [q,r]of n)q!==e&&l.set(q,r);k.Bi().then(q=>{var r=l.get(d);null!==r&&olympe.dc.ea(r)!==q&&
1184
1187
  (r=this.Vb(),this.G.warn(`Remote action ${this.db.name(r)} ${r}: try to run it with an input user that is not the real authenticated user.`));l.set(d,q);l.set(e,n.get(e))}).catch(q=>{const r=this.Vb();this.G.warn(`Remote action ${this.db.name(r)} ${r} Triggered by unrecognized user: ${q}.`);l.set(g,olympe.sc.logic.Error.create('Unrecognized User',1))})},k=>{const l=this.Vb();this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};
1185
- olympe.sc.logic.Xh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Xh,olympe.sc.P.Ca,olympe.host.P.Ge,new olympe.V.oa(olympe.sc.Config.nr),new olympe.V.oa(olympe.sc.Config.ye));olympe.sc.logic.Xh.F=olympe.sc.logic.Xh.O.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.qm=class{constructor(a){this.db=olympe.dc.ga();this.typeRel=a}};olympe.sc.logic.controllers.qm.j={PA:-1,PB:1};olympe.sc.logic.controllers.HC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.qd.j)}};olympe.sc.logic.controllers.QC=class extends olympe.sc.logic.controllers.qm{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.el={};olympe.sc.logic.el.Bw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ea(b);d?olympe.dc.la.Ob(a,d,olympe.dc.Lb.jg).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.el.Bw);olympe.sc.logic.actions={};olympe.sc.logic.el.vv=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const [b,c,d]=Wn(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.lf(f)),f++,c(Date.now())):(Fn(h.state),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.wg();f=0;En(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1186
- olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.el.vv);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.em=class extends olympe.sc.logic.Bd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Qb.em.O=io('0169b6876a03f14ae61b',olympe.sc.logic.Qb.em);olympe.sc.logic.Qb.em.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);let po=null;olympe.sc.logic.Qb.sm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63808535703691c')}F(a){if(null===po){let b;po=null!=(b=olympe.V.getParameter('sc.event.experimental'))?b:!1}return po?a.observe(Pn(this)[0]):super.F(a)}};olympe.sc.logic.Qb.sm.O=io('0169b6876a03f139d50a',olympe.sc.logic.Qb.sm);olympe.sc.logic.Qb.sm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Im=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63809a9a8e6db96')}Z(){return this.D('016ac6380ab003363b3e')}};io('01646ad602f933b8caaf',olympe.sc.logic.Qb.Im);olympe.sc.logic.Qb.Im.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Im.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.wk=class extends olympe.sc.logic.Bd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}Z(){return this.D('016ac63c5a377fceabaa')}};io('0168ec42fc01747a98b6',olympe.sc.logic.Qb.wk);olympe.sc.logic.Qb.wk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.wk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.wk.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.Vg=class extends olympe.sc.logic.Bd{um(){return this.j('017a7b07b09e3b22c8b4')}mq(){return this.j('017a7b07ba05807a74b0')}vm(){return this.D('017a7b0818c12388d731')}wm(){return this.D('017a7b085146d5e69aec')}bv(){return olympe.C.ba.D}};olympe.sc.logic.Qb.Vg.N='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Vg.Oc='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Vg.ia='017a7b0818c12388d731';olympe.sc.logic.Qb.Vg.j='017a7b085146d5e69aec';
1187
- olympe.sc.logic.Qb.Vg.O=io('017a7b07a948e30508fa',olympe.sc.logic.Qb.Vg,olympe.sc.logic.Xh);m=olympe.sc.logic.Qb.Vg.prototype;m.um.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.mq.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.vm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.wm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.bv.K=olympe.C.J.N;olympe.sc.logic.Qb.Qr=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63c5b3ed0562740')}};io('016a9766c230916ea5ec',olympe.sc.logic.Qb.Qr);olympe.sc.logic.Qb.Qr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.ro=class extends olympe.sc.Og{};olympe.sc.query.ro.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.ro);olympe.sc.query.Wq=class extends olympe.dm.Enum{};olympe.sc.query.Wq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.Wq);olympe.sc.query.gr=class extends olympe.dm.Enum{};olympe.sc.query.gr.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.gr);olympe.sc.query.jr=class extends olympe.sc.Og{};olympe.sc.query.jr.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.jr);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.Vo=class extends olympe.dc.CloudObject{};olympe.sc.Vo.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.Vo);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.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13a');
1188
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ef=class extends olympe.sc.logic.Bd{dv(){return this.j('017ffe02381f9fac5060')}gv(){return this.j('017ffe02381f9fac5061')}hv(){return this.j('017ffe02381f9fac5062')}ky(){return this.j('017ffe02381f9fac5065')}ev(){return this.D('017ffe02381f9fac5063')}fv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Ef.O=io('017ffde21f5fe0f704ce',olympe.sc.workflow.Ef);olympe.sc.workflow.Ef.j='017ffe02381f9fac5060';olympe.sc.workflow.Ef.Pe='017ffe02381f9fac5061';
1189
- olympe.sc.workflow.Ef.ef='017ffe02381f9fac5062';olympe.sc.workflow.Ef.ia='017ffe02381f9fac5065';olympe.sc.workflow.Ef.N='017ffe02381f9fac5063';olympe.sc.workflow.Ef.Oc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ef.prototype;m.dv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.gv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.hv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.ky.K=new olympe.C.J(()=>Map,[]);m.ev.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.fv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.workflow.cf=class extends olympe.dm.BrickMetadata{Vc(){return this.Rc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',this.ka()])}};olympe.sc.workflow.cf.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.cf);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Us()}j(){return this.Rc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf)}F(){return this.Rc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.cf)}Vc(){const a=this.Rc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf);return a.Rc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',a.ka(),'->',this.ka()])}};
1188
+ olympe.sc.logic.Xh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Xh,olympe.sc.P.Ca,olympe.host.P.Ge,new olympe.V.oa(olympe.sc.Config.sr),new olympe.V.oa(olympe.sc.Config.ye));olympe.sc.logic.Xh.F=olympe.sc.logic.Xh.O.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.sm=class{constructor(a){this.db=olympe.dc.ga();this.typeRel=a}};olympe.sc.logic.controllers.sm.j={TA:-1,TB:1};olympe.sc.logic.controllers.LC=class extends olympe.sc.logic.controllers.sm{constructor(){super(olympe.sc.logic.qd.j)}};olympe.sc.logic.controllers.UC=class extends olympe.sc.logic.controllers.sm{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.fl={};olympe.sc.logic.fl.Fw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ea(b);d?olympe.dc.la.Ob(a,d,olympe.dc.Lb.jg).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.fl.Fw);olympe.sc.logic.actions={};olympe.sc.logic.fl.zv=class extends olympe.sc.logic.Function{run(a){Sn(this,a);const [b,c,d]=Wn(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.lf(f)),f++,c(Date.now())):(Fn(h.state),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.wg();f=0;En(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1189
+ olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.fl.zv);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.fm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Qb.fm.O=io('0169b6876a03f14ae61b',olympe.sc.logic.Qb.fm);olympe.sc.logic.Qb.fm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);let po=null;olympe.sc.logic.Qb.tm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63808535703691c')}F(a){if(null===po){let b;po=null!=(b=olympe.V.getParameter('sc.event.experimental'))?b:!1}return po?a.observe(Pn(this)[0]):super.F(a)}};olympe.sc.logic.Qb.tm.O=io('0169b6876a03f139d50a',olympe.sc.logic.Qb.tm);olympe.sc.logic.Qb.tm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Jm=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63809a9a8e6db96')}Z(){return this.D('016ac6380ab003363b3e')}};io('01646ad602f933b8caaf',olympe.sc.logic.Qb.Jm);olympe.sc.logic.Qb.Jm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Jm.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk=class extends olympe.sc.logic.Bd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}Z(){return this.D('016ac63c5a377fceabaa')}};io('0168ec42fc01747a98b6',olympe.sc.logic.Qb.xk);olympe.sc.logic.Qb.xk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.xk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.xk.prototype.Z.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.logic.Qb.Vg=class extends olympe.sc.logic.Bd{vm(){return this.j('017a7b07b09e3b22c8b4')}pq(){return this.j('017a7b07ba05807a74b0')}wm(){return this.D('017a7b0818c12388d731')}xm(){return this.D('017a7b085146d5e69aec')}gv(){return olympe.C.ba.D}};olympe.sc.logic.Qb.Vg.N='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Vg.Qc='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Vg.ia='017a7b0818c12388d731';olympe.sc.logic.Qb.Vg.j='017a7b085146d5e69aec';
1190
+ olympe.sc.logic.Qb.Vg.O=io('017a7b07a948e30508fa',olympe.sc.logic.Qb.Vg,olympe.sc.logic.Xh);m=olympe.sc.logic.Qb.Vg.prototype;m.vm.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.pq.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.wm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.xm.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.gv.K=olympe.C.J.N;olympe.sc.logic.Qb.Tr=class extends olympe.sc.logic.Bd{R(){return this.j('016ac63c5b3ed0562740')}};io('016a9766c230916ea5ec',olympe.sc.logic.Qb.Tr);olympe.sc.logic.Qb.Tr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.so=class extends olympe.sc.Og{};olympe.sc.query.so.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.so);olympe.sc.query.Zq=class extends olympe.dm.Enum{};olympe.sc.query.Zq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.Zq);olympe.sc.query.jr=class extends olympe.dm.Enum{};olympe.sc.query.jr.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.jr);olympe.sc.query.mr=class extends olympe.sc.Og{};olympe.sc.query.mr.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.mr);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.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13a');
1191
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Ef=class extends olympe.sc.logic.Bd{hv(){return this.j('017ffe02381f9fac5060')}lv(){return this.j('017ffe02381f9fac5061')}mv(){return this.j('017ffe02381f9fac5062')}oy(){return this.j('017ffe02381f9fac5065')}jv(){return this.D('017ffe02381f9fac5063')}kv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Ef.O=io('017ffde21f5fe0f704ce',olympe.sc.workflow.Ef);olympe.sc.workflow.Ef.j='017ffe02381f9fac5060';olympe.sc.workflow.Ef.Pe='017ffe02381f9fac5061';
1192
+ olympe.sc.workflow.Ef.ef='017ffe02381f9fac5062';olympe.sc.workflow.Ef.ia='017ffe02381f9fac5065';olympe.sc.workflow.Ef.N='017ffe02381f9fac5063';olympe.sc.workflow.Ef.Qc='017ffe02381f9fac5064';m=olympe.sc.workflow.Ef.prototype;m.hv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.lv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.mv.K=new olympe.C.J(()=>olympe.sc.logic.ub,[]);m.oy.K=new olympe.C.J(()=>Map,[]);m.jv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);m.kv.K=new olympe.C.J(()=>olympe.sc.logic.Fb,[]);olympe.sc.workflow.cf=class extends olympe.dm.BrickMetadata{Wc(){return this.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',this.ka()])}};olympe.sc.workflow.cf.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.cf);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.Ys()}j(){return this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf)}F(){return this.Sc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.cf)}Wc(){const a=this.Sc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.cf);return a.Sc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).ka().concat(['.',a.ka(),'->',this.ka()])}};
1190
1193
  olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ja('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.ra('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.ra('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
1191
- olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}F(){return this.mh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Rc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.zc)}D(){return this.Rc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.cf)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ja('017ffdc010e5bcc9c972');
1192
- olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.ra('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.zc,[]);
1193
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.pa={};olympe.sc.pa.Yc=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.jw}};olympe.sc.pa.Yc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.pa.Yc);olympe.sc.pa.Yc.j=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb89');olympe.sc.pa.Yc.ia=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb90');R(olympe.dm.Nc.O,olympe.sc.pa.Yc.j);olympe.sc.pa.Ei=class extends olympe.sc.Runnable{H(){return[this.Vb()]}j(){return olympe.dc.rd.from(this.Vb()).bb(olympe.sc.pa.Yc.j).Cc()}};olympe.sc.pa.Ei.O=ig(olympe.dc.na.j('0113030000000aca1100',olympe.sc.pa.Ei));olympe.sc.pa.Ei.prototype.j.K=new olympe.C.J(()=>olympe.dm.hb,[]);olympe.sc.pa.kb=class extends olympe.dc.CloudObject{kv(){return this.mh(olympe.sc.pa.kb.gi)}xz(){return this.mh(olympe.sc.pa.kb.ia)}Ic(){return this.xd(olympe.sc.pa.kb.j)}sy(){return this.vb(olympe.sc.pa.kb.H)}Ny(){return this.vb(olympe.sc.pa.kb.da)}My(){return this.vb(olympe.sc.pa.kb.X)}Of(){return this.vb(olympe.sc.pa.kb.Z)}Cy(){return this.vb(olympe.sc.pa.kb.N)}Xx(){return this.vb(olympe.sc.pa.kb.D)}Ly(){return this.vb(olympe.sc.pa.kb.R)}jv(){return this.vb(olympe.sc.pa.kb.F)}};
1194
- olympe.sc.pa.kb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.pa.kb);olympe.sc.pa.kb.gi=olympe.sc.pa.kb.O.ja('011203300000000adef6');olympe.sc.pa.kb.ia=olympe.sc.pa.kb.O.ja('011203300000000adef7');olympe.sc.pa.kb.j=olympe.sc.pa.kb.O.ja('011203300000000adef8');olympe.sc.pa.kb.H=olympe.sc.pa.kb.O.ja('011203300000000adef9');olympe.sc.pa.kb.da=olympe.sc.pa.kb.O.ja('011203300000000adefa');olympe.sc.pa.kb.X=olympe.sc.pa.kb.O.ja('011203300000000adefb');olympe.sc.pa.kb.D=olympe.sc.pa.kb.O.ja('011203300000000adefc');
1195
- olympe.sc.pa.kb.Z=olympe.sc.pa.kb.O.ja('011203300000000adefd');olympe.sc.pa.kb.N=olympe.sc.pa.kb.O.ja('011203300000000adefe');olympe.sc.pa.kb.R=olympe.sc.pa.kb.O.ja('011203300000000adeff');olympe.sc.pa.kb.F=olympe.sc.pa.kb.O.ja('011203300000000adee0');olympe.sc.pa.kb.oc={INIT:0,BA:1,Ok:2,Nk:3,Wm:4,jD:5,zb:9};m=olympe.sc.pa.kb.prototype;m.kv.K=olympe.C.J.N;m.xz.K=olympe.C.J.N;m.Ic.K=olympe.C.J.F;m.sy.K=olympe.C.J.D;m.Ny.K=olympe.C.J.D;m.My.K=olympe.C.J.D;m.Of.K=olympe.C.J.D;m.Cy.K=olympe.C.J.D;
1196
- m.Xx.K=olympe.C.J.D;m.Ly.K=olympe.C.J.D;m.jv.K=olympe.C.J.D;olympe.sc.pa.om=class extends olympe.sc.pa.Ei{F(a){a.set(olympe.sc.xa.j.ho,!0);super.F(a)}ia(){return!0}};olympe.sc.pa.om.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.pa.om,olympe.sc.P.Ca);olympe.sc.pa.bf=class extends olympe.sc.pa.Yc{j(){return(new olympe.dc.qk(this.W(),olympe.sc.pa.kb)).bb(olympe.sc.pa.bf.N).Xi().Hc()}};olympe.sc.pa.bf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.pa.bf);olympe.sc.pa.bf.N=olympe.sc.pa.bf.O.ra('011203300000000adef4');R(olympe.sc.pa.kb.O,olympe.sc.pa.bf.N);
1197
- olympe.sc.pa.bf.O.j=(a,b,c)=>{b=$l(a,b||'New Service Application model',olympe.sc.pa.bf,olympe.sc.pa.om);a.Oa(olympe.sc.pa.Yc.j,b,c);c=a.create(olympe.sc.pa.kb).W();a.Oa(olympe.sc.pa.bf.N,b,c);return b.W()};olympe.sc.pa.bf.prototype.j.K=new olympe.C.J(()=>olympe.sc.pa.kb,[]);olympe.sc.bh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.bh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.bh);olympe.sc.bh.D=olympe.sc.bh.O.ja('011203300000000adf01');olympe.sc.bh.j=olympe.sc.bh.O.ja('011203300000000adf02');olympe.sc.bh.F='011203300000000adf0f';olympe.sc.Ag={};olympe.sc.Ag.lz=a=>{var b=a.j;const c=olympe.dc.ga();var d=null;var e=null===bo;for(const f of b.Tc())if((b=f.Ub())&&f.D()&&f.ib()===olympe.dc.Ha.SERVER&&Z(a,f.tag())&&c.Nb(b,olympe.sc.zc)){if(!e)throw new olympe.dc.Mq;let g,h;null==d&&(d=null,null!==ao?d=ao:'string'===typeof $n&&(d=olympe.dc.rd.from($n).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).Cc()),d=null==(g=d)?void 0:g.W());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ea(b)}`);a.Oa(olympe.sc.sf.D.W(),
1194
+ olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}F(){return this.mh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Sc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Ac)}D(){return this.Sc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.cf)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ja('017ffdc010e5bcc9c972');
1195
+ olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.ra('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.ra('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.Ac,[]);
1196
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.cf,[]);olympe.sc.pa={};olympe.sc.pa.Yc=class extends olympe.sc.Ua{ue(){return olympe.sc.we.Ne.nw}};olympe.sc.pa.Yc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.pa.Yc);olympe.sc.pa.Yc.j=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb89');olympe.sc.pa.Yc.ia=olympe.sc.pa.Yc.O.ra('0171bc1f15da96dfdb90');R(olympe.dm.Pc.O,olympe.sc.pa.Yc.j);olympe.sc.pa.Ei=class extends olympe.sc.Runnable{H(){return[this.Vb()]}j(){return olympe.dc.rd.from(this.Vb()).bb(olympe.sc.pa.Yc.j).Cc()}};olympe.sc.pa.Ei.O=ig(olympe.dc.na.j('0113030000000aca1100',olympe.sc.pa.Ei));olympe.sc.pa.Ei.prototype.j.K=new olympe.C.J(()=>olympe.dm.hb,[]);olympe.sc.pa.mb=class extends olympe.dc.CloudObject{ov(){return this.mh(olympe.sc.pa.mb.gi)}Az(){return this.mh(olympe.sc.pa.mb.ia)}Jc(){return this.xd(olympe.sc.pa.mb.j)}vy(){return this.vb(olympe.sc.pa.mb.H)}Qy(){return this.vb(olympe.sc.pa.mb.da)}Py(){return this.vb(olympe.sc.pa.mb.X)}Of(){return this.vb(olympe.sc.pa.mb.Z)}Fy(){return this.vb(olympe.sc.pa.mb.N)}ay(){return this.vb(olympe.sc.pa.mb.D)}Oy(){return this.vb(olympe.sc.pa.mb.R)}nv(){return this.vb(olympe.sc.pa.mb.F)}};
1197
+ olympe.sc.pa.mb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.pa.mb);olympe.sc.pa.mb.gi=olympe.sc.pa.mb.O.ja('011203300000000adef6');olympe.sc.pa.mb.ia=olympe.sc.pa.mb.O.ja('011203300000000adef7');olympe.sc.pa.mb.j=olympe.sc.pa.mb.O.ja('011203300000000adef8');olympe.sc.pa.mb.H=olympe.sc.pa.mb.O.ja('011203300000000adef9');olympe.sc.pa.mb.da=olympe.sc.pa.mb.O.ja('011203300000000adefa');olympe.sc.pa.mb.X=olympe.sc.pa.mb.O.ja('011203300000000adefb');olympe.sc.pa.mb.D=olympe.sc.pa.mb.O.ja('011203300000000adefc');
1198
+ olympe.sc.pa.mb.Z=olympe.sc.pa.mb.O.ja('011203300000000adefd');olympe.sc.pa.mb.N=olympe.sc.pa.mb.O.ja('011203300000000adefe');olympe.sc.pa.mb.R=olympe.sc.pa.mb.O.ja('011203300000000adeff');olympe.sc.pa.mb.F=olympe.sc.pa.mb.O.ja('011203300000000adee0');olympe.sc.pa.mb.oc={INIT:0,FA:1,Pk:2,Ok:3,Xm:4,nD:5,Ab:9};m=olympe.sc.pa.mb.prototype;m.ov.K=olympe.C.J.N;m.Az.K=olympe.C.J.N;m.Jc.K=olympe.C.J.F;m.vy.K=olympe.C.J.D;m.Qy.K=olympe.C.J.D;m.Py.K=olympe.C.J.D;m.Of.K=olympe.C.J.D;m.Fy.K=olympe.C.J.D;
1199
+ m.ay.K=olympe.C.J.D;m.Oy.K=olympe.C.J.D;m.nv.K=olympe.C.J.D;olympe.sc.pa.pm=class extends olympe.sc.pa.Ei{F(a){a.set(olympe.sc.xa.j.io,!0);super.F(a)}ia(){return!0}};olympe.sc.pa.pm.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.pa.pm,olympe.sc.P.Ca);olympe.sc.pa.bf=class extends olympe.sc.pa.Yc{j(){return(new olympe.dc.rk(this.W(),olympe.sc.pa.mb)).bb(olympe.sc.pa.bf.N).Xi().Ic()}};olympe.sc.pa.bf.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.pa.bf);olympe.sc.pa.bf.N=olympe.sc.pa.bf.O.ra('011203300000000adef4');R(olympe.sc.pa.mb.O,olympe.sc.pa.bf.N);
1200
+ olympe.sc.pa.bf.O.j=(a,b,c)=>{b=$l(a,b||'New Service Application model',olympe.sc.pa.bf,olympe.sc.pa.pm);a.Oa(olympe.sc.pa.Yc.j,b,c);c=a.create(olympe.sc.pa.mb).W();a.Oa(olympe.sc.pa.bf.N,b,c);return b.W()};olympe.sc.pa.bf.prototype.j.K=new olympe.C.J(()=>olympe.sc.pa.mb,[]);olympe.sc.bh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.bh.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.bh);olympe.sc.bh.D=olympe.sc.bh.O.ja('011203300000000adf01');olympe.sc.bh.j=olympe.sc.bh.O.ja('011203300000000adf02');olympe.sc.bh.F='011203300000000adf0f';olympe.sc.Ag={};olympe.sc.Ag.oz=a=>{var b=a.j;const c=olympe.dc.ga();var d=null;var e=null===bo;for(const f of b.Uc())if((b=f.Ub())&&f.D()&&f.jb()===olympe.dc.Ia.SERVER&&Z(a,f.tag())&&c.Nb(b,olympe.sc.Ac)){if(!e)throw new olympe.dc.Pq;let g,h;null==d&&(d=null,null!==ao?d=ao:'string'===typeof $n&&(d=olympe.dc.rd.from($n).bb(olympe.sc.pa.Yc.j).bb(olympe.sc.sf.j.$b()).Cc()),d=null==(g=d)?void 0:g.W());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ea(b)}`);a.Oa(olympe.sc.sf.D.W(),
1198
1201
  d,f.tag())}};
1199
- olympe.sc.Ag.zz=a=>{const b=a.j,c=olympe.dc.ga();for(const d of b.Tc()){const e=d.Ub();e&&!d.yd()&&c.Nb(e,olympe.sc.zc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Sc(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Ub())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Td)){h=l.Ib(olympe.sc.Td.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1200
- let p;f=null!=(p=null==(k=b.Sc(h))?void 0:k.Ub())?p:c.model(h)}if(c.Tf(f,olympe.dm.Ie)){k=jn(f);let p;n=null!=(p=l.Qa(k.W()))?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.Xc(d.tag(),new Map([[g,n]]));Ul(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1201
- olympe.sc.Ag.wx=a=>{const b=a.j,c=olympe.dc.ga(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Ub())?f:c.model(a);if(null!==g&&e.Fd()&&(d.has(g)||c.Nb(g,olympe.sc.zc))){d.add(g);const h=Array.from(e.da()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Sc(k))?void 0:l.Ub())?n:c.model(k);return!p||!(d.has(p)||c.Nb(p,olympe.sc.zc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Sc(h))?void 0:k.Ub())?l:c.model(h))?
1202
- 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.Ag.Pz=a=>{var b=a.j;const c=olympe.dc.ga();for(const d of b.Tc()){b=d.tag();const e=d.Ub();if(e&&!c.Nb(e,olympe.sc.zc)&&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`);}};
1203
- olympe.V.run([olympe.dc.transaction.P.Da],a=>{fm(fm(fm(a,olympe.sc.Ag.wx,'businessDataRelations'),olympe.sc.Ag.lz,'linkBusinessContainer'),olympe.sc.Ag.zz,'noBusinessComplexProperty')});olympe.sc.Zj=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.Zj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Zj);olympe.sc.Zj.j=olympe.sc.Zj.O.ra('017ed8ac775f48d4d589');olympe.sc.So=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.So.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.So);olympe.sc.zh=class extends olympe.dm.BrickMetadata{};olympe.sc.zh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.zh);olympe.sc.zh.j=olympe.sc.zc.O.ra('016324fde11a836088d3');olympe.sc.zh.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.zh).W();olympe.sc.LA=class{};olympe.sc.dk=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.dk.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.dk);olympe.sc.dk.O.j=(a,b)=>$l(a,null!=b?b:'New data connector',olympe.sc.dk,olympe.dm.DataSource).W();olympe.sc.Ae=class extends olympe.sc.Runnable{sa(){return this.cb(olympe.sc.Ae.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.F,olympe.dm.Property)}};olympe.sc.Ae.O=ig(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.H=olympe.sc.Ae.O.ra('016c3cb7742ec9309e0b');olympe.sc.Ae.F=olympe.sc.Ae.O.ra('016c42d3454636f90533');olympe.sc.Ae.prototype.sa.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.qp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.qp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.qp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ga();e=void 0!==e?e:f.Ia(b)&&f.Tc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.vq=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Lw}};olympe.sc.vq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.vq);olympe.sc.wq=class extends olympe.dc.CloudObject{};olympe.sc.wq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.wq);const qo={pp:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.pp,{c:a.Aj(),m:a.message,s:a.re()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.pp?(a=a.v,pn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Td.O.W()){const b=olympe.sc.Td.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Ib(a,b)})}return a}};olympe.sc.Rr=class extends olympe.sc.Ae{};olympe.sc.Rr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Rr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Ag.Pz;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.am))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
1204
- 'string'===typeof c?c:olympe.dc.ee().fromModel(a);a=this.j.create(a,d).yi(c);for(const [e,f]of b)X(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ht(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Kd.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}wn(a,b){this.j.wn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Oz(a,b=!0){olympe.ha.Xa('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1205
- return this.persist(a,b)}yi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}mn(a){this.j.mn(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}xn(){return new Promise((a,b)=>{this.j.xn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.xn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.nb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.mn;
1206
- olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.yi;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.Oz;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.wn;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.hc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.Oa;
1207
- olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.ht;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.mj=class{constructor(a){this.j=a}hy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.hy;olympe.xc={};olympe.xc.Ht=class{run(){}};function ro(a,b='default'){return a.j===b}
1208
- 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)}Mj(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),
1209
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Mj=function(a,b,c='default'){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.Config.ye+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.wd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Mj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.Config={ye:'hc.app',Hp:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.xc.Config.ye,'default');E(a,olympe.xc.Config.Hp,!1);D(a,olympe.xc.P.Ca,[olympe.ha.P.Da],b=>b.ad('hc'));D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.xc.Config.ye)],b=>b);D(a,olympe.auth.P.Bl,[olympe.Db.P.$g,new olympe.V.oa(olympe.xc.Config.Hp)],(b,c)=>new olympe.auth.qo(c?'':b));C(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.V.oa(olympe.xc.Config.ye),olympe.xc.P.Ca)},'olympe.hc');
1210
- olympe.V.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Hb={};function so(a){a.X=a.F.H(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.j(()=>olympe.C.Pa(a.Z)===olympe.C.ba.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
1211
- function vo(a){if(a.sa)return a.G.debug('Sending getContext request'),Ji(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;bo=null;$n=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=nn(a.D);!b&&jl();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Bb(),d=new Promise((f,g)=>{const h=olympe.dc.ga(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.vi(l)?l:h.model(l);return null!==l&&
1212
- h.Nb(l,olympe.sc.zh)},{ld:b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf,$n:!0,at:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Nb(a.j,olympe.sc.pa.Yc)?(a.Wa.X(a.j,b),f()):Qd(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.Uc([a.ia.te()],g=>{olympe.dc.la.Qe(g,olympe.dm.User,olympe.dc.Ha.SERVER).observe(c,
1213
- {ld:olympe.dc.la.nc.Bk,bl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return wo(a);wo(a).then(()=>{})})}
1214
- function xo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ga();if(0<a.j.length){const c=Nf(b,a.j,a.D.Bb().rc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.pa.Ei){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.$a.Zv(a.H);ob(a.H,()=>xn(a.D.state,h));pb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.lb&&a.H.start();f.run(g);'string'===typeof a.yb&&(new olympe.sc.$d).da(f.W(),g,a.G);g.zt(olympe.sc.xa.j.ho).then(()=>{var k;null==(k=d)||k.cancel();a.Z.update(olympe.C.ba.D);
1202
+ olympe.sc.Ag.Cz=a=>{const b=a.j,c=olympe.dc.ga();for(const d of b.Uc()){const e=d.Ub();e&&!d.yd()&&c.Nb(e,olympe.sc.Ac)&&d.zb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Tc(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Ub())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Td)){h=l.Ib(olympe.sc.Td.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1203
+ let p;f=null!=(p=null==(k=b.Tc(h))?void 0:k.Ub())?p:c.model(h)}if(c.Tf(f,olympe.dm.Ie)){k=jn(f);let p;n=null!=(p=l.Pa(k.W()))?p:c.Pa(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.Xc(d.tag(),new Map([[g,n]]));Ul(a,l.tag(),olympe.dc.Lb.Dc)}})}};
1204
+ olympe.sc.Ag.Ax=a=>{const b=a.j,c=olympe.dc.ga(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Ub())?f:c.model(a);if(null!==g&&e.Fd()&&(d.has(g)||c.Nb(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.da()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Tc(k))?void 0:l.Ub())?n:c.model(k);return!p||!(d.has(p)||c.Nb(p,olympe.sc.Ac))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Tc(h))?void 0:k.Ub())?l:c.model(h))?
1205
+ 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.Ag.Sz=a=>{var b=a.j;const c=olympe.dc.ga();for(const d of b.Uc()){b=d.tag();const e=d.Ub();if(e&&!c.Nb(e,olympe.sc.Ac)&&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`);}};
1206
+ olympe.V.run([olympe.dc.transaction.P.Fa],a=>{fm(fm(fm(a,olympe.sc.Ag.Ax,'businessDataRelations'),olympe.sc.Ag.oz,'linkBusinessContainer'),olympe.sc.Ag.Cz,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.ra('017ed8ac775f48d4d589');olympe.sc.To=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.To.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.To);olympe.sc.zh=class extends olympe.dm.BrickMetadata{};olympe.sc.zh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.zh);olympe.sc.zh.j=olympe.sc.Ac.O.ra('016324fde11a836088d3');olympe.sc.zh.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.zh).W();olympe.sc.PA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.ek.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.ek);olympe.sc.ek.O.j=(a,b)=>$l(a,null!=b?b:'New data connector',olympe.sc.ek,olympe.dm.DataSource).W();olympe.sc.Ae=class extends olympe.sc.Runnable{sa(){return this.cb(olympe.sc.Ae.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.F,olympe.dm.Property)}};olympe.sc.Ae.O=ig(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.H=olympe.sc.Ae.O.ra('016c3cb7742ec9309e0b');olympe.sc.Ae.F=olympe.sc.Ae.O.ra('016c42d3454636f90533');olympe.sc.Ae.prototype.sa.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.rp=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Bh}};olympe.sc.rp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.rp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ga();e=void 0!==e?e:f.Ja(b)&&f.Uc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.yq=class extends olympe.dm.Kb{ue(){return olympe.sc.we.Ne.Pw}};olympe.sc.yq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.yq);olympe.sc.zq=class extends olympe.dc.CloudObject{};olympe.sc.zq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.zq);const qo={qp:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.qp,{c:a.Aj(),m:a.message,s:a.re()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.qp?(a=a.v,pn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Td.O.W()){const b=olympe.sc.Td.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Ib(a,b)})}return a}};olympe.sc.Ur=class extends olympe.sc.Ae{};olympe.sc.Ur.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Ur);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Ag.Sz;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.bm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.lb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
1207
+ 'string'===typeof c?c:olympe.dc.ee().fromModel(a);a=this.j.create(a,d).yi(c);for(const [e,f]of b)X(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}lt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Kd.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}xn(a,b){this.j.xn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Rz(a,b=!0){olympe.ha.Xa('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1208
+ return this.persist(a,b)}yi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}nn(a){this.j.nn(a);return this}lb(){return new Promise((a,b)=>{this.j.lb((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}yn(){return new Promise((a,b)=>{this.j.yn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.yn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.lb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.nn;
1209
+ olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.yi;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.Rz;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.xn;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.hc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.Oa;
1210
+ olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.lt;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.mj=class{constructor(a){this.j=a}ly(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.ly;olympe.yc={};olympe.yc.Lt=class{run(){}};function ro(a,b='default'){return a.j===b}
1211
+ olympe.yc.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)}Nj(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),
1212
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.yc.Nj=function(a,b,c='default'){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.yc.Config.ye+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.wd(olympe.yc.P.Fa).config(c,[b],(e,f)=>f.Nj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.yc.P={Fa:'hc.Manager',Ca:'hc.Logger'};olympe.yc.Config={ye:'hc.app',Ip:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.yc.Config.ye,'default');E(a,olympe.yc.Config.Ip,!1);D(a,olympe.yc.P.Ca,[olympe.ha.P.Fa],b=>b.ad('hc'));D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ye)],b=>b);D(a,olympe.auth.P.Cl,[olympe.Db.P.$g,new olympe.V.oa(olympe.yc.Config.Ip)],(b,c)=>new olympe.auth.ro(c?'':b));C(a,olympe.yc.P.Fa,olympe.yc.Ta,new olympe.V.oa(olympe.yc.Config.ye),olympe.yc.P.Ca)},'olympe.hc');
1213
+ olympe.V.run([olympe.yc.P.Fa],a=>a.run(),'olympe.hc');olympe.sc.Hb={};function so(a){a.X=a.F.H(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.j(()=>olympe.C.Qa(a.Z)===olympe.C.ba.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
1214
+ function vo(a){if(a.sa)return a.G.debug('Sending getContext request'),Ji(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;bo=null;$n=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=nn(a.D);!b&&jl();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ga(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.vi(l)?l:h.model(l);return null!==l&&
1215
+ h.Nb(l,olympe.sc.zh)},{ld:b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf,ao:!0,ft:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Nb(a.j,olympe.sc.pa.Yc)?(a.Wa.X(a.j,b),f()):Qd(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.Vc([a.ia.te()],g=>{olympe.dc.la.Qe(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
1216
+ {ld:olympe.dc.la.nc.Ck,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return wo(a);wo(a).then(()=>{})})}
1217
+ function xo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ga();if(0<a.j.length){const c=Nf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.pa.Ei){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.$a.cw(a.H);ob(a.H,()=>xn(a.D.state,h));pb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.nb&&a.H.start();f.run(g);'string'===typeof a.yb&&(new olympe.sc.$d).da(f.W(),g,a.G);g.Dt(olympe.sc.xa.j.io).then(()=>{var k;null==(k=d)||k.cancel();a.Z.update(olympe.C.ba.D);
1215
1218
  a.G.info(`Application ${olympe.dc.ga().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.ce();k.Yb=!0;k.X+=0;k.ke.next(0<k.X);0===k.X&&k.Z&&k.Yb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Wa.set('__code-as-data-version__',k.version),k.yb||(k.Z=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C.Za().onDestroy(()=>{Lf(b,a.j,c)});const d=Bc(()=>{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)`)},
1216
- 3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a){return u(function*(){yo(a.j)&&(yield co(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function to(a){a.G.info('Stop the application');a.D.Bb().rg();a.F.D(a.R);a.F.F(a.X)}
1217
- olympe.sc.Hb.Um=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ia=b;this.N=c;this.Ga=d;this.F=e;this.X=this.R='';this.D=f;this.Wa=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.sa=k.get('getContextMode');let n;this.yb=null!=(n=k.get('debuggerName'))?n:null;this.lb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.Z=olympe.C.bc(olympe.C.ba).update(olympe.C.ba.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;so(this);uo(this);const b=olympe.L.tc.j.cj,
1218
- c=olympe.L.tc.j.Df,d=olympe.L.tc.j.yc;olympe.C.Uc([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,vo(this).then(olympe.C.Za().rc(()=>xo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Hb.Um.j='app_instance';olympe.sc.Hb.Um.ya=[olympe.xc.Ht];olympe.sc.Hb.hw=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.Cj();this.G.debug('Request headers',b);return b.origin?b.origin:b.Vz?(new URL(b.Vz)).origin:b[olympe.net.va.Headers.xp]&&
1219
- b[olympe.net.va.Headers.yp]?b[olympe.net.va.Headers.yp]+'://'+b[olympe.net.va.Headers.xp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Rd.GET],(b,c)=>{const d=this;return u(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.pd('Invalid appTag',olympe.net.va.Tb.El);try{var f=yield olympe.dc.la.Qe(e,olympe.sc.pa.Yc).nb()}catch(h){return new olympe.net.pd(`Something went wrong: ${'string'===typeof h?
1220
- h:h.message}`,olympe.net.va.Tb.El)}if(0===f.size())return new olympe.net.pd('App not found',olympe.net.va.Tb.Zi);var g=a(b);f=f.Hc();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.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1219
+ 3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a){return u(function*(){yo(a.j)&&(yield co(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function to(a){a.G.info('Stop the application');a.D.Cb().rg();a.F.D(a.R);a.F.F(a.X)}
1220
+ olympe.sc.Hb.Vm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ia=b;this.N=c;this.Ha=d;this.F=e;this.X=this.R='';this.D=f;this.Wa=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.sa=k.get('getContextMode');let n;this.yb=null!=(n=k.get('debuggerName'))?n:null;this.nb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.Z=olympe.C.bc(olympe.C.ba).update(olympe.C.ba.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;so(this);uo(this);const b=olympe.L.uc.j.cj,
1221
+ c=olympe.L.uc.j.Df,d=olympe.L.uc.j.zc;olympe.C.Vc([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,vo(this).then(olympe.C.Za().rc(()=>xo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Hb.Vm.j='app_instance';olympe.sc.Hb.Vm.ya=[olympe.yc.Lt];olympe.sc.Hb.lw=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.Cj();this.G.debug('Request headers',b);return b.origin?b.origin:b.Zz?(new URL(b.Zz)).origin:b[olympe.net.va.Headers.yp]&&
1222
+ b[olympe.net.va.Headers.zp]?b[olympe.net.va.Headers.zp]+'://'+b[olympe.net.va.Headers.yp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.va.Rd.GET],(b,c)=>{const d=this;return u(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.pd('Invalid appTag',olympe.net.va.Tb.Fl);try{var f=yield olympe.dc.la.Qe(e,olympe.sc.pa.Yc).lb()}catch(h){return new olympe.net.pd(`Something went wrong: ${'string'===typeof h?
1223
+ h:h.message}`,olympe.net.va.Tb.Fl)}if(0===f.size())return new olympe.net.pd('App not found',olympe.net.va.Tb.Zi);var g=a(b);f=f.Ic();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.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1221
1224
  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.pd(JSON.stringify(e),olympe.net.va.Tb.Qh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function yo(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.dm.Ad.F.$b()).bb(olympe.dm.Ad.j).Cc();a=olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.j).bb(olympe.dm.hb.D).Cc();return c.concat(a).has(b)}
1222
- olympe.sc.Hb.Rk=class extends olympe.dc.sources.Rk{R(a){return this.db.Nb(a,olympe.sc.zc)}X(a,b){if(!this.H){super.init();var c=olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).Cc();if(!(c instanceof olympe.dm.hb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.ia).observe(c,{ld:b}).subscribe(d=>{const e=
1223
- new olympe.dc.Ya;d.yj().forEach(f=>{e.Oa(olympe.dm.DataSource.Lj,this.j,f)});d.Ej().forEach(f=>{e.hc(olympe.dm.DataSource.Lj,this.j,f)});e.nb()})}}};olympe.sc.Hb.P={jg:'sc.runtime.Main',af:'sc.runtime.SourceSolver',vr:'sc.runtime.appConfig',xr:'sc.runtime.runtimeHTTPServiceConfig',wr:'sc.runtime.RuntimeHTTPService',Oq:'sc.runtime.OfflineAppConfig'};olympe.sc.Hb.Config={Sp:'app.httpManifestPath',tq:'app.manifest.common',pq:'sc.loadBusinessContainer'};
1224
- olympe.V.config(function(a){E(a,olympe.sc.Hb.Config.Sp,'/runtime/manifest');E(a,olympe.sc.Hb.Config.tq,null);E(a,olympe.sc.Hb.Config.pq,!1);D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.xc.Config.ye),new olympe.V.oa(olympe.sc.Config.ye)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Hb.P.Oq,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Em)],(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`))?
1225
- g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Fm,olympe.sc.Hb.P.Oq);C(a,olympe.sc.Hb.P.af,olympe.sc.Hb.Rk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.Zl));Wa(a,olympe.dc.sources.P.af,olympe.sc.Hb.P.af);D(a,olympe.sc.Hb.P.vr,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.sc.Config.bp),new olympe.V.oa(olympe.sc.Config.jo),new olympe.V.oa(olympe.sc.Hb.Config.pq)],
1226
- (b,c,d,e,f)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Hb.P.jg,olympe.sc.Hb.Um,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.uf,olympe.dc.query.P.Ek,olympe.host.P.Ge,olympe.sc.P.Jk,olympe.sc.Hb.P.af,olympe.U.P.ig,olympe.sc.Hb.P.vr,olympe.sc.Hb.P.wr);D(a,olympe.sc.Hb.P.xr,[new olympe.V.oa(olympe.sc.Hb.Config.Sp),new olympe.V.oa(olympe.sc.Hb.Config.tq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));
1227
- C(a,olympe.sc.Hb.P.wr,olympe.sc.Hb.hw,olympe.sc.P.Ca,olympe.net.P.nj,olympe.sc.P.Jk,olympe.sc.Hb.P.xr);olympe.xc.Mj(a,olympe.sc.Hb.P.jg,'sc.runtime');olympe.xc.Mj(a,olympe.sc.Hb.P.jg,'sc.headless');olympe.xc.Mj(a,olympe.sc.Hb.P.jg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static Vx(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 qf(olympe.public.Ma.get())}static pl(b){return a.D(olympe.public.Ma.get().pl(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static jy(){return olympe.C.Pa(olympe.public.Ma.get().te())}static Iz(b){return a.D(olympe.public.Ma.get().te(),b)}static se(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().dd.sb().Gd();return c.call(b,
1228
- d)}static yg(){return new Promise((b,c)=>{olympe.public.Ma.get().yg(d=>d?c(d):b())})}static xy(){return olympe.C.Pa(olympe.public.Ma.get().ri())||void 0}static Xy(){const b=ce(olympe.public.Ma.get());return{user:b.wc(),userTag:b.te(),nonce:b.Gd(),payload:b.Vi(),idpName:b.Cf(),protocol:b.Mg()}}static wy(){return Array.from(rf().keys())}static qf(){olympe.public.Ma.get().qf()}static qh(b){return new Promise((c,d)=>{olympe.public.Ma.get().qh(b,e=>e?d(e):c())})}static oz(b,c){return olympe.public.Ma.j((new Map).set('username',
1229
- b).set('password',c),olympe.auth.Ec.j.SRP)}static pz(b){const c=rf();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 nz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static qz(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1230
- c),olympe.auth.Ec.j.Gm)}static mz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Ma.get().Jj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{pf(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.qe()}static D(b,c){return b.asObservable('function'===typeof c.Bb?c.Bb():c)}};olympe.public.Ma.logout=olympe.public.Ma.Jj;olympe.public.Ma.loginOpenID=olympe.public.Ma.mz;
1231
- olympe.public.Ma.loginToken=olympe.public.Ma.qz;olympe.public.Ma.loginSAML=olympe.public.Ma.nz;olympe.public.Ma.loginSSO=olympe.public.Ma.pz;olympe.public.Ma.loginSRP=olympe.public.Ma.oz;olympe.public.Ma.getUserFromToken=olympe.public.Ma.qh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.qf;olympe.public.Ma.getIDPNames=olympe.public.Ma.wy;olympe.public.Ma.getUserToken=olympe.public.Ma.Xy;olympe.public.Ma.getIDPToken=olympe.public.Ma.xy;olympe.public.Ma.refreshToken=olympe.public.Ma.yg;
1232
- olympe.public.Ma.getToken=olympe.public.Ma.se;olympe.public.Ma.observeUser=olympe.public.Ma.Iz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.jy;olympe.public.Ma.isAuthenticated=olympe.public.Ma.pl;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.Vx;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.Ai(a,b)}};olympe.public.Config.setParameter=olympe.public.Config.setParameter;olympe.public.Config.getParameter=olympe.public.Config.getParameter;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Y.Bg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ba),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.sb()}}}};
1233
- olympe.public.wf=class{static create(a){return new class extends olympe.dc.vc.Bg{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.$),e=b.subscribe(f=>d.update(olympe.C.qa(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.sb()}}}};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.kl(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Lz(a,b,c){const d=olympe.host.kl(),e=d.ia(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.An().connect()}static disconnect(){return olympe.L.An().disconnect()}static Vf(a){a='function'===typeof a.Bb?a.Bb():a;return olympe.L.An().Vf().asObservable(a).pipe(rxjs.operators.map(b=>
1234
- b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Vf;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.U.hf,tagToString:olympe.dc.ea,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Cs,defineInverseRelation:olympe.dc.Fx,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.xa.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1225
+ olympe.sc.Hb.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Nb(a,olympe.sc.Ac)}X(a,b){if(!this.H){super.init();var c=olympe.dc.rd.from(a).bb(olympe.sc.pa.Yc.j).Cc();if(!(c instanceof olympe.dm.hb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.nc.Qg:olympe.dc.la.nc.vf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.pa.Yc.ia).observe(c,{ld:b}).subscribe(d=>{const e=
1226
+ new olympe.dc.Ya;d.yj().forEach(f=>{e.Oa(olympe.dm.DataSource.Mj,this.j,f)});d.Ej().forEach(f=>{e.hc(olympe.dm.DataSource.Mj,this.j,f)});e.lb()})}}};olympe.sc.Hb.P={jg:'sc.runtime.Main',af:'sc.runtime.SourceSolver',yr:'sc.runtime.appConfig',Ar:'sc.runtime.runtimeHTTPServiceConfig',zr:'sc.runtime.RuntimeHTTPService',Rq:'sc.runtime.OfflineAppConfig'};olympe.sc.Hb.Config={Tp:'app.httpManifestPath',wq:'app.manifest.common',sq:'sc.loadBusinessContainer'};
1227
+ olympe.V.config(function(a){E(a,olympe.sc.Hb.Config.Tp,'/runtime/manifest');E(a,olympe.sc.Hb.Config.wq,null);E(a,olympe.sc.Hb.Config.sq,!1);D(a,olympe.Db.P.$g,[new olympe.V.oa(olympe.yc.Config.ye),new olympe.V.oa(olympe.sc.Config.ye)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Hb.P.Rq,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.net.Config.bj),new olympe.V.oa(olympe.net.Config.Fm)],(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`))?
1228
+ g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Gm,olympe.sc.Hb.P.Rq);C(a,olympe.sc.Hb.P.af,olympe.sc.Hb.Sk,olympe.dc.P.Ch,new olympe.V.oa(olympe.dc.Config.Xg),new olympe.V.oa(olympe.dc.Config.$l));Wa(a,olympe.dc.sources.P.af,olympe.sc.Hb.P.af);D(a,olympe.sc.Hb.P.yr,[new olympe.V.oa(olympe.sc.Config.ye),new olympe.V.oa(olympe.dc.Config.Yh),new olympe.V.oa(olympe.sc.Config.cp),new olympe.V.oa(olympe.sc.Config.ko),new olympe.V.oa(olympe.sc.Hb.Config.sq)],
1229
+ (b,c,d,e,f)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Hb.P.jg,olympe.sc.Hb.Vm,olympe.sc.P.Ca,olympe.auth.P.Fa,olympe.L.P.uf,olympe.dc.query.P.Fk,olympe.host.P.Ge,olympe.sc.P.Kk,olympe.sc.Hb.P.af,olympe.U.P.ig,olympe.sc.Hb.P.yr,olympe.sc.Hb.P.zr);D(a,olympe.sc.Hb.P.Ar,[new olympe.V.oa(olympe.sc.Hb.Config.Tp),new olympe.V.oa(olympe.sc.Hb.Config.wq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));
1230
+ C(a,olympe.sc.Hb.P.zr,olympe.sc.Hb.lw,olympe.sc.P.Ca,olympe.net.P.nj,olympe.sc.P.Kk,olympe.sc.Hb.P.Ar);olympe.yc.Nj(a,olympe.sc.Hb.P.jg,'sc.runtime');olympe.yc.Nj(a,olympe.sc.Hb.P.jg,'sc.headless');olympe.yc.Nj(a,olympe.sc.Hb.P.jg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static Zx(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 qf(olympe.public.Ma.get())}static ql(b){return a.D(olympe.public.Ma.get().ql(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static ny(){return olympe.C.Qa(olympe.public.Ma.get().te())}static Lz(b){return a.D(olympe.public.Ma.get().te(),b)}static se(){var b=olympe.C,c=b.Qa;var d=olympe.public.Ma.get().dd.tb().Gd();return c.call(b,
1231
+ d)}static yg(){return new Promise((b,c)=>{olympe.public.Ma.get().yg(d=>d?c(d):b())})}static Ay(){return olympe.C.Qa(olympe.public.Ma.get().ri())||void 0}static $y(){const b=ce(olympe.public.Ma.get());return{user:b.xc(),userTag:b.te(),nonce:b.Gd(),payload:b.Vi(),idpName:b.Cf(),protocol:b.Mg()}}static zy(){return Array.from(rf().keys())}static qf(){olympe.public.Ma.get().qf()}static qh(b){return new Promise((c,d)=>{olympe.public.Ma.get().qh(b,e=>e?d(e):c())})}static rz(b,c){return olympe.public.Ma.j((new Map).set('username',
1232
+ b).set('password',c),olympe.auth.Ec.j.SRP)}static sz(b){const c=rf();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 qz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static uz(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1233
+ c),olympe.auth.Ec.j.Hm)}static pz(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Ma.get().Jj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{pf(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.qe()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.Jj;olympe.public.Ma.loginOpenID=olympe.public.Ma.pz;
1234
+ olympe.public.Ma.loginToken=olympe.public.Ma.uz;olympe.public.Ma.loginSAML=olympe.public.Ma.qz;olympe.public.Ma.loginSSO=olympe.public.Ma.sz;olympe.public.Ma.loginSRP=olympe.public.Ma.rz;olympe.public.Ma.getUserFromToken=olympe.public.Ma.qh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.qf;olympe.public.Ma.getIDPNames=olympe.public.Ma.zy;olympe.public.Ma.getUserToken=olympe.public.Ma.$y;olympe.public.Ma.getIDPToken=olympe.public.Ma.Ay;olympe.public.Ma.refreshToken=olympe.public.Ma.yg;
1235
+ olympe.public.Ma.getToken=olympe.public.Ma.se;olympe.public.Ma.observeUser=olympe.public.Ma.Lz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.ny;olympe.public.Ma.isAuthenticated=olympe.public.Ma.ql;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.Zx;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.Ai(a,b)}};olympe.public.Config.setParameter=olympe.public.Config.setParameter;olympe.public.Config.getParameter=olympe.public.Config.getParameter;olympe.public.za=class{static create(a){return new class extends olympe.dc.Y.Bg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ba),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};
1236
+ olympe.public.wf=class{static create(a){return new class extends olympe.dc.wc.Bg{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.$),e=b.subscribe(f=>d.update(olympe.C.qa(f)));olympe.C.Za().Xd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Nz(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.ll(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Oz(a,b,c){const d=olympe.host.ll(),e=d.ia(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.Bn().connect()}static disconnect(){return olympe.L.Bn().disconnect()}static Vf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.Bn().Vf().asObservable(a).pipe(rxjs.operators.map(b=>
1237
+ b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Vf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Oz;olympe.public.Process.onHealthCheck=olympe.public.Process.Nz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.ua,generateTag:olympe.U.hf,tagToString:olympe.dc.ea,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Fs,defineInverseRelation:olympe.dc.Jx,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.xa.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1235
1238
  Context:olympe.sc.xa,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.fg,EnumValue:olympe.sc.Mi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Dd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.cf,WorkflowTransition:olympe.sc.workflow.Transition,
1236
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ha,QueryResult:olympe.dc.Ja,Query:olympe.dc.la,QuerySingle:olympe.dc.rd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.Ak,Config:olympe.public.Config,Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.ce().N,clearCache:a=>ql(olympe.dc.sources.ce(),a),getProcessingStatus:()=>olympe.dc.sources.ce().Ic(),
1237
- getProcessingErrors:()=>olympe.dc.sources.ce().vd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.ce().da.asObservable(),synchroniseChanges:()=>wl(),getPendingChanges:()=>zl(),clearPendingChanges:()=>Dl(),loadPendingChanges:a=>Bl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.wa.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.qb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Rj,GUEST:olympe.auth.Ta.j.Pi,AUTHENTICATED:olympe.auth.Ta.j.rf,
1238
- ERROR:olympe.auth.Ta.j.zb},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.jb{static get(){return olympe.dc.ga()}},ListDef:olympe.dc.za,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.na.j,
1239
- getUniqueTag:olympe.U.hf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Wf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.$e,RecursiveRelated:olympe.dc.aa.Ke,Distinct:olympe.dc.aa.Ki,Filter:olympe.dc.aa.yf,Limit:olympe.dc.aa.Mh,Sort:olympe.dc.aa.ah,Union:olympe.dc.aa.Kf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Y.Nd,Or:olympe.dc.Y.Fe,Not:olympe.dc.Y.ie,Equals:olympe.dc.Y.Be,Contains:olympe.dc.Y.xf,Greater:olympe.dc.Y.lk,Smaller:olympe.dc.Y.Qk,
1240
- HasRelated:olympe.dc.Y.Ri,InstanceOf:olympe.dc.Y.Ui,Regex:olympe.dc.Y.Gf},Comparator:olympe.public.wf,comparators:{Number:olympe.dc.vc.Number,String:olympe.dc.vc.String,DateTime:olympe.dc.vc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Vj,StringProperty:olympe.dc.ab.jj,NumberProperty:olympe.dc.ab.aj,DateTimeProperty:olympe.dc.ab.Ji,Constant:olympe.dc.ab.We,Tag:olympe.dc.ab.kj}});
1239
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.la,QuerySingle:olympe.dc.rd,Predicate:olympe.dc.query.za,Order:olympe.dc.query.Bk,Config:olympe.public.Config,Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.ce().N,clearCache:a=>ql(olympe.dc.sources.ce(),a),getProcessingStatus:()=>olympe.dc.sources.ce().Jc(),
1240
+ getProcessingErrors:()=>olympe.dc.sources.ce().vd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.ce().da.asObservable(),synchroniseChanges:()=>wl(),getPendingChanges:()=>zl(),clearPendingChanges:()=>Dl(),loadPendingChanges:a=>Bl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.wa.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.qb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Sj,GUEST:olympe.auth.Ta.j.Pi,AUTHENTICATED:olympe.auth.Ta.j.rf,
1241
+ 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.ga()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.na.j,
1242
+ getUniqueTag:olympe.U.hf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Wf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.$e,RecursiveRelated:olympe.dc.aa.Ke,Distinct:olympe.dc.aa.Ki,Filter:olympe.dc.aa.yf,Limit:olympe.dc.aa.Mh,Sort:olympe.dc.aa.ah,Union:olympe.dc.aa.Kf},ListDefPredicate:olympe.public.za,predicates:{And:olympe.dc.Y.Nd,Or:olympe.dc.Y.Fe,Not:olympe.dc.Y.ie,Equals:olympe.dc.Y.Be,Contains:olympe.dc.Y.xf,Greater:olympe.dc.Y.mk,Smaller:olympe.dc.Y.Rk,
1243
+ HasRelated:olympe.dc.Y.Ri,InstanceOf:olympe.dc.Y.Ui,Regex:olympe.dc.Y.Gf},Comparator:olympe.public.wf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Wj,StringProperty:olympe.dc.ab.jj,NumberProperty:olympe.dc.ab.aj,DateTimeProperty:olympe.dc.ab.Ji,Constant:olympe.dc.ab.We,Tag:olympe.dc.ab.kj}});
1241
1244
 
1242
1245
 
1243
1246
  }.bind(this))();