@olympeio/runtime-node 9.10.0 → 9.10.2

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
@@ -241,18 +241,18 @@ v('Promise.prototype.finally',function(a){return a?a:function(b){return this.the
241
241
  v('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ua(this);return va(c,b-d.length)+d}});v('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ua(this);return d+va(c,b-d.length)}});v('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
242
242
  v('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});v('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});
243
243
  v('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var wa=this||self;function B(a,b){a=a.split('.');let c=wa;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={Zd:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.Zd())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.Zd().olympe=olympe;olympe.jE=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const ya=require('util');function za(a){return'string'===typeof a?a:ya.inspect(a,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));
244
- console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Wa={};olympe.Wa.node={};olympe.W={};olympe.W.Ff={};olympe.W.Ff.io=class{process(a){for(const b of Object.keys(a.we))if(a.pd(b).hn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Ff.io.xa=[olympe.W.Ff.uq];olympe.W.Ff.jo=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.pd(e);c(e.ij(),f);for(const g of Ha(e))c(g.ij(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.we));for(const e of d)b(e,[])}};olympe.W.Ff.jo.xa=[olympe.W.Ff.uq];olympe.W.Ff.uq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.$a();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.J.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.$a();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.ij());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
245
- olympe.W.oo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.tl(a,b))}static D(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ja.push(new olympe.W.tl(b,c,a))}};olympe.W.config=olympe.W.oo.j;olympe.W.run=olympe.W.oo.D;olympe.W.ds=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.Bj=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.tl=class{constructor(a,b,c){this.D=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}ij(){return this.J}};function Qa(a,b){var c=olympe.W.P.rg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(a,b,c){let d=a.j[b];if(void 0===d){const e=a.J[b];if(void 0===e){if(c===olympe.W.mh.j.am)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.J&&(a.j[b]=d)}return d}
244
+ console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Ff={};olympe.W.Ff.io=class{process(a){for(const b of Object.keys(a.ve))if(a.rd(b).hn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Ff.io.xa=[olympe.W.Ff.uq];olympe.W.Ff.jo=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.rd(e);c(e.ij(),f);for(const g of Ha(e))c(g.ij(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.ve));for(const e of d)b(e,[])}};olympe.W.Ff.jo.xa=[olympe.W.Ff.uq];olympe.W.Ff.uq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.ab();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.J.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.ab();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.ij());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
245
+ olympe.W.oo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.tl(a,b))}static D(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ja.push(new olympe.W.tl(b,c,a))}};olympe.W.config=olympe.W.oo.j;olympe.W.run=olympe.W.oo.D;olympe.W.ds=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.Bj=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.tl=class{constructor(a,b,c){this.D=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}ij(){return this.J}};function Qa(a,b){var c=olympe.W.P.sg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(a,b,c){let d=a.j[b];if(void 0===d){const e=a.J[b];if(void 0===e){if(c===olympe.W.mh.j.am)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.J&&(a.j[b]=d)}return d}
246
246
  function Sa(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.D.get(b))?d:[];e.push(c);a.D.set(b,e)}function Na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.G.j++,f=b[e],d[e]=f instanceof olympe.W.Bj?f.getValue(a):f,La(a.G);return d}
247
- olympe.W.mh=class{constructor(a,b,c,d,e=2){this.J=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.Np(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.xj.bind(this,f)))}$a(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}xj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
247
+ olympe.W.mh=class{constructor(a,b,c,d,e=2){this.J=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.Np(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.xj.bind(this,f)))}ab(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}xj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
248
248
  (d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.W.mh.j={At:'exception',am:'null'};function Ta(a,b){b=olympe.W.ds(b);for(const [c,d]of b)Ua(a,c,d)}function D(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){C(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){C(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){C(a.G,'Defining abstract service '+b);a.j(b).F=!0}function Ua(a,b,c){a.parameters[b.toLowerCase()]=c}
249
249
  function Ya(a,b,c,d){a.F.push(b);Ua(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.ph(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.D[b.toLowerCase()]=c}
250
- olympe.W.qt=class{constructor(a,b){this.we=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Ff.io,new olympe.W.Ff.jo];this.J=[];a=this.getParameter(olympe.W.U.Gu);this.N=void 0!==a?a:3;this.G=new olympe.W.Np(this.N)}$a(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.we[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
251
- var g=this.we[f];g.id=g.id+'!!'+ ++olympe.W.Dl.j;g.J=!0;g=g.id;c[h]=g;this.we[g]=this.we[f]}}this.we[f]=new olympe.W.Dl(b,c,d||!1,f);return this.we[f]}pd(a){const b=this.we[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.J;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
252
- La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.we).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.mh(this.we,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
253
- olympe.W.Dl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.J=!1}T(){return this.id}instantiate(a){const b=a.$a();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.Xg().run(()=>e()):e();let g;if(0<(null==
250
+ olympe.W.qt=class{constructor(a,b){this.ve=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Ff.io,new olympe.W.Ff.jo];this.J=[];a=this.getParameter(olympe.W.U.Gu);this.N=void 0!==a?a:3;this.G=new olympe.W.Np(this.N)}ab(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ve[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
251
+ var g=this.ve[f];g.id=g.id+'!!'+ ++olympe.W.Dl.j;g.J=!0;g=g.id;c[h]=g;this.ve[g]=this.ve[f]}}this.ve[f]=new olympe.W.Dl(b,c,d||!1,f);return this.ve[f]}rd(a){const b=this.ve[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.J;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
252
+ La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.ve).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.mh(this.ve,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
253
+ olympe.W.Dl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.J=!1}T(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.Xg().run(()=>e()):e();let g;if(0<(null==
254
254
  (g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.ij()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}ij(){return this.D}hn(){return this.F}config(a,b,c,d,e){null===this.j&&
255
- (this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.tl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.Dl.j=0;olympe.W.ph=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Sa(a,this.id,c=>b.next(c))})}};function La(a){0<a.j&&a.j--}function C(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.W.Np=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.W.pa=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.ub=class extends olympe.W.Bj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.mh.j.At}T(){return this.id}getValue(a){return Ra(a,this.id,this.j)}};olympe.W.P={rg:'di.Container',SB:'di.PublicContainer'};olympe.W.U={Gu:'logging.di'};olympe.W.run([olympe.W.P.rg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.xj=(b,c)=>a.xj(b,c);olympe.Zd().getConfig=b=>a.getParameter(b);olympe.Zd().getConfigNames=()=>Object.keys(a.parameters);olympe.Zd().updateConfig=(b,c)=>a.xj(b,c)});olympe.V={};olympe.V.Bp=class{constructor(a){this.id=a||olympe.V.Bp.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.V.Bp.j=0;olympe.V.wB=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.V.yh=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.V.yh.D=function(a){return new olympe.V.yh(.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.V.yh.j=function(){return new olympe.V.yh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.yh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.yh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j($a(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function db(a){const b=new olympe.V.stream.yf;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}
255
+ (this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.tl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.Dl.j=0;olympe.W.ph=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Sa(a,this.id,c=>b.next(c))})}};function La(a){0<a.j&&a.j--}function C(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.W.Np=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.W.pa=class extends olympe.W.Bj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.ub=class extends olympe.W.Bj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.mh.j.At}T(){return this.id}getValue(a){return Ra(a,this.id,this.j)}};olympe.W.P={sg:'di.Container',SB:'di.PublicContainer'};olympe.W.U={Gu:'logging.di'};olympe.W.run([olympe.W.P.sg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.xj=(b,c)=>a.xj(b,c);olympe.Zd().getConfig=b=>a.getParameter(b);olympe.Zd().getConfigNames=()=>Object.keys(a.parameters);olympe.Zd().updateConfig=(b,c)=>a.xj(b,c)});olympe.V={};olympe.V.Bp=class{constructor(a){this.id=a||olympe.V.Bp.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.V.Bp.j=0;olympe.V.wB=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.V.yh=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.V.yh.D=function(a){return new olympe.V.yh(.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.V.yh.j=function(){return new olympe.V.yh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.yh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.yh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j($a(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function db(a){const b=new olympe.V.stream.yf;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}
256
256
  olympe.V.ll=class{D(){}j(){}J(a){return w(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.V.stream.yf){const b=[];for(const c=fa(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(){}};
257
257
  olympe.V.Ir=a=>a.replace('+','-').replace('/','_');olympe.V.Ew=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.J)}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}
258
258
  olympe.V.Bm=class{constructor(a,b=a/2){this.timeout=a;this.J=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}
@@ -292,18 +292,18 @@ olympe.V.HE=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void
292
292
  olympe.V.vs=a=>{var b=Ab,c=Bb;return w(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[l.slice(g.length)]=olympe.V.Jr(n);return h},{})}}).reduce((d,e,f)=>{olympe.V.xs(d,e,'version.json'===a[f]?'version.':'');
293
293
  return d},Object.create(null))})};olympe.V.Jr=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.V.xs=(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.V.xs(a[e],f,''):a[e]=f}};olympe.V.SD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}bn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.V.Ju=class{constructor(a,b){this.start=a;this.end=b}};olympe.V.Ju.j={kB:'left',bC:'right',Pz:'bottom',kD:'top'};function Cb(a){return`${a.j}.${a.D}.${a.F}`}
294
294
  olympe.V.Df=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.J=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.V.Df.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.V.Df.j:new olympe.V.Df(b,c,d,a[4])}Ok(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}vj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
295
- 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.J?`-${this.J}`:'')}};olympe.V.Df.j=new olympe.V.Df(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={pg:'utils.binaryConverter',Vs:'utils.base64Converter',$f:'utils.Profiler'};olympe.W.config(a=>{Xa(a,olympe.V.P.pg);Wa(a,olympe.V.P.Vs,olympe.V.P.pg,!0);D(a,olympe.V.P.$f,olympe.V.ov)},'Utils services');olympe.W.run([olympe.V.P.pg,olympe.V.P.$f],(a,b)=>{olympe.V.Ze=()=>a;olympe.Zd().isProfilerEnabled=()=>b.j;olympe.Zd().startProfiler=()=>b.start();olympe.Zd().stopProfiler=()=>b.stop();olympe.Zd().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ja={};olympe.ja.yb=class{la(){}J(){}F(){}j(){}fa(){}N(){}ua(){}$(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ja.yb.prototype.fatal=olympe.ja.yb.prototype.fatal;olympe.ja.yb.prototype.error=olympe.ja.yb.prototype.error;olympe.ja.yb.prototype.warn=olympe.ja.yb.prototype.warn;olympe.ja.yb.prototype.info=olympe.ja.yb.prototype.info;olympe.ja.yb.prototype.log=olympe.ja.yb.prototype.log;olympe.ja.yb.prototype.debug=olympe.ja.yb.prototype.debug;olympe.ja.yb.prototype.trace=olympe.ja.yb.prototype.trace;
295
+ 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.J?`-${this.J}`:'')}};olympe.V.Df.j=new olympe.V.Df(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={qg:'utils.binaryConverter',Vs:'utils.base64Converter',ag:'utils.Profiler'};olympe.W.config(a=>{Xa(a,olympe.V.P.qg);Wa(a,olympe.V.P.Vs,olympe.V.P.qg,!0);D(a,olympe.V.P.ag,olympe.V.ov)},'Utils services');olympe.W.run([olympe.V.P.qg,olympe.V.P.ag],(a,b)=>{olympe.V.Ze=()=>a;olympe.Zd().isProfilerEnabled=()=>b.j;olympe.Zd().startProfiler=()=>b.start();olympe.Zd().stopProfiler=()=>b.stop();olympe.Zd().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ja={};olympe.ja.yb=class{la(){}J(){}F(){}j(){}fa(){}N(){}ua(){}$(){}ba(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ja.yb.prototype.fatal=olympe.ja.yb.prototype.fatal;olympe.ja.yb.prototype.error=olympe.ja.yb.prototype.error;olympe.ja.yb.prototype.warn=olympe.ja.yb.prototype.warn;olympe.ja.yb.prototype.info=olympe.ja.yb.prototype.info;olympe.ja.yb.prototype.log=olympe.ja.yb.prototype.log;olympe.ja.yb.prototype.debug=olympe.ja.yb.prototype.debug;olympe.ja.yb.prototype.trace=olympe.ja.yb.prototype.trace;
296
296
  olympe.ja.yb.j={Yv:0,Uf:1,Fu:2,Uj:3,zr:4,zb:5,Dt:6,zB:7};olympe.ja.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ja.Ta=class{cd(){}};olympe.ja.pe={};function Db(a,b,c){a.Ga[b](`[OLYMPE.${a.Y}]:`,...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.Y,b,...c)}}
297
297
  olympe.ja.pe.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ja.yb.j.Uj:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ga=console}la(){return this.name}J(){return this.D}F(){return this.D<=olympe.ja.yb.j.Yv}j(){return this.D<=olympe.ja.yb.j.Uf}N(){return this.D<=olympe.ja.yb.j.Fu}fa(){return this.D<=olympe.ja.yb.j.Uj}ua(){return this.D<=olympe.ja.yb.j.zr}$(){return this.D<=olympe.ja.yb.j.zb}ba(){return this.D<=olympe.ja.yb.j.Dt}trace(...a){this.F()&&
298
- Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.fa()&&Db(this,'info',a)}warn(...a){this.ua()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.ba()&&Db(this,'error',a)}};olympe.ja.pe.yb.xa=[olympe.ja.yb];olympe.ja.pe.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.info('Logging initialized, global log level is '+olympe.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.et}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Kv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
299
- b=new olympe.ja.pe.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.pe.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={bp:'logging',cp:'logging.showLogLevel',et:'logging',Kv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.bp,olympe.ja.yb.j.Uj);F(a,olympe.ja.U.cp,!0);Va(a,olympe.ja.P.Da,olympe.ja.pe.Ta,olympe.W.P.rg,new olympe.W.pa(olympe.ja.U.bp),new olympe.W.pa(olympe.ja.U.cp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.$a=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={Tp:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.H=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static J(){var b=[];return void 0===b||0===b.length?olympe.C.H.$:new a(Gb,b)}J(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};olympe.C.H.Y=new olympe.C.H;olympe.C.H.j=new olympe.C.H(null,null);olympe.C.H.$=new olympe.C.H(Gb);olympe.C.H.F=new olympe.C.H(()=>olympe.C.aa);
300
- olympe.C.H.D=new olympe.C.H(()=>olympe.C.Sa);olympe.C.H.N=new olympe.C.H(()=>olympe.C.ea);olympe.C.H.R=new olympe.C.H(()=>olympe.C.Zb);olympe.C.qh=class{T(){return''}$c(){return''}destroy(){}eb(){return!1}rd(){return!1}run(a,...b){return a(...b)}F(a){return a}getParent(){return null}Gf(){}Ec(){}Kc(){}Fk(){}fa(){}onDestroy(){return''}Qf(){}Y(){return''}Wd(){}};olympe.C.qh.prototype.offDestroy=olympe.C.qh.prototype.Qf;olympe.C.qh.prototype.onDestroy=olympe.C.qh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.Tp)],()=>{});
301
- olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.gb=new Map;this.cb=new Map;this.Ga=new Map;this.$b=0;this.name=a;this.id=String(Hb);this.J=this.Bb=!1;(this.$=void 0===b?olympe.C.Va():b)&&this.$.Ec(this);this.debug=!1}T(){return this.id}$c(){return this.name}run(a,...b){if(!this.Bb){var c=olympe.C.Gs(this);a=a(...b);c&&olympe.C.Gs(c);return a}}F(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Bb&&!this.J){this.J=!0;this.fa();for(const a of this.cb.keys())this.cb.has(a)&&this.cb.get(a)();
302
- this.cb.clear();this.Ga.clear();this.$&&(this.$.Kc(this,!1),this.$=null);this.Bb=!0;this.J=!1;this.fa()}}eb(){return this.Bb}rd(){return this.J}Ec(a){if(!this.Bb){var b;olympe.C.ib(a)?b=a.Ba:olympe.C.ln(a)&&(b=a);b&&this.gb.set(b.T(),b)}}Kc(a,b=!0){let c;olympe.C.ib(a)?c=a.Ba:olympe.C.ln(a)&&(c=a);c&&this.gb.has(c.T())&&(b&&c.Fk(this),this.gb.delete(c.T()))}Fk(){this.$=null;this.destroy()}fa(){const a=this.gb;for(const b of a.keys())a.has(b)&&a.get(b).Fk(this);this.gb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
303
- this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.$b,b=String(this.$b));this.cb.set(b,a);return b}Qf(a){this.cb.delete(a)}Y(a){if(void 0===b){++this.$b;var b=String(this.$b)}this.Ga.set(b,a);return b}Wd(a){this.Ga.delete(a)}Gf(a){this.$&&this.$.Kc(this,!1);(this.$=a||null)&&this.$.Ec(this)}getParent(){return this.$}};olympe.C.Sq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Qf(){}};olympe.C.qh.xa=[olympe.C.qh];let Ib=0;
298
+ Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.fa()&&Db(this,'info',a)}warn(...a){this.ua()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.ba()&&Db(this,'error',a)}};olympe.ja.pe.yb.xa=[olympe.ja.yb];olympe.ja.pe.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.log('Logging initialized, global log level is '+olympe.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.et}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Kv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
299
+ b=new olympe.ja.pe.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.pe.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={bp:'logging',cp:'logging.showLogLevel',et:'logging',Kv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.bp,olympe.ja.yb.j.Uj);F(a,olympe.ja.U.cp,!0);Va(a,olympe.ja.P.Da,olympe.ja.pe.Ta,olympe.W.P.sg,new olympe.W.pa(olympe.ja.U.bp),new olympe.W.pa(olympe.ja.U.cp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.ab=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={Tp:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.H=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static J(){var b=[];return void 0===b||0===b.length?olympe.C.H.$:new a(Gb,b)}J(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};olympe.C.H.Y=new olympe.C.H;olympe.C.H.j=new olympe.C.H(null,null);olympe.C.H.$=new olympe.C.H(Gb);olympe.C.H.F=new olympe.C.H(()=>olympe.C.aa);
300
+ olympe.C.H.D=new olympe.C.H(()=>olympe.C.Sa);olympe.C.H.N=new olympe.C.H(()=>olympe.C.ea);olympe.C.H.R=new olympe.C.H(()=>olympe.C.Zb);olympe.C.qh=class{T(){return''}$c(){return''}destroy(){}hb(){return!1}td(){return!1}run(a,...b){return a(...b)}F(a){return a}getParent(){return null}Gf(){}Ec(){}Kc(){}Fk(){}fa(){}onDestroy(){return''}Qf(){}Y(){return''}Wd(){}};olympe.C.qh.prototype.offDestroy=olympe.C.qh.prototype.Qf;olympe.C.qh.prototype.onDestroy=olympe.C.qh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.Tp)],()=>{});
301
+ olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.fb=new Map;this.$a=new Map;this.Ga=new Map;this.$b=0;this.name=a;this.id=String(Hb);this.J=this.Bb=!1;(this.$=void 0===b?olympe.C.Xa():b)&&this.$.Ec(this);this.debug=!1}T(){return this.id}$c(){return this.name}run(a,...b){if(!this.Bb){var c=olympe.C.Gs(this);a=a(...b);c&&olympe.C.Gs(c);return a}}F(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Bb&&!this.J){this.J=!0;this.fa();for(const a of this.$a.keys())this.$a.has(a)&&this.$a.get(a)();
302
+ this.$a.clear();this.Ga.clear();this.$&&(this.$.Kc(this,!1),this.$=null);this.Bb=!0;this.J=!1;this.fa()}}hb(){return this.Bb}td(){return this.J}Ec(a){if(!this.Bb){var b;olympe.C.ib(a)?b=a.Ba:olympe.C.ln(a)&&(b=a);b&&this.fb.set(b.T(),b)}}Kc(a,b=!0){let c;olympe.C.ib(a)?c=a.Ba:olympe.C.ln(a)&&(c=a);c&&this.fb.has(c.T())&&(b&&c.Fk(this),this.fb.delete(c.T()))}Fk(){this.$=null;this.destroy()}fa(){const a=this.fb;for(const b of a.keys())a.has(b)&&a.get(b).Fk(this);this.fb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
303
+ this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.$b,b=String(this.$b));this.$a.set(b,a);return b}Qf(a){this.$a.delete(a)}Y(a){if(void 0===b){++this.$b;var b=String(this.$b)}this.Ga.set(b,a);return b}Wd(a){this.Ga.delete(a)}Gf(a){this.$&&this.$.Kc(this,!1);(this.$=a||null)&&this.$.Ec(this)}getParent(){return this.$}};olympe.C.Sq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Qf(){}};olympe.C.qh.xa=[olympe.C.qh];let Ib=0;
304
304
  function Jb(a,b){a.ba||(a.ba=new Map);a.ba.set(b.T(),b);switch(b.Hc()){case olympe.C.Node.j.zh:break;case olympe.C.Node.j.Lh:break;case olympe.C.Node.j.Yj:case olympe.C.Node.j.Vf:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.rh:Kb(a,olympe.C.Node.j.rh);break;case olympe.C.Node.j.OBSOLETE:a.rc=!0;a.j!==olympe.C.Node.j.rh&&Kb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Sd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
305
305
  default:olympe.C.G.warn('Unknown state, investigate: ',b.Hc())}Lb(b,a)}
306
- function Mb(a){if(a.Jc){var b=[],c=[];if(a.Rf)if(a.Rf instanceof olympe.C.Node)if(Nb(a.Rf))b=a.Rf.Fb;else return;else b=a.Rf;else b=null;if(null!==a.ua){const e=a.fg;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Nb(h))c.push(h.Fb);else return}else c.push(a.ua[f])}if(a.Jc instanceof Function)var d=a.Jc;else b&&(b[a.Jc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Jc),d=b[a.Jc]);a.run(()=>{a.fa();if(void 0!==d){const e=d.apply(b,c);e&&e.Dr?
306
+ function Mb(a){if(a.Jc){var b=[],c=[];if(a.Rf)if(a.Rf instanceof olympe.C.Node)if(Nb(a.Rf))b=a.Rf.Fb;else return;else b=a.Rf;else b=null;if(null!==a.ua){const e=a.gg;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Nb(h))c.push(h.Fb);else return}else c.push(a.ua[f])}if(a.Jc instanceof Function)var d=a.Jc;else b&&(b[a.Jc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Jc),d=b[a.Jc]);a.run(()=>{a.fa();if(void 0!==d){const e=d.apply(b,c);e&&e.Dr?
307
307
  Ob(a,e.Ba):e instanceof olympe.C.Node?Ob(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Kb(a,olympe.C.Node.j.Lh))}else Pb(a)})}}function M(a){void 0===a.Ub&&(a.Ub=a.valueType===olympe.C.Proxy?Qb(void 0,a.Vd):Qb(a.valueType,a.Vd),a.Ub.Ba=a);return a.Ub}function Rb(a){void 0!==a.N&&(Sb(a.N,a),a.N=void 0)}function Tb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.Lh,null!==a.R))for(const b of a.R.values())Ub(b)}function Kb(a,b){b!==a.j&&(a.j=b)}
308
308
  function Vb(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.Yj&&a.j!==olympe.C.Node.j.zh&&a.j!==olympe.C.Node.j.rh){Kb(a,olympe.C.Node.j.Yj);var b=a.R;if(b)for(const c of b.values())b.has(c.T())&&Vb(c);Kb(a,olympe.C.Node.j.OBSOLETE)}}function Wb(a,b,c){if(a.j!==olympe.C.Node.j.Vf)if(b===a.N)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.Yj)a.rc=!0;Mb(a)}}
309
309
  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.Fb);a.Eb||c||void 0===a.N||Rb(a);if(void 0!==b){if((a.Eb||a.j===olympe.C.Node.j.Lh||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.ib(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Tb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Ea&&a.Fb.Ea(b))){Tb(a);return}}if(!0===a.Eb)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
@@ -312,23 +312,23 @@ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&(
312
312
  function Xb(a,b){if(a.j!==olympe.C.Node.j.Vf&&a.j!==olympe.C.Node.j.Sd&&(a.j!==olympe.C.Node.j.zh||a.Jc)){var c=void 0!==a.defaultValue;a.Jc&&b!==a.N&&a.fa();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Kb(a,olympe.C.Node.j.zh),b=a.R)for(const d of b.values())Xb(d,a)}}function Pb(a){if(a.j!==olympe.C.Node.j.rh){Kb(a,olympe.C.Node.j.rh);var b=a.R;if(b)for(const c of b.values())Pb(c);a.fa();void 0!==a.N&&Rb(a);a.Fb=a.defaultValue}}function Nb(a){return a.j===olympe.C.Node.j.Lh}
313
313
  function Ob(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.N&&a.N!==b&&Rb(a),Lb(b,a),Nb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):Xb(a),a.N=b)}function Yb(a,b){a.Jc&&(a.Jc=void 0);a.ad='Repeater';Ob(a,b)}function Ub(a){a.N?Tb(a):null!==a.ba&&0===Array.from(a.ba.values()).filter(b=>!Nb(b)).length&&(a.rc&&(a.rc=!1,Mb(a)),Tb(a))}
314
314
  function Lb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);a.j===olympe.C.Node.j.Sd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Sb(a,b){a.R&&(b=b.T(),a.R.has(b)&&(a.R.delete(b),Zb(a)))}function Zb(a){if(null===a.getParent()){var b=a.R;b&&0<b.size||a.destroy()}}
315
- olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,iz:c=!0,Rf:d,gn:e,debug:f=!1,fg:g=null,ad:h='Node',$i:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.ua=e&&0<e.length?e:null;this.fg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Eb=!1;this.j=olympe.C.Node.j.zh;this.rc=!1;this.R=this.ba=null;this.Jc=b;this.Rf=d||null;this.defaultValue=this.Ub=this.N=void 0;this.$i=k;d&&d instanceof
316
- olympe.C.Node&&Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}jh(a){this.defaultValue=a;this.j===olympe.C.Node.j.zh&&L(this,a,!0);return this}bj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Va()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.j}eb(){return this.j===olympe.C.Node.j.Sd}rd(){return this.j===
315
+ olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,iz:c=!0,Rf:d,gn:e,debug:f=!1,gg:g=null,ad:h='Node',$i:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.ua=e&&0<e.length?e:null;this.gg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Eb=!1;this.j=olympe.C.Node.j.zh;this.rc=!1;this.R=this.ba=null;this.Jc=b;this.Rf=d||null;this.defaultValue=this.Ub=this.N=void 0;this.$i=k;d&&d instanceof
316
+ olympe.C.Node&&Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}jh(a){this.defaultValue=a;this.j===olympe.C.Node.j.zh&&L(this,a,!0);return this}bj(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.j}hb(){return this.j===olympe.C.Node.j.Sd}td(){return this.j===
317
317
  olympe.C.Node.j.Vf}Vd(...a){if(this.$i instanceof Function)return this.$i(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Hc();a!==olympe.C.Node.j.Vf&&a!==olympe.C.Node.j.Sd||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.ib(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.Tg&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.J(),
318
- Jc:c,Rf:this,gn:e,debug:!1,fg:b,ad:'Proxy.'+c+'()'}))}Fk(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.Gf(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Vf&&a!==olympe.C.Node.j.Sd){Kb(this,olympe.C.Node.j.Vf);if(a=this.R){for(const c of a.values())if(a.has(c.T())){var b=c;b.ba&&b.ba.delete(this.T());
319
- b.N&&b.N.T()===this.T()?b.N=void 0:b.destroy()}a.clear()}this.R=null;super.destroy();if(this.ba){for(const c of this.ba.values())this.ba.has(c.T())&&Sb(c,this);this.ba.clear()}this.ba=null;this.N&&(Sb(this.N,this),this.N=void 0);this.Fb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.fg&&(this.fg.length=0,this.fg=null);this.$i=this.Jc=void 0;this.defaultValue=this.Rf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Sd)}}$c(){return this.ad}print(){const a=this.Jc?this.Jc instanceof
318
+ Jc:c,Rf:this,gn:e,debug:!1,gg:b,ad:'Proxy.'+c+'()'}))}Fk(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.Gf(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Vf&&a!==olympe.C.Node.j.Sd){Kb(this,olympe.C.Node.j.Vf);if(a=this.R){for(const c of a.values())if(a.has(c.T())){var b=c;b.ba&&b.ba.delete(this.T());
319
+ b.N&&b.N.T()===this.T()?b.N=void 0:b.destroy()}a.clear()}this.R=null;super.destroy();if(this.ba){for(const c of this.ba.values())this.ba.has(c.T())&&Sb(c,this);this.ba.clear()}this.ba=null;this.N&&(Sb(this.N,this),this.N=void 0);this.Fb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.gg&&(this.gg.length=0,this.gg=null);this.$i=this.Jc=void 0;this.defaultValue=this.Rf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Sd)}}$c(){return this.ad}print(){const a=this.Jc?this.Jc instanceof
320
320
  Function?this.Jc.name?this.Jc.name:'()':this.Jc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={zh:0,Lh:1,rh:3,Yj:4,OBSOLETE:5,Vf:6,Sd:7};function Qb(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($b(c,a.prototype));c.Oh=a;c.Er=b;return c}function $b(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.km)||Object.defineProperty(b,olympe.C.Proxy.km,{enumerable:!1,configurable:!1,writable:!1,value:ac(a,b)});return b[olympe.C.Proxy.km]}
321
321
  function bc(a,b){if(a.Oh!==b){a.Oh=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=$b(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.bj(b)}}
322
322
  function ac(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create($b(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&&Nb(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.H.Y,c[d]=function(...f){f=this.Er.call(this.Ba,
323
323
  ...f,e,d);const g=e.Y;if(g){const h=this.Ba.Fb;h&&h[g]&&bc(f,h[g])}return e.R()?this:f})}});return c}function cc(a,b){L(a.Ba,b)}function dc(a){Xb(a.Ba)}function ec(a,b){Yb(a.Ba,olympe.C.Of(b)?b:b.Ba)}function fc(a,b){olympe.C.ib(b)||olympe.C.Of(b)?ec(a,b):cc(a,b)}
324
- olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Oh=a;this.Er=b}static ib(a){return!(!a||!a.Tg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Ed(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Dr(){return this.Ba}};olympe.C.Proxy.km='__opp__';olympe.C.Proxy.prototype.Tg=!0;function gc(a,b){a.node.jh(b);return a}olympe.C.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.ib(a)?L(this.node,olympe.C.Pa(a)):L(this.node,a);return this}repeat(a){Yb(this.node,olympe.C.ib(a)?a.Ba:a);return this}clear(){Xb(this.node);return this}rb(){return M(this.node)}getContext(){return this.node}};function hc(a,b,c=1E3,d,e){const f=olympe.C.cc(olympe.C.aa),g=d||olympe.C.aa.Go.Lp;let h,k,l,n;f.update(olympe.C.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().eb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.rb()}
324
+ olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Oh=a;this.Er=b}static ib(a){return!(!a||!a.Tg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Fd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Dr(){return this.Ba}};olympe.C.Proxy.km='__opp__';olympe.C.Proxy.prototype.Tg=!0;function gc(a,b){a.node.jh(b);return a}olympe.C.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.ib(a)?L(this.node,olympe.C.Pa(a)):L(this.node,a);return this}repeat(a){Yb(this.node,olympe.C.ib(a)?a.Ba:a);return this}clear(){Xb(this.node);return this}rb(){return M(this.node)}getContext(){return this.node}};function hc(a,b,c=1E3,d,e){const f=olympe.C.cc(olympe.C.aa),g=d||olympe.C.aa.Go.Lp;let h,k,l,n;f.update(olympe.C.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().hb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.rb()}
325
325
  olympe.C.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.ra(b.value)}Bn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Rb(!this.Bn())}Uc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.xb(''):olympe.C.xb(this.value.toString())}toString(a,b){return void 0!==
326
- 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.Bn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.cc(olympe.C.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.ra(c))};a.forEach((f,g)=>{olympe.C.Sc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().eb()){var g=b.get(f);b.delete(f);
326
+ 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.Bn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.cc(olympe.C.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.ra(c))};a.forEach((f,g)=>{olympe.C.Sc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().hb()){var g=b.get(f);b.delete(f);
327
327
  g===c&&e()}});return d.rb()}be(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}hh(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()-c.valueOf()),olympe.C.aa,'ONumber.minus')}round(){return olympe.C.ra(Math.round(this.valueOf()))}wj(){return olympe.C.ra(-this.valueOf())}Tk(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}ej(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
328
- c.valueOf()),olympe.C.aa,'ONumber.div')}My(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()%c.valueOf()),olympe.C.aa,'ONumber.div')}floor(){return olympe.C.ra(Math.floor(this.valueOf()))}ceil(){return olympe.C.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.C.ra(Math.trunc(this.valueOf()))}log(){return olympe.C.ra(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.C.aa,'ONumber.pow')}exp(){return olympe.C.ra(Math.exp(this.valueOf()))}Ed(a){return olympe.C.ta([this,
328
+ c.valueOf()),olympe.C.aa,'ONumber.div')}My(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()%c.valueOf()),olympe.C.aa,'ONumber.div')}floor(){return olympe.C.ra(Math.floor(this.valueOf()))}ceil(){return olympe.C.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.C.ra(Math.trunc(this.valueOf()))}log(){return olympe.C.ra(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.C.aa,'ONumber.pow')}exp(){return olympe.C.ra(Math.exp(this.valueOf()))}Fd(a){return olympe.C.ta([this,
329
329
  a],(b,c)=>olympe.C.Rb(b.Ea(c)),olympe.C.ea,'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}Vx(){return this.valueOf()}kn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isBiggerThan')}mz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}Cs(a){return olympe.C.ta([this,
330
330
  a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}Dy(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isSmallerThan')}sin(){return olympe.C.ra(Math.sin(this.valueOf()))}cos(){return olympe.C.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.C.ib(a)?olympe.C.re([a],b=>olympe.C.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.aa):olympe.C.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.ra(Math.abs(this.valueOf()))}qj(a,
331
- b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.re([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static rw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ae(a));'number'===typeof b&&(b=olympe.C.ae(b));'number'===typeof c&&(c=olympe.C.ae(c));let e=0;const f=olympe.C.ae(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.oj(b.kn(c),()=>{olympe.ja.$a('df').warn('You have a min bigger than max, cap your inputs')});
331
+ b){return olympe.C.ib(a)||olympe.C.ib(b)?olympe.C.re([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static rw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ae(a));'number'===typeof b&&(b=olympe.C.ae(b));'number'===typeof c&&(c=olympe.C.ae(c));let e=0;const f=olympe.C.ae(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.oj(b.kn(c),()=>{olympe.ja.ab('df').warn('You have a min bigger than max, cap your inputs')});
332
332
  const k=(l,n)=>{n=olympe.C.ae(n);const p=olympe.C.aa.animate(n,500);ec(f,p);cc(n,olympe.C.ra(l));e=l};olympe.C.re([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ec(f,olympe.C.ae(e))},olympe.C.aa);void 0!==b&&olympe.C.nn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.ae(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ba,l);e=g;ec(f,p)}});void 0!==c&&olympe.C.nn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.ae(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ba,l);e=h;ec(f,
333
333
  p)}});return f}static offset(a){let b;return olympe.C.re([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Rr(a){let b,c,d;return olympe.C.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.ra(0);d=window.performance.now();const f=olympe.C.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.aa,'derivative')}static vy(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
334
334
  e=window.performance.now();b=b.be((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static Xw(a){let b;return olympe.C.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.C.aa,'diff')}static Mw(a,b,c){return olympe.C.re([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.ra(d>=e?d<=f?d:f:e)},olympe.C.aa)}static animate(a,b,c,d){let e;
@@ -343,26 +343,26 @@ FA: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
343
343
  c*(2*d*d+2*d*a+-3*d)},tA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},uA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},QA: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)},PA: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)},zA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},yA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},MA:function(a,
344
344
  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},vA: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.aa.prototype;m.toJSON.K=olympe.C.H.j;m.Bn.K=olympe.C.H.j;m.isNaN.K=olympe.C.H.N;m.Uc.K=olympe.C.H.D;
345
345
  m.toString.K=new olympe.C.H(()=>String,[]);m.toFixed.K=new olympe.C.H(()=>String,[]);m.be.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.hh.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.round.K=olympe.C.H.F;m.wj.K=olympe.C.H.F;m.Tk.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.ej.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.My.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.floor.K=olympe.C.H.F;m.ceil.K=olympe.C.H.F;m.trunc.K=olympe.C.H.F;m.log.K=olympe.C.H.F;m.pow.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.exp.K=olympe.C.H.F;
346
- m.Ed.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Vx.K=olympe.C.H.j;m.kn.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.mz.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Cs.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Dy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.sin.K=olympe.C.H.F;m.cos.K=olympe.C.H.F;m.atan2.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.abs.K=olympe.C.H.F;m.qj.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Nr(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.xb(d)},olympe.C.Sa,'OString.concat')}Uc(){return this}Az(a){return olympe.C.ra(parseInt(this.value,
347
- a))}Is(){return olympe.C.ra(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())}Ed(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ea,'OString.oEquals')}cf(){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())),
346
+ m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Vx.K=olympe.C.H.j;m.kn.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.mz.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Cs.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.Dy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.sin.K=olympe.C.H.F;m.cos.K=olympe.C.H.F;m.atan2.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.abs.K=olympe.C.H.F;m.qj.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Nr(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.xb(d)},olympe.C.Sa,'OString.concat')}Uc(){return this}Az(a){return olympe.C.ra(parseInt(this.value,
347
+ a))}Is(){return olympe.C.ra(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())}Fd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Rb(c&&b.valueOf()===c.valueOf()),olympe.C.ea,'OString.oEquals')}cf(){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())),
348
348
  olympe.C.ea,'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.ea,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.bn().valueOf()+e.valueOf()+1;return olympe.C.Rb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ea,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
349
349
  olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.aa,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}bn(){return olympe.C.ra(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.xb(this.value.toLowerCase())}toUpperCase(){return olympe.C.xb(this.value.toUpperCase())}trim(){return olympe.C.xb(this.value.trim())}padStart(a,
350
350
  b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(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.xb(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.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}wz(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
351
- e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.Nv=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.H.j;m.Nr.K=new olympe.C.H(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.Az.K=olympe.C.H.F;m.Is.K=olympe.C.H.F;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Ed.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.cf.K=olympe.C.H.N;
351
+ e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.Nv=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.H.j;m.Nr.K=new olympe.C.H(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.Az.K=olympe.C.H.F;m.Is.K=olympe.C.H.F;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.cf.K=olympe.C.H.N;
352
352
  m.contains.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.startsWith.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.endsWith.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.indexOf.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.lastIndexOf.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.slice.K=new olympe.C.H(()=>olympe.C.Sa,[0,1]);m.bn.K=olympe.C.H.F;m.threshold.K=new olympe.C.H(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.H.D;m.toUpperCase.K=olympe.C.H.D;m.trim.K=olympe.C.H.D;m.padStart.K=olympe.C.H.D;m.padEnd.K=olympe.C.H.D;
353
- m.replace.K=olympe.C.H.D;m.wz.K=olympe.C.H.D;olympe.C.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ea.D:olympe.C.ea.j}and(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()&&b.valueOf()),olympe.C.ea,'and'):this.value&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Ed(a){if(void 0!==a)return olympe.C.ib(a)?
354
- olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()===b.valueOf()),olympe.C.ea,'oEquals'):this.Ea(a)?olympe.C.ea.D:olympe.C.ea.j}sd(){return this.value?olympe.C.ea.j:olympe.C.ea.D}Bw(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(!(this.valueOf()&&b.valueOf())),olympe.C.ea,'andNot'):this.value&&!a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}or(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()||b.valueOf()),olympe.C.ea,'or'):this.value||a.valueOf()?
353
+ m.replace.K=olympe.C.H.D;m.wz.K=olympe.C.H.D;olympe.C.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ea.D:olympe.C.ea.j}and(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()&&b.valueOf()),olympe.C.ea,'and'):this.value&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Fd(a){if(void 0!==a)return olympe.C.ib(a)?
354
+ olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()===b.valueOf()),olympe.C.ea,'oEquals'):this.Ea(a)?olympe.C.ea.D:olympe.C.ea.j}ud(){return this.value?olympe.C.ea.j:olympe.C.ea.D}Bw(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(!(this.valueOf()&&b.valueOf())),olympe.C.ea,'andNot'):this.value&&!a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}or(a){if(void 0!==a)return olympe.C.ib(a)?olympe.C.re([a],b=>new olympe.C.ea(this.valueOf()||b.valueOf()),olympe.C.ea,'or'):this.value||a.valueOf()?
355
355
  olympe.C.ea.D:olympe.C.ea.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.ea,'OBoolean.xor')}nx(){return this.value}js(){return!0===this.value?olympe.C.aa.ONE:olympe.C.aa.ZERO}Uc(){return olympe.C.xb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ea.D=new olympe.C.ea(!0);olympe.C.ea.j=new olympe.C.ea(!1);m=olympe.C.ea.prototype;m.toJSON.K=olympe.C.H.j;
356
- m.and.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.Ed.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.sd.K=olympe.C.H.N;m.Bw.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.or.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.xor.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.nx.K=new olympe.C.H(()=>Boolean,[]);m.js.K=olympe.C.H.F;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;function ic(a){return new olympe.C.fb(new Date(a))}
357
- olympe.C.fb=class{constructor(a){this.qb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.qb.toJSON()+'" }'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.fb(new Date(b.value.valueOf()))}static now(){return new olympe.C.fb(new Date)}Dp(){return this.qb&&!isNaN(this.qb.getTime())?olympe.C.ea.D:olympe.C.ea.j}bu(){return olympe.C.ra(this.qb.getMilliseconds())}du(){return olympe.C.ra(this.qb.getSeconds())}cu(){return olympe.C.ra(this.qb.getMinutes())}au(){return olympe.C.ra(this.qb.getHours())}Bx(){return olympe.C.ra(this.qb.getDate())}getMonth(){return olympe.C.ra(this.qb.getMonth()+1)}eu(){return olympe.C.ra(this.qb.getFullYear())}getTime(){return this.qb.getTime()}sz(){var a=
356
+ m.and.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.H.j;m.Fd.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.ud.K=olympe.C.H.N;m.Bw.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.or.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.xor.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.nx.K=new olympe.C.H(()=>Boolean,[]);m.js.K=olympe.C.H.F;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.valueOf.K=olympe.C.H.j;function ic(a){return new olympe.C.eb(new Date(a))}
357
+ olympe.C.eb=class{constructor(a){this.qb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.qb.toJSON()+'" }'}static Ob(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)}Dp(){return this.qb&&!isNaN(this.qb.getTime())?olympe.C.ea.D:olympe.C.ea.j}bu(){return olympe.C.ra(this.qb.getMilliseconds())}du(){return olympe.C.ra(this.qb.getSeconds())}cu(){return olympe.C.ra(this.qb.getMinutes())}au(){return olympe.C.ra(this.qb.getHours())}Bx(){return olympe.C.ra(this.qb.getDate())}getMonth(){return olympe.C.ra(this.qb.getMonth()+1)}eu(){return olympe.C.ra(this.qb.getFullYear())}getTime(){return this.qb.getTime()}sz(){var a=
358
358
  olympe.C,b=a.xb;var c=this.qb.getDate();c=10>c?'0'+c:c;var d=this.qb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.qb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleDateString(c.valueOf())),
359
- olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Uc(){return olympe.C.xb(this.qb.toISOString())}xz(){return new Date(this.getTime())}zz(){return this}Bz(){return this}eg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.fb(new Date(this.qb.getTime()));d.qb['set'+a](this.qb['get'+a]()+c.valueOf());return d},olympe.C.fb)}tw(a){return this.eg('Milliseconds',
360
- a)}yw(a){return this.eg('Seconds',a)}uw(a){return this.eg('Minutes',a)}sw(a){return this.eg('Hours',a)}Km(a){return this.eg('Date',a)}zw(a){return'number'===typeof a?this.Km(7*a):this.Km(a.Tk(7))}vw(a){return this.eg('Month',a)}Aw(a){return this.eg('FullYear',a)}uz(){let a=this.qb.getDay();a=0===a?6:a-1;return new olympe.C.fb(new Date(this.qb.getFullYear(),this.qb.getMonth(),this.qb.getDate()-a))}vz(){return new olympe.C.fb(new Date(this.qb.getFullYear(),this.qb.getMonth()))}Ed(a){return olympe.C.ta([a],
361
- b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ea(a){return a instanceof olympe.C.fb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Nx(){let a=this.qb.getDay();0===a&&(a=7);return olympe.C.ra(a)}Fx(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.qb.getFullYear()-c.qb.getFullYear():'months'===d?c=12*(this.qb.getFullYear()-c.qb.getFullYear())+(this.qb.getMonth()-c.qb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
362
- void 0===d&&(olympe.ja.$a('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.qb.getTime()-c.qb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}yy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ea)}wy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ea)}zy(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ea)}valueOf(){return this.Dp().valueOf()?
363
- new Date(this.getTime()):new Date(0)}};olympe.C.fb.j=ic(0);olympe.C.fb.D=ic(Number.NaN);m=olympe.C.fb.prototype;m.Dp.K=olympe.C.H.N;m.bu.K=olympe.C.H.F;m.du.K=olympe.C.H.F;m.cu.K=olympe.C.H.F;m.au.K=olympe.C.H.F;m.Bx.K=olympe.C.H.F;m.getMonth.K=olympe.C.H.F;m.eu.K=olympe.C.H.F;m.getTime.K=olympe.C.H.j;m.sz.K=new olympe.C.H(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.H.D;m.toLocaleDateString.K=olympe.C.H.D;m.toLocaleTimeString.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.xz.K=olympe.C.H.j;
364
- m.zz.K=new olympe.C.H(()=>olympe.C.fb,[]);m.Bz.K=new olympe.C.H(()=>olympe.C.fb,[]);m.eg.K=new olympe.C.H(()=>olympe.C.fb,[]);m.tw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.yw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.uw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.sw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.Km.K=new olympe.C.H(()=>olympe.C.fb,[0]);m.zw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.vw.K=new olympe.C.H(()=>olympe.C.fb,[]);m.Aw.K=new olympe.C.H(()=>olympe.C.fb,[0]);
365
- m.uz.K=new olympe.C.H(()=>olympe.C.fb,[]);m.vz.K=new olympe.C.H(()=>olympe.C.fb,[]);m.Ed.K=olympe.C.H.N;m.Ea.K=olympe.C.H.j;m.Nx.K=olympe.C.H.F;m.Fx.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.yy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.wy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.zy.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.valueOf.K=olympe.C.H.j;const jc=new Map,kc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,lc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function mc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=lc.exec(c)):(d=1,c=kc.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.df(a)?olympe.C.re([a],b,olympe.C.Color):b(a)}
359
+ olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Uc(){return olympe.C.xb(this.qb.toISOString())}xz(){return new Date(this.getTime())}zz(){return this}Bz(){return this}fg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.qb.getTime()));d.qb['set'+a](this.qb['get'+a]()+c.valueOf());return d},olympe.C.eb)}tw(a){return this.fg('Milliseconds',
360
+ a)}yw(a){return this.fg('Seconds',a)}uw(a){return this.fg('Minutes',a)}sw(a){return this.fg('Hours',a)}Km(a){return this.fg('Date',a)}zw(a){return'number'===typeof a?this.Km(7*a):this.Km(a.Tk(7))}vw(a){return this.fg('Month',a)}Aw(a){return this.fg('FullYear',a)}uz(){let a=this.qb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth(),this.qb.getDate()-a))}vz(){return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth()))}Fd(a){return olympe.C.ta([a],
361
+ b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Nx(){let a=this.qb.getDay();0===a&&(a=7);return olympe.C.ra(a)}Fx(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.qb.getFullYear()-c.qb.getFullYear():'months'===d?c=12*(this.qb.getFullYear()-c.qb.getFullYear())+(this.qb.getMonth()-c.qb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
362
+ void 0===d&&(olympe.ja.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.qb.getTime()-c.qb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}yy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()<b.getTime()),olympe.C.ea)}wy(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.getTime()>b.getTime()),olympe.C.ea)}zy(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Rb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ea)}valueOf(){return this.Dp().valueOf()?
363
+ new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=ic(0);olympe.C.eb.D=ic(Number.NaN);m=olympe.C.eb.prototype;m.Dp.K=olympe.C.H.N;m.bu.K=olympe.C.H.F;m.du.K=olympe.C.H.F;m.cu.K=olympe.C.H.F;m.au.K=olympe.C.H.F;m.Bx.K=olympe.C.H.F;m.getMonth.K=olympe.C.H.F;m.eu.K=olympe.C.H.F;m.getTime.K=olympe.C.H.j;m.sz.K=new olympe.C.H(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.H.D;m.toLocaleDateString.K=olympe.C.H.D;m.toLocaleTimeString.K=olympe.C.H.D;m.Uc.K=olympe.C.H.D;m.xz.K=olympe.C.H.j;
364
+ m.zz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Bz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.fg.K=new olympe.C.H(()=>olympe.C.eb,[]);m.tw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.yw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.uw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.sw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Km.K=new olympe.C.H(()=>olympe.C.eb,[0]);m.zw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.vw.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Aw.K=new olympe.C.H(()=>olympe.C.eb,[0]);
365
+ m.uz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.vz.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Fd.K=olympe.C.H.N;m.Ea.K=olympe.C.H.j;m.Nx.K=olympe.C.H.F;m.Fx.K=new olympe.C.H(()=>olympe.C.aa,[0,1]);m.yy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.wy.K=new olympe.C.H(()=>olympe.C.ea,[0]);m.zy.K=new olympe.C.H(()=>olympe.C.ea,[0,1]);m.valueOf.K=olympe.C.H.j;const jc=new Map,kc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,lc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function mc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=lc.exec(c)):(d=1,c=kc.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.df(a)?olympe.C.re([a],b,olympe.C.Color):b(a)}
366
366
  olympe.C.Color=class{constructor(a,b,c,d){this.j=olympe.C.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.D=olympe.C.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.C.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.C.ra(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 Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
367
367
  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.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of jc.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)}ah(){return this.j}Vg(){return this.b}Yg(){return this.D}Ug(){return this.a}Fw(a,
368
368
  b){return olympe.C.Color.create(this.j.qj(a.ah(),b),this.D.qj(a.Yg(),b),this.b.qj(a.Vg(),b),this.a.qj(a.Ug(),b))}gx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}Js(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}zn(){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.zn()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
@@ -372,274 +372,275 @@ m.gx.K=new olympe.C.H(()=>olympe.C.Color,[]);m.Js.K=new olympe.C.H(()=>String,[]
372
372
  olympe.C.Zb,'Vector2.plus')}hh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.hh(c.x),b.y.hh(c.y)),olympe.C.Zb,'Vector2.minus')}Oy(a){return new olympe.C.Zb(this.x.Tk(a),this.y.Tk(a))}Zw(a){return new olympe.C.Zb(this.x.ej(a),this.y.ej(a))}Qy(){return new olympe.C.Zb(this.x.wj(),this.y.wj())}$w(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
373
373
  a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}ww(a){return new olympe.C.Zb(this.x.be(a),
374
374
  this.y.be(a))}xw(a,b){return new olympe.C.Zb(this.x.be(a),this.y.be(b))}Uc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.H.j;m.fu.K=olympe.C.H.F;m.qz.K=olympe.C.H.j;m.gu.K=olympe.C.H.F;m.rz.K=olympe.C.H.j;m.iy.K=olympe.C.H.F;m.be.K=new olympe.C.H(()=>olympe.C.Zb,[0]);
375
- m.hh.K=new olympe.C.H(()=>olympe.C.Zb,[0]);m.Oy.K=olympe.C.H.R;m.Zw.K=olympe.C.H.R;m.Qy.K=olympe.C.H.R;m.$w.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.length.K=olympe.C.H.F;m.normalize.K=olympe.C.H.R;m.floor.K=olympe.C.H.R;m.ceil.K=olympe.C.H.R;m.round.K=olympe.C.H.R;m.ww.K=olympe.C.H.R;m.xw.K=olympe.C.H.R;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;olympe.C.wg=class{constructor(){}Mb(){}Ld(){}get(){}ai(){}has(){}eh(){}Gc(){}Lf(){}sf(){}ig(){}forEach(){}ie(){}};olympe.C.wg.prototype.forEachCurrentValue=olympe.C.wg.prototype.ie;olympe.C.wg.prototype.forEach=olympe.C.wg.prototype.forEach;m=olympe.C.wg.prototype;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.ig.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;olympe.C.od=class extends olympe.C.wg{Bd(){}Kf(){}bf(){}Jf(){}je(){}af(){}fj(){}ci(){}};olympe.C.od.prototype.getCurrentAt=olympe.C.od.prototype.af;olympe.C.od.prototype.getAt=olympe.C.od.prototype.je;olympe.C.od.prototype.getCurrentKeyAt=olympe.C.od.prototype.Jf;olympe.C.od.prototype.getKeyAt=olympe.C.od.prototype.bf;olympe.C.od.prototype.getCurrentRank=olympe.C.od.prototype.Kf;olympe.C.od.prototype.getRank=olympe.C.od.prototype.Bd;m=olympe.C.od.prototype;m.Bd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
376
- m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>Object,[]);m.af.K=olympe.C.H.j;m.fj.K=olympe.C.H.j;m.ci.K=new olympe.C.H(()=>Array,[]);olympe.C.ji=class{constructor(a,b){this.N=b||olympe.C.Va();this.valueType=a||Object;this.values={};this.gb=this.ua=null;this.Wd=0;this.Y=Object.create(null);this.Bb=Object.create(null);this.size=0;this.J=null;this.N.onDestroy(()=>{const c=this.Y;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.N}Mb(){return this.valueType}Ld(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
377
- c)&&bc(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.jj(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}ai(a){a=this.values[a];return olympe.C.ib(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.gb&&(this.gb={});return this.jj(this.gb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}eh(a){return a in this.values}jj(a,b,c,d,e){let f=a[b];
378
- f||this.N.run(()=>{f=olympe.C.Qd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.ib(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Lf(){throw Error('Abstract method getFirstKey needs to be overridden');}sf(){null===this.J&&this.N.run(()=>{this.J=olympe.C.Qd(olympe.C.aa,olympe.C.ra(this.size));this.J.Ba.onDestroy(()=>{this.J=null})});return this.J}ig(){return this.size}forEach(a,b){const c=this.Gm();a=this.Fr(c,a,b);this.Fm(c,a)}Gm(){return String(++this.Wd)}Fm(a,
379
- b){this.Bb[a]=b;olympe.C.Va().Y(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Bb[a]});this.ie(b)}Fr(a,b,c){const d=olympe.C.Va();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.Jm(a,f,g)})}}Jm(a,b,c){void 0===this.Y[b]&&(this.Y[b]={});this.Y[b][a]=c}ie(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
380
- a(b[c],c,this))break}Bk(a,b){void 0!==this.values[a]&&this.Zi(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?ec(c[a],b):cc(c[a],b));c=this.gb;null!==c&&void 0!==c[a]&&fc(c[a],!0);this.size++;c=this.Bb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Zi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Tg?d.Ba.Fb:d;var e=this.ua;null!==e&&void 0!==e[a]&&dc(e[a]);e=this.gb;null!==e&&void 0!==
381
- e[a]&&fc(e[a],!1);delete c[a];this.size--;b||this.Ef()}a=this.Y[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Ef(){null!==this.J&&fc(this.J,this.size)}Qh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&dc(a[c]);a=this.gb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&fc(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.Y)if(Object.prototype.hasOwnProperty.call(this.Y,
382
- c)){b=this.Y[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&fc(this.J,this.size)}Ag(){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.ji.xa=[olympe.C.wg];m=olympe.C.ji.prototype;m.getContext.K=olympe.C.H.j;m.Mb.K=olympe.C.H.j;m.Ld.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>Object,[],'valueType');m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.jj.K=olympe.C.H.j;
383
- m.sf.K=olympe.C.H.F;m.ig.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.Gm.K=olympe.C.H.j;m.Fm.K=olympe.C.H.j;m.Fr.K=olympe.C.H.j;m.Jm.K=olympe.C.H.j;m.ie.K=olympe.C.H.j;m.Bk.K=olympe.C.H.j;m.Zi.K=olympe.C.H.j;m.Ef.K=olympe.C.H.j;m.Qh.K=olympe.C.H.j;m.Ag.K=olympe.C.H.j;olympe.C.Aj=class extends olympe.C.ji{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.fa=this.Ga=this.cb=this.ba=null}Ld(a){super.Ld(a);if(null!==this.fa)for(let b of this.fa.values())bc(b,a)}Gc(){return this.je(0)}Lf(){return this.bf(0)}Bd(a){const b=c=>{null===this.cb&&(this.cb=Object.create(null));let d=this.Kf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.jj(this.cb,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.ib(a)?M(olympe.C.createNode(olympe.C.aa,b,null,
384
- [a.Ba],[0],'onResolved('+(b.name||'')+')')):b(a)}Kf(a){return this.D[a]}bf(a){const b=c=>{const d=c.valueOf(),e=this.Jf(d);null===this.Ga&&(this.Ga=Object.create(null));return this.jj(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Jf(a){return this.j[a.valueOf()]}je(a){if(olympe.C.ib(a))return this.get(olympe.C.ta([a],c=>{c=this.bf(c);if(!Nb(c.Ba)){const d=olympe.C.Va();olympe.C.Of(d)&&Xb(d)}return c},String));null===this.fa&&(this.fa=new Map);let b=this.fa.get(a);
385
- b||this.N.run(()=>{b=this.get(this.bf(a));this.fa.set(a,b);b.Ba.onDestroy(()=>this.fa.delete(a))});return b}af(a){return this.ai(this.Jf(a))}fj(a,b,c,d){let e=this.Gm();a=this.ws(e,a,b,c,d);this.Fm(e,a)}ws(a,b,c,d,e){return olympe.C.Va().F((f,g)=>{let h=!1,k=olympe.C.hi([b,c,this.Bd(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.Jm(a,g,k)})}ci(){null===this.ba&&this.N.run(()=>{this.ba=olympe.C.Qd(Array,this.j.filter(a=>void 0!==a));
386
- this.ba.Ba.onDestroy(()=>{this.J=null})});return this.ba}ie(a){if(this.j.length!==this.size)super.ie(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}}Im(a,b){const c=this.cb,d=this.Ga,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&dc(c[g]),void 0!==
387
- c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Hm(a){var b=this.Ga,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.cb;null!==c&&void 0!==c[a]&&dc(c[a])}Gr(){if(null!==this.ba){const a=this.j,b=this.ba.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.ba,a)}}Ef(){this.Gr();super.Ef()}Qh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.cb;if(null!==
388
- a)for(b in a)dc(a[b]);a=this.Ga;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.ba;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.ji.prototype.Qh.call(this)}Ag(){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.Aj.xa=[olympe.C.od];m=olympe.C.Aj.prototype;m.Ld.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.Bd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
375
+ m.hh.K=new olympe.C.H(()=>olympe.C.Zb,[0]);m.Oy.K=olympe.C.H.R;m.Zw.K=olympe.C.H.R;m.Qy.K=olympe.C.H.R;m.$w.K=new olympe.C.H(()=>olympe.C.aa,[0]);m.length.K=olympe.C.H.F;m.normalize.K=olympe.C.H.R;m.floor.K=olympe.C.H.R;m.ceil.K=olympe.C.H.R;m.round.K=olympe.C.H.R;m.ww.K=olympe.C.H.R;m.xw.K=olympe.C.H.R;m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;olympe.C.xg=class{constructor(){}Mb(){}Ld(){}get(){}ai(){}has(){}eh(){}Gc(){}Lf(){}sf(){}jg(){}forEach(){}ie(){}};olympe.C.xg.prototype.forEachCurrentValue=olympe.C.xg.prototype.ie;olympe.C.xg.prototype.forEach=olympe.C.xg.prototype.forEach;m=olympe.C.xg.prototype;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;olympe.C.qd=class extends olympe.C.xg{Cd(){}Kf(){}bf(){}Jf(){}je(){}af(){}fj(){}ci(){}};olympe.C.qd.prototype.getCurrentAt=olympe.C.qd.prototype.af;olympe.C.qd.prototype.getAt=olympe.C.qd.prototype.je;olympe.C.qd.prototype.getCurrentKeyAt=olympe.C.qd.prototype.Jf;olympe.C.qd.prototype.getKeyAt=olympe.C.qd.prototype.bf;olympe.C.qd.prototype.getCurrentRank=olympe.C.qd.prototype.Kf;olympe.C.qd.prototype.getRank=olympe.C.qd.prototype.Cd;m=olympe.C.qd.prototype;m.Cd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
376
+ m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>Object,[]);m.af.K=olympe.C.H.j;m.fj.K=olympe.C.H.j;m.ci.K=new olympe.C.H(()=>Array,[]);olympe.C.ji=class{constructor(a,b){this.N=b||olympe.C.Xa();this.valueType=a||Object;this.values={};this.fb=this.ua=null;this.Wd=0;this.Y=Object.create(null);this.Bb=Object.create(null);this.size=0;this.J=null;this.N.onDestroy(()=>{const c=this.Y;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.N}Mb(){return this.valueType}Ld(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
377
+ c)&&bc(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.jj(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}ai(a){a=this.values[a];return olympe.C.ib(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.fb&&(this.fb={});return this.jj(this.fb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}eh(a){return a in this.values}jj(a,b,c,d,e){let f=a[b];
378
+ f||this.N.run(()=>{f=olympe.C.Qd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.ib(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Lf(){throw Error('Abstract method getFirstKey needs to be overridden');}sf(){null===this.J&&this.N.run(()=>{this.J=olympe.C.Qd(olympe.C.aa,olympe.C.ra(this.size));this.J.Ba.onDestroy(()=>{this.J=null})});return this.J}jg(){return this.size}forEach(a,b){const c=this.Gm();a=this.Fr(c,a,b);this.Fm(c,a)}Gm(){return String(++this.Wd)}Fm(a,
379
+ b){this.Bb[a]=b;olympe.C.Xa().Y(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Bb[a]});this.ie(b)}Fr(a,b,c){const d=olympe.C.Xa();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.Jm(a,f,g)})}}Jm(a,b,c){void 0===this.Y[b]&&(this.Y[b]={});this.Y[b][a]=c}ie(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
380
+ a(b[c],c,this))break}Bk(a,b){void 0!==this.values[a]&&this.Zi(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?ec(c[a],b):cc(c[a],b));c=this.fb;null!==c&&void 0!==c[a]&&fc(c[a],!0);this.size++;c=this.Bb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Zi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Tg?d.Ba.Fb:d;var e=this.ua;null!==e&&void 0!==e[a]&&dc(e[a]);e=this.fb;null!==e&&void 0!==
381
+ e[a]&&fc(e[a],!1);delete c[a];this.size--;b||this.Ef()}a=this.Y[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Ef(){null!==this.J&&fc(this.J,this.size)}Qh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&dc(a[c]);a=this.fb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&fc(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.Y)if(Object.prototype.hasOwnProperty.call(this.Y,
382
+ c)){b=this.Y[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&fc(this.J,this.size)}Ag(){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.ji.xa=[olympe.C.xg];m=olympe.C.ji.prototype;m.getContext.K=olympe.C.H.j;m.Mb.K=olympe.C.H.j;m.Ld.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>Object,[],'valueType');m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.jj.K=olympe.C.H.j;
383
+ m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.Gm.K=olympe.C.H.j;m.Fm.K=olympe.C.H.j;m.Fr.K=olympe.C.H.j;m.Jm.K=olympe.C.H.j;m.ie.K=olympe.C.H.j;m.Bk.K=olympe.C.H.j;m.Zi.K=olympe.C.H.j;m.Ef.K=olympe.C.H.j;m.Qh.K=olympe.C.H.j;m.Ag.K=olympe.C.H.j;olympe.C.Aj=class extends olympe.C.ji{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.fa=this.Ga=this.$a=this.ba=null}Ld(a){super.Ld(a);if(null!==this.fa)for(let b of this.fa.values())bc(b,a)}Gc(){return this.je(0)}Lf(){return this.bf(0)}Cd(a){const b=c=>{null===this.$a&&(this.$a=Object.create(null));let d=this.Kf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.jj(this.$a,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.ib(a)?M(olympe.C.createNode(olympe.C.aa,b,null,
384
+ [a.Ba],[0],'onResolved('+(b.name||'')+')')):b(a)}Kf(a){return this.D[a]}bf(a){const b=c=>{const d=c.valueOf(),e=this.Jf(d);null===this.Ga&&(this.Ga=Object.create(null));return this.jj(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Jf(a){return this.j[a.valueOf()]}je(a){if(olympe.C.ib(a))return this.get(olympe.C.ta([a],c=>{c=this.bf(c);if(!Nb(c.Ba)){const d=olympe.C.Xa();olympe.C.Of(d)&&Xb(d)}return c},String));null===this.fa&&(this.fa=new Map);let b=this.fa.get(a);
385
+ b||this.N.run(()=>{b=this.get(this.bf(a));this.fa.set(a,b);b.Ba.onDestroy(()=>this.fa.delete(a))});return b}af(a){return this.ai(this.Jf(a))}fj(a,b,c,d){let e=this.Gm();a=this.ws(e,a,b,c,d);this.Fm(e,a)}ws(a,b,c,d,e){return olympe.C.Xa().F((f,g)=>{let h=!1,k=olympe.C.hi([b,c,this.Cd(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.Jm(a,g,k)})}ci(){null===this.ba&&this.N.run(()=>{this.ba=olympe.C.Qd(Array,this.j.filter(a=>void 0!==a));
386
+ this.ba.Ba.onDestroy(()=>{this.J=null})});return this.ba}ie(a){if(this.j.length!==this.size)super.ie(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}}Im(a,b){const c=this.$a,d=this.Ga,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&dc(c[g]),void 0!==
387
+ c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Hm(a){var b=this.Ga,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.$a;null!==c&&void 0!==c[a]&&dc(c[a])}Gr(){if(null!==this.ba){const a=this.j,b=this.ba.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.ba,a)}}Ef(){this.Gr();super.Ef()}Qh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.$a;if(null!==
388
+ a)for(b in a)dc(a[b]);a=this.Ga;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.ba;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.ji.prototype.Qh.call(this)}Ag(){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.Aj.xa=[olympe.C.qd];m=olympe.C.Aj.prototype;m.Ld.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.Cd.K=olympe.C.H.F;m.Kf.K=olympe.C.H.j;
389
389
  m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>Object,[]);m.af.K=olympe.C.H.j;m.fj.K=new olympe.C.H(()=>{},[]);m.ws.K=olympe.C.H.j;m.ci.K=new olympe.C.H(()=>Array,[]);m.ie.K=olympe.C.H.j;m.Im.K=olympe.C.H.j;m.Hm.K=olympe.C.H.j;m.Gr.K=olympe.C.H.j;m.Ef.K=olympe.C.H.j;m.Qh.K=olympe.C.H.j;m.Ag.K=olympe.C.H.j;olympe.C.Map=class extends olympe.C.ji{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Ld(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&bc(this.D,a);super.Ld(a)}Gc(){null===this.D&&this.Tm();return this.D}Lf(){null===this.j&&this.Tm();return this.j}Tm(){this.getContext().run(()=>{this.D=olympe.C.Qd(this.Mb());this.j=olympe.C.Qd(String);this.uj(this.Wm())})}Wm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}uj(a){if(void 0!==
390
390
  a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Bk(a,b);1===this.size&&null!==this.j&&this.uj(a);this.Ef()}remove(a){const b=this.Zi(a);null!==this.j&&this.j.Ba.Fb===a&&this.uj(this.Wm());return b}clear(){this.Qh();null!==this.j&&this.uj()}};m=olympe.C.Map.prototype;m.Ld.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>Object,[]);m.Lf.K=new olympe.C.H(()=>String,[]);m.Tm.K=olympe.C.H.j;
391
- m.Wm.K=olympe.C.H.j;m.uj.K=olympe.C.H.j;m.set.K=olympe.C.H.j;m.remove.K=new olympe.C.H(()=>Object,[]);m.clear.K=olympe.C.H.j;olympe.C.Dg=class extends olympe.C.Aj{constructor(a){super(a)}set(a,b,c){this.Bk(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Im(a,d)});this.Ef()}remove(a){this.Hm(a);return this.Zi(a)}clear(){this.Qh()}};olympe.C.Dg.prototype.remove.K=olympe.C.H.j;olympe.C.Dg.prototype.clear.K=olympe.C.H.j;olympe.C.Ss=class extends olympe.C.Rj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.Go.Lp}rb(){return olympe.C.Sy(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.rn=void 0;olympe.C.Vh=void 0;olympe.C.Ph=new Map;olympe.C.Ph.set(0,olympe.C.aa.ZERO);olympe.C.Ph.set(1,olympe.C.aa.ONE);olympe.C.Ph.set(2,olympe.C.aa.aw);olympe.C.Ak=new Map;olympe.C.Ak.set('',olympe.C.Sa.EMPTY);olympe.C.Ak.set(' ',olympe.C.Sa.Nv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Rf:c,gn:d,debug:g,fg:e,ad:f,$i:h})};olympe.C.Of=function(a){return a instanceof olympe.C.Node};
391
+ m.Wm.K=olympe.C.H.j;m.uj.K=olympe.C.H.j;m.set.K=olympe.C.H.j;m.remove.K=new olympe.C.H(()=>Object,[]);m.clear.K=olympe.C.H.j;olympe.C.Dg=class extends olympe.C.Aj{constructor(a){super(a)}set(a,b,c){this.Bk(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Im(a,d)});this.Ef()}remove(a){this.Hm(a);return this.Zi(a)}clear(){this.Qh()}};olympe.C.Dg.prototype.remove.K=olympe.C.H.j;olympe.C.Dg.prototype.clear.K=olympe.C.H.j;olympe.C.Ss=class extends olympe.C.Rj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.Go.Lp}rb(){return olympe.C.Sy(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.rn=void 0;olympe.C.Vh=void 0;olympe.C.Ph=new Map;olympe.C.Ph.set(0,olympe.C.aa.ZERO);olympe.C.Ph.set(1,olympe.C.aa.ONE);olympe.C.Ph.set(2,olympe.C.aa.aw);olympe.C.Ak=new Map;olympe.C.Ak.set('',olympe.C.Sa.EMPTY);olympe.C.Ak.set(' ',olympe.C.Sa.Nv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Rf:c,gn:d,debug:g,gg:e,ad:f,$i:h})};olympe.C.Of=function(a){return a instanceof olympe.C.Node};
392
392
  olympe.C.Qd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Of(b)?Yb(a,b):olympe.C.ib(b)?Yb(a,b.Ba):L(a,b);return M(a)};olympe.C.ib=function(a){return!(!a||!a.Tg)};olympe.C.df=function(a){return!(!a||!(a instanceof olympe.C.Node||a.Tg))};olympe.C.ln=function(a){return a instanceof olympe.C.Xb||a instanceof olympe.C.Sq||a instanceof olympe.C.Node};olympe.C.fh=function(a){return a instanceof olympe.C.Rj};
393
393
  olympe.C.nn=function(a,b){if(void 0!==a){olympe.C.fh(a)&&(a=a.rb().Ba);if(!olympe.C.df(a))return b(a);var c=[];olympe.C.ib(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.ib(a)?c=a.Ba.Fb:olympe.C.Of(a)?c=a.Fb:olympe.C.fh(a)&&(c=a.rb().Ba.Fb);return void 0===c?b:c};
394
394
  olympe.C.jh=function(a,b){let c;olympe.C.ib(a)?c=a.Ba:olympe.C.Of(a)?c=a:olympe.C.fh(a)&&(c=a.rb().Ba);c&&olympe.C.Sc([b],d=>{c.jh(d)},'setDefaultValue');return a};olympe.C.hi=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.Dr?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.fh(h)&&(h=h.rb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
395
395
  olympe.C.re=function(a,b,c,d){return M(olympe.C.hi(a,b,c,d||'syncProxies'))};const oc=a=>{for(const b of a)if(olympe.C.df(b)||olympe.C.fh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(oc(a))return b(...a);const f=olympe.C.hi(a,b,c,d||'TransformFlows');e&&olympe.C.Sc([e],g=>{f.jh(g)},'setDefaultValue');return M(f)};olympe.C.Sc=function(a,b,c){oc(a)?b(...a):olympe.C.hi(a,b,void 0,c||'processFlows')};
396
- olympe.C.cE=function(a,b,c){const d=olympe.C.Of(a)?a.Mb():olympe.C.fh(a)?a.rb().Oh:a.Oh,e=olympe.C.cc(d,c),f=olympe.V.Promise.dj(g=>{e.getContext().eb()||e.update(g)},b);olympe.C.Sc([a],g=>f(g).then());return e.rb()};olympe.C.zs=function(a,b){if(oc(a))b(...a);else{const c=olympe.C.Va();olympe.C.hi(a,(...d)=>{olympe.C.Va().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
397
- olympe.C.pn=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.ib(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.fh(g)&&(g=g.rb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Jc:b,gn:e,fg:f,iz:!1,ad:c})};olympe.C.As=function(a,b){const c=olympe.C.Va();olympe.C.pn(a,(...d)=>{olympe.C.Va().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.aE=function(a,b,c){a=new olympe.C.Rj(a,c);b(a);return a.rb()};
398
- olympe.C.cc=function(a,b='flowSource'){return new olympe.C.Rj(a,b)};olympe.C.IE=function(a,b,c,d){const e=olympe.C.Va();olympe.C.hi(a,(...f)=>{olympe.C.Va().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.oj=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.nE=function(a,b,c='from observable'){const d=olympe.C.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.rb()};
399
- olympe.C.kE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.ME=function(a){return olympe.C.Va().F(a)};olympe.C.hE=function(a,b,c){olympe.C.ax(a?a.Ba:a,b,c)};
396
+ olympe.C.cE=function(a,b,c){const d=olympe.C.Of(a)?a.Mb():olympe.C.fh(a)?a.rb().Oh:a.Oh,e=olympe.C.cc(d,c),f=olympe.V.Promise.dj(g=>{e.getContext().hb()||e.update(g)},b);olympe.C.Sc([a],g=>f(g).then());return e.rb()};olympe.C.zs=function(a,b){if(oc(a))b(...a);else{const c=olympe.C.Xa();olympe.C.hi(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
397
+ olympe.C.pn=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.ib(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.fh(g)&&(g=g.rb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Jc:b,gn:e,gg:f,iz:!1,ad:c})};olympe.C.As=function(a,b){const c=olympe.C.Xa();olympe.C.pn(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.aE=function(a,b,c){a=new olympe.C.Rj(a,c);b(a);return a.rb()};
398
+ olympe.C.cc=function(a,b='flowSource'){return new olympe.C.Rj(a,b)};olympe.C.IE=function(a,b,c,d){const e=olympe.C.Xa();olympe.C.hi(a,(...f)=>{olympe.C.Xa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.oj=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.nE=function(a,b,c='from observable'){const d=olympe.C.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.rb()};
399
+ olympe.C.kE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.ME=function(a){return olympe.C.Xa().F(a)};olympe.C.hE=function(a,b,c){olympe.C.ax(a?a.Ba:a,b,c)};
400
400
  olympe.C.ax=function(a,b,c){if(a){var d=a.T();null===nc&&(nc={});if(nc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{nc[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}`:
401
- ''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.gE=function(){let a='',b=olympe.C.Va();for(;null!==b;)a+=b.$c()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
401
+ ''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.gE=function(){let a='',b=olympe.C.Xa();for(;null!==b;)a+=b.$c()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
402
402
  olympe.C.ra=function(a){if(void 0===a)return olympe.C.aa.ZERO;if(a instanceof olympe.C.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.aa.Sp;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.Ut;if(-Infinity===a)return olympe.C.aa.Qu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.Ph.has(a)||olympe.C.Ph.set(a,new olympe.C.aa(a)),olympe.C.Ph.get(a)):new olympe.C.aa(a)}return null};
403
403
  olympe.C.ae=function(a){return void 0===a?olympe.C.Qd(olympe.C.aa):olympe.C.Qd(olympe.C.aa,olympe.C.df(a)?a:olympe.C.ra(a))};olympe.C.Sy=olympe.C.aa.animate;olympe.C.xE=function(a,b){return new olympe.C.Ss(a,b)};olympe.C.xb=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.Ak.has(a)?olympe.C.Ak.get(a):new olympe.C.Sa(a)};
404
- olympe.C.CE=function(a){return void 0===a?olympe.C.Qd(olympe.C.Sa):olympe.C.Qd(olympe.C.Sa,olympe.C.df(a)?a:olympe.C.xb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j};olympe.C.zE=function(a){return void 0===a?olympe.C.Qd(olympe.C.ea):olympe.C.Qd(olympe.C.ea,olympe.C.df(a)?a:olympe.C.Rb(a))};olympe.C.yE=function(a){if(a instanceof Date)return new olympe.C.fb(a)};
405
- olympe.C.BE=function(a){return olympe.C.Qd(olympe.C.fb,void 0!==a?new olympe.C.fb(a):null)};olympe.C.qs=a=>a instanceof olympe.C.ea||a instanceof olympe.C.aa||a instanceof olympe.C.Sa||a instanceof olympe.C.fb;olympe.C.DE=function(a,b){return olympe.C.Qd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.cz=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.Qd(olympe.C.Color,e)};olympe.C.AE=olympe.C.cz;
406
- olympe.C.Sw=function(a){olympe.C.G=a;olympe.C.Vh=olympe.C.Xg()};olympe.C.Xg=function(){olympe.C.rn||(olympe.C.rn=new olympe.C.Sq);return olympe.C.rn};olympe.C.Va=function(){olympe.C.Vh||(olympe.C.Vh=olympe.C.Xg());return olympe.C.Vh};olympe.C.Gs=function(a){const b=olympe.C.Vh;olympe.C.ln(a)&&(olympe.C.Vh=a);return null!=b?b:null};
407
- olympe.C.Ob=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.fb.Ob(a);break;case 'number':b=olympe.C.aa.Ob(a);break;case 'string':b=olympe.C.Sa.Ob(a);break;case 'vector2':b=olympe.C.Zb.Ob(a);break;case 'color':b=olympe.C.Color.Ob(a);break;case 'boolean':b=olympe.C.ea.Ob(a)}return b}return null};function pc(a){a.j.eb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.J.length=0)}
404
+ olympe.C.CE=function(a){return void 0===a?olympe.C.Qd(olympe.C.Sa):olympe.C.Qd(olympe.C.Sa,olympe.C.df(a)?a:olympe.C.xb(a))};olympe.C.Rb=function(a){return a instanceof olympe.C.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j};olympe.C.zE=function(a){return void 0===a?olympe.C.Qd(olympe.C.ea):olympe.C.Qd(olympe.C.ea,olympe.C.df(a)?a:olympe.C.Rb(a))};olympe.C.yE=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
405
+ olympe.C.BE=function(a){return olympe.C.Qd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.qs=a=>a instanceof olympe.C.ea||a instanceof olympe.C.aa||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.DE=function(a,b){return olympe.C.Qd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.cz=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.Qd(olympe.C.Color,e)};olympe.C.AE=olympe.C.cz;
406
+ olympe.C.Sw=function(a){olympe.C.G=a;olympe.C.Vh=olympe.C.Xg()};olympe.C.Xg=function(){olympe.C.rn||(olympe.C.rn=new olympe.C.Sq);return olympe.C.rn};olympe.C.Xa=function(){olympe.C.Vh||(olympe.C.Vh=olympe.C.Xg());return olympe.C.Vh};olympe.C.Gs=function(a){const b=olympe.C.Vh;olympe.C.ln(a)&&(olympe.C.Vh=a);return null!=b?b:null};
407
+ olympe.C.Ob=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Ob(a);break;case 'number':b=olympe.C.aa.Ob(a);break;case 'string':b=olympe.C.Sa.Ob(a);break;case 'vector2':b=olympe.C.Zb.Ob(a);break;case 'color':b=olympe.C.Color.Ob(a);break;case 'boolean':b=olympe.C.ea.Ob(a)}return b}return null};function pc(a){a.j.hb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.J.length=0)}
408
408
  olympe.C.yC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.cc(qc,'Last slot manager entry');this.size=gc(olympe.C.cc(olympe.C.aa,'SlotManager size').repeat(this.D.rb().an()),olympe.C.aa.ZERO);this.N=gc(olympe.C.cc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.J=[];this.j.onDestroy(()=>{pc(this)})}};
409
- class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.J=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.cc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.ib(b)?e.repeat(b):e.update(b);this.j=olympe.C.cc(olympe.C.aa);this.F=this.j.rb().be(e.rb())});this.next=null}T(){return this.id}my(){return this.j.rb()}an(){return this.F}Bd(){return this.J}xy(){return this.N}Dz(a){this.J=a}pz(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.an()),a.next=this)}hu(){this.j.clear();
410
- this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.H.j;m.my.K=new olympe.C.H(()=>olympe.C.aa);m.an.K=new olympe.C.H(()=>olympe.C.aa);m.Bd.K=olympe.C.H.j;m.xy.K=olympe.C.H.j;m.Dz.K=olympe.C.H.j;m.pz.K=olympe.C.H.j;m.hu.K=olympe.C.H.j;m.destroy.K=olympe.C.H.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.Tp,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.Sw(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.Xp=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Xp.create(c,b,a.G,a.J))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.J()<=olympe.ja.yb.j.Uf&&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.ib(f))b.push(a.j.get(f.qw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Va();b.push((...k)=>{h.eb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
411
- function vc(a){var b=olympe.host.He.zd,c=olympe.host.He.Wp.wr;++a.F;const d=a.F;tc(a,d,c);const e=olympe.C.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.ib(p)?(h.push(n),p=p.Ba):olympe.C.Of(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
412
- {uc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Y(a.N.bind(a,d));a=M(e);a.qw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.J=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}$a(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Nd=class{constructor(a){this.j=a;this.D=olympe.C.Va()}F(){return this.j}rd(){return this.j.Ba.rd()||this.D.rd()}eb(){return this.j.Ba.eb()}};olympe.host.Nd.prototype.F.K=new olympe.C.H(()=>olympe.host.He.Nd,[]);olympe.host.vk=class{j(){}D(){}};olympe.host.Ot=class{};function wc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.eb()||e.rd()||e.run(a);c.j.F(d)});return new olympe.host.zd.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.eb()||e.rd()?c.j.D(d):e.run(a)})}olympe.host.zd=class{constructor(a){this.j=vc(a)}};olympe.host.zd.j=class{constructor(a,b,c){this.Sf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
413
- olympe.host.zd.J=class extends olympe.host.zd.j{cancel(){this.Sf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.zd.D=class extends olympe.host.zd.j{cancel(){this.Sf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.zd.F=class extends olympe.host.zd.j{cancel(){this.Sf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ce=class{D(a,b){return null!=b?b:''}fa(a,b){return null!=b?b:''}N(){}j(a,b){return null!=b?b:''}F(){}};olympe.host.Ce.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.He={};olympe.host.He.Nd=class{destroy(){}};olympe.host.He.Nd.prototype.destroy=olympe.host.He.Nd.prototype.destroy;olympe.host.He.Wp={Kz:100,Mz:101,Lz:102,Oz:103,Nz:104,Jz:105,pC:201,nC:202,kC:204,sC:205,jC:206,mC:207,qC:208,tC:209,uC:210,vC:211,lC:212,rC:218,oC:219,wC:220,iC:221,hC:222,DC:300,EC:301,FC:302,JC:303,KC:304,LC:305,GC:310,HC:311,IC:312,JB:400,KB:401,LB:402,yB:450,rB:500,pB:501,uB:502,tB:503,qB:504,sB:505,dD:600,VC:601,ZC:602,RC:603,SC:604,PC:605,UC:606,jD:607,bD:608,MC:609,QC:610,TC:611,aD:612,fD:613,NC:614,eD:615,$C:616,iD:617,WC:618,XC:619,YC:620,cD:630,OC:631,gD:632,hD:633,PD:700,sD:701,tD:702,
414
- uD:703,wD:704,xD:705,yD:706,vD:707,AD:708,zD:709,BD:710,FD:711,ND:712,CD:713,DD:714,GD:715,HD:716,JD:717,KD:718,MD:719,ID:720,LD:721,OD:722,ED:723,QD:724,RD:725,wr:800};olympe.host.He.zd=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={rk:'host.System',kp:'host.HistoryManager',Uq:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Re:'host.ProcessManager'};olympe.host.U={kk:'role',lp:'host.currentHost',rq:'host.processProbe',$q:'host.gracefulShutdownTimeout'};olympe.host.Lg={bl:'active',Dh:'preview'};olympe.host.Sf=null;
415
- olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ua(a,olympe.host.U.lp,d);b=olympe.host.Lg.bl;c=olympe.host.Lg.Dh;F(a,olympe.host.U.kk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.rk);Xa(a,olympe.host.P.kp);D(a,olympe.host.P.Re,olympe.host.Ce);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.rg);E(a,olympe.host.P.Uq,[olympe.host.P.Da],
416
- e=>{null===olympe.host.Sf&&(olympe.host.Sf=new olympe.host.zd(e));return olympe.host.Sf},!0)},'olympe.host');olympe.W.run([olympe.host.P.Uq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.host.Mk=()=>a});olympe.net={};olympe.net.wa={};olympe.net.wa.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS',MB:'PATCH'};olympe.net.wa.ResponseType={lr:'text',JSON:'json',il:'blob',Kh:'uint8array',fe:'stream'};olympe.net.wa.Headers={oi:'content-type',Yz:'content-length',Pn:'authorization',Rs:'access-control-allow-origin',Ps:'access-control-allow-headers',Qs:'access-control-allow-methods',Vo:'x-forwarded-host',Wo:'x-forwarded-proto'};
409
+ class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.J=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.cc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.ib(b)?e.repeat(b):e.update(b);this.j=olympe.C.cc(olympe.C.aa);this.F=this.j.rb().be(e.rb())});this.next=null}T(){return this.id}my(){return this.j.rb()}an(){return this.F}Cd(){return this.J}xy(){return this.N}Dz(a){this.J=a}pz(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.an()),a.next=this)}hu(){this.j.clear();
410
+ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.H.j;m.my.K=new olympe.C.H(()=>olympe.C.aa);m.an.K=new olympe.C.H(()=>olympe.C.aa);m.Cd.K=olympe.C.H.j;m.xy.K=olympe.C.H.j;m.Dz.K=olympe.C.H.j;m.pz.K=olympe.C.H.j;m.hu.K=olympe.C.H.j;m.destroy.K=olympe.C.H.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.Tp,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.Sw(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.Xp=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Xp.create(c,b,a.G,a.J))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.J()<=olympe.ja.yb.j.Uf&&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.ib(f))b.push(a.j.get(f.qw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Xa();b.push((...k)=>{h.hb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
411
+ function vc(a){var b=olympe.host.He.Ad,c=olympe.host.He.Wp.wr;++a.F;const d=a.F;tc(a,d,c);const e=olympe.C.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.ib(p)?(h.push(n),p=p.Ba):olympe.C.Of(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
412
+ {uc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Y(a.N.bind(a,d));a=M(e);a.qw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.J=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}ab(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Nd=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}td(){return this.j.Ba.td()||this.D.td()}hb(){return this.j.Ba.hb()}};olympe.host.Nd.prototype.F.K=new olympe.C.H(()=>olympe.host.He.Nd,[]);olympe.host.vk=class{j(){}D(){}};olympe.host.Ot=class{};function wc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.hb()||e.td()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Sf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.hb()||e.td()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Sf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
413
+ olympe.host.Ad.J=class extends olympe.host.Ad.j{cancel(){this.Sf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.D=class extends olympe.host.Ad.j{cancel(){this.Sf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.F=class extends olympe.host.Ad.j{cancel(){this.Sf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ce=class{D(a,b){return null!=b?b:''}fa(a,b){return null!=b?b:''}N(){}j(a,b){return null!=b?b:''}F(){}};olympe.host.Ce.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.He={};olympe.host.He.Nd=class{destroy(){}};olympe.host.He.Nd.prototype.destroy=olympe.host.He.Nd.prototype.destroy;olympe.host.He.Wp={Kz:100,Mz:101,Lz:102,Oz:103,Nz:104,Jz:105,pC:201,nC:202,kC:204,sC:205,jC:206,mC:207,qC:208,tC:209,uC:210,vC:211,lC:212,rC:218,oC:219,wC:220,iC:221,hC:222,DC:300,EC:301,FC:302,JC:303,KC:304,LC:305,GC:310,HC:311,IC:312,JB:400,KB:401,LB:402,yB:450,rB:500,pB:501,uB:502,tB:503,qB:504,sB:505,dD:600,VC:601,ZC:602,RC:603,SC:604,PC:605,UC:606,jD:607,bD:608,MC:609,QC:610,TC:611,aD:612,fD:613,NC:614,eD:615,$C:616,iD:617,WC:618,XC:619,YC:620,cD:630,OC:631,gD:632,hD:633,PD:700,sD:701,tD:702,
414
+ uD:703,wD:704,xD:705,yD:706,vD:707,AD:708,zD:709,BD:710,FD:711,ND:712,CD:713,DD:714,GD:715,HD:716,JD:717,KD:718,MD:719,ID:720,LD:721,OD:722,ED:723,QD:724,RD:725,wr:800};olympe.host.He.Ad=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={rk:'host.System',kp:'host.HistoryManager',Uq:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Re:'host.ProcessManager'};olympe.host.U={kk:'role',lp:'host.currentHost',rq:'host.processProbe',$q:'host.gracefulShutdownTimeout'};olympe.host.Lg={bl:'active',Dh:'preview'};olympe.host.Sf=null;
415
+ olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ua(a,olympe.host.U.lp,d);b=olympe.host.Lg.bl;c=olympe.host.Lg.Dh;F(a,olympe.host.U.kk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.rk);Xa(a,olympe.host.P.kp);D(a,olympe.host.P.Re,olympe.host.Ce);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.sg);E(a,olympe.host.P.Uq,[olympe.host.P.Da],
416
+ e=>{null===olympe.host.Sf&&(olympe.host.Sf=new olympe.host.Ad(e));return olympe.host.Sf},!0)},'olympe.host');olympe.W.run([olympe.host.P.Uq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.host.Mk=()=>a});olympe.net={};olympe.net.wa={};olympe.net.wa.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS',MB:'PATCH'};olympe.net.wa.ResponseType={lr:'text',JSON:'json',il:'blob',Kh:'uint8array',fe:'stream'};olympe.net.wa.Headers={oi:'content-type',Yz:'content-length',Pn:'authorization',Rs:'access-control-allow-origin',Ps:'access-control-allow-headers',Qs:'access-control-allow-methods',Vo:'x-forwarded-host',Wo:'x-forwarded-proto'};
417
417
  olympe.net.wa.ul={$A:'text/html',JSON:'application/json',pw:'application/zip',fe:'application/octet-stream'};olympe.net.wa.Tb={eo:0,Ah:200,ho:201,yj:202,gl:400,dw:401,So:403,$l:404,vB:405,Pi:500,Fv:503};function yc(a){return a.host&&encodeURI(a.host)}function zc(a){return encodeURI(a.path).replace(olympe.net.Yi.j,(b,c)=>'%'+c)}olympe.net.Yi=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.D=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.D=d)}j(){return`${(void 0===this.D?443===this.port:this.D)?'wss':'ws'}://${yc(this)}:${this.port}/${zc(this)}`}toString(){return`${yc(this)}:${this.port}/${zc(this)}`}};
418
418
  olympe.net.Yi.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ba(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.dz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Ai(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Ks&&(c=a.Ks.split(':'),2===c.length&&(c=bb(olympe.V.Ze(),`${c[0]}:${c[1]}`),Ac(b,{Authorization:`Basic ${c}`})));return b}function Bc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Cc(a,b){a.F=b;return a}function Ac(a,b){Object.assign(a.headers,b)}
419
419
  olympe.net.Ai=class extends olympe.net.Yi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.wa.Md.GET;this.query=h;this.headers={};this.body=f;this.F=null!=g?g:olympe.net.wa.ResponseType.lr}kj(){return this.headers}j(){let a=Bc(this);a=a?`?${a}`:'';if(!yc(this))return`${zc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.D?443===this.port:this.D)?'https':'http'}://${yc(this)}${b}/${zc(this)}${a}`}toString(){return this.j()}};
420
- olympe.net.Ai.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS'};olympe.net.jd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Hc(){return this.status}kj(){return this.headers}};function Dc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Va(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Qf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.pe.Pt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.info(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}J(){}Pf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.J}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
420
+ olympe.net.Ai.Md={Ch:'POST',GET:'GET',Lt:'HEAD',sq:'PUT',Cc:'DELETE',hq:'OPTIONS'};olympe.net.ld=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Hc(){return this.status}kj(){return this.headers}};function Dc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Qf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.pe.Pt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}J(){}Pf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.J}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
421
421
  function Hc(a,b){if(!Fc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.G.j()&&a.G.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.j.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function Ic(a,b){a.R.push(b)}function Jc(a,b){a.N.push(b)}function Kc(a,b){a.Y.push(b)}
422
- olympe.net.uf=class{constructor(a){this.G=olympe.ja.$a('MQTT');this.J=!1;this.j=this.D=null;this.N=[];this.Y=[];this.ba=[];this.$=[];this.R=[];this.F=new Map;const b=olympe.V.Promise.dj(()=>this.connect(),0);a.subscribe(c=>{this.G.j()&&this.G.debug('New MQTT configuration received',c);this.D=c;null!==c&&this.J&&(Fc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(Fc(this))return null==a||a(),this;a&&this.N.push(a);this.J=!0;null===this.j&&null!==this.D&&(this.j=mqtt.connect(this.D.url,
422
+ olympe.net.uf=class{constructor(a){this.G=olympe.ja.ab('MQTT');this.J=!1;this.j=this.D=null;this.N=[];this.Y=[];this.ba=[];this.$=[];this.R=[];this.F=new Map;const b=olympe.V.Promise.dj(()=>this.connect(),0);a.subscribe(c=>{this.G.j()&&this.G.debug('New MQTT configuration received',c);this.D=c;null!==c&&this.J&&(Fc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(Fc(this))return null==a||a(),this;a&&this.N.push(a);this.J=!0;null===this.j&&null!==this.D&&(this.j=mqtt.connect(this.D.url,
423
423
  Gc(this)),this.j.on(olympe.net.uf.j.Pu,(b,c)=>{this.G.j()&&this.G.debug(`MQTT < ${c}`);this.F.has(b)?this.F.get(b)(JSON.parse(c.toString())):this.G.warn('There is no subscriber for topic '+b)}),this.j.on(olympe.net.uf.j.jt,()=>{this.G.info('Mqtt client is connected to bus');this.N.forEach(b=>b())}),this.j.on(olympe.net.uf.j.uv,()=>{this.G.info('Mqtt client is reconnecting to bus ... ');null===this.D&&this.end(!1);this.Y.forEach(b=>b())}),this.j.on(olympe.net.uf.j.zb,b=>{this.G.error('Mqtt client error ',
424
- b);this.$.forEach(c=>c(b))}),this.j.on(olympe.net.uf.j.ee,()=>{this.G.info('Mqtt client is offline');this.ba.forEach(b=>b())}),this.j.on(olympe.net.uf.j.it,()=>{this.G.info('Mqtt client is closed');this.R.forEach(b=>b())}),this.j.on(olympe.net.uf.j.Yf,()=>{this.G.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!Fc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.G.j()&&this.G.debug(`MQTT > ${d}`);return new Promise((e,
424
+ b);this.$.forEach(c=>c(b))}),this.j.on(olympe.net.uf.j.ye,()=>{this.G.info('Mqtt client is offline');this.ba.forEach(b=>b())}),this.j.on(olympe.net.uf.j.it,()=>{this.G.info('Mqtt client is closed');this.R.forEach(b=>b())}),this.j.on(olympe.net.uf.j.Yf,()=>{this.G.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!Fc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.G.j()&&this.G.debug(`MQTT > ${d}`);return new Promise((e,
425
425
  f)=>{this.j.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!Fc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.G.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.j.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.F.set(a,b),c())})})}end(a,b){this.J=!1;this.F.clear();this.j?this.j.end(a,{},()=>{this.j=null;null==b||b()}):null==b||b();return this}};
426
- olympe.net.uf.j={jt:'connect',uv:'reconnect',Pu:'message',it:'close',Yf:'end',zb:'error',ee:'offline'};olympe.net.Nh=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}J(){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.')}F(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
426
+ olympe.net.uf.j={jt:'connect',uv:'reconnect',Pu:'message',it:'close',Yf:'end',zb:'error',ye:'offline'};olympe.net.Nh=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}J(){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.')}F(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
427
427
  olympe.net.Nh.ALL='*';olympe.net.Rv=class{register(){return w(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',Xi:'net.WebServer',Jv:'net.ServiceWorkerManager',cm:'net.OfflineConfig'};olympe.net.U={rf:'net.httpPort',op:'net.httpBodyLimit',vr:'net.http2',np:'net.httpsCertificatesPath',Vl:'net.localNetworkSuffix',Li:'offline.enabled',bm:'offline.autoBackOnline',gq:'offline.downloadBatchSize'};
428
428
  olympe.W.config(function(a){F(a,olympe.net.U.rf,3141);F(a,olympe.net.U.op,100);F(a,olympe.net.U.vr,!1);F(a,olympe.net.U.np,null);F(a,olympe.net.U.Vl,'frontend');F(a,olympe.net.U.Li,!1);F(a,olympe.net.U.bm,!1);F(a,olympe.net.U.gq,20);Xa(a,olympe.net.P.Da);E(a,olympe.net.P.Ca,[olympe.ja.P.Da],b=>b.cd('net'));D(a,olympe.net.P.Xi,olympe.net.Nh,olympe.net.P.Ca);D(a,olympe.net.P.Jv,olympe.net.Rv);E(a,olympe.net.P.cm,[new olympe.W.pa(olympe.net.U.Li),new olympe.W.pa(olympe.net.U.bm)],(b,c)=>new Map([['offlineEnabled',
429
- b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Wa.node.host={};olympe.Wa.node.host.Nd=function(a,b){this.G=b};olympe.Wa.node.host.Nd.prototype.constructor=olympe.Wa.node.host.Nd;olympe.Wa.node.host.Nd.prototype.destroy=function(){};olympe.Wa.node.host.Nd.prototype.destroy=olympe.Wa.node.host.Nd.prototype.destroy;olympe.Wa.node.host.Nd.prototype.$a=function(){return this.G};olympe.Wa.node.host.Nd.xa=[olympe.host.He.Nd];olympe.Wa.node.host.Yp=class{constructor(a){this.G=a}};olympe.Wa.node.host.Yp.xa=[olympe.host.Ot];olympe.Wa.node.host.zd=class{constructor(){this.j={};this.J={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.J[b]=setInterval(c,a)}D(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Xp.register(olympe.host.He.Wp.wr,olympe.Wa.node.host.zd);olympe.Wa.node.host.zd.xa=[olympe.host.He.zd];olympe.Wa.node.host.vk=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Wa.node.host.vk.xa=[olympe.host.vk];function Lc(a){a.ba.F('readinessProbe','/readiness',[olympe.net.wa.Md.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ba.F('livenessProbe','/liveness',[olympe.net.wa.Md.GET],()=>Mc(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.D(()=>a.ba.stop())}
429
+ b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Nd=function(a,b){this.G=b};olympe.Va.node.host.Nd.prototype.constructor=olympe.Va.node.host.Nd;olympe.Va.node.host.Nd.prototype.destroy=function(){};olympe.Va.node.host.Nd.prototype.destroy=olympe.Va.node.host.Nd.prototype.destroy;olympe.Va.node.host.Nd.prototype.ab=function(){return this.G};olympe.Va.node.host.Nd.xa=[olympe.host.He.Nd];olympe.Va.node.host.Yp=class{constructor(a){this.G=a}};olympe.Va.node.host.Yp.xa=[olympe.host.Ot];olympe.Va.node.host.Ad=class{constructor(){this.j={};this.J={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.J[b]=setInterval(c,a)}D(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Xp.register(olympe.host.He.Wp.wr,olympe.Va.node.host.Ad);olympe.Va.node.host.Ad.xa=[olympe.host.He.Ad];olympe.Va.node.host.vk=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Va.node.host.vk.xa=[olympe.host.vk];function Lc(a){a.ba.F('readinessProbe','/readiness',[olympe.net.wa.Md.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ba.F('livenessProbe','/liveness',[olympe.net.wa.Md.GET],()=>Mc(a,a.Y)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.D(()=>a.ba.stop())}
430
430
  function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.Cn(d(),a.ua,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function Oc(a){return w(function*(){try{const b=yield Nc(a,a.J),c=yield Nc(a,a.R);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.J.clear(),a.R.clear()}})}
431
- function Mc(a,b){const c=olympe.net.wa.Tb.Ah,d=olympe.net.wa.Tb.Pi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.jd('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.jd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
432
- olympe.Wa.node.host.Ce=class extends olympe.host.Ce{constructor(a,b,c,d=!0){super();this.G=a;this.ba=b;this.ua=c;this.Y=new Map;this.$=new Map;this.J=new Map;this.R=new Map;d&&Lc(this)}j(a,b=olympe.V.Hf(),c=olympe.host.Ce.j.ALL){switch(c){case olympe.host.Ce.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Ce.j.READINESS:this.$.set(b,a);break;default:this.Y.set(b,a),this.$.set(b,a)}return b}F(a){this.$.delete(a);this.Y.delete(a)}D(a,b=olympe.V.Hf()){this.J.set(b,a);return b}fa(a,b=olympe.V.Hf()){this.R.set(b,
433
- a);return b}N(a){this.J.has(a)?this.J.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.rq,!0);F(a,olympe.host.U.$q,1E4);Va(a,olympe.host.P.kp,olympe.Wa.node.host.Yp,olympe.host.P.Ca);Va(a,olympe.host.P.rk,olympe.Wa.node.host.vk,olympe.host.P.Ca);D(a,olympe.host.P.Re,olympe.Wa.node.host.Ce,olympe.host.P.Ca,olympe.net.P.Xi,new olympe.W.pa(olympe.host.U.$q),new olympe.W.pa(olympe.host.U.rq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.Wa.node.host.Mk=()=>a});olympe.net.pe={};function Ec(a,b,c){const d=olympe.net.wa.Tb.eo,e=olympe.net.wa.Tb.Pi,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.kj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.jd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.jd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
434
- l.name?new olympe.net.jd('',d,'Request canceled'):new olympe.net.jd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
435
- function Pc(a,b){return w(function*(){switch(b){case olympe.net.wa.ResponseType.il:var c=yield a.blob();break;case olympe.net.wa.ResponseType.Kh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.wa.ResponseType.JSON:c=yield a.json();break;case olympe.net.wa.ResponseType.fe:c=a.body;break;default:c=yield a.text()}return new olympe.net.jd(c,a.status,a.statusText,a.headers)})}olympe.net.pe.Pt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.pe.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.J=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.fa(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));
431
+ function Mc(a,b){const c=olympe.net.wa.Tb.Ah,d=olympe.net.wa.Tb.Pi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.ld('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.ld(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
432
+ olympe.Va.node.host.Ce=class extends olympe.host.Ce{constructor(a,b,c,d=!0){super();this.G=a;this.ba=b;this.ua=c;this.Y=new Map;this.$=new Map;this.J=new Map;this.R=new Map;d&&Lc(this)}j(a,b=olympe.V.Hf(),c=olympe.host.Ce.j.ALL){switch(c){case olympe.host.Ce.j.LIVENESS:this.Y.set(b,a);break;case olympe.host.Ce.j.READINESS:this.$.set(b,a);break;default:this.Y.set(b,a),this.$.set(b,a)}return b}F(a){this.$.delete(a);this.Y.delete(a)}D(a,b=olympe.V.Hf()){this.J.set(b,a);return b}fa(a,b=olympe.V.Hf()){this.R.set(b,
433
+ a);return b}N(a){this.J.has(a)?this.J.delete(a):this.R.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.rq,!0);F(a,olympe.host.U.$q,1E4);Va(a,olympe.host.P.kp,olympe.Va.node.host.Yp,olympe.host.P.Ca);Va(a,olympe.host.P.rk,olympe.Va.node.host.vk,olympe.host.P.Ca);D(a,olympe.host.P.Re,olympe.Va.node.host.Ce,olympe.host.P.Ca,olympe.net.P.Xi,new olympe.W.pa(olympe.host.U.$q),new olympe.W.pa(olympe.host.U.rq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Re],a=>{olympe.Va.node.host.Mk=()=>a});olympe.net.pe={};function Ec(a,b,c){const d=olympe.net.wa.Tb.eo,e=olympe.net.wa.Tb.Pi,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.kj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.ld(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.ld(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
434
+ l.name?new olympe.net.ld('',d,'Request canceled'):new olympe.net.ld(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
435
+ function Pc(a,b){return w(function*(){switch(b){case olympe.net.wa.ResponseType.il:var c=yield a.blob();break;case olympe.net.wa.ResponseType.Kh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.wa.ResponseType.JSON:c=yield a.json();break;case olympe.net.wa.ResponseType.fe:c=a.body;break;default:c=yield a.text()}return new olympe.net.ld(c,a.status,a.statusText,a.headers)})}olympe.net.pe.Pt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.pe.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.J=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.fa(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
436
436
  this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):cb(d.data);(this.G.F()||this.G.j()&&!d.startsWith('pong'))&&this.G.debug(b,'<',d);this.F&&this.F(d)});c.addEventListener('close',()=>{this.G.info(`WebSocket ${b} CLOSED`);this.J&&this.J()});c.addEventListener('error',()=>{this.G.debug(`WebSocket ${b} ERROR`);this.N&&this.N()});this.j=c}send(a){const b=`#${this.id}`;if(null!==this.j){const c=this.j.constructor;switch(this.j.readyState){case c.OPEN:(this.G.F()||
437
437
  this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);this.j.send(a);break;case c.CONNECTING:this.G.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.G.debug(b,'- Closed','>',a),!1}}else this.G.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.j){const a=this.j.constructor,b=this.j.readyState;if(b===a.OPEN||b===a.CONNECTING){this.G.debug(`Force closing native websocket ${`#${this.id}`}`);this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}ba(a){this.R=
438
- a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.J=a||null}fa(){}};olympe.net.pe.WebSocket.xa=[olympe.net.WebSocket];olympe.Wa.node.net={};olympe.Wa.node.net.Vu=class extends olympe.net.Ta{N(){return'NodeJS'}Pf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Wa.node.net.Wu(b,this.G);b.open(a);return b}J(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Wa.node.net.Wu=class extends olympe.net.pe.WebSocket{fa(a){return new (require('ws'))(a)}};olympe.Wa.node.net.U={rD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Li)&&Ua(a,olympe.net.U.Li,!1);Va(a,olympe.net.P.Da,olympe.Wa.node.net.Vu,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Wa.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={qk:0,pk:1,um:2},Tc=olympe.net.wa.Md.hq,Uc=olympe.net.wa.Headers.Rs,Vc=olympe.net.wa.Headers.Ps,Wc=olympe.net.wa.Headers.Qs,Xc=olympe.net.wa.Tb.Ah;
438
+ a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.J=a||null}fa(){}};olympe.net.pe.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.Vu=class extends olympe.net.Ta{N(){return'NodeJS'}Pf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.Wu(b,this.G);b.open(a);return b}J(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.Wu=class extends olympe.net.pe.WebSocket{fa(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={rD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Li)&&Ua(a,olympe.net.U.Li,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.Vu,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={qk:0,pk:1,um:2},Tc=olympe.net.wa.Md.hq,Uc=olympe.net.wa.Headers.Rs,Vc=olympe.net.wa.Headers.Ps,Wc=olympe.net.wa.Headers.Qs,Xc=olympe.net.wa.Tb.Ah;
439
439
  function Yc(a,b){const c=b.methods,d=b.sy,e=b.headers,f=b.origin;a.D.route({bodyLimit:a.$<<20,url:b.path,method:[...c,Tc],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[Uc]:f,[Wc]:c,[Vc]:e};if(k===Tc)return a.G.debug('< HTTP: OPTIONS'),h.code(Xc).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=
440
440
  new olympe.net.Ai(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;a.G.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.Hc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Rc)&&h.type(olympe.net.wa.ul.fe);if(u>=olympe.net.wa.Tb.Pi)throw Error(x);u>=olympe.net.wa.Tb.gl?a.G.warn('> HTTP: client bad request: reply with error:',
441
441
  x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.kj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.wa.Tb.Pi).headers(Object.assign(l,{[olympe.net.wa.Headers.oi]:'text/plain'})).send('Internal server error')})}})}
442
- olympe.Wa.node.net.http.Nh=class extends olympe.net.Nh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.ba=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.qk;this.td=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Nh.ALL;this.N.set(a,{path:b,methods:c,sy:d,headers:e,origin:e});return this.J()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.J():b.stop()})}start(){if(this.j===Sc.qk)return this.J();if(this.j===Sc.pk){for(const a of this.N.values())Yc(this,
443
- a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.um;this.G.debug('Web server listening on '+a);this.td.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.td.forEach(b=>b(a))}).finally(()=>this.td.clear())}return Promise.reject('Try to start a webservice already started')}J(){return this.j===Sc.pk?(new Promise((a,b)=>{this.td.add(c=>c?b(c):a())})).then(()=>this.J()):new Promise((a,b)=>{this.td.add(c=>c?b(c):a());this.dj(()=>{const c=this;return w(function*(){c.j=Sc.pk;
442
+ olympe.Va.node.net.http.Nh=class extends olympe.net.Nh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.ba=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.qk;this.hd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Nh.ALL;this.N.set(a,{path:b,methods:c,sy:d,headers:e,origin:e});return this.J()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.J():b.stop()})}start(){if(this.j===Sc.qk)return this.J();if(this.j===Sc.pk){for(const a of this.N.values())Yc(this,
443
+ a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.um;this.G.debug('Web server listening on '+a);this.hd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.hd.forEach(b=>b(a))}).finally(()=>this.hd.clear())}return Promise.reject('Try to start a webservice already started')}J(){return this.j===Sc.pk?(new Promise((a,b)=>{this.hd.add(c=>c?b(c):a())})).then(()=>this.J()):new Promise((a,b)=>{this.hd.add(c=>c?b(c):a());this.dj(()=>{const c=this;return w(function*(){c.j=Sc.pk;
444
444
  yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.um?this.D.close().then(()=>{this.j=Sc.qk}):Promise.resolve()}createServer(){var a=olympe.ja.yb.j.zr,b=this.G.J();a={logger:{level:olympe.ja.yb.D[b===olympe.ja.yb.j.Uj?a:b].toLowerCase()},http2:this.ba};if('string'===typeof this.R){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.R,'key.pem')),cert:b.readFileSync(c.join(this.R,'cert.pem'))}})}a=Qc(a);a.addContentTypeParser('*',
445
- {parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}dj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.Xi,olympe.Wa.node.net.http.Nh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.rf),new olympe.W.pa(olympe.net.U.op),new olympe.W.pa(olympe.net.U.vr),new olympe.W.pa(olympe.net.U.np))},'olympe.native.node.net.http');olympe.Wa.node.V={};const Zc=require('stream').Readable,$c=require('buffer');
446
- olympe.Wa.node.V.ll=class extends olympe.V.ll{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')}J(a){const b=this,c=()=>super.J;return w(function*(){if(a instanceof Zc){const d=[];for(const e=fa(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>$c.resolveObjectURL(a)).catch(b=>
447
- {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Va(a,olympe.V.P.pg,olympe.Wa.node.V.ll)},'olympe.native.node.utils');olympe.async={};function bd(a,b){a.J||a.Y.push(a.F.F(b))}
448
- olympe.async.No=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Xb('Async executor context');this.fa=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.J=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Ic()}Cn(a){0<=a&&(this.timeout=a);return this}$a(){return this.G}add(a){this.J||this.D.push(this.F.F(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)},
445
+ {parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}dj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.Xi,olympe.Va.node.net.http.Nh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.rf),new olympe.W.pa(olympe.net.U.op),new olympe.W.pa(olympe.net.U.vr),new olympe.W.pa(olympe.net.U.np))},'olympe.native.node.net.http');olympe.Va.node.V={};const Zc=require('stream').Readable,$c=require('buffer');
446
+ olympe.Va.node.V.ll=class extends olympe.V.ll{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')}J(a){const b=this,c=()=>super.J;return w(function*(){if(a instanceof Zc){const d=[];for(const e=fa(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>$c.resolveObjectURL(a)).catch(b=>
447
+ {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Va(a,olympe.V.P.qg,olympe.Va.node.V.ll)},'olympe.native.node.utils');olympe.async={};function bd(a,b){a.J||a.Y.push(a.F.F(b))}
448
+ olympe.async.No=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Xb('Async executor context');this.fa=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.J=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Ic()}Cn(a){0<=a&&(this.timeout=a);return this}ab(){return this.G}add(a){this.J||this.D.push(this.F.F(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)},
449
449
  this.$),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.Y=[];this.env.clear();this.fa&&this.F.destroy()}complete(a){this.F.Qf(this.$);if(!this.J){this.J=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.Y)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
450
450
  function cd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Qv=class extends olympe.async.No{static create(){return new olympe.async.Qv(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),cd(this))}};
451
451
  olympe.async.fk=class extends olympe.async.No{constructor(a,b){super(a,b);this.R=0;this.ba=!0}static create(){return new olympe.async.fk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ba=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.J&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.ba)}start(){if(!this.N)if(super.start(),
452
452
  0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.Cu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ba(){}$(){}clear(){}J(){}};olympe.Db.Du=class{D(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.Mu=class{get(){return null}set(){return this}delete(){}};olympe.Db.P={Vj:'localStorage.KeyValueDatabaseManager',Qi:'localStorage.Storage',bA:'localStorage.DatacloudStorage',Wl:'localStorage.LocalStorage',Ca:'localStorage.Logger',Og:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Db.P.Vj);E(a,olympe.Db.P.Og,[],()=>'olympe');E(a,olympe.Db.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Db.P.Wl,olympe.Db.Mu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Fo=class extends Error{};olympe.L.errors.mq=class extends Error{};olympe.L.errors.bq=class extends Error{};olympe.L.errors.wk=class extends Error{};olympe.L.errors.no=class extends Error{};olympe.L.errors.Pq=class extends Error{};olympe.L.errors.pq=class extends Error{};olympe.L.errors.kw=class extends Error{};olympe.L.errors.xm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Ji=class extends olympe.L.errors.xm{};
453
- olympe.L.errors.Yn=class extends olympe.L.errors.xm{};olympe.L.errors.jp=class extends olympe.L.errors.xm{};olympe.L.Yb={Pj:'urls.FileSvc',Qn:'urls.BackupSvc',Gq:'urls.RestoreBackupSvc',xg:'urls.GetContext',fp:'urls.GraphDef',$n:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',ur:'urls.UserTagFromToken',jw:'urls.UserNameFromTag',iw:'urls.UserRoles',yv:'urls.RoleMembers',Zj:'urls.OpenIDSvc'};
454
- olympe.W.config(a=>{F(a,olympe.L.Yb.Pj,'rest/filesvc');F(a,olympe.L.Yb.Qn,'rest/backupsvc');F(a,olympe.L.Yb.Gq,'rest/backupsvc/restore');F(a,olympe.L.Yb.Zj,'rest/openid');F(a,olympe.L.Yb.xg,'rest/initialData');F(a,olympe.L.Yb.fp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.$n,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.ur,'rest/token');F(a,olympe.L.Yb.jw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.iw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.yv,
453
+ olympe.L.errors.Yn=class extends olympe.L.errors.xm{};olympe.L.errors.jp=class extends olympe.L.errors.xm{};olympe.L.Yb={Pj:'urls.FileSvc',Qn:'urls.BackupSvc',Gq:'urls.RestoreBackupSvc',yg:'urls.GetContext',fp:'urls.GraphDef',$n:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',ur:'urls.UserTagFromToken',jw:'urls.UserNameFromTag',iw:'urls.UserRoles',yv:'urls.RoleMembers',Zj:'urls.OpenIDSvc'};
454
+ olympe.W.config(a=>{F(a,olympe.L.Yb.Pj,'rest/filesvc');F(a,olympe.L.Yb.Qn,'rest/backupsvc');F(a,olympe.L.Yb.Gq,'rest/backupsvc/restore');F(a,olympe.L.Yb.Zj,'rest/openid');F(a,olympe.L.Yb.yg,'rest/initialData');F(a,olympe.L.Yb.fp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.$n,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.ur,'rest/token');F(a,olympe.L.Yb.jw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.iw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.yv,
455
455
  'rest/authorization/roleMembers')});function dd(a){Ic(a.D,()=>{ed(a)});Kc(a.D,()=>{a.$=!0});Jc(a.D,()=>{fd(a).then(()=>{a.$=!1;gd(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.D.end()})})}function hd(a){return id(a.Eb)&&Fc(a.D)}
456
- function jd(a,b,c){return w(function*(){hd(a)||(yield a.connect());a.G.debug(`Bus: Subscribe to ${b}`);a.ba.set(b,c);yield a.D.subscribe(a.fa+b,d=>{a.G.j()&&a.G.debug(`BUS < #${b}:`,JSON.stringify(d));let e=null;try{if(kd(a,d.seq,'consumed'),e=olympe.L.sk.D(d,a.cb,f=>ld(a,d.src,f).stream),kd(a,e.ce.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.L.bb.j.fe){md(a,e);return}}catch(f){a.G.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
456
+ function jd(a,b,c){return w(function*(){hd(a)||(yield a.connect());a.G.debug(`Bus: Subscribe to ${b}`);a.ba.set(b,c);yield a.D.subscribe(a.fa+b,d=>{a.G.j()&&a.G.debug(`BUS < #${b}:`,JSON.stringify(d));let e=null;try{if(kd(a,d.seq,'consumed'),e=olympe.L.sk.D(d,a.$a,f=>ld(a,d.src,f).stream),kd(a,e.de.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.L.cb.j.fe){md(a,e);return}}catch(f){a.G.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
457
457
  e&&c(e)})})}function ed(a){a.G.info('Disconnected from bus');let b;null==(b=a.j)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${c.j.size} subscriptions for ${d} service.`),nd(c))})}
458
- function fd(a){a.G.debug('Connection to bus established. Listening to responses on topic',a.J);return a.D.subscribe(a.J,b=>{a.G.j()&&a.G.debug('BUS <',JSON.stringify(b));kd(a,b.seq,'consumed');const c=olympe.L.bb.D(b,a.cb,d=>ld(a,b.src,d).stream);kd(a,c.ce.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.L.bb.j.fe)md(a,c);else{let d;null==(d=a.F.get(c.ce))||d(c)}})}
458
+ function fd(a){a.G.debug('Connection to bus established. Listening to responses on topic',a.J);return a.D.subscribe(a.J,b=>{a.G.j()&&a.G.debug('BUS <',JSON.stringify(b));kd(a,b.seq,'consumed');const c=olympe.L.cb.D(b,a.$a,d=>ld(a,b.src,d).stream);kd(a,c.de.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.L.cb.j.fe)md(a,c);else{let d;null==(d=a.F.get(c.de))||d(c)}})}
459
459
  function gd(a){a.G.debug(`Connected to bus: subscribe to ${a.ba.size} active topics.`);a.ba.forEach((c,d)=>{jd(a,d,c).catch(e=>{a.G.error(`Failed to subscribe topic after connecting to the bus, with error: ${e}`)})});let b;null==(b=a.j)||b.forEach((c,d)=>{null===c.D&&(a.G.debug(`Connected to bus: start keep alive of ${c.j.size} subscriptions for ${d} service.`),od(c,!0))});a.R.forEach(c=>c(null));a.R=[]}
460
460
  function pd(a){a.$b=a.Ga.j(()=>hd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function kd(a,b,c,d=new Map){a.Ub.j&&mb(a.Ub,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function ld(a,b,c){const d=`${b}:${c}`;b=a.ua.get(d);b||(b=new olympe.L.oq(()=>a.ua.delete(d)),a.ua.set(d,b));return b}
461
- function md(a,b){const c=olympe.L.Fe.tg,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,f=b.j,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=ld(a,b.sb(),g);if(h===c){fb(a.ua.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}`))}function qd(a,b,c,d){const e=rd(a.N).Ad();a.Y++;return new olympe.L.sk(b,a.J,e,a.Y,c,d)}
462
- function sd(a,b,c,d){const e=b.ce;let f=null;f=setTimeout(()=>td(a,e),a.Kc);a.F.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.L.bb.j.al?f=setTimeout(()=>td(a,e),d):(a.F.delete(e),c(g))})}function td(a,b){const c=a.F.get(b);a.F.delete(b);null==c||c(new olympe.L.bb(a.J,a.J,b,olympe.L.bb.j.zb,{reason:'Timeout'}))}function ud(a,b){a.Y++;const c=a.Y,d=setTimeout(()=>td(a,c),a.Kc);a.F.set(c,e=>{a.F.delete(c);clearTimeout(d);b(e)});return a.Y}
461
+ function md(a,b){const c=olympe.L.Fe.ug,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,f=b.j,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=ld(a,b.sb(),g);if(h===c){fb(a.ua.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}`))}function qd(a,b,c,d){const e=rd(a.N).Bd();a.Y++;return new olympe.L.sk(b,a.J,e,a.Y,c,d)}
462
+ function sd(a,b,c,d){const e=b.de;let f=null;f=setTimeout(()=>td(a,e),a.Kc);a.F.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.L.cb.j.al?f=setTimeout(()=>td(a,e),d):(a.F.delete(e),c(g))})}function td(a,b){const c=a.F.get(b);a.F.delete(b);null==c||c(new olympe.L.cb(a.J,a.J,b,olympe.L.cb.j.zb,{reason:'Timeout'}))}function ud(a,b){a.Y++;const c=a.Y,d=setTimeout(()=>td(a,c),a.Kc);a.F.set(c,e=>{a.F.delete(c);clearTimeout(d);b(e)});return a.Y}
463
463
  function vd(a,b){return w(function*(){let c;const d=null==(c=a.j)?void 0:c.get(b);d&&(nd(d),a.j.delete(b));a.ba.delete(b);a.G.debug(`Bus: Unsubscribe to ${b}`);hd(a)&&(yield Hc(a.D,a.fa+b))})}function wd(a,b,c,d,e){null===a.j&&(a.j=new Map);let f=a.j.get(b);f?(a=f,a.F!==d&&(a.F=d,null!==a.D&&(nd(a),od(a,!1)))):(f=new olympe.L.Vv(a.G,a,b,d),a.j.set(b,f));d=f;d.j.set(c,e);1===d.j.size&&od(d,!1)}
464
- function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.bb.j.Cm,hd(a)&&a.publish(qd(a,b,d,c)).catch(f=>a.G.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.j.size&&(a.j.delete(b),0===a.j.size&&(a.j=null))}function zd(a,b){return new Promise((c,d)=>{a.N.dh(b.me(),(e,f)=>{e?d(e):c(f)})})}
465
- olympe.L.Zn=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Eb=c;this.N=d;this.Ga=e;this.cb=f;this.Ub=g;this.F=new Map;this.Kc=h.get('shortTimeout');this.Ec=h.get('requestTimeout');this.$c=h.get('subscriptionsRefreshRate');this.Bb=h.get('allowGuest');a=h.get('connection');b=this.N.j.rb().asObservable();c=c.Pf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.Ad()}):null));this.D=new olympe.net.uf(c);dd(this);
464
+ function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.cb.j.Cm,hd(a)&&a.publish(qd(a,b,d,c)).catch(f=>a.G.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.j.size&&(a.j.delete(b),0===a.j.size&&(a.j=null))}function zd(a,b){return new Promise((c,d)=>{a.N.dh(b.me(),(e,f)=>{e?d(e):c(f)})})}
465
+ olympe.L.Zn=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Eb=c;this.N=d;this.Ga=e;this.$a=f;this.Ub=g;this.F=new Map;this.Kc=h.get('shortTimeout');this.Ec=h.get('requestTimeout');this.$c=h.get('subscriptionsRefreshRate');this.Bb=h.get('allowGuest');a=h.get('connection');b=this.N.j.rb().asObservable();c=c.Pf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.Bd()}):null));this.D=new olympe.net.uf(c);dd(this);
466
466
  this.fa='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.fa;this.fa=k;if(hd(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.ba).map(([p,q])=>{const r=this;return w(function*(){yield jd(r,p,q);yield Hc(r.D,l+p)})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.j)||n.forEach(p=>{Ad(p)})}});this.Wd=this.Y=0;this.J=olympe.V.Ic();this.j=null;
467
- this.$=!1;this.R=[];this.ba=new Map;this.ua=new olympe.V.Jh(this.Ec);this.rc=this.$b='';this.gb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};hd(this)?a():this.$||this.gb?this.R.push(d=>d?b(d):a()):id(this.Eb)?(this.gb=!0,olympe.C.zs([this.N.Sk()],d=>{pd(this);this.gb=!1;d.valueOf()||this.Bb?(this.Bb||Bd(this.N,()=>this.disconnect().then()),this.$=!0,this.R.push(e=>e?b(e):a()),this.D.connect(),this.rc=this.Ga.fa(()=>this.disconnect(),'Bus websocket')):
468
- 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(){return new Promise(a=>{this.G.debug('Disconnecting from bus');this.N.ba.delete('busLogoutCallback');this.Ga.F(this.$b);this.Ga.N(this.rc);this.D.end(!1,()=>a())})}publish(a,b=!1){const c=this;return w(function*(){if(!c.$||a.getType()!==olympe.L.bb.j.xe){hd(c)||(yield c.connect());var d=b?a.jc():c.fa+
469
- a.jc();try{kd(c,a.ce.toString(),'serialize');var e=a.ga(c.cb,c.Vd.bind(c,a));c.G.j()&&c.G.debug(`BUS > #${d}:`,JSON.stringify(e))}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ce}): ${f}`);}yield c.D.publish(d,e);kd(c,a.ce.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}Vd(a,b){const c=this.Wd++;(()=>{const d=this;return w(function*(){const e=l=>d.publish(new olympe.L.bb(a.jc(),a.sb(),a.ce,olympe.L.bb.j.fe,l)),
470
- f=olympe.L.Fe.tg,g=olympe.L.Fe.Yf,h=olympe.L.Fe.zb;let k=0;try{for(const l=fa(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}ud(a,b,c){return this.send(a.ce,a.sb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.L.bb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=qd(this,a,b,c);c=olympe.L.bb.j.al;if(b===olympe.L.bb.j.PUBLISH){const f=new olympe.L.bb(a,
471
- this.J,e.ce,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Ec);this.publish(e).catch(g)})}};olympe.L.Zn.j='Timeout';const Cd=olympe.net.wa.Headers.Pn,Dd=olympe.net.wa.Tb.Ah,Ed=olympe.net.wa.Tb.ho,Fd=olympe.net.wa.Tb.yj,Gd=olympe.net.wa.Tb.Fv,Hd=olympe.net.wa.Tb.eo,Id=olympe.net.wa.Tb.So,Jd=olympe.net.wa.Tb.dw,Kd=olympe.net.wa.Tb.$l;function Ld(a,b){let c;return null!=(c=a.F.get(b))?c:''}function Md(a,b,c,d=new Map){a.j.j&&mb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
467
+ this.$=!1;this.R=[];this.ba=new Map;this.ua=new olympe.V.Jh(this.Ec);this.rc=this.$b='';this.fb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};hd(this)?a():this.$||this.fb?this.R.push(d=>d?b(d):a()):id(this.Eb)?(this.fb=!0,olympe.C.zs([this.N.Sk()],d=>{pd(this);this.fb=!1;d.valueOf()||this.Bb?(this.Bb||Bd(this.N,()=>this.disconnect().then()),this.$=!0,this.R.push(e=>e?b(e):a()),this.D.connect(),this.rc=this.Ga.fa(()=>this.disconnect(),'Bus websocket')):
468
+ 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(){return new Promise(a=>{this.G.debug('Disconnecting from bus');this.N.ba.delete('busLogoutCallback');this.Ga.F(this.$b);this.Ga.N(this.rc);this.D.end(!1,()=>a())})}publish(a,b=!1){const c=this;return w(function*(){if(!c.$||a.getType()!==olympe.L.cb.j.we){hd(c)||(yield c.connect());var d=b?a.jc():c.fa+
469
+ a.jc();try{kd(c,a.de.toString(),'serialize');var e=a.ga(c.$a,c.Vd.bind(c,a));c.G.j()&&c.G.debug(`BUS > #${d}:`,JSON.stringify(e))}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.de}): ${f}`);}yield c.D.publish(d,e);kd(c,a.de.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}Vd(a,b){const c=this.Wd++;(()=>{const d=this;return w(function*(){const e=l=>d.publish(new olympe.L.cb(a.jc(),a.sb(),a.de,olympe.L.cb.j.fe,l)),
470
+ f=olympe.L.Fe.ug,g=olympe.L.Fe.Yf,h=olympe.L.Fe.zb;let k=0;try{for(const l=fa(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}vd(a,b,c){return this.send(a.de,a.sb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.L.cb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=qd(this,a,b,c);c=olympe.L.cb.j.al;if(b===olympe.L.cb.j.PUBLISH){const f=new olympe.L.cb(a,
471
+ this.J,e.de,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Ec);this.publish(e).catch(g)})}};olympe.L.Zn.j='Timeout';const Cd=olympe.net.wa.Headers.Pn,Dd=olympe.net.wa.Tb.Ah,Ed=olympe.net.wa.Tb.ho,Fd=olympe.net.wa.Tb.yj,Gd=olympe.net.wa.Tb.Fv,Hd=olympe.net.wa.Tb.eo,Id=olympe.net.wa.Tb.So,Jd=olympe.net.wa.Tb.dw,Kd=olympe.net.wa.Tb.$l;function Ld(a,b){let c;return null!=(c=a.F.get(b))?c:''}function Md(a,b,c,d=new Map){a.j.j&&mb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
472
472
  function Nd(a,b,c){if(null===b)return Promise.reject('No http request to send');Ac(b,{[Cd]: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}`)}Md(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Dc(a.J,b).then(f=>{Md(a,e,'reply');switch(f.Hc()){case Dd:case Ed:case Fd:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Hc(),`content: ${'string'===
473
473
  typeof g?g:typeof g}`);return f;case Gd:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.L.errors.pq(f);case Hd:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case Id:case Jd:throw f=`HTTP < request authorization denied: ${b.j()}`,a.G.error(f),new olympe.L.errors.kw(f);case Kd:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.L.errors.bq(f);default:g=`HTTP < Error: ${f.Hc()}, ${f.statusText}`;
474
- a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.no(g);throw Error(g);}})}).pipe(nb(olympe.L.errors.pq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Mt=class{constructor(a,b,c,d,e){this.G=a;this.J=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.j!==b)switch(a.G.debug('State change '+a.j+' --\x3e '+b),a.j=b,a.Eb.forEach(c=>c(b)),b){case olympe.L.Na.j.zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.Ao:break;case olympe.L.Na.j.qg:a.connected.update(olympe.C.ea.D);break;case olympe.L.Na.j.Ig:a.J=[0,0,a.J[2]];Od(a);break;case olympe.L.Na.j.zb:let c;a.G.error('Connection to server',null==(c=a.R)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ea.j);break;case olympe.L.Na.j.Kn:Od(a);break;case olympe.L.Na.j.Td:a.connected.update(olympe.C.ea.j);
474
+ a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.no(g);throw Error(g);}})}).pipe(nb(olympe.L.errors.pq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Mt=class{constructor(a,b,c,d,e){this.G=a;this.J=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.j!==b)switch(a.G.debug('State change '+a.j+' --\x3e '+b),a.j=b,a.Eb.forEach(c=>c(b)),b){case olympe.L.Na.j.zk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.Ao:break;case olympe.L.Na.j.rg:a.connected.update(olympe.C.ea.D);break;case olympe.L.Na.j.Ig:a.J=[0,0,a.J[2]];Od(a);break;case olympe.L.Na.j.zb:let c;a.G.error('Connection to server',null==(c=a.R)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ea.j);break;case olympe.L.Na.j.Kn:Od(a);break;case olympe.L.Na.j.Td:a.connected.update(olympe.C.ea.j);
475
475
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
476
476
  function Pd(a){const b=olympe.L.Na.j.Kn,c=olympe.L.Na.j.zk,d=olympe.L.Na.j.Td,e=zc(a.ba);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.Ub.D(a.ba);f.$(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(),
477
477
  O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.ba(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
478
- function Qd(a,b,c){a.G.info('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'))}Rd(a,olympe.L.ye.zb,d=>{switch(d.c){case olympe.L.Hi.fw:a.G.error('Unknown message sent to the server:',olympe.L.Na.pc[d.s]);break;case olympe.L.Hi.Et:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.sn&&Sd(a,f,d.i)})}});Rd(a,olympe.L.ye.pc,d=>
479
- {d.c===olympe.L.Hi.tv&&'boolean'===typeof d.a&&a.Yh.update(olympe.C.Rb(d.a))});olympe.C.oj(a.connected,()=>{let d=!1;olympe.C.oj(a.gb.j(),()=>{d&&(a.rc(),a.Bb(),d=!1);xc(a.rc.bind(a),a.$c);xc(a.Bb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Y=null;wc(a.Bb.bind(a),a.Ga)});c.j(()=>Td(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.j}`));c.fa(()=>a.disconnect(),'Orchestrator websocket');hb(a.N,(d,e)=>{e.throw(Error('Stream timeout'))});
480
- a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Td(a){return a.j===olympe.L.Na.j.qg}function Ud(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Eb.delete(e),c(f)};a.Eb.add(e);e(a.j)}function Vd(a,b,c,d,e){a.fa.j&&mb(a.fa,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
481
- function Od(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.qg,e=olympe.L.Na.j.Td,f=olympe.L.Na.j.Ig,g=olympe.L.Na.j.zk,h=olympe.L.Na.j.zb;if(null===a.R)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.D&&(a.D.Y(null),a.D.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.R)?void 0:yc(k)}:${null==(l=a.R)?void 0:l.port}...`);a.D=a.Ub.D(a.R);a.D.ba(a.Vd.bind(a));a.D.$(a.Gf.bind(a));
482
- a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.ba&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.ba=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.Wd;a.Wd++;c={message:{seqId:e,messageFamily:b,payload:c},Om:d?Xd(d):null,sn:null};a.F.set(e,c);Vd(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Ig];(Td(a)||b===olympe.L.ye.Tj&&d.includes(a.j))&&Yd(a,e,c)}
478
+ function Qd(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'))}Rd(a,olympe.L.xe.zb,d=>{switch(d.c){case olympe.L.Hi.fw:a.G.error('Unknown message sent to the server:',olympe.L.Na.pc[d.s]);break;case olympe.L.Hi.Et:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.sn&&Sd(a,f,d.i)})}});Rd(a,olympe.L.xe.pc,d=>
479
+ {d.c===olympe.L.Hi.tv&&'boolean'===typeof d.a&&a.Yh.update(olympe.C.Rb(d.a))});olympe.C.oj(a.connected,()=>{let d=!1;olympe.C.oj(a.fb.j(),()=>{d&&(a.rc(),a.Bb(),d=!1);xc(a.rc.bind(a),a.$c);xc(a.Bb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Y=null;wc(a.Bb.bind(a),a.Ga)});c.j(()=>Td(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.j}`));c.fa(()=>a.disconnect(),'Orchestrator websocket');hb(a.N,(d,e)=>{e.throw(Error('Stream timeout'))});
480
+ a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Td(a){return a.j===olympe.L.Na.j.rg}function Ud(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Eb.delete(e),c(f)};a.Eb.add(e);e(a.j)}function Vd(a,b,c,d,e){a.fa.j&&mb(a.fa,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
481
+ function Od(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.rg,e=olympe.L.Na.j.Td,f=olympe.L.Na.j.Ig,g=olympe.L.Na.j.zk,h=olympe.L.Na.j.zb;if(null===a.R)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.D&&(a.D.Y(null),a.D.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.R)?void 0:yc(k)}:${null==(l=a.R)?void 0:l.port}...`);a.D=a.Ub.D(a.R);a.D.ba(a.Vd.bind(a));a.D.$(a.Gf.bind(a));
482
+ a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.ba&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.ba=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.Wd;a.Wd++;c={message:{seqId:e,messageFamily:b,payload:c},Om:d?Xd(d):null,sn:null};a.F.set(e,c);Vd(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Ig];(Td(a)||b===olympe.L.xe.Tj&&d.includes(a.j))&&Yd(a,e,c)}
483
483
  function Xd(a){const b=olympe.L.Na.D.Ri;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.pc[e]?`Status code = ${e} [${olympe.L.Na.pc[e]}]`:`Status code = ${e}`;e=olympe.L.errors.Pq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.L.errors.wk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
484
- function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.Om?a.F.delete(b):c.sn=Date.now():olympe.C.Pa(a.gb.j()).valueOf()&&O(a,olympe.L.Na.j.Ig);return d}function Rd(a,b,c,d){void 0===d&&(d=olympe.V.Ic());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Zd(a){a=a.ua.get(olympe.L.ye.Cg);void 0!==a&&a.delete('logoutHandler')}
485
- function Sd(a,b,c){if(a.F.has(b)){const {Om:d}=a.F.get(b);a.F.delete(b);null==d||d({s:olympe.L.Na.D.Xt,error:c})}}function $d(a,b){a.G.error(b);O(a,olympe.L.Na.j.zb)}function ae(a,b,c){a.Ec=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.R)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Yd(a,e,f))return;O(a,olympe.L.Na.j.qg)}
486
- function be(a,b){const c=olympe.L.Fe.tg,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,{id:f,e:g}=b;let h=a.N.get(f);h||(h=new olympe.L.oq(()=>a.N.delete(f)),a.N.set(f,h));if(g===c){fb(a.N.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}`))}
487
- olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Ub=b;this.R=null;e.subscribe(k=>{this.R=k;k=olympe.L.Na.j.CONNECTING;if(this.j===olympe.L.Na.j.qg||this.j===k){let l;null==(l=this.D)||l.close()}});this.ba=this.D=null;e.subscribe(k=>{this.ba=k;k=olympe.L.Na.j.Td;this.j===olympe.L.Na.j.zk&&(O(this,k),Pd(this))});this.fa=g;this.$c=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.$=olympe.V.Df.parse(h.get('clientVersion'));this.cb=olympe.V.Df.parse(h.get('serverVersion'));this.j=
488
- olympe.L.Na.j.INIT;this.gb=d;this.$b=h.get('getContextMode');this.Wd=1;this.Y=null;this.J=[0,0,0];this.ua=new Map;this.connected=olympe.C.cc(olympe.C.ea,'Server is connected');this.Yh=gc(olympe.C.cc(olympe.C.ea,'Server is readonly'),olympe.C.ea.j);this.Eb=new Set;this.F=new Map;this.N=new olympe.V.Jh(this.Ga);this.Kc=new Map;this.Ec=-1;Qd(this,h,c)}connect(){const a=olympe.L.Na.j.qg,b=olympe.L.Na.j.Td,c=olympe.L.Na.j.zb,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.j!==d&&this.j!==b||Od(this);
489
- Ud(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.Ao,d=olympe.L.Na.j.Td,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.zb;this.j===olympe.L.Na.j.qg||this.j===e||this.j===c?(Ud(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.j!==c&&(O(this,c),this.D.close())):(O(this,d),a())})}Vd(){this.G.debug('Websocket connected, sending handshake. Client version:',Cb(this.$),
490
- 'subscribeEverything:',this.$b?'NO':'YES');Wd(this,olympe.L.ye.Tj,{c:olympe.L.Hi.Tj,cv:Cb(this.$),m:this.$b?0:1,s:this.Y,b:this.gb.D()},this.Wh.bind(this))}Wh(a,b){if(a)$d(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.Yt:$d(this,`Framework version (${Cb(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
491
- return;case c.Xv:$d(this,`Framework version (${Cb(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ht:$d(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.cb.Ea(olympe.V.Df.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Df.parse(a);if(e.vj(this.cb)){$d(this,`Framework v${Cb(this.$)} is expecting Orchestrator to be at least in v${Cb(this.cb)}`);
492
- return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Cb(this.cb))}catch(f){$d(this,f);return}e=olympe.L.Na.j.Td;if(this.j===olympe.L.Na.j.Ig&&null!==this.Y&&this.Y!==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.Kc.set(f,g);this.Y=b.sessionId||null;ae(this,a,d)}}}rc(){this.J[0]-this.J[1]>this.$c/2?(this.G.debug('Ping did not get answer, try to reconnect'),
493
- O(this,olympe.L.Na.j.Ig)):(this.J[0]=Date.now(),this.D.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Ig)))}Gf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.gb.j()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.fa.j&&(b=performance.now()-this.fa.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=c.seqId;var d=c.stream;
494
- const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Fe.tg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Fe.Yf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Vd(this,a,'consumed',new Map,b);Vd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.N.has(f);be(this,d);if(b)return null;d=this.N.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
484
+ function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.Om?a.F.delete(b):c.sn=Date.now():olympe.C.Pa(a.fb.j()).valueOf()&&O(a,olympe.L.Na.j.Ig);return d}function Rd(a,b,c,d){void 0===d&&(d=olympe.V.Ic());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Zd(a){a=a.ua.get(olympe.L.xe.Cg);void 0!==a&&a.delete('logoutHandler')}
485
+ function Sd(a,b,c){if(a.F.has(b)){const {Om:d}=a.F.get(b);a.F.delete(b);null==d||d({s:olympe.L.Na.D.Xt,error:c})}}function $d(a,b){a.G.error(b);O(a,olympe.L.Na.j.zb)}function ae(a,b,c){a.Ec=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.R)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Yd(a,e,f))return;O(a,olympe.L.Na.j.rg)}
486
+ function be(a,b){const c=olympe.L.Fe.ug,d=olympe.L.Fe.Yf,e=olympe.L.Fe.zb,{id:f,e:g}=b;let h=a.N.get(f);h||(h=new olympe.L.oq(()=>a.N.delete(f)),a.N.set(f,h));if(g===c){fb(a.N.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}`))}
487
+ olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Ub=b;this.R=null;e.subscribe(k=>{this.R=k;k=olympe.L.Na.j.CONNECTING;if(this.j===olympe.L.Na.j.rg||this.j===k){let l;null==(l=this.D)||l.close()}});this.ba=this.D=null;e.subscribe(k=>{this.ba=k;k=olympe.L.Na.j.Td;this.j===olympe.L.Na.j.zk&&(O(this,k),Pd(this))});this.fa=g;this.$c=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.$=olympe.V.Df.parse(h.get('clientVersion'));this.$a=olympe.V.Df.parse(h.get('serverVersion'));this.j=
488
+ olympe.L.Na.j.INIT;this.fb=d;this.$b=h.get('getContextMode');this.Wd=1;this.Y=null;this.J=[0,0,0];this.ua=new Map;this.connected=olympe.C.cc(olympe.C.ea,'Server is connected');this.Yh=gc(olympe.C.cc(olympe.C.ea,'Server is readonly'),olympe.C.ea.j);this.Eb=new Set;this.F=new Map;this.N=new olympe.V.Jh(this.Ga);this.Kc=new Map;this.Ec=-1;Qd(this,h,c)}connect(){const a=olympe.L.Na.j.rg,b=olympe.L.Na.j.Td,c=olympe.L.Na.j.zb,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.j!==d&&this.j!==b||Od(this);
489
+ Ud(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.Ao,d=olympe.L.Na.j.Td,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.zb;this.j===olympe.L.Na.j.rg||this.j===e||this.j===c?(Ud(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.j!==c&&(O(this,c),this.D.close())):(O(this,d),a())})}Vd(){this.G.debug('Websocket connected, sending handshake. Client version:',Cb(this.$),
490
+ 'subscribeEverything:',this.$b?'NO':'YES');Wd(this,olympe.L.xe.Tj,{c:olympe.L.Hi.Tj,cv:Cb(this.$),m:this.$b?0:1,s:this.Y,b:this.fb.D()},this.Wh.bind(this))}Wh(a,b){if(a)$d(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.Yt:$d(this,`Framework version (${Cb(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
491
+ return;case c.Xv:$d(this,`Framework version (${Cb(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Ht:$d(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.$a.Ea(olympe.V.Df.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.Df.parse(a);if(e.vj(this.$a)){$d(this,`Framework v${Cb(this.$)} is expecting Orchestrator to be at least in v${Cb(this.$a)}`);
492
+ return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Cb(this.$a))}catch(f){$d(this,f);return}e=olympe.L.Na.j.Td;if(this.j===olympe.L.Na.j.Ig&&null!==this.Y&&this.Y!==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.Kc.set(f,g);this.Y=b.sessionId||null;ae(this,a,d)}}}rc(){this.J[0]-this.J[1]>this.$c/2?(this.G.debug('Ping did not get answer, try to reconnect'),
493
+ O(this,olympe.L.Na.j.Ig)):(this.J[0]=Date.now(),this.D.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Ig)))}Gf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.fb.j()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.fa.j&&(b=performance.now()-this.fa.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=c.seqId;var d=c.stream;
494
+ const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.Fe.ug?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.Fe.Yf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Vd(this,a,'consumed',new Map,b);Vd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.N.has(f);be(this,d);if(b)return null;d=this.N.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
495
495
  null;f=d.stream}this.F.has(a)&&({Om:d}=this.F.get(a),this.F.delete(a),null==d||d(c,f));a=this.ua.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}Bb(){const a=Date.now();for(const [b,{sn:c}]of this.F)null!==c&&a-c>this.Ga&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),Sd(this,b,'Message timeout: never receive acknowledge'))}};function id(a){return olympe.C.Pa(a.j)===olympe.L.uc.j.Mi}
496
- function ce(a,b){const c=olympe.L.uc.j.im,d=olympe.L.uc.j.ee,e=olympe.L.uc.j.Td,f=olympe.L.uc.j.Lv,g=b.get('reconnectionDelay');Ud(a.F,[olympe.L.Na.j.INIT],()=>{de(a)?(a.j.update(c),a.connect().catch(h=>a.G.error(h))):a.F.disconnect().catch(h=>a.G.error(h))},!0);Ud(a.F,[olympe.L.Na.j.Td],()=>{if(olympe.C.Pa(a.j)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.j.update(a.D?d:e),de(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.D?a.G.log(h):a.G.error(h);
496
+ function ce(a,b){const c=olympe.L.uc.j.im,d=olympe.L.uc.j.ye,e=olympe.L.uc.j.Td,f=olympe.L.uc.j.Lv,g=b.get('reconnectionDelay');Ud(a.F,[olympe.L.Na.j.INIT],()=>{de(a)?(a.j.update(c),a.connect().catch(h=>a.G.error(h))):a.F.disconnect().catch(h=>a.G.error(h))},!0);Ud(a.F,[olympe.L.Na.j.Td],()=>{if(olympe.C.Pa(a.j)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.j.update(a.D?d:e),de(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.D?a.G.log(h):a.G.error(h);
497
497
  setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.R.D(()=>{a.j.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function de(a){return null===a.storage.get(a.J+'olympe_manual_offline')}
498
- olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.F=b;this.R=d;this.storage=e;this.j=olympe.C.cc(Number).update(olympe.L.uc.j.INIT);this.D=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');ce(this,f)}Pf(){const a=olympe.L.uc.j.Mi,b=olympe.L.uc.j.ee,c=olympe.L.uc.j.Td;let d=olympe.C.ea.j;return olympe.C.ta([this.j],e=>{if(e===a)d=olympe.C.ea.D;else if(e===b||e===c)d=olympe.C.ea.j;return d},olympe.C.ea)}getState(){return this.j.rb()}connect(){const a=
499
- this;return w(function*(){const b=olympe.L.uc.j.Mi,c=olympe.L.uc.j.im;olympe.C.Pa(a.j)!==b&&(a.j.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.F.connect(),yield ee(),a.j.update(b))})}disconnect(){const a=this;return w(function*(){const b=olympe.L.uc.j.ee,c=olympe.L.uc.j.im;if(!a.D)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.J+'olympe_manual_offline','true');olympe.C.Pa(a.j)!==b&&
500
- (a.j.update(c),yield olympe.L.$h().disconnect(),yield a.F.disconnect())})}};olympe.L.uc.j={INIT:0,im:1,Mi:2,ee:3,Td:4,Lv:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.bb=class{constructor(a,b,c,d,e){this.ce=c;this.D=a;this.source=b;this.messageType=d;this.j=null!=e?e:null}static D(a,b,c){let d;var e=olympe.L.bb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.R=c;return new e(f,g,h,k,b.N(null!=(d=a.content)?d:null))}jc(){return this.D}sb(){return this.source}getType(){return this.messageType}ga(a,b){const c={dest:this.D,src:this.source,seq:this.ce,type:this.messageType};null!==this.j&&(a.Y=b,c.content=a.ga(this.j));return c}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.ce}, type: ${this.messageType})`}};
501
- olympe.L.bb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,xr:4,fe:5,zm:6,zb:7,al:10,Vq:11,nr:12,xe:13,Cm:14};olympe.L.sk=class extends olympe.L.bb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.F=c}static D(a,b,c){let d;var e=olympe.L.sk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.R=c;return new e(f,g,h,k,l,b.N(null!=(d=a.content)?d:null))}me(){return this.F}ga(a,b){return Object.assign(super.ga(a,b),{auth:this.F})}};olympe.L.sk.Hi={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,xe:4,Cm:5};const fe=olympe.L.bb.j.SEND,ge=olympe.L.bb.j.GET,he=olympe.L.bb.j.SUBSCRIBE,ie=olympe.L.bb.j.xe,je=olympe.L.bb.j.Vq,ke=olympe.L.bb.j.zb,le=olympe.L.bb.j.xr,me=olympe.L.bb.j.zm,ne=olympe.L.bb.j.nr;
502
- olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.J=c;this.F=null}ii(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Bs(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Hr(){return this.j.getType()===fe?this.D.ud(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}ud(a){const b=this.j.getType();return b===ge||b===ie?this.D.ud(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}mn(a){if(this.j.getType()!==
503
- he)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.V.Ic();return new Promise((c,d)=>{const e={seq:ud(this.D,f=>{switch(f.getType()){case ne:oe(this.J,b);c(b);break;case ke:d(f.j.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.D.$c};this.D.ud(this.j,me,e).catch(d)})}Xh(a){return this.D.ud(this.j,ke,{reason:a.message})}};olympe.L.Zc.prototype.fail=olympe.L.Zc.prototype.Xh;
504
- olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.mn;olympe.L.Zc.prototype.reply=olympe.L.Zc.prototype.ud;olympe.L.Zc.prototype.ack=olympe.L.Zc.prototype.Hr;olympe.L.Zc.prototype.body=olympe.L.Zc.prototype.body;olympe.L.Zc.prototype.source=olympe.L.Zc.prototype.source;olympe.L.Zc.prototype.requestType=olympe.L.Zc.prototype.Bs;olympe.L.Zc.prototype.userTag=olympe.L.Zc.prototype.ii;function Ad(a){const b=olympe.L.errors.Ji;a.j.forEach((c,d)=>{yd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function nd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function od(a,b){b&&a.ff();null===a.D&&(a.D=setInterval(a.ff.bind(a),a.F))}function yd(a,b){b=a.j.delete(b);0===a.j.size&&nd(a);return b}function pe(a,b){a.j.forEach((c,d)=>{yd(a,d);c(b)})}
505
- olympe.L.Vv=class{constructor(a,b,c,d){this.G=a;this.J=b;this.N=c;this.F=d;this.j=new Map;this.D=null}ff(){const a=olympe.L.errors.Ji;hd(this.J)?this.J.request(this.N,olympe.L.bb.j.xe,Array.from(this.j.keys())).then(b=>{b=b.j;0<b.length&&b.forEach(c=>{const d=this.j.get(c);yd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.G.error(b);pe(this,Error(b))}):nd(this)}};olympe.L.ec=class{constructor(){this.R=this.Y=null}ga(a){a=this.D(a);this.Y=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.fb:return this.format(olympe.L.ec.j.wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.ec.j.wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.ec.j.COLOR,
498
+ olympe.L.uc=class{constructor(a,b,c,d,e,f){this.G=a;this.F=b;this.R=d;this.storage=e;this.j=olympe.C.cc(Number).update(olympe.L.uc.j.INIT);this.D=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');ce(this,f)}Pf(){const a=olympe.L.uc.j.Mi,b=olympe.L.uc.j.ye,c=olympe.L.uc.j.Td;let d=olympe.C.ea.j;return olympe.C.ta([this.j],e=>{if(e===a)d=olympe.C.ea.D;else if(e===b||e===c)d=olympe.C.ea.j;return d},olympe.C.ea)}getState(){return this.j.rb()}connect(){const a=
499
+ this;return w(function*(){const b=olympe.L.uc.j.Mi,c=olympe.L.uc.j.im;olympe.C.Pa(a.j)!==b&&(a.j.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.F.connect(),yield ee(),a.j.update(b))})}disconnect(){const a=this;return w(function*(){const b=olympe.L.uc.j.ye,c=olympe.L.uc.j.im;if(!a.D)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.J+'olympe_manual_offline','true');olympe.C.Pa(a.j)!==b&&
500
+ (a.j.update(c),yield olympe.L.$h().disconnect(),yield a.F.disconnect())})}};olympe.L.uc.j={INIT:0,im:1,Mi:2,ye:3,Td:4,Lv:5};olympe.L.uc.D='olympe_manual_offline';olympe.L.cb=class{constructor(a,b,c,d,e){this.de=c;this.D=a;this.source=b;this.messageType=d;this.j=null!=e?e:null}static D(a,b,c){let d;var e=olympe.L.cb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.R=c;return new e(f,g,h,k,b.N(null!=(d=a.content)?d:null))}jc(){return this.D}sb(){return this.source}getType(){return this.messageType}ga(a,b){const c={dest:this.D,src:this.source,seq:this.de,type:this.messageType};null!==this.j&&(a.Y=b,c.content=a.ga(this.j));return c}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.de}, type: ${this.messageType})`}};
501
+ olympe.L.cb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,xr:4,fe:5,zm:6,zb:7,al:10,Vq:11,nr:12,we:13,Cm:14};olympe.L.sk=class extends olympe.L.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.F=c}static D(a,b,c){let d;var e=olympe.L.sk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.R=c;return new e(f,g,h,k,l,b.N(null!=(d=a.content)?d:null))}me(){return this.F}ga(a,b){return Object.assign(super.ga(a,b),{auth:this.F})}};olympe.L.sk.Hi={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,we:4,Cm:5};const fe=olympe.L.cb.j.SEND,ge=olympe.L.cb.j.GET,he=olympe.L.cb.j.SUBSCRIBE,ie=olympe.L.cb.j.we,je=olympe.L.cb.j.Vq,ke=olympe.L.cb.j.zb,le=olympe.L.cb.j.xr,me=olympe.L.cb.j.zm,ne=olympe.L.cb.j.nr;
502
+ olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.J=c;this.F=null}ii(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Bs(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Hr(){return this.j.getType()===fe?this.D.vd(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}vd(a){const b=this.j.getType();return b===ge||b===ie?this.D.vd(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}mn(a){if(this.j.getType()!==
503
+ he)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.V.Ic();return new Promise((c,d)=>{const e={seq:ud(this.D,f=>{switch(f.getType()){case ne:oe(this.J,b);c(b);break;case ke:d(f.j.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.D.$c};this.D.vd(this.j,me,e).catch(d)})}Xh(a){return this.D.vd(this.j,ke,{reason:a.message})}};olympe.L.Zc.prototype.fail=olympe.L.Zc.prototype.Xh;
504
+ olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.mn;olympe.L.Zc.prototype.reply=olympe.L.Zc.prototype.vd;olympe.L.Zc.prototype.ack=olympe.L.Zc.prototype.Hr;olympe.L.Zc.prototype.body=olympe.L.Zc.prototype.body;olympe.L.Zc.prototype.source=olympe.L.Zc.prototype.source;olympe.L.Zc.prototype.requestType=olympe.L.Zc.prototype.Bs;olympe.L.Zc.prototype.userTag=olympe.L.Zc.prototype.ii;function Ad(a){const b=olympe.L.errors.Ji;a.j.forEach((c,d)=>{yd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function nd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function od(a,b){b&&a.ff();null===a.D&&(a.D=setInterval(a.ff.bind(a),a.F))}function yd(a,b){b=a.j.delete(b);0===a.j.size&&nd(a);return b}function pe(a,b){a.j.forEach((c,d)=>{yd(a,d);c(b)})}
505
+ olympe.L.Vv=class{constructor(a,b,c,d){this.G=a;this.J=b;this.N=c;this.F=d;this.j=new Map;this.D=null}ff(){const a=olympe.L.errors.Ji;hd(this.J)?this.J.request(this.N,olympe.L.cb.j.we,Array.from(this.j.keys())).then(b=>{b=b.j;0<b.length&&b.forEach(c=>{const d=this.j.get(c);yd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.G.error(b);pe(this,Error(b))}):nd(this)}};olympe.L.ec=class{constructor(){this.R=this.Y=null}ga(a){a=this.D(a);this.Y=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.ec.j.wl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.ec.j.wl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.ec.j.COLOR,
506
506
  a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.ec.j.Pp,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.ec.j.Ng,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.Ze().j(new Uint8Array(a)),this.format(olympe.L.ec.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.Ze().j(a),this.format(olympe.L.ec.j.Kh,a);case a instanceof
507
507
  olympe.V.stream.yf:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize the stream.');let b;return this.format(olympe.L.ec.j.fe,null==(b=this.Y)?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.ec.j.eq,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'===
508
508
  typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.Fo(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.ec.j.wl:return new Date(c);case olympe.L.ec.j.COLOR:return olympe.C.Color.Ob(c);case olympe.L.ec.j.Pp:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.ec.j.Ng:return new Set(c.map(e=>this.j(e)));case olympe.L.ec.j.ARRAY_BUFFER:return olympe.V.Ze().D(c).buffer;
509
- case olympe.L.ec.j.Kh:return olympe.V.Ze().D(c);case olympe.L.ec.j.fe: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.ec.j.eq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Fo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={wl:1,COLOR:2,Pp:3,Ng:4,ARRAY_BUFFER:5,Kh:6,fe:7,eq:8};const qe=olympe.L.bb.j.SEND,re=olympe.L.bb.j.GET,se=olympe.L.bb.j.PUBLISH,te=olympe.L.bb.j.SUBSCRIBE,ue=olympe.L.bb.j.xe,ve=olympe.L.bb.j.Cm,we=olympe.L.bb.j.Vq,xe=olympe.L.bb.j.al,ye=olympe.L.bb.j.zb,ze=olympe.L.bb.j.xr,Ae=olympe.L.bb.j.zm;function oe(a,b){a.j||(a.j=gb(new olympe.V.Bm(a.D.$c+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
510
- function Be(a,b){const c=olympe.L.bb.j.zm,d=olympe.L.bb.j.nr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.wk(a):Error(a)}
511
- olympe.L.ub=class{constructor(a,b){this.D=olympe.L.$h();this.J=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.D?b.D():b);this.G=olympe.ja.$a(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.D?b.D():b,f=olympe.L.$h();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.$a('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Y(l);f.request(a,te,c,d.timeout).then(n=>
509
+ case olympe.L.ec.j.Kh:return olympe.V.Ze().D(c);case olympe.L.ec.j.fe: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.ec.j.eq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Fo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={wl:1,COLOR:2,Pp:3,Ng:4,ARRAY_BUFFER:5,Kh:6,fe:7,eq:8};const qe=olympe.L.cb.j.SEND,re=olympe.L.cb.j.GET,se=olympe.L.cb.j.PUBLISH,te=olympe.L.cb.j.SUBSCRIBE,ue=olympe.L.cb.j.we,ve=olympe.L.cb.j.Cm,we=olympe.L.cb.j.Vq,xe=olympe.L.cb.j.al,ye=olympe.L.cb.j.zb,ze=olympe.L.cb.j.xr,Ae=olympe.L.cb.j.zm;function oe(a,b){a.j||(a.j=gb(new olympe.V.Bm(a.D.$c+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
510
+ function Be(a,b){const c=olympe.L.cb.j.zm,d=olympe.L.cb.j.nr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.wk(a):Error(a)}
511
+ olympe.L.ub=class{constructor(a,b){this.D=olympe.L.$h();this.J=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.D?b.D():b);this.G=olympe.ja.ab(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.D?b.D():b,f=olympe.L.$h();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Y(l);f.request(a,te,c,d.timeout).then(n=>
512
512
  {switch(n.getType()){case Ae:const p=n.j;h=p.topic;jd(f,h,q=>{q.getType()===se?g.next(q.j):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;wd(f,a,k,p.refresh,q=>g.error(q));Be(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case ye:g.error(Ce(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
513
- return l})).pipe(nb(olympe.L.errors.Ji,(g,h)=>{olympe.ja.$a(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Hs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.J).catch(b=>this.G.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
513
+ return l})).pipe(nb(olympe.L.errors.Ji,(g,h)=>{olympe.ja.ab(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Hs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.J).catch(b=>this.G.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
514
514
  b){return w(function*(){yield olympe.L.$h().request(a,se,b)})}static send(a,b,c={}){return olympe.L.$h().request(a,qe,b,c.timeout).then(d=>{switch(d.getType()){case we:break;case ye:throw Ce(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.$h().request(a,re,b,c.timeout).then(d=>{switch(d.getType()){case ze:d=d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case ye:throw Ce(d);default:throw Error('Unsupported response type for a GET request');
515
- }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);jd(this.D,this.J,c=>{const d=new olympe.L.Zc(c,this.D,this);switch(c.getType()){case ue:var e=d.body().filter(g=>{let h;return!(null==(h=this.j)?0:fb(h,g))});d.ud(e).catch(g=>this.G.error('Not able to validate subscription keep alive',g));break;case ve:c=d.body();null==(e=this.j)||e.delete(c);let f;null==(f=this.F)||f.call(this,c);break;case se:a.next(d);break;default:this.D.ud(c,xe).then(()=>a.next(d))}}).catch(c=>
515
+ }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);jd(this.D,this.J,c=>{const d=new olympe.L.Zc(c,this.D,this);switch(c.getType()){case ue:var e=d.body().filter(g=>{let h;return!(null==(h=this.j)?0:fb(h,g))});d.vd(e).catch(g=>this.G.error('Not able to validate subscription keep alive',g));break;case ve:c=d.body();null==(e=this.j)||e.delete(c);let f;null==(f=this.F)||f.call(this,c);break;case se:a.next(d);break;default:this.D.vd(c,xe).then(()=>a.next(d))}}).catch(c=>
516
516
  {c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}};olympe.L.ub.prototype.listen=olympe.L.ub.prototype.listen;olympe.L.ub.get=olympe.L.ub.get;olympe.L.ub.send=olympe.L.ub.send;olympe.L.ub.publish=olympe.L.ub.publish;olympe.L.ub.prototype.stop=olympe.L.ub.prototype.stop;olympe.L.ub.prototype.setUnsubscriptionHandler=olympe.L.ub.prototype.Hs;olympe.L.ub.observe=olympe.L.ub.observe;olympe.L.oq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.yf;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return w(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!==
517
- 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)}};olympe.L.ye={tg:1,Uf:2,zb:3,Cg:4,Sz:5,Tj:6,pc:7};olympe.L.Hi={Tj:1,fw:2,Et:3,xe:5,tv:1,pD:2};olympe.L.Fe={tg:0,Yf:1,zb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Td:'disconnected',Ao:'disconnecting',qg:'connected',Ig:'reconnecting',zk:'waking',Kn:'awake',zb:'error'};olympe.L.Na.F={Ah:1,Ht:-1,Yt:-2,Xv:-3};olympe.L.Na.D={Ri:0,Xt:23};
517
+ 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)}};olympe.L.xe={ug:1,Uf:2,zb:3,Cg:4,Sz:5,Tj:6,pc:7};olympe.L.Hi={Tj:1,fw:2,Et:3,we:5,tv:1,pD:2};olympe.L.Fe={ug:0,Yf:1,zb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Td:'disconnected',Ao:'disconnecting',rg:'connected',Ig:'reconnecting',zk:'waking',Kn:'awake',zb:'error'};olympe.L.Na.F={Ah:1,Ht:-1,Yt:-2,Xv:-3};olympe.L.Na.D={Ri:0,Xt:23};
518
518
  olympe.L.Na.pc={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',
519
519
  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={kf:'com.ConnectivityManager',nk:'com.ServerManager',Vn:'com.BusManager',Kl:'com.HttpManager',Ee:'com.Serializer',Ca:'com.Logger',br:'com.Source',sr:'com.Urls',NB:'com.peerFileSvcUrl'};
520
- olympe.L.U={yl:'defaultHost',Ev:'server.host',Gv:'server.port',Hv:'server.ssl',Wq:'server.basePath',Br:'server.wsPath',om:'server.reconnectionDelay',qq:'server.pingInterval',Ar:'server.messageTimeout',Iq:'server.retryHttpOnOverload',ql:'server.clientVersion',Zq:'server.serverVersion',Iv:'server.wakeUpService',Zs:'bus.host',$s:'bus.path',at:'bus.port',dt:'bus.vhost',bt:'bus.ssl',xe:'bus.keepalive',xv:'bus.reschedulePings',ht:'bus.clientId',ft:'bus.clean',kt:'bus.connectTimeout',Wn:'bus.shortTimeout',
520
+ olympe.L.U={yl:'defaultHost',Ev:'server.host',Gv:'server.port',Hv:'server.ssl',Wq:'server.basePath',Br:'server.wsPath',om:'server.reconnectionDelay',qq:'server.pingInterval',Ar:'server.messageTimeout',Iq:'server.retryHttpOnOverload',ql:'server.clientVersion',Zq:'server.serverVersion',Iv:'server.wakeUpService',Zs:'bus.host',$s:'bus.path',at:'bus.port',dt:'bus.vhost',bt:'bus.ssl',we:'bus.keepalive',xv:'bus.reschedulePings',ht:'bus.clientId',ft:'bus.clean',kt:'bus.connectTimeout',Wn:'bus.shortTimeout',
521
521
  kl:'bus.requestTimeout',Xn:'bus.subscriptionRefreshRate',qv:'bus.queueQoSZero',jl:'bus.allowGuest',qr:'bus.topicPrefix'};
522
522
  olympe.W.config(function(a){const b=olympe.host.Lg.Dh;F(a,olympe.L.U.yl,a.getParameter(olympe.host.U.lp));F(a,olympe.L.U.Wq,'OlympeServer');F(a,olympe.L.U.qr,'');Ya(a,'com.hostConfig',[olympe.host.U.kk,olympe.L.U.yl,olympe.L.U.Ev,olympe.L.U.Gv,olympe.L.U.Hv,olympe.L.U.Wq,olympe.L.U.Zs,olympe.L.U.dt,olympe.L.U.at,olympe.L.U.$s,olympe.L.U.bt],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.U.Vl);e=e===olympe.host.Lg.Dh;var x=['localhost','127.0.0.1'],y=(u=f.endsWith(u))&&e?`${f}-${b}`:f;g=
523
- null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{tn:g,un:null!=h?h:y?8080:z?e?85:80:443,vn:null!=k?k:!z,Es:l,Gw:n,Kw:null!=p?p:f,Iw:null!=q?q:x?15675:u?e?85:80:443,Hw:null!=r?r:x?'':'/mqtt',Jw:null!=t?t:!u}});F(a,olympe.L.U.Br,'websocket');F(a,olympe.L.U.om,5E3);F(a,olympe.L.U.qq,5E3);F(a,olympe.L.U.Ar,3E4);F(a,olympe.L.U.Iq,4E3);F(a,olympe.L.U.Zq,'7.5.0');F(a,olympe.L.U.xe,30);F(a,olympe.L.U.kl,3E4);F(a,olympe.L.U.Wn,a.getParameter(olympe.L.U.kl));
524
- F(a,olympe.L.U.Xn,6E4);F(a,olympe.L.U.jl,!1);const c=a.getParameter(olympe.jg.U.To);if(void 0!==c)Ua(a,olympe.L.U.ql,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.L.P.Ca,[olympe.ja.P.Da],e=>e.cd('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ph('com.hostConfig'),new olympe.W.pa(olympe.L.U.Br)],(e,f)=>e.pipe(rxjs.operators.map(({tn:g,un:h,vn:k,Es:l})=>new olympe.net.Yi(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,
523
+ null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{tn:g,un:null!=h?h:y?8080:z?e?85:80:443,vn:null!=k?k:!z,Es:l,Gw:n,Kw:null!=p?p:f,Iw:null!=q?q:x?15675:u?e?85:80:443,Hw:null!=r?r:x?'':'/mqtt',Jw:null!=t?t:!u}});F(a,olympe.L.U.Br,'websocket');F(a,olympe.L.U.om,5E3);F(a,olympe.L.U.qq,5E3);F(a,olympe.L.U.Ar,3E4);F(a,olympe.L.U.Iq,4E3);F(a,olympe.L.U.Zq,'7.5.0');F(a,olympe.L.U.we,30);F(a,olympe.L.U.kl,3E4);F(a,olympe.L.U.Wn,a.getParameter(olympe.L.U.kl));
524
+ F(a,olympe.L.U.Xn,6E4);F(a,olympe.L.U.jl,!1);const c=a.getParameter(olympe.kg.U.To);if(void 0!==c)Ua(a,olympe.L.U.ql,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.L.P.Ca,[olympe.ja.P.Da],e=>e.cd('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ph('com.hostConfig'),new olympe.W.pa(olympe.L.U.Br)],(e,f)=>e.pipe(rxjs.operators.map(({tn:g,un:h,vn:k,Es:l})=>new olympe.net.Yi(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,
525
525
  ''),k))).pipe(rxjs.operators.shareReplay(1)));E(a,'server.wakeUpRequest',[new olympe.W.ph('com.hostConfig'),new olympe.W.pa(olympe.L.U.Iv)],(e,f)=>e.pipe(rxjs.operators.map(({tn:g,un:h,vn:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Yi(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Yb));E(a,olympe.L.P.sr,[new olympe.W.ph('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({tn:g,
526
- un:h,vn:k,Es:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Ai(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));D(a,olympe.L.P.Ee,olympe.L.ec);D(a,olympe.L.P.Kl,olympe.L.Mt,olympe.L.P.Ca,olympe.net.P.Da,olympe.V.P.$f,olympe.L.P.sr,new olympe.W.pa(olympe.L.U.Iq));E(a,'com.server.ManagerConfig',[new olympe.W.pa(olympe.L.U.qq),new olympe.W.pa(olympe.L.U.Ar),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.Zq),
527
- new olympe.W.pa(olympe.dc.U.Ih)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.nk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Re,olympe.host.P.rk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.$f,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.kk,olympe.L.U.qr],(e,f)=>e===olympe.host.Lg.Dh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
528
- [new olympe.W.ph('com.hostConfig'),new olympe.W.ph('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.jl),new olympe.W.pa(olympe.L.U.Wn),new olympe.W.pa(olympe.L.U.kl),new olympe.W.pa(olympe.L.U.Xn),new olympe.W.pa(olympe.L.U.xe),new olympe.W.pa(olympe.L.U.xv),new olympe.W.pa(olympe.L.U.ht),new olympe.W.pa(olympe.L.U.ft),new olympe.W.pa(olympe.L.U.om),new olympe.W.pa(olympe.L.U.kt),new olympe.W.pa(olympe.L.U.qv)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Gw:p,Hw:q,Iw:r,Kw:t,Jw:u})=>{p=`${u?
526
+ un:h,vn:k,Es:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Ai(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));D(a,olympe.L.P.Ee,olympe.L.ec);D(a,olympe.L.P.Kl,olympe.L.Mt,olympe.L.P.Ca,olympe.net.P.Da,olympe.V.P.ag,olympe.L.P.sr,new olympe.W.pa(olympe.L.U.Iq));E(a,'com.server.ManagerConfig',[new olympe.W.pa(olympe.L.U.qq),new olympe.W.pa(olympe.L.U.Ar),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.Zq),
527
+ new olympe.W.pa(olympe.dc.U.Ih)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.nk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Re,olympe.host.P.rk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.ag,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.kk,olympe.L.U.qr],(e,f)=>e===olympe.host.Lg.Dh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
528
+ [new olympe.W.ph('com.hostConfig'),new olympe.W.ph('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.jl),new olympe.W.pa(olympe.L.U.Wn),new olympe.W.pa(olympe.L.U.kl),new olympe.W.pa(olympe.L.U.Xn),new olympe.W.pa(olympe.L.U.we),new olympe.W.pa(olympe.L.U.xv),new olympe.W.pa(olympe.L.U.ht),new olympe.W.pa(olympe.L.U.ft),new olympe.W.pa(olympe.L.U.om),new olympe.W.pa(olympe.L.U.kt),new olympe.W.pa(olympe.L.U.qv)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Gw:p,Hw:q,Iw:r,Kw:t,Jw:u})=>{p=`${u?
529
529
  'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.Vn,olympe.L.Zn,olympe.L.P.Ca,olympe.net.P.Da,olympe.L.P.kf,olympe.auth.P.Da,
530
- olympe.host.P.Re,olympe.L.P.Ee,olympe.V.P.$f,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.cm,olympe.Db.P.Og,new olympe.W.pa(olympe.L.U.om)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.kf,olympe.L.uc,olympe.L.P.Ca,olympe.L.P.nk,olympe.net.P.Da,olympe.host.P.Re,olympe.Db.P.Wl,'com.connectivity.ManagerConfig')},'olympe.communication');
531
- olympe.W.run([olympe.L.P.Vn,olympe.L.P.kf],(a,b)=>{olympe.L.$h=()=>a;olympe.L.Ym=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.ye.Cg,c=>{const d=c.c;d===olympe.auth.nd.j.Hu?(a.j.Vd(),b(olympe.auth.Ta.D.yj,c)):d===olympe.auth.nd.j.Cv&&b(olympe.auth.Ta.D.rp,c)},'logoutHandler')}
532
- function Ee(a,b,c){const d=null==b?void 0:b.tf();if(b instanceof olympe.auth.bk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Ad();h.access_token=Fe(b);g=`${Ld(a.wh,olympe.L.Yb.Zj)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Wd(a.j,
533
- olympe.L.ye.Cg,Object.assign({},{c:olympe.auth.nd.j.Iu},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.J.getState())===olympe.L.uc.j.ee?d(new olympe.L.errors.mq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.ye.Cg,c,d))}
534
- function He(a,b,c){if(b.Bg()!==olympe.auth.Dc.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.tf()}&access_token=${Fe(b)}`;d=`${Ld(a.wh,olympe.L.Yb.Zj)}/refresh${d}`;d=Cc(N(d),olympe.net.wa.ResponseType.JSON);Nd(a.wh,d,b.Ad()).then(e=>{(e=e.getData())?(e=new olympe.auth.bk(b.Bc(),b.ne(),b.Ad(),e,b.tf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
535
- olympe.auth.nd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.wh=c;this.J=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.mk.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}`)})}ff(a){Wd(this.j,olympe.L.ye.Cg,{c:olympe.auth.nd.j.xe},b=>a(b))}dh(a,b,c){const d=Ld(this.wh,olympe.L.Yb.ur);
536
- a=N(`${d}/${a}`);Nd(this.wh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.nd.j={Cg:1,Iu:2,zb:3,xe:5,Ri:6,Qt:10,Pv:11,Os:12,SAML:13,Cv:14,Hu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.Zh());a.ba.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
530
+ olympe.host.P.Re,olympe.L.P.Ee,olympe.V.P.ag,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.cm,olympe.Db.P.Og,new olympe.W.pa(olympe.L.U.om)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.kf,olympe.L.uc,olympe.L.P.Ca,olympe.L.P.nk,olympe.net.P.Da,olympe.host.P.Re,olympe.Db.P.Wl,'com.connectivity.ManagerConfig')},'olympe.communication');
531
+ olympe.W.run([olympe.L.P.Vn,olympe.L.P.kf],(a,b)=>{olympe.L.$h=()=>a;olympe.L.Ym=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.xe.Cg,c=>{const d=c.c;d===olympe.auth.pd.j.Hu?(a.j.Vd(),b(olympe.auth.Ta.D.yj,c)):d===olympe.auth.pd.j.Cv&&b(olympe.auth.Ta.D.rp,c)},'logoutHandler')}
532
+ function Ee(a,b,c){const d=null==b?void 0:b.tf();if(b instanceof olympe.auth.bk){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Bd();h.access_token=Fe(b);g=`${Ld(a.wh,olympe.L.Yb.Zj)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Wd(a.j,
533
+ olympe.L.xe.Cg,Object.assign({},{c:olympe.auth.pd.j.Iu},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.J.getState())===olympe.L.uc.j.ye?d(new olympe.L.errors.mq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.xe.Cg,c,d))}
534
+ function He(a,b,c){if(b.Bg()!==olympe.auth.Dc.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.tf()}&access_token=${Fe(b)}`;d=`${Ld(a.wh,olympe.L.Yb.Zj)}/refresh${d}`;d=Cc(N(d),olympe.net.wa.ResponseType.JSON);Nd(a.wh,d,b.Bd()).then(e=>{(e=e.getData())?(e=new olympe.auth.bk(b.Bc(),b.ne(),b.Bd(),e,b.tf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
535
+ olympe.auth.pd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.wh=c;this.J=d;this.D=e;this.F=f;Ie(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.mk.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}`)})}ff(a){Wd(this.j,olympe.L.xe.Cg,{c:olympe.auth.pd.j.we},b=>a(b))}dh(a,b,c){const d=Ld(this.wh,olympe.L.Yb.ur);
536
+ a=N(`${d}/${a}`);Nd(this.wh,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.pd.j={Cg:1,Iu:2,zb:3,we:5,Ri:6,Qt:10,Pv:11,Os:12,SAML:13,Cv:14,Hu:20};function Bd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.V.Zh());a.ba.set(c,b)}function rd(a){return olympe.C.Pa(a.j.rb())}
537
537
  function ee(){var a=olympe.auth.ke();const b=olympe.auth.Ta.j.zj,c=olympe.auth.Ta.j.INIT;Je(a,b);a.Ga?(a.F=olympe.auth.Ta.F.Ns,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ke(a)):(a.F=olympe.auth.Ta.F.Ti,a.G.log('Connector online, attempting to log with token'),Le(a));return rxjs.firstValueFrom(a.D.rb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
538
- function Me(a){a.G.info('Initializing AUTH layer');let b=a.Ub;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&Ne(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Sc([a.cb.getState()],c=>{switch(c){case olympe.L.uc.j.ee:a.F=olympe.auth.Ta.F.Ti;a.G.log('Connector offline, attempting to recover sessions from current token');
538
+ function Me(a){a.G.log('Initializing AUTH layer');let b=a.Ub;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&Ne(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Sc([a.$a.getState()],c=>{switch(c){case olympe.L.uc.j.ye:a.F=olympe.auth.Ta.F.Ti;a.G.log('Connector offline, attempting to recover sessions from current token');
539
539
  Le(a);break;case olympe.L.uc.j.Td:switch(olympe.C.Pa(a.D)){case olympe.auth.Ta.j.gf:c=olympe.C.Pa(a.j).Bc();Oe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.xi:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.zj:Oe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:Oe(a,'Cannot open auth session - no server connection');break;default:Oe(a,'Should not get there, investigate',!0)}}});De(a.J,
540
- (c,d)=>{if(c===olympe.auth.Ta.D.yj){Oe(a,'authentication revoked');let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.ba.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.rp){a.G.info('Redirection to IDP to invalidate token (SAML)');rd(a);let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.gb.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.ua=Qe(a);a.R.D(()=>a.fi().catch(c=>a.G.error(`Failed to logout ${c}`)),
541
- 'Logout');a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Re(a,b){let c=null;olympe.C.oj(a.D.rb().Ed(olympe.auth.Ta.j.gf).and(b),()=>{const d=rd(a);!Se(a)&&d&&(c=a.Rd.get(d.Bg()).J(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.fi().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&Te(a,f)}))},()=>{let d;null==(d=c)||d()})}
542
- function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.me().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Bc();e.set('username',c);c=e;var d=b.Ad();c.set('nonce',d);'string'===typeof b.tf()&&e.set('idpName',b.tf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Dc.j.em)}else Oe(a,'No token found, cannot perform auto login')}).catch(b=>{Oe(a,b.message,!0)})):Oe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
540
+ (c,d)=>{if(c===olympe.auth.Ta.D.yj){Oe(a,'authentication revoked');let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.ba.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.rp){a.G.info('Redirection to IDP to invalidate token (SAML)');rd(a);let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.fb.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.ua=Qe(a);a.R.D(()=>a.fi().catch(c=>a.G.error(`Failed to logout ${c}`)),
541
+ 'Logout');a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}function Re(a,b){let c=null;olympe.C.oj(a.D.rb().Fd(olympe.auth.Ta.j.gf).and(b),()=>{const d=rd(a);!Se(a)&&d&&(c=a.Rd.get(d.Bg()).J(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.fi().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&Te(a,f)}))},()=>{let d;null==(d=c)||d()})}
542
+ function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.me().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Bc();e.set('username',c);c=e;var d=b.Bd();c.set('nonce',d);'string'===typeof b.tf()&&e.set('idpName',b.tf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Dc.j.em)}else Oe(a,'No token found, cannot perform auto login')}).catch(b=>{Oe(a,b.message,!0)})):Oe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
543
543
  !0)}function Oe(a,b,c=!1){a.j.update(a.$);Je(a,olympe.auth.Ta.j.xi);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function Qe(a){const b=[olympe.auth.Ta.j.gf];a.Ga||b.push(olympe.auth.Ta.j.xi);return a.R.j(()=>{const c=Ve(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 Je(a,b){a.G.log('State change: ',Ve(a),'--\x3e',b);a.D.update(b)}
544
544
  function Ke(a){if(a.Y){const b=new olympe.auth.Request;b.set('username',a.Y);b.set('password',a.Bb);a.G.log('Autologin with user "'+a.Y+'"');Ue(a,b)}else Oe(a,'No user specified for auto login',!0)}function Se(a){return olympe.C.Pa(a.j)===a.$}function Te(a,b){if(b){a.j.update(b);let c;null==(c=a.storage)||Ne(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function Ve(a){return olympe.C.Pa(a.D.rb())}function We(){var a=olympe.public.Ma.get();return new Map(a.J.j.Kc)}
545
545
  function Xe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));Je(a,olympe.auth.Ta.j.zb);if(d)throw Error(b);}function Ue(a,b,c,d){void 0===c&&(c=a.Eb);void 0===c&&Xe(a,'No authentication provider specified',null,!0);const e=a.Rd.get(c);e||Xe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.N.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.me(b,a.$b.bind(a));Je(a,olympe.auth.Ta.j.zj)}
546
546
  function Ye(a,b,c){a.N.forEach(d=>{d(b,c)})}
547
- olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.cb=b;this.J=c;this.storage=d;this.gb=e;this.Eb=k.get('defaultProvider');this.Ga=!!k.get('autoLogin');this.Y=k.get('autoUser');this.Bb=k.get('autoPassword');this.Ub=k.get('autoToken');this.Rd=new Map;this.R=f;this.ua='';this.D=olympe.C.cc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.cc(olympe.C.Sa);this.F=null;this.$=new olympe.auth.Sg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.j=olympe.C.cc(olympe.auth.Sg).update(this.$);
547
+ olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.$a=b;this.J=c;this.storage=d;this.fb=e;this.Eb=k.get('defaultProvider');this.Ga=!!k.get('autoLogin');this.Y=k.get('autoUser');this.Bb=k.get('autoPassword');this.Ub=k.get('autoToken');this.Rd=new Map;this.R=f;this.ua='';this.D=olympe.C.cc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.cc(olympe.C.Sa);this.F=null;this.$=new olympe.auth.Sg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.j=olympe.C.cc(olympe.auth.Sg).update(this.$);
548
548
  this.N=new Map;this.ba=new Map;this.fa=new olympe.V.Jh(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Rd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Rd.set(n,l)});Me(this);Re(this,g.j())}Sk(){const a=olympe.auth.Ta.j.gf,b=olympe.auth.Ta.j.xi,c=olympe.auth.Ta.j.zb,d=olympe.C.cc(olympe.C.ea);olympe.C.Sc([this.D],e=>{e===a?d.update(olympe.C.ea.D):e===b?d.update(olympe.C.ea.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.ea.j)):d.clear()});
549
- return d.rb()}kg(a){if(olympe.C.Pa(this.D)===olympe.auth.Ta.j.gf){var b=rd(this);!Se(this)&&b&&this.Rd.get(b.Bg()).kg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.fi().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&Te(this,d);a(c)})}}getState(){return this.D.rb()}Bc(){return this.j.rb().Bc()}ne(){return this.j.rb().ne()}bi(){return this.j.rb().bi()}dh(a,b){if(fb(this.fa.j,a))b(null,this.fa.get(a));else{var c,d=null==(c=olympe.C.Pa(this.j.rb()))?
550
- void 0:c.Ad();this.J.dh(a,d,(e,f)=>{'string'===typeof f&&this.fa.set(a,f);b(e,f)})}}fi(){return Se(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)||Pe(c).catch(d=>this.G.error('Failed to clear token',d));Ee(this.J,rd(this),d=>{d?(Xe(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.R.F(this.ua)})}ff(a){Ve(this)===olympe.auth.Ta.j.gf&&
549
+ return d.rb()}lg(a){if(olympe.C.Pa(this.D)===olympe.auth.Ta.j.gf){var b=rd(this);!Se(this)&&b&&this.Rd.get(b.Bg()).lg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.fi().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&Te(this,d);a(c)})}}getState(){return this.D.rb()}Bc(){return this.j.rb().Bc()}ne(){return this.j.rb().ne()}bi(){return this.j.rb().bi()}dh(a,b){if(fb(this.fa.j,a))b(null,this.fa.get(a));else{var c,d=null==(c=olympe.C.Pa(this.j.rb()))?
550
+ void 0:c.Bd();this.J.dh(a,d,(e,f)=>{'string'===typeof f&&this.fa.set(a,f);b(e,f)})}}fi(){return Se(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)||Pe(c).catch(d=>this.G.error('Failed to clear token',d));Ee(this.J,rd(this),d=>{d?(Xe(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.R.F(this.ua)})}ff(a){Ve(this)===olympe.auth.Ta.j.gf&&
551
551
  this.J.ff(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}$b(a,b){const c=null===this.F?olympe.auth.Ta.F.Ou:this.F;this.F=null;if(!a||a instanceof olympe.L.errors.mq){null===a?this.G.info(`User ${b.Bc()} (#${b.ne()}) successfully authenticated`):this.G.info(`User ${b.Bc()} (#${b.ne()}) recovered from token, while offline`);this.j.update(b);Je(this,olympe.auth.Ta.j.gf);Ye(this,a,c);let d;null==(d=this.storage)||Ne(d,b).catch(e=>this.G.error(e))}else{let d;
552
- null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',zj:'authenticating',xi:'guest',gf:'authenticated',zb:'error'};olympe.auth.Ta.F={Ou:'manual',Ns:'auto',Ti:'tokenOnFirstConnection'};olympe.auth.Ta.D={yj:'accepted',rp:'redirect'};olympe.auth.Dc=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}me(){}J(a,b){const c=()=>{this.j=setTimeout(()=>this.D.ff(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Ec)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}kg(a,b){this.D.ff(c=>{b(c,null)})}};olympe.auth.Dc.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',em:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Tg&&(a=a.Ba.Fb);return a?a.valueOf():a}Bc(){return this.get('username')}Ad(){return this.get('nonce')}toString(){return this.Bc()+(this.Ad()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Sg=class{constructor(a,b,c,d={},e=null){this.J=a;this.ii=b;this.D=c;this.j=e;this.F=d}Bc(){return this.J}ne(){return this.ii}Ad(){return this.D}Di(){return this.F}bi(){return null}tf(){return this.j}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.J,userTag:this.ii,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Ir(bb(a,JSON.stringify(b)))}Bg(){return olympe.auth.Dc.j.SRP}};m=olympe.auth.Sg.prototype;m.Bc.K=new olympe.C.H(()=>String,[]);
553
- m.ne.K=new olympe.C.H(()=>String,[]);m.Ad.K=new olympe.C.H(()=>String,[]);m.Di.K=new olympe.C.H(()=>Object,[]);m.bi.K=new olympe.C.H(()=>String,[]);m.tf.K=new olympe.C.H(()=>String,[]);m.ga.K=new olympe.C.H(()=>String,[]);m.Bg.K=new olympe.C.H(()=>String,[]);function Fe(a){return a.Di().access_token||null}function $e(a){return 1E3*parseInt(a.Di().access_token_exp||'0',10)}olympe.auth.bk=class extends olympe.auth.Sg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}bi(){return Fe(this)}Bg(){return olympe.auth.Dc.j.OAUTH2}};olympe.auth.Tq=class extends olympe.auth.Sg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}bi(){return this.N}Bg(){return olympe.auth.Dc.j.SAML}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.Bc(),userTag:this.ne(),nonce:this.Ad()},this.tf()&&{idpName:this.tf()},{payload:this.Di(),fullToken:this.N});return olympe.V.Ir(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function Pe(a){return qb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
552
+ null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',zj:'authenticating',xi:'guest',gf:'authenticated',zb:'error'};olympe.auth.Ta.F={Ou:'manual',Ns:'auto',Ti:'tokenOnFirstConnection'};olympe.auth.Ta.D={yj:'accepted',rp:'redirect'};olympe.auth.Dc=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}me(){}J(a,b){const c=()=>{this.j=setTimeout(()=>this.D.ff(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Ec)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}lg(a,b){this.D.ff(c=>{b(c,null)})}};olympe.auth.Dc.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',em:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Tg&&(a=a.Ba.Fb);return a?a.valueOf():a}Bc(){return this.get('username')}Bd(){return this.get('nonce')}toString(){return this.Bc()+(this.Bd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Sg=class{constructor(a,b,c,d={},e=null){this.J=a;this.ii=b;this.D=c;this.j=e;this.F=d}Bc(){return this.J}ne(){return this.ii}Bd(){return this.D}Di(){return this.F}bi(){return null}tf(){return this.j}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.J,userTag:this.ii,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Ir(bb(a,JSON.stringify(b)))}Bg(){return olympe.auth.Dc.j.SRP}};m=olympe.auth.Sg.prototype;m.Bc.K=new olympe.C.H(()=>String,[]);
553
+ m.ne.K=new olympe.C.H(()=>String,[]);m.Bd.K=new olympe.C.H(()=>String,[]);m.Di.K=new olympe.C.H(()=>Object,[]);m.bi.K=new olympe.C.H(()=>String,[]);m.tf.K=new olympe.C.H(()=>String,[]);m.ga.K=new olympe.C.H(()=>String,[]);m.Bg.K=new olympe.C.H(()=>String,[]);function Fe(a){return a.Di().access_token||null}function $e(a){return 1E3*parseInt(a.Di().access_token_exp||'0',10)}olympe.auth.bk=class extends olympe.auth.Sg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}bi(){return Fe(this)}Bg(){return olympe.auth.Dc.j.OAUTH2}};olympe.auth.Tq=class extends olympe.auth.Sg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}bi(){return this.N}Bg(){return olympe.auth.Dc.j.SAML}ga(){const a=olympe.V.Ze(),b=Object.assign({},{user:this.Bc(),userTag:this.ne(),nonce:this.Bd()},this.tf()&&{idpName:this.tf()},{payload:this.Di(),fullToken:this.N});return olympe.V.Ir(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function Pe(a){return qb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
554
554
  olympe.auth.Us=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.wm;this.db=this.F.D('AUTH')}me(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return qb(this.D,()=>{const a=this;return w(function*(){let b;try{b=yield a.db.get('main',a.j)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.G.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
555
- d.parse;var f=cb(olympe.V.Ze().D(olympe.V.Ew(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Tq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.bk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Sg(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.mk=class{redirect(){}D(){}j(){}};olympe.auth.mk.j={GET:'GET',Ch:'POST'};olympe.auth.Nn=class{constructor(a){this.j=a||'default'}};olympe.auth.Rd={};function af(a,b,c){Ge(a.D,olympe.auth.nd.j.Cg,{token:b.Ad()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.nd.j.zb:c(Error('Invalid token'),null);break;case olympe.auth.nd.j.Ri: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.Tq(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.bk(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
556
- olympe.auth.Rd.Nu=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Dc.j.em}me(a,b){this.storage.me().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.mr);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.kg(b,c)},d);a.kg(b,c);return null}
557
- olympe.auth.Rd.dv=class extends olympe.auth.Dc{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Dc.j.OAUTH2}me(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.mk.j.GET)}J(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}kg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.nd.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.Rd.SAML=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Dc.j.SAML}me(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.nd.j.Qt,e=olympe.auth.nd.j.zb,f=olympe.auth.nd.j.Pv,g={I:b.Bc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Bc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
558
- function ef(a,b,c){const d=olympe.auth.nd.j.Os,e=olympe.auth.nd.j.zb,f=olympe.auth.nd.j.Ri;b={A:b.get('a'),M:b.get('m1'),I:b.Bc()};Ge(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Sg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
555
+ d.parse;var f=cb(olympe.V.Ze().D(olympe.V.Ew(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Tq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.bk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Sg(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.mk=class{redirect(){}D(){}j(){}};olympe.auth.mk.j={GET:'GET',Ch:'POST'};olympe.auth.Nn=class{constructor(a){this.j=a||'default'}};olympe.auth.Rd={};function af(a,b,c){Ge(a.D,olympe.auth.pd.j.Cg,{token:b.Bd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.pd.j.zb:c(Error('Invalid token'),null);break;case olympe.auth.pd.j.Ri: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.Tq(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.bk(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
556
+ olympe.auth.Rd.Nu=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Dc.j.em}me(a,b){this.storage.me().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.mr);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.lg(b,c)},d);a.lg(b,c);return null}
557
+ olympe.auth.Rd.dv=class extends olympe.auth.Dc{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Dc.j.OAUTH2}me(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.mk.j.GET)}J(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}lg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.pd.j.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Rd.SAML=class extends olympe.auth.Dc{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Dc.j.SAML}me(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.pd.j.Qt,e=olympe.auth.pd.j.zb,f=olympe.auth.pd.j.Pv,g={I:b.Bc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Bc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
558
+ function ef(a,b,c){const d=olympe.auth.pd.j.Os,e=olympe.auth.pd.j.zb,f=olympe.auth.pd.j.Ri;b={A:b.get('a'),M:b.get('m1'),I:b.Bc()};Ge(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Sg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
559
559
  null)}})}olympe.auth.Rd.SRP=class extends olympe.auth.Dc{F(){return olympe.auth.Dc.j.SRP}me(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Bc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Qi:'auth.Storage',dl:'auth.appNameToken',ik:'auth.Redirector',Xq:'auth.ServerConnector'};olympe.auth.U={zl:'auth.defaultProvider',Hn:'auth.autoLogin',Jn:'auth.autoUser',In:'auth.autoPassword',Ti:'auth.token',ao:'auth.cacheTokenTimeout',mr:'auth.tokenDurationPercentage'};
560
- olympe.W.config(function(a){F(a,olympe.auth.U.zl,olympe.auth.Dc.j.SRP);F(a,olympe.auth.U.Hn,!1);F(a,olympe.auth.U.Jn,'');F(a,olympe.auth.U.In,'');F(a,olympe.auth.U.Ti,'');F(a,olympe.auth.U.mr,50);F(a,olympe.auth.U.ao,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.dl,olympe.auth.Nn,olympe.Db.P.Og);D(a,olympe.auth.P.Qi,olympe.auth.Us,olympe.Db.P.Vj,olympe.auth.P.Ca,olympe.auth.P.dl);D(a,olympe.auth.P.Xq,olympe.auth.nd,olympe.auth.P.Ca,olympe.L.P.nk,olympe.L.P.Kl,olympe.L.P.kf,
560
+ olympe.W.config(function(a){F(a,olympe.auth.U.zl,olympe.auth.Dc.j.SRP);F(a,olympe.auth.U.Hn,!1);F(a,olympe.auth.U.Jn,'');F(a,olympe.auth.U.In,'');F(a,olympe.auth.U.Ti,'');F(a,olympe.auth.U.mr,50);F(a,olympe.auth.U.ao,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.dl,olympe.auth.Nn,olympe.Db.P.Og);D(a,olympe.auth.P.Qi,olympe.auth.Us,olympe.Db.P.Vj,olympe.auth.P.Ca,olympe.auth.P.dl);D(a,olympe.auth.P.Xq,olympe.auth.pd,olympe.auth.P.Ca,olympe.L.P.nk,olympe.L.P.Kl,olympe.L.P.kf,
561
561
  olympe.auth.P.ik,olympe.auth.P.Qi);Xa(a,olympe.auth.P.ik);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.kf,olympe.auth.P.Xq,olympe.host.P.Re,olympe.host.P.rk,new olympe.W.ub(olympe.auth.P.Qi,olympe.W.mh.j.am),new olympe.W.ub(olympe.auth.P.ik,olympe.W.mh.j.am),new olympe.W.pa(olympe.auth.U.zl),new olympe.W.pa(olympe.auth.U.Hn),new olympe.W.pa(olympe.auth.U.Jn),new olympe.W.pa(olympe.auth.U.In),new olympe.W.pa(olympe.auth.U.Ti),new olympe.W.pa(olympe.auth.U.ao)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
562
562
  [new olympe.auth.Rd.Nu(b,d,g),new olympe.auth.Rd.SRP(b,d),new olympe.auth.Rd.SAML(b,d,h),new olympe.auth.Rd.dv(b,d,h,Ld(d.wh,olympe.L.Yb.Zj))];if(!t.map(u=>u.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.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',r]]))},!0)},'olympe.auth');
563
- olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.ke=()=>a});olympe.Wa.node.auth={};olympe.Wa.node.auth.aq=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.Wa.node.auth.aq.xa=[olympe.auth.mk];olympe.W.config(a=>{D(a,olympe.auth.P.ik,olympe.Wa.node.auth.aq)},'olympe.native.node.auth');olympe.Wa.node.Db={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
- olympe.Wa.node.Db.Zp=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
563
+ olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.ke=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.aq=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.aq.xa=[olympe.auth.mk];olympe.W.config(a=>{D(a,olympe.auth.P.ik,olympe.Va.node.auth.aq)},'olympe.native.node.auth');olympe.Va.node.Db={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
564
+ olympe.Va.node.Db.Zp=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
565
565
  return w(function*(){let d,e;return null!=(e=null==(d=c.j.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return w(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return w(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return w(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}ba(){ff();return Promise.resolve()}$(){ff();return Promise.resolve()}clear(a){const b=this;return w(function*(){let c;
566
- null==(c=b.j.get(a))||c.clear()})}J(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Wa.node.Db.Zp.xa=[olympe.Db.Cu];olympe.Wa.node.Db.$p=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Wa.node.Db.Zp(this.G));return this.j.get(a)}};olympe.Wa.node.Db.$p.xa=[olympe.Db.Du];olympe.W.config(function(a){D(a,olympe.Db.P.Vj,olympe.Wa.node.Db.$p,olympe.Db.P.Ca)},'olympe.native.node.localstorage');olympe.Wa.node.storage={};olympe.Wa.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.Wa.node.storage.Storage.xa=[olympe.Db.Storage];olympe.W.config(function(a){Va(a,olympe.Db.P.Qi,olympe.Wa.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.jg={};olympe.jg.U={VERSION:'version.version',Xs:'version.branch',jf:'version.commit',Wv:'version.tag',To:'version.olympe-framework',Ys:'version.build'};olympe.W.config(function(a){F(a,olympe.jg.U.VERSION,'');F(a,olympe.jg.U.Xs,'');F(a,olympe.jg.U.jf,'');F(a,olympe.jg.U.Wv,'');F(a,olympe.jg.U.To,'');F(a,olympe.jg.U.Ys,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
566
+ null==(c=b.j.get(a))||c.clear()})}J(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Db.Zp.xa=[olympe.Db.Cu];olympe.Va.node.Db.$p=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.Zp(this.G));return this.j.get(a)}};olympe.Va.node.Db.$p.xa=[olympe.Db.Du];olympe.W.config(function(a){D(a,olympe.Db.P.Vj,olympe.Va.node.Db.$p,olympe.Db.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Db.Storage];olympe.W.config(function(a){Va(a,olympe.Db.P.Qi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.kg={};olympe.kg.U={VERSION:'version.version',Xs:'version.branch',jf:'version.commit',Wv:'version.tag',To:'version.olympe-framework',Ys:'version.build'};olympe.W.config(function(a){F(a,olympe.kg.U.VERSION,'');F(a,olympe.kg.U.Xs,'');F(a,olympe.kg.U.jf,'');F(a,olympe.kg.U.Wv,'');F(a,olympe.kg.U.To,'');F(a,olympe.kg.U.Ys,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
567
567
  function mf(a){var b=nf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{hf.access(c,gf.constants.F_OK).then(()=>{gf.watch(c,d=>w(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.vs([c]),f=olympe.W.ds(e);for(const [g,h]of f)a.xj(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
568
- function of(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Wa.node.host).Mk)?void 0:null==(c=b.call(a))?void 0:Oc(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
568
+ function of(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Va.node.host).Mk)?void 0:null==(c=b.call(a))?void 0:Oc(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
569
569
  process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);of()});const nf=['oConfig.json','conf.d/oConfig.json','version.json'];kf&&nf.push(kf);
570
570
  olympe.V.vs(nf).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.V.Jr(g[3])}const d=new olympe.W.qt(a,b);Ka(d);const e=d.compile();Ma(e);mf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
571
- setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.hc={Yc:'ff022000000000000000',ti:'ff02200000000000000e',Gj:'ff02200000000000000f'};olympe.dc.Cp={VERSION:'@v',br:'@s'};olympe.dc.ve={Pe:'?',yg:'~'};olympe.dc.AC={Mi:'online',ee:'offline',fB:'invalidate'};olympe.dc.Ka={SELF:'self',SERVER:'server',wf:'remote',ee:'offline'};
572
- olympe.dc.Lb={NONE:null,Bo:'ff023000000000000037',Cc:'ff023000000000000137',ag:'ff023000000000000237',Mv:'ff023000000000000337',xt:'ff023000000000000437',hw:'ff023000000000000537',hB:olympe.dc.ve.yg+'ff023000000000000037',iB:olympe.dc.ve.yg+'ff023000000000000237',gB:olympe.dc.ve.yg+'ff023000000000000437',qD:olympe.dc.ve.yg+'ff023000000000000537'};olympe.dc.kq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.$d(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.sb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.cq=class extends Error{constructor(){var a=pf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Pc(){}Wc(){}D(){}Oa(){}ic(){}};olympe.dc.vq=class{tc(){}T(){}J(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.xa=[olympe.dc.Qe];olympe.dc.vc.prototype.Ea.K=olympe.C.H.j;olympe.dc.Gt=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.ba=d;this.Wb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.V.Jh(6E5),(h,k)=>{URL.revokeObjectURL(k);qf(this.db,h,a.j(h))})}fa(b,c,d,e,f){this.Ga(c).then(g=>{this.cb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}J(b){const c=this;return w(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
571
+ setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.hc={Yc:'ff022000000000000000',ti:'ff02200000000000000e',Gj:'ff02200000000000000f'};olympe.dc.Cp={VERSION:'@v',br:'@s'};olympe.dc.ce={Pe:'?',$f:'~'};olympe.dc.AC={Mi:'online',ye:'offline',fB:'invalidate'};olympe.dc.Ka={SELF:'self',SERVER:'server',wf:'remote'};
572
+ olympe.dc.Lb={NONE:null,Bo:'ff023000000000000037',Cc:'ff023000000000000137',bg:'ff023000000000000237',Mv:'ff023000000000000337',xt:'ff023000000000000437',hw:'ff023000000000000537',hB:olympe.dc.ce.$f+'ff023000000000000037',iB:olympe.dc.ce.$f+'ff023000000000000237',gB:olympe.dc.ce.$f+'ff023000000000000437',qD:olympe.dc.ce.$f+'ff023000000000000537'};olympe.dc.kq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.$d(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.sb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.cq=class extends Error{constructor(){var a=pf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Pc(){}Wc(){}D(){}Oa(){}ic(){}};olympe.dc.vq=class{tc(){}T(){}J(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ea(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.xa=[olympe.dc.Qe];olympe.dc.vc.prototype.Ea.K=olympe.C.H.j;olympe.dc.Gt=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.ba=d;this.Wb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.V.Jh(6E5),(h,k)=>{URL.revokeObjectURL(k);qf(this.db,h,a.j(h))})}fa(b,c,d,e,f){this.Ga(c).then(g=>{this.$a(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}J(b){const c=this;return w(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
573
573
  new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.J(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.X(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.Y(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
574
- 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.Wf,olympe.dc.$d().Ie(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c);c=N(e);Cc(c,olympe.net.wa.ResponseType.il);return Dc(this.ba,c).then(f=>{const g=f.Hc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}ua(b){const c=new olympe.V.stream.yf;this.J(b).then(d=>{db(d).pipeTo(c).catch(()=>{})});return c}gb(b,c){this.D.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));
575
- const e=new olympe.dc.db.fc;e.Wc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.Tc(rf(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)})}Y(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}cb(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.cg,olympe.dc.$d().Ie(b),
574
+ 0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.Wf,olympe.dc.$d().Ie(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c);c=N(e);Cc(c,olympe.net.wa.ResponseType.il);return Dc(this.ba,c).then(f=>{const g=f.Hc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}ua(b){const c=new olympe.V.stream.yf;this.J(b).then(d=>{db(d).pipeTo(c).catch(()=>{})});return c}fb(b,c){this.D.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));
575
+ const e=new olympe.dc.db.fc;e.Wc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.Tc(rf(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)})}Y(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}$a(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.dg,olympe.dc.$d().Ie(b),
576
576
  {tag:b,model:e,content:c,mimeType:d});this.Wb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Ga(b){return w(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ha(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);sf(this.db,d,f=>{f||(this.F.delete(d),qf(this.db,
577
577
  d,e))},e)}static j(b){return`cacheBinary${b}`}};function tf(a,b){let c=uf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Xe(b);if(null===b)break;c=uf(b)}let e;return null!=(e=c)?e:null}olympe.dc.$t=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.j.Ub([d])})}};function vf(a,b){a.origin=b;return a}function wf(a,b,c){a.D.set(b,c);return a}function xf(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.Ka.SELF;this.j=b;this.content=null!=c?c:null;this.F=null!=d?d:rd(olympe.auth.ke()).ne();this.D=new Map}getType(){return this.type}Bc(){return this.F}jc(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
578
- olympe.dc.Request.j={pc:1,xg:10,It:24,gp:25,Jt:28,Hg:30,hk:31,WB:32,We:40,Rg:41,Rn:42,Hq:43,lD:44,mi:45,Tn:46,Qj:47,cg:50,Wf:51,ug:52,ew:60,vv:61,ap:62,YA:63,gt:64,kh:65,so:91,Kt:93,Zl:95,QUERY_RESULT:97};function yf(a,b,c,d,e){const f=olympe.C.Xg();a.sources.set(olympe.dc.Ka.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ka.wf,d.init(a)):sf(b,a.j,()=>{a.sources.set(olympe.dc.Ka.wf,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).hb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,!0)).observe(f).subscribe(h=>{var k=h.mj();for(var l of k){const [p,q]=g.get(l);c.F(p);c.N(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.hj();for(const p of h)if(h=
578
+ olympe.dc.Request.j={pc:1,yg:10,It:24,gp:25,Jt:28,Hg:30,hk:31,WB:32,We:40,Rg:41,Rn:42,Hq:43,lD:44,mi:45,Tn:46,Qj:47,dg:50,Wf:51,vg:52,ew:60,vv:61,ap:62,YA:63,gt:64,kh:65,so:91,Kt:93,Zl:95,QUERY_RESULT:97};function yf(a,b,c,d,e){const f=olympe.C.Xg();a.sources.set(olympe.dc.Ka.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ka.wf,d.init(a)):sf(b,a.j,()=>{a.sources.set(olympe.dc.Ka.wf,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).gb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,!0)).observe(f).subscribe(h=>{var k=h.mj();for(var l of k){const [p,q]=g.get(l);c.F(p);c.N(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.hj();for(const p of h)if(h=
579
579
  p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Mp(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Ce.j.READINESS);n=c.D(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});qf(b,a.j,'router',!0)},'router')}function zf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
580
- olympe.dc.Av=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;yf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.sb(a.jc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.sb(a.jc()).subscribe(a,b)}ud(a){const b=a.jc();if(b===this.j){let c;null==(c=this.D.get(a.getType()))||c.forEach(d=>d(a))}else olympe.L.ub.publish(b,a).catch(c=>{this.G.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;
581
- return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ka.wf)}};function rf(a,b){b=new olympe.dc.vg(a.T(),null!=b?b:null);b.j=a;return b}function Af(a,b,c,d){c=new olympe.dc.vg(null!=d?d:olympe.V.Ic(),null!=c?c:null);c.D=b;c.Fa=a;return c}
582
- olympe.dc.vg=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.Ek=b}static j(a){return Af(a.p,a.s,a.t,a.i)}T(){return this.id}tc(a){return this.j instanceof olympe.dc.db.fc?this.j.tc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.Ni(this.D)).D(this.Fa,a):a}J(){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.J())?d:0}kc(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.Ni(this.D)).j(this.Fa,
583
- this.id),this.Fa=null,this.j):new olympe.dc.db.fc(this.id)}Kk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.Ae;this.j.tc(a);return Bf(a)}return[]}ga(){return{p:this.Kk(),t:this.Ek,s:this.D,i:this.id}}};olympe.dc.vg.xa=[olympe.dc.vq];olympe.dc.Ra={};const Cf=olympe.dc.va.ORIGIN,Df=olympe.dc.va.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.yn||[])];return olympe.dc.na.j(b,c,...a)}function Jf(a,b){Hf.set(a,b);return a}function Kf(a){let b,c;return null!=(c=null==(b=Ef.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
580
+ olympe.dc.Av=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;yf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.sb(a.jc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.sb(a.jc()).subscribe(a,b)}vd(a){const b=a.jc();if(b===this.j){let c;null==(c=this.D.get(a.getType()))||c.forEach(d=>d(a))}else olympe.L.ub.publish(b,a).catch(c=>{this.G.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;
581
+ return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ka.wf)}};function rf(a,b){b=new olympe.dc.wg(a.T(),null!=b?b:null);b.j=a;return b}function Af(a,b,c,d){c=new olympe.dc.wg(null!=d?d:olympe.V.Ic(),null!=c?c:null);c.D=b;c.Fa=a;return c}
582
+ olympe.dc.wg=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.Ek=b}static j(a){return Af(a.p,a.s,a.t,a.i)}T(){return this.id}tc(a){return this.j instanceof olympe.dc.db.fc?this.j.tc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.Ni(this.D)).D(this.Fa,a):a}J(){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.J())?d:0}kc(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.Ni(this.D)).j(this.Fa,
583
+ this.id),this.Fa=null,this.j):new olympe.dc.db.fc(this.id)}Kk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.Ae;this.j.tc(a);return Bf(a)}return[]}ga(){return{p:this.Kk(),t:this.Ek,s:this.D,i:this.id}}};olympe.dc.wg.xa=[olympe.dc.vq];olympe.dc.Ra={};const Cf=olympe.dc.va.ORIGIN,Df=olympe.dc.va.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.yn||[])];return olympe.dc.na.j(b,c,...a)}function Jf(a,b){Hf.set(a,b);return a}function Kf(a){let b,c;return null!=(c=null==(b=Ef.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
584
584
  function Lf(a,b,c){const d=a+'@'+(b===Df?Cf:Df);if(Ff.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ff.set(d,c)}function Mf(a){a=a.X()+'@'+a.Ja();return Ff.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;Gf.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
585
585
  olympe.dc.na=class{constructor(){}static j(a,b,...c){if(Ef.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Ef.get(a).D.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.W.ub(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Ef.set(a,b);return b.D.entry=b}static bc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Nf(a,b){a.j=b}function R(a,b){b=b.ac();Lf(b.X(),b.Ja(),a.D);return b}function Of(a){a.F=!0;return a}
586
- olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.yn=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.hn()&&b.getParameter(olympe.dc.U.Ko)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ja.$a('dc').error(d)}return this.yn?(a=[void 0,a].concat(Na(b,this.yn)),new c(...a)):new c(void 0,
586
+ olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.yn=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.hn()&&b.getParameter(olympe.dc.U.Ko)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ja.ab('dc').error(d)}return this.yn?(a=[void 0,a].concat(Na(b,this.yn)),new c(...a)):new c(void 0,
587
587
  a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){Lf(a,b,this.D);return new olympe.dc.da.Se(a,b)}hn(){return this.F}};B('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.sa;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ka;olympe.dc.Ra.Entry.xa=[olympe.dc.Qe];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.X;olympe.dc.Ra.Property.xa=[olympe.dc.Qe];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ha(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ja(){return this.direction}type(){return this.J}ac(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.J,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.X()===this.X()&&a.Ja()===this.Ja():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
588
- olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.ac;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ja;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Qe];olympe.dc.db={};function Pf(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Oi,f=olympe.dc.db.Database.D.Pe,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('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.Cd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.Dd())for(const r of Qf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
- y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Pc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Cd())x?k.ic(t,n,u):k.Oa(t,n,u)}}});return k}
588
+ olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.ac;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ja;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Qe];olympe.dc.db={};function Pf(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Oi,f=olympe.dc.db.Database.D.Pe,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('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.Dd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.Ed())for(const r of Qf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
589
+ y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Pc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Dd())x?k.ic(t,n,u):k.Oa(t,n,u)}}});return k}
590
590
  function Sf(a,b,c){const d=b.T();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Tf(b,Pf(a,b));a.D.unshift(d);a.F.set(d,e);a.J.us(c);a.write(b,!1,!1)}
591
591
  function Uf(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.Tc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Vf(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
592
592
  function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.Em(a.G,a.J,a.ia,c);e.open(d);for(const f=fa(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
593
593
  function Yf(a,b,c,d){b=b.pipeThrough(olympe.V.stream.tap(e=>{0<a.D.length&&Uf(a,Wf(a,e.kc(),a.D.length),e.Ek)}));return Xf(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
594
594
  olympe.dc.db.ot=class{constructor(a,b,c,d){this.G=a;this.J=b;this.ia=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Yo,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}Tc(a,b,c){const d=a.T(),e=a.Ek;this.F.has(d)?this.push(d,e):(a=Uf(this,Wf(this,a.kc(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
595
595
  1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Em(this.G,this.J,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.j.Rc(c);b.Cb().forEach((g,h)=>{f.ka(h,g);b.ba(h)});for(const [g,h,k,l]of b.fa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
596
- function ag(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Rc(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.ba(k))});for(const [h,k,l]of b.Cd()){const n=c.Bb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
- class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.Dd()?b.D()?a.j(d,b.J()):(this.D.j(d,c.J()),this.j.j(d,c.J())):b.Dd()?($f(this,c,b,a),a.j(d,b.J())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
596
+ function ag(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Rc(f);b.Cb().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.ba(k))});for(const [h,k,l]of b.Dd()){const n=c.Bb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
597
+ class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.Ed()?b.D()?a.j(d,b.J()):(this.D.j(d,c.J()),this.j.j(d,c.J())):b.Ed()?($f(this,c,b,a),a.j(d,b.J())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
598
598
  class Vf extends Zf{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.J=d;this.F=null;bg(this)}T(){return this.j.T()}Tc(a){return a.R(this.j)}update(a,b){this.D=b;a.tc(this.j);bg(this);return this}};const cg=olympe.dc.hc.Yc,dg=olympe.dc.hc.ti,eg=olympe.dc.va.ORIGIN,fg=olympe.dc.va.DESTINATION;let gg=0;
599
- olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ka.SELF;this.G=b;this.$c=olympe.C.Va();this.R=olympe.dc.db.Database.F.IDLE;this.ua=new Map;this.rc=[];this.$=new Map;this.F=null;this.fa=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.qf.j.Bl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Vd=new olympe.dc.db.qf(c,this,b,f);d.get('debug')&&this.ps()}T(){return this.id}getState(){return this.R}$a(){return this.G}create(b,
600
- c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.F||f.F===c)){f.F=c;let g;(null==(g=f.model())?0:g.e)&&f.db.ba(f,!0)}e&&f.persist();this.R===a.F.hl&&hg(f,!0);d&&this.Kc(f,d);this.D(a.j.vp,b)}update(b,c){c&&(b=this.N(b,!0),this.Kc(b,c))}cb(b){const c=this.get(b);void 0!==c&&(this.ba(c,!1),this.D(a.j.wp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case cg:kg(c,
599
+ olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ka.SELF;this.G=b;this.$c=olympe.C.Xa();this.R=olympe.dc.db.Database.F.IDLE;this.ua=new Map;this.rc=[];this.$=new Map;this.F=null;this.fa=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.qf.j.Bl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Vd=new olympe.dc.db.qf(c,this,b,f);d.get('debug')&&this.ps()}T(){return this.id}getState(){return this.R}ab(){return this.G}create(b,
600
+ c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.F||f.F===c)){f.F=c;let g;(null==(g=f.model())?0:g.e)&&f.db.ba(f,!0)}e&&f.persist();this.R===a.F.hl&&hg(f,!0);d&&this.Kc(f,d);this.D(a.j.vp,b)}update(b,c){c&&(b=this.N(b,!0),this.Kc(b,c))}$a(b){const c=this.get(b);void 0!==c&&(this.ba(c,!1),this.D(a.j.wp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case cg:kg(c,
601
601
  d);break;case dg:lg(c,d);break;default:c.unlink(b,d)}}Ga(b){for(const c of b)mg(this.N(c))}Ub(b){for(const c of b)(b=this.get(c))&&ng(b)}us(b){b.forEach(c=>{this.N(c).persist()})}Wd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.Io,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Pc(b,c)}Pc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.Ho,b);c&&this.R!==a.F.hl&&this.D(a.j.Dm,b);return d}$b(b){var c=olympe.V.Zh();this.F?og(this.F,c,b):b()}Y(b){let c;
602
- null!=(c=this.F)&&c.j.delete(b)}gb(b,...c){this.ua.has(b)&&this.ua.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.gb(b,c,...d)}ba(b,c){let d;null!=(d=this.F)&&d.J.set(b,c)}Wh(b,c,d,e){let f;null!=(f=this.F)&&pg(f,b).ka(e?qg+c:c,d)}Yh(b,c,d,e,f){let g;null!=(g=this.F)&&(d===rg?f?pg(g,b).link(c,e):pg(g,b).unlink(c,e):f?pg(g,b).Eb(c,e):pg(g,b).Ub(c,e))}Bb(b,c,d){let e;null!=(e=this.F)&&pg(e,b).$c(c,d)}addEventListener(b,c){let d=this.ua.get(b);void 0===d&&(d=[],this.ua.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,
602
+ null!=(c=this.F)&&c.j.delete(b)}fb(b,...c){this.ua.has(b)&&this.ua.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.fb(b,c,...d)}ba(b,c){let d;null!=(d=this.F)&&d.J.set(b,c)}Wh(b,c,d,e){let f;null!=(f=this.F)&&pg(f,b).ka(e?qg+c:c,d)}Yh(b,c,d,e,f){let g;null!=(g=this.F)&&(d===rg?f?pg(g,b).link(c,e):pg(g,b).unlink(c,e):f?pg(g,b).Eb(c,e):pg(g,b).Ub(c,e))}Bb(b,c,d){let e;null!=(e=this.F)&&pg(e,b).$c(c,d)}addEventListener(b,c){let d=this.ua.get(b);void 0===d&&(d=[],this.ua.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,
603
603
  c)}Eb(b){this.rc.push(b)}J(b){for(const c of this.$.values())if(c.R.has(b))return!0;return!1}Pk(b=!1){const c=gg++;this.R=a.F.bl;this.fa.add(c);b||this.$.set(c,new olympe.dc.db.Ct(c,this,this.$c));return c}Ey(b,c){if(!this.fa.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.F=null!=(d=this.$.get(b))?d:null;b=this.R;this.R=null===this.F?a.F.hl:a.F.jv;c();this.R=b;this.F=null}Gf(b){this.R=a.F.jf;const c=this.$.get(b);c&&(this.F=c,sg(this.F),tg(this.F),this.$.delete(b),
604
604
  this.F=null);this.fa.delete(b);0===this.fa.size&&(this.R=a.F.IDLE,this.rc.forEach(d=>{d()}),ug(this.Vd))}Kc(b,c){const d=a.D.Pe;for(const [e,f]of c)void 0!==f&&(e[0]===d?vg(b,e.substring(1),f):b.update(e,f))}Ec(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(eg+cg)))for(const f of c.values())null!==f.source()&&this.Ec(b,f,d);return d}ps(){const b=a.j.El,c=a.j.jk,d=new Set,e=new Map;this.j(a.j.vp,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===
605
605
  dg&&g[1]===fg){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.Eb(()=>{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 !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});
606
606
  e.clear()})}};olympe.dc.db.Database.D={Oi:'$',Vt:'~',Pe:'?',cl:'=',tp:'|',pl:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={Ho:0,Io:1,tr:2,Dm:3,bo:4,co:5,El:6,Cc:7,jk:8,qm:9,vp:10,wp:11,Cq:12,Uz:13,Tz:14,$v:15,Yo:16};olympe.dc.db.Database.F={IDLE:0,bl:1,jv:2,hl:3,jf:4};function wg(a,b,c=[]){const d=b.T();Sf(a.D,b,c);return e=>{if(null!==e)a.D.push(d,e);else{e=a.D;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=Wf(e,f.j,e.D.length);e.write(Uf(e,f,Date.now()),!1);e.F.delete(d)}}}}function xg(a,b,c={}){let d,e;return Yf(a.D,b,null!=(d=c.persist)?d:!0,null!=(e=c.Nm)?e:!1)}function yg(a,b){a.j.Eb(b)}
607
- olympe.dc.db.yt=class{constructor(a,b,c,d,e){this.G=a;this.j=b;this.view=c;this.D=new olympe.dc.db.ot(a,b,c,d);this.Ny=new olympe.dc.db.Tu(a,c,b,e)}$a(){return this.G}Tc(a,b={}){let c,d;this.D.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.Nm)?d:!1)}};const zg=olympe.dc.db.Database.D.ORIGIN,Ag=olympe.dc.db.Database.D.DESTINATION,Bg=olympe.dc.db.Database.D.Oi,Cg=olympe.dc.db.Database.D.Pe,Dg=olympe.dc.db.Database.D.cl,Eg=olympe.dc.db.Database.D.tp,Fg=zg+Ag,Gg=Bg+Bg,Hg=olympe.dc.db.Database.F;let Ig=0;function qf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=Jg(e,'',c);void 0!==f&&(a.j.getState()!==Hg.jf||e.J()&&!d||a.j.Y(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
607
+ olympe.dc.db.yt=class{constructor(a,b,c,d,e){this.G=a;this.j=b;this.view=c;this.D=new olympe.dc.db.ot(a,b,c,d);this.Ny=new olympe.dc.db.Tu(a,c,b,e)}ab(){return this.G}Tc(a,b={}){let c,d;this.D.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.Nm)?d:!1)}};const zg=olympe.dc.db.Database.D.ORIGIN,Ag=olympe.dc.db.Database.D.DESTINATION,Bg=olympe.dc.db.Database.D.Oi,Cg=olympe.dc.db.Database.D.Pe,Dg=olympe.dc.db.Database.D.cl,Eg=olympe.dc.db.Database.D.tp,Fg=zg+Ag,Gg=Bg+Bg,Hg=olympe.dc.db.Database.F;let Ig=0;function qf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=Jg(e,'',c);void 0!==f&&(a.j.getState()!==Hg.jf||e.J()&&!d||a.j.Y(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
608
608
  function sf(a,b,c,d){a=a.j.N(Kg(b));d=null!=d?d:Lg();Mg(a,'',d,c)&&a.Ha()&&c(!0,b);return d}function Qf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ha(e));for(const h of g)yield h,d.Jk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Lg(){++Ig;return String(Ig)}function Kg(a){if(a)return olympe.dc.ha(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
609
609
  function Ng(a,b,c,d,e){a=a.j.N(Kg(b));c=Kg(c);b=Bg+c;e=null!=e?e:Lg();if(Mg(a,b,e,d)&&a.Ha()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Dg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ha(b)),!a||c&&!a.Ha()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function Og(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.ha(c),Jg(b,Bg+c,d),a.j.getState()===Hg.jf&&a.j.Y(d))}
610
610
  function Pg(a,b,c,d){a=a.j.N(Kg(b));d=null!=d?d:Lg();Mg(a,Gg,d,c)&&a.Ha()&&a.forEach((e,f)=>{const g=f[0];g!==Bg&&g!==Dg||c(f.substring(1),e,g===Dg)});return d}function Qg(a,b,c){b=S(a,b);null!==b&&(Jg(b,Gg,c),a.j.getState()===Hg.jf&&a.j.Y(c))}function Rg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ha()||!c&&g.J())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(Kg(b));c=c.Ja()+c.X();e=null!=e?e:Lg();(d=Sg(a,c,e,d))&&a.Ha()&&Rg(a,c,!0,d,!1);return e}
611
611
  function Tg(a,b,c,d){const e=a.j.N(Kg(b));a=null!=d?d:Lg();const f=Sg(e,Fg,a,c);f&&e.Ha()&&e.forEach((g,h)=>{g=h[0];g!==zg&&g!==Ag||Rg(e,h,!0,f,!0)})}function Ug(a,b,c){const d=S(a,b);if(null!==d){const e=Jg(d,Fg,c);void 0!==e&&(a.j.getState()!==Hg.jf||d.J()||a.j.Y(c),!d.Ha()&&!d.J()||d.forEach((f,g)=>{f=g[0];(f===zg||f===Ag)&&e&&Rg(d,g,!1,e,!0)}))}}
612
- function Vg(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.ve.yg,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Bg||h===Cg))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===zg||h===Ag){const k=g.substring(1),l=(h===zg?12:3)&Wg(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}
612
+ function Vg(a,b,c){b=S(a,b,!1);if(!b||c===olympe.dc.Lb.NONE)return[];const d=c.charAt(0)===olympe.dc.ce.$f,e=[];b.forEach((f,g)=>{const h=g.charAt(0);if(!d&&f instanceof olympe.dc.vc&&(h===Bg||h===Cg))(f=a.j.get(f.X()))&&e.push([f,g.substring(1),null,!0]);else if(h===zg||h===Ag){const k=g.substring(1),l=(h===zg?12:3)&Wg(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}
613
613
  function Xg(a,b,c,d,e){const f=a.j.N(Kg(b));e=null!=e?e:Lg();const g=Sg(f,Eg+c,e,d);g&&f.Ha()&&Vg(a,b,c).forEach(([h,...k])=>{h.Ha()&&g(...k,!0,h.tag())})}function Yg(a,b,c,d){const e=S(a,b);if(null!==e){const f=Jg(e,Eg+c,d);void 0!==f&&(a.j.getState()!==Hg.jf||e.J()||a.j.Y(d),!e.Ha()&&!e.J()||Vg(a,b,c).forEach(([g,...h])=>{(g.Ha()||g.J())&&f(...h,!1,g.tag())}))}}function Zg(a,b){a=S(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Cg&&b.set(c.substring(1),d);return b}
614
- function Wg(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.ve.yg;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function $g(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===zg||c===Ag){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
615
- function ah(a,b,c){if(!a.Ha(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ha(b)];for(const f of e){const g=a.ab(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.G.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ha(b)}`);return d}function bh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
614
+ function Wg(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.ce.$f;c=d?c.substring(1):c;a=a.Qa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function $g(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===zg||c===Ag){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(S(a,b,!0))}
615
+ function ah(a,b,c){if(!a.Ha(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ha(b)];for(const f of e){const g=a.bb(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.ha(b)}`);return d}function bh(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
616
616
  olympe.dc.kb=class{constructor(a,b){this.G=a;this.j=b}T(){return this.j.T()}D(a,b,c,d=!1){a=S(this,a);if(null!==a){b=b.Ja()+b.X();const e=Jg(a,b,c);void 0!==e&&(this.j.getState()!==Hg.jf||a.J()&&!d||this.j.Y(c),d||!a.Ha()&&!a.J()||Rg(a,b,!1,e,!1))}}Ha(a){a=this.j.get(olympe.dc.ha(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}Xe(a){return(a=(a=S(this,
617
617
  a,!0))&&a.Xe())?a.tag():null}ei(a){a=S(this,a,!0);return!(!a||!a.Xe())}Qb(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Nf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}ef(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.ha(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===Bg||!b&&c===Dg)&&a.set(d.substring(1),e);return a}Jk(a,b){return Vg(this,a,b).filter(([c])=>c.Ha()).map(([c,
618
- ...d])=>[c.tag(),...d])}ab(a,b){a=S(this,a,!0);b=b.Ja()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}ss(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ja()+b.X()))?void 0:e.get(olympe.dc.ha(c));return!(null==a||!a.Ha())}dn(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.Ja()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
618
+ ...d])=>[c.tag(),...d])}bb(a,b){a=S(this,a,!0);b=b.Ja()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}ss(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ja()+b.X()))?void 0:e.get(olympe.dc.ha(c));return!(null==a||!a.Ha())}dn(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.Ja()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
619
619
  S(this,a,!0);const d=b.Ja()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ha())?a.tag():null}$g(a,b,c){a=olympe.dc.ha(a);const d=ah(this,a,b);d.delete(a);return c?(c=olympe.dc.ha(c),d.has(c)?Array.from(ah(this,c,b.ac()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Ur(a,b,c){if(!this.Ha(a))return null;b=ah(this,
620
620
  a,b);const d=[olympe.dc.ha(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}Xm(a,b,c){return this.dn(a,b).find(c)||null}hx(a,b,c){return this.dn(a,b).filter(c)}bs(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.Xe();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ha())throw a=`Try to get all extensions of the model ${olympe.dc.ha(a)} but one of them does not exists (${c.tag()})`,
621
- Error(a);null!==c&&e.push(c)}c=S(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Nf(a,b){const c=olympe.dc.ha(b);return!!this.Ur(a,olympe.dc.CloudObject.extendRel,d=>d===c)}dd(a){return this.ab(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.dd;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Nf;
621
+ Error(a);null!==c&&e.push(c)}c=S(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Nf(a,b){const c=olympe.dc.ha(b);return!!this.Ur(a,olympe.dc.CloudObject.extendRel,d=>d===c)}dd(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.dd;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Nf;
622
622
  olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.bs;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.hx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.Xm;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Ur;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.$g;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.dn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.ss;
623
- olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.ab;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Cb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.ef;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Qb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ei;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.Xe;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
623
+ olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.bb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Cb;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.ef;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Qb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ei;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.Xe;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
624
624
  olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ha;const ch=olympe.dc.db.Database.D.ORIGIN,rg=olympe.dc.db.Database.D.DESTINATION,qg=olympe.dc.db.Database.D.cl,dh=olympe.dc.db.Database.D.Oi,eh=olympe.dc.db.Database.D.tp,fh=olympe.dc.db.Database.D.pl,gh=ch+rg,hh=dh+dh,ih=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function og(a,b,c){let d=a.j.get(b);void 0===d&&(d=[],a.j.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
625
- function sg(a){for(const [b,c]of a.J)a.F.Ec(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?pg(a,d).create():pg(a,d).delete()})}
626
- function tg(a){const b=a.F;a.D.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.Dd()){var f=e.get(fh);f&&jh(a,f,c.D(),d);c.Dd()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===qg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(fh+dh+h);q&&jh(f,q,l,g);(k=k.get(fh+hh))&&jh(f,k,h,l,g)}for(const n of c.fa())kh(a,e,...n);(e=c.$)&&lh(a,b.get(e),c.$b,!c.Dd(),d)});a.J.clear();a.D.clear();a.N.clear();mh(a)}function pg(a,b){let c=a.D.get(b);void 0===c&&(c=new olympe.dc.db.uh(b),a.D.set(b,c));return c}
627
- function jh(a,b,...c){b.forEach((d,e)=>{og(a,e,d.bind(null,...c))})}function kh(a,b,c,d,e,f){var g=b.get(fh+d+c);g&&jh(a,g,f,e);(g=b.get(fh+gh))&&jh(a,g,c,d,f,e);nh(a,c,d).forEach((h,k)=>{(k=b.get(fh+eh+k))&&jh(a,k,c,d,h,f,e)})}function lh(a,b,c,d,e){ih.forEach(f=>{(f=b.get(fh+eh+f))&&jh(a,f,c,null,!0,d,e)})}function mh(a){a.Y.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}
628
- function nh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.F.get(b);e=new Map;ih.forEach(g=>{const h=g[0]===olympe.dc.ve.yg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(dh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ch?12:3)&k&&e.set(g,!!((c===ch?8:2)&k))});a.N.set(d,e)}return e}olympe.dc.db.Ct=class{constructor(a,b,c){this.id=a;this.F=b;this.Y=c;this.J=new Map;this.D=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function ug(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.qf.j.Fn:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.qf.j.Ov:a.F=!0,a.run()}}
629
- olympe.dc.db.qf=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.qf.j.Bl&&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.Wd(c),b.push(c))}this.D.clear();this.j.gb(olympe.dc.db.Database.j.Yo,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.tr,b=olympe.dc.db.Database.j.wp,
630
- c=olympe.dc.db.Database.j.Cq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&ug(this)};this.j.j(olympe.dc.db.Database.j.Dm,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.$v,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.qf.j={Bl:0,Ov:1,Fn:2};olympe.dc.db.qf.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.V.Hf();this.Ab=new Map}T(){return this.id}tc(a){const b=olympe.dc.db.uh.j.Yl,c=olympe.dc.db.uh.j.Cc,d=olympe.dc.db.uh.j.xk;this.Ab.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Cb():void 0;a.Pc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Cb(),g);break;case c:a.D(f,e.J(),g)}for(const [h,k,l]of e.Cd())e=this.Ab.get(k),
625
+ function sg(a){for(const [b,c]of a.J)a.D.Ec(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?pg(a,d).create():pg(a,d).delete()})}
626
+ function tg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.Ed()){var f=e.get(fh);f&&jh(a,f,c.D(),d);c.Ed()&&a.R.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===qg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(fh+dh+h);q&&jh(f,q,l,g);(k=k.get(fh+hh))&&jh(f,k,h,l,g)}for(const n of c.fa())kh(a,e,...n);(e=c.$)&&lh(a,e,d,c.$b,!c.Ed())});a.J.clear();a.F.clear();a.N.clear();mh(a)}function pg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.uh(b),a.F.set(b,c));return c}
627
+ function jh(a,b,...c){b.forEach((d,e)=>{og(a,e,d.bind(null,...c))})}function kh(a,b,c,d,e,f){var g=b.get(fh+d+c);g&&jh(a,g,f,e);(g=b.get(fh+gh))&&jh(a,g,c,d,f,e);nh(a,c,d).forEach((h,k)=>{(k=b.get(fh+eh+k))&&jh(a,k,c,d,h,f,e)})}function lh(a,b,c,d,e){ih.forEach(f=>{const g=f[0]===olympe.dc.ce.$f;(f=a.D.get(g?c:b).get(fh+eh+f))&&jh(a,f,d,null,!0,e,g?b:c)})}
628
+ function mh(a){a.Y.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}function nh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;ih.forEach(g=>{const h=g[0]===olympe.dc.ce.$f;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(dh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ch?12:3)&k&&e.set(g,!!((c===ch?8:2)&k))});a.N.set(d,e)}return e}
629
+ olympe.dc.db.Ct=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=c;this.J=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 ug(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.qf.j.Fn:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.qf.j.Ov:a.F=!0,a.run()}}
630
+ olympe.dc.db.qf=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.qf.j.Bl&&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.Wd(c),b.push(c))}this.D.clear();this.j.fb(olympe.dc.db.Database.j.Yo,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.tr,b=olympe.dc.db.Database.j.wp,
631
+ c=olympe.dc.db.Database.j.Cq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&ug(this)};this.j.j(olympe.dc.db.Database.j.Dm,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.$v,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.qf.j={Bl:0,Ov:1,Fn:2};olympe.dc.db.qf.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.V.Hf();this.Ab=new Map}T(){return this.id}tc(a){const b=olympe.dc.db.uh.j.Yl,c=olympe.dc.db.uh.j.Cc,d=olympe.dc.db.uh.j.xk;this.Ab.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Cb():void 0;a.Pc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Cb(),g);break;case c:a.D(f,e.J(),g)}for(const [h,k,l]of e.Dd())e=this.Ab.get(k),
631
632
  l?a.Oa(h,f,k,g,e.Vb()):a.ic(h,f,k,g,e.Vb())});return a}cf(){return 0===this.Ab.size}J(){let a=0;this.Ab.forEach(b=>{a+=b.Ec()});return a}Pc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.hc.Yc,a,d,d,null);c&&b.Lm(c)}Wc(a,b,c=null){b&&this.F(a,c).Lm(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.Jk(a,b,!1))this.Ab.get(e).Cb().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
632
- c);this.F(c,e).Eb(a,b)}ic(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Ub(a,b)}$(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Zg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.ve.Pe}${g}`,f)});this.Pc(a,d,e,c);(b=b.Xe(a))&&this.Oa(olympe.dc.hc.ti,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.$(f.X())})}}dd(){return function*(a){for(const b of a.values())if(b.D()||b.Dd()||b.R())yield b}(this.Ab)}Rc(a){let b;return null!=(b=this.Ab.get(olympe.dc.ha(a)))?
633
- b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Jk(a,b);for(const c of a)this.Y(c,!1),this.Ab.delete(c)}Cd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Cd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Ab.values())}$g(a,b,c=(d,e)=>[d,e]){return this.fa(a,b,c)}*fa(a,b,c,d=[]){d.push(a);a=this.Rc(a);for(const [e,f]of a.ab(b))d.includes(e)||(yield*this.fa(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.N(a,olympe.dc.va.DESTINATION,c);e&&e.N(a,olympe.dc.va.ORIGIN,
634
- b)}Y(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Ab.get(a);for(const [g,h,k]of e.Cd())if(k||!b){e.N(g,d,h);var f=this.Ab.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.gb())if(k||!b)e.N(g,c,h),(f=this.Ab.get(h))&&f.N(g,d,a)}*gs(a){let b;for(const [c,d]of(null==(b=this.Rc(a))?void 0:b.ab(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.Dd()||(yield a))}Jk(a,b,c=!0){const d=olympe.dm.Relation.j.Jq,e=olympe.dm.Relation.j.rr,f=olympe.dc.va.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
635
- 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.Cd())q&&Wg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.gb())q&&Wg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of $g(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Wg(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.uh(a),this.Ab.set(a,c));return b?c.Ga(b):c}R(a){const b=
636
- olympe.dc.va.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Dd())this.j(a,d.J());else if(c.Dd())d.D()&&this.j(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Qa(f)&&c.ba(f)});for(const [e,f,g]of c.Cd()){const h=d.Bb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Ab;const c=a.Ab,d=(a=a.J()>this.J())?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.fc.xa=[olympe.dc.Writable,olympe.dc.vq];const oh=olympe.dc.db.Database.j,ph=olympe.dc.db.Database.D.Oi,qh=olympe.dc.db.Database.D.Vt,rh=olympe.dc.db.Database.D.Pe,sh=olympe.dc.db.Database.D.cl,th=olympe.dc.db.Database.D.pl,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,uh=olympe.dc.hc.Yc,vh=olympe.dc.hc.ti;function Rf(a,b,c=!1){const d=a.get(rh+b);return c||void 0!==d?d:a.get(qh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,wh(a)):(xh(a),a.e=b),a.db.D(b?oh.El:oh.Cc,a.j));return c}
633
+ c);this.F(c,e).Eb(a,b)}ic(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Ub(a,b)}$(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Zg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.ce.Pe}${g}`,f)});this.Pc(a,d,e,c);(b=b.Xe(a))&&this.Oa(olympe.dc.hc.ti,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.$(f.X())})}}dd(){return function*(a){for(const b of a.values())if(b.D()||b.Ed()||b.R())yield b}(this.Ab)}Rc(a){let b;return null!=(b=this.Ab.get(olympe.dc.ha(a)))?
634
+ b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Jk(a,b);for(const c of a)this.Y(c,!1),this.Ab.delete(c)}Dd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Dd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Ab.values())}$g(a,b,c=(d,e)=>[d,e]){return this.fa(a,b,c)}*fa(a,b,c,d=[]){d.push(a);a=this.Rc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.fa(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.N(a,olympe.dc.va.DESTINATION,c);e&&e.N(a,olympe.dc.va.ORIGIN,
635
+ b)}Y(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Ab.get(a);for(const [g,h,k]of e.Dd())if(k||!b){e.N(g,d,h);var f=this.Ab.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.fb())if(k||!b)e.N(g,c,h),(f=this.Ab.get(h))&&f.N(g,d,a)}*gs(a){let b;for(const [c,d]of(null==(b=this.Rc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Ab.get(c),a.Ed()||(yield a))}Jk(a,b,c=!0){const d=olympe.dm.Relation.j.Jq,e=olympe.dm.Relation.j.rr,f=olympe.dc.va.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
636
+ 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.Dd())q&&Wg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.fb())q&&Wg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of $g(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Wg(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.uh(a),this.Ab.set(a,c));return b?c.Ga(b):c}R(a){const b=
637
+ olympe.dc.va.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Ed())this.j(a,d.J());else if(c.Ed())d.D()&&this.j(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Qa(f)&&c.ba(f)});for(const [e,f,g]of c.Dd()){const h=d.Bb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Ab;const c=a.Ab,d=(a=a.J()>this.J())?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.fc.xa=[olympe.dc.Writable,olympe.dc.vq];const oh=olympe.dc.db.Database.j,ph=olympe.dc.db.Database.D.Oi,qh=olympe.dc.db.Database.D.Vt,rh=olympe.dc.db.Database.D.Pe,sh=olympe.dc.db.Database.D.cl,th=olympe.dc.db.Database.D.pl,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,uh=olympe.dc.hc.Yc,vh=olympe.dc.hc.ti;function Rf(a,b,c=!1){const d=a.get(rh+b);return c||void 0!==d?d:a.get(qh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,wh(a)):(xh(a),a.e=b),a.db.D(b?oh.El:oh.Cc,a.j));return c}
637
638
  function ig(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(uh,c)}a.link(uh,b);b.forEach((d,e)=>{if(e[0]===rh||e[0]===qh)e=e.substring(1),yh(a,e,d)});null===a.F||!b.e&&b!==a||a.db.ba(a,!0)}function jg(a,b){const c=a.Xe();if(null!==c){if(c===b)return;a.unlink(vh,c)}a.link(vh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===rh||f[0]===qh)f=f.substring(1),a.has(rh+f)||(a.set(qh+f,e),d.set(f,e))});zh(a,d)}
638
639
  function kg(a,b){a.unlink(uh,b);a.forEach((c,d)=>{c=d.substring(1);yh(a,c,null)});a.db.ba(a,!1)}function lg(a,b){a.unlink(vh,b);const c=new Map;a.forEach((d,e)=>{e[0]===qh&&(a.delete(e),d=e.substring(1),c.set(d,null))});zh(a,c)}function mg(a){a.c++;1===a.c&&a.db.D(oh.tr,a.j)}
639
640
  function ng(a){0<a.c?--a.c:a.db.D(oh.Cq,a.j,`Try to decrease references on instance ${a.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===a.c&&a.db.D(oh.Dm,a.j)}
640
641
  function vg(a,b,c){const d=rh+b;var e=a.get(d);e=void 0===e?null:e;if(!Ah(e,c))if(Bh(a,b,e,c,!0),e=qh+b,null===c){a.delete(d);let f;c=null==(f=a.Xe())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);zh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),zh(a,(new Map).set(b,c))}function Mg(a,b,c,d){const e=Ch(a,th+b);return e.has(c)?!1:(e.set(c,d),mg(a),a.db.D(oh.bo,a.j,b,c),!0)}function Jg(a,b,c){const d=Dh(a,th+b,c);void 0!==d&&(ng(a),a.db.D(oh.co,a.j,b,c));return d}
641
642
  function Sg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?mg(g):ng(g));d(...f)};return Mg(a,b,c,e)?e:null}function Ah(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
642
- function Bh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Eh(a.db.get(c.X())),a.db.cb(c.X()));d instanceof olympe.dc.vc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.$a().fatal('Instance',d.X(),'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&&(mg(d),d.db.Bb(d.j,a,b)),d.D={tag:a,La:b,Ay:e})}function Fh(a,b,c,d){a.e&&a.db.Wh(a.j,b,c,d)}
643
+ function Bh(a,b,c,d,e){c instanceof olympe.dc.vc&&(Eh(a.db.get(c.X())),a.db.$a(c.X()));d instanceof olympe.dc.vc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.ab().fatal('Instance',d.X(),'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&&(mg(d),d.db.Bb(d.j,a,b)),d.D={tag:a,La:b,Ay:e})}function Fh(a,b,c,d){a.e&&a.db.Wh(a.j,b,c,d)}
643
644
  function zh(a,b,c=[]){const d=a.get(U+uh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>yh(e,g,f))});a=a.get(U+vh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(rh+k)||(g.set(k,h),null!==h?e.set(qh+k,h):e.delete(qh+k))});zh(e,g,[...c,f])}})}function Ch(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Gh(a,b,c,d,e){a.db.Yh(a.j,b,c,d.j,e)}
644
645
  function Dh(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 yh(a,b,c){if(!a.has(ph+b)){const d=sh+b,e=a.get(d);Ah(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Fh(a,b,c,null!==c))}}function wh(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&&(Gh(a,e,d,g,!0),Gh(g,e,f,a,!0))})}else if(d===ph||d===sh)c=c.substring(1),Fh(a,c,b,d===sh)})}
645
646
  function xh(a){a.forEach((b,c)=>{const d=c[0];if(d!==th){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===ph?a.update(e,null):d===rh&&vg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.Ay;let d,e;(null==(d=b.get(`${c?rh:ph}${a.D.La}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.j&&(c?vg(b,a.D.La,null):b.update(a.D.La,null))}}function Eh(a){void 0!==a.D&&(ng(a),a.db.Bb(a.j,a.D.tag,a.D.La),a.D=void 0)}
@@ -647,15 +648,15 @@ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.F
647
648
  var b=this.model();if(b){var c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Xe())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'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(ph+a);return b||void 0!==c?c:this.get(sh+a)}update(a,b){const c=ph+a;var d=this.get(c);d=void 0===d?null:d;if(!Ah(d,b))if(Bh(this,
648
649
  a,d,b,!1),d=sh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Rf(e,a);void 0!==b?(this.set(d,b),Fh(this,a,b,!0)):Fh(this,a,null,!1)}else this.set(c,b),this.delete(d),Fh(this,a,b,!1)}link(a,b){var c=U+a;const d=Ch(this,V+a);c=Ch(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(oh.jk,this.j,a,V,b.j),this.db.D(oh.jk,b.j,a,U,this.j),this.e&&b.e&&(Gh(this,a,V,b,!0),Gh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Dh(this,V+a,b.j)&&(Dh(b,c,this.j),this.db.D(oh.qm,this.j,
649
650
  a,V,b.j),this.db.D(oh.qm,b.j,a,U,this.j),this.e&&b.e&&(Gh(this,a,V,b,!1),Gh(b,a,U,this,!1)))}persist(){this.N=!0;return this}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===ph&&a instanceof olympe.dc.vc&&Eh(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(ph+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};
650
- olympe.dc.db.Instance.j={eB:'instance',ZB:'rel',pl:'cb',pm:'ref',TRANSACTION:'tx'};olympe.dc.db.uh=class a{constructor(b){this.rc=b;this.Y=this.cb=null;this.Nb=olympe.dc.Lb.NONE;this.F=a.j.xk;this.j=this.ob=this.$b=this.$=this.properties=null}tag(){return this.rc}Vb(){return this.Y}sb(){return this.cb}getState(){return this.F}Ga(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}J(){return this.F===a.j.Cc?this.Nb:olympe.dc.Lb.NONE}create(b){this.F=a.j.Yl;this.cb=null!=
651
+ olympe.dc.db.Instance.j={eB:'instance',ZB:'rel',pl:'cb',pm:'ref',TRANSACTION:'tx'};olympe.dc.db.uh=class a{constructor(b){this.rc=b;this.Y=this.$a=null;this.Nb=olympe.dc.Lb.NONE;this.F=a.j.xk;this.j=this.ob=this.$b=this.$=this.properties=null}tag(){return this.rc}Vb(){return this.Y}sb(){return this.$a}getState(){return this.F}Ga(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}J(){return this.F===a.j.Cc?this.Nb:olympe.dc.Lb.NONE}create(b){this.F=a.j.Yl;this.$a=null!=
651
652
  b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Cc;this.Nb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Cc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Lm(b){this.F!==a.j.Cc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}$c(b,c){if(null!==this.$&&this.$!==b)throw Error('An instance should never be set as complex property of multiple instances');this.$=b;this.$b=c}ba(b){let c;null==
652
653
  (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.hc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.hc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!1);return this}Eb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}Ub(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}Bb(b,c,d){if(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)return(b=c.get(b))&&
653
- b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.Yl}Dd(){return this.F===a.j.Cc}Ec(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Kc(){return null!==this.ob||null!==this.j}Cb(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}ab(b,c=(d,e)=>[d,e]){return function*(d){if(d=
654
- d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Cd(b=(c,d,e)=>[c,d,e]){return this.ua(this.ob,b)}gb(b=(c,d,e)=>[c,d,e]){return this.ua(this.j,b)}fa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.ua.bind(this),
654
+ b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.Yl}Ed(){return this.F===a.j.Cc}Ec(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Kc(){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)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
655
+ d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ja()===olympe.dc.va.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Dd(b=(c,d,e)=>[c,d,e]){return this.ua(this.ob,b)}fb(b=(c,d,e)=>[c,d,e]){return this.ua(this.j,b)}fa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.ua.bind(this),
655
656
  this.ob,this.j)}sa(b,c,d,e){if(this.F!==a.j.Cc||!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)}}*ua(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.uh.j={Yl:0,xk:1,Cc:2};olympe.dc.db.Tu=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.ha(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ha()){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.Oi+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
656
657
  ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.Io,b=olympe.dc.db.Database.j.El,c=olympe.dc.db.Database.j.Cc,d=olympe.dc.db.Database.j.jk,e=olympe.dc.db.Database.j.qm,f=olympe.dc.db.Database.j.bo,g=olympe.dc.db.Database.j.co,h=()=>{};this.j.j(olympe.dc.db.Database.j.Ho,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.$b(()=>{Tg(this.view,
657
658
  k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.$b(()=>{Ug(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.Em=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ia=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.Pk(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new Hh(this.ia),a.tc(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',
658
- this.transactionId);this.j.Ey(this.transactionId,()=>a.tc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.Gf(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Pc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.hc.Yc,a,d)}Wc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of Qf(this.ia,a,b))this.j.cb(c)}Oa(a,b,c){this.j.link(a,b,c)}ic(a,b,c){this.j.unlink(a,b,c)}};
659
+ this.transactionId);this.j.Ey(this.transactionId,()=>a.tc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.Gf(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Pc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.hc.Yc,a,d)}Wc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of Qf(this.ia,a,b))this.j.$a(c)}Oa(a,b,c){this.j.link(a,b,c)}ic(a,b,c){this.j.unlink(a,b,c)}};
659
660
  function Ih(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.X()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.ah()+','+f.Yg()+','+f.Vg()+','+f.Ug()+'")';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+=Ih(a,f,
660
661
  (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Jh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Kh(a,b){let c;return b===olympe.dc.hc.Yc?'Model':null!=(c=a.db.name(b))?c:b}
661
662
  class Hh{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}`:''}`}Pc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${Ih(this,c)})`,Jh(this,d))}Wc(a,b,c){this.log(`updateInstance(tag: ${a}, ${Ih(this,b)})`,Jh(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,Jh(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,Kh(this,a))}ic(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
@@ -664,7 +665,7 @@ olympe.W.config(function(a){F(a,olympe.dc.db.U.Zo,olympe.dc.db.qf.j.Fn);F(a,olym
664
665
  (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.qf.j.Bl:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.P.xl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.Jj);E(a,olympe.dc.db.P.Gi,[olympe.dc.db.P.Da],b=>b.Ny);E(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.Jj,olympe.dc.db.P.xl,new olympe.W.pa(olympe.dc.U.Uf),new olympe.W.pa(olympe.dc.db.U.rl),new olympe.W.pa(olympe.dc.db.U.Gi),new olympe.W.pa(olympe.dc.db.U.Su),
665
666
  new olympe.W.pa(olympe.dc.db.U.Ru)],(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.yt(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.Jj,olympe.dc.db.P.Gi],(a,b)=>{olympe.Zd().db=a;olympe.Zd().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Lh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
666
667
  olympe.dc.query.mf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.j=a;this.La=b;this.Ei=c}ga(){return{p:this.La.X(),o:this.Ei}}toString(){return'sortByQueryPart-'+this.Ei+this.La.X()}Wg(){const a=this.db.Jb(this.La,olympe.dm.Property.typeRel),b=olympe.dc.ha;if(this.db.Nf(a,olympe.dm.String))return Lh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Lh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Lh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return Lh((c,
667
- d)=>c.compare(d));olympe.ja.$a('dc.query').warn(`No comparator found for type with tag ${a}`);return Lh(()=>-1)}Qa(){return this.La}};olympe.dc.Qe=class{X(){}};olympe.dc.Qe.prototype.getTag=olympe.dc.Qe.prototype.X;olympe.dc.bB=olympe.dc.Qe;function Mh(a){let b;if(null==(b=a.j)?0:b.cf())if(a=a.J,!a.N){let c;null==(c=a.R)||c.call(a)}}function Nh(a,b,c,d,e){Mh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
668
+ d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Lh(()=>-1)}Qa(){return this.La}};olympe.dc.Qe=class{X(){}};olympe.dc.Qe.prototype.getTag=olympe.dc.Qe.prototype.X;olympe.dc.bB=olympe.dc.Qe;function Mh(a){let b;if(null==(b=a.j)?0:b.cf())if(a=a.J,!a.N){let c;null==(c=a.R)||c.call(a)}}function Nh(a,b,c,d,e){Mh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
668
669
  olympe.dc.query.Xu=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.J=d;this.j=this.F=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;sf(this.db,a,(d,e)=>{if(d){Mh(this);let f;null==(f=this.j)||f.$(e)}else if(b&&Qg(this.db,e,c),!this.db.Ha(e)){Mh(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&Pg(this.db,a,(d,e,f)=>{Mh(this);let g;f||null!=(g=this.j)&&g.Wc(a,new Map([[d,e]]))},c)}}stop(a){qf(this.db,a,`${this.D}:${a}:notif`)}};olympe.dc.query.dk={ASC:'ASC',DESC:'DESC'};function Oh(a){const b=Ph(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.dd()),n=new Map,p=a.J.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;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,X)=>K.add(X),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.j(x)){let A;n.set(z,
669
670
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.j(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let X;const xa=null!=(X=x.get(z))?X:new Set;y.forEach(ab=>xa.add(ab+K));x.set(z,xa)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
670
671
  q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Qh(a){if(null===a.D){const b={Hb:a.query.Wg(),Hd:a.Hd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ia.from(a.Y,Oh(a),b)}return a.D}function Rh(a,b){a.R=b}function Sh(a){if(!a.N){null!==a.D&&(a.Y=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
@@ -672,41 +673,41 @@ function Th(a,b){let c;return null!=(c=a.j.get(b).dd())?c:[]}function Uh(a,b,c){
672
673
  function Xh(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.Xu(a.G,a.query.sb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.dd())b.watch(e,a.J.has(d))});null!=b.j||(b.j=new olympe.dc.db.fc);a.Je=b}function Yh(a){null!==a.Je&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.dd())a.Je.stop(c)}),a.Je=null)}
673
674
  function Zh(a){a.N=!1;if(null!=(a=a.Je)){let b;const c=!(null==(b=a.j)?0:b.cf());a.F=c?a.j:null;c&&(a.j=new olympe.dc.db.fc,a.G.j()&&a.G.debug(`Commit notification with ${a.F.J()} operations for query ${a.D}`))}}
674
675
  olympe.dc.query.tq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.tb(b.D);this.oa=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.oa.vm);this.J=new Set(b.F);this.Hd=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ia.empty();this.Je=this.D=null;a=Ph(b);a.forEach(c=>{const d=c.T();this.oa.set(d,c.N());this.j.set(d,c.fa())});b=b.Wg();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.J.has(d)?1:0,b===d){this.Hd=c;break}}}remove(a,b=this.F,c='root'){b=
675
- this.j.get(b);if(null==b?0:b.remove(a,c))if(Sh(this),!b.has(a)){let d;null==(d=this.Je)||d.stop(a);return!0}return!1}Oc(a){const b=a.D,c=olympe.V.tb(b);a=Ph(a);const d=[];for(const [f,g]of this.j){if(g.F(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.$(k,this.oa.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.oa.get(k))?void 0:l.Oc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function $h(a){if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.xd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
676
+ this.j.get(b);if(null==b?0:b.remove(a,c))if(Sh(this),!b.has(a)){let d;null==(d=this.Je)||d.stop(a);return!0}return!1}Oc(a){const b=a.D,c=olympe.V.tb(b);a=Ph(a);const d=[];for(const [f,g]of this.j){if(g.F(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.$(k,this.oa.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.oa.get(k))?void 0:l.Oc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function $h(a){if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
676
677
  function ai(a){var b=olympe.dc.query.Aa.j.kr;const c=olympe.dc.query.Aa.j.Jo,d=olympe.dc.query.Aa.j.Gj,e=olympe.dc.query.Aa.j.up,f=olympe.dc.query.Aa.j.Up,g=olympe.dc.query.Aa.j.Dq,h=olympe.dc.query.Aa.j.Dn,k=olympe.dc.query.Aa.j.iq;switch(a.pr){case b:return new olympe.dc.query.Z.Am(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Z.te(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.nf(a.p,
677
- a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.de(ai(a.v));case g:return new olympe.dc.query.Z.zf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.ze(...a.p.map(l=>ai(l)));case h:return new olympe.dc.query.Z.Id(...a.p.map(l=>ai(l)));default:return null}}
678
- olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}sd(){return new olympe.dc.query.Z.de(this)}Cb(){}Oc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static uy(...a){return new olympe.dc.query.Z.Am(a)}static Ea(a,b){$h(a);return new olympe.dc.query.Z.te(a,b,olympe.dc.ia())}static contains(a,b,c=!0){$h(a);return new olympe.dc.query.Z.nf(a,b,olympe.dc.ia(),c)}static kz(a,b,c=!0){$h(a);return new olympe.dc.query.Z.zf(a,b,olympe.dc.ia(),c)}static Ok(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),
679
- a,b,!1,c)}static vj(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.xd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Id(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.xd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
680
- return new olympe.dc.query.Z.ze(...a)}static sd(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.xd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.de(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.sd;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.vj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Ok;
678
+ a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.ee(ai(a.v));case g:return new olympe.dc.query.Z.zf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.ze(...a.p.map(l=>ai(l)));case h:return new olympe.dc.query.Z.Id(...a.p.map(l=>ai(l)));default:return null}}
679
+ olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.ee(this)}Cb(){}Oc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static uy(...a){return new olympe.dc.query.Z.Am(a)}static Ea(a,b){$h(a);return new olympe.dc.query.Z.te(a,b,olympe.dc.ia())}static contains(a,b,c=!0){$h(a);return new olympe.dc.query.Z.nf(a,b,olympe.dc.ia(),c)}static kz(a,b,c=!0){$h(a);return new olympe.dc.query.Z.zf(a,b,olympe.dc.ia(),c)}static Ok(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),
680
+ a,b,!1,c)}static vj(a,b,c=!0){$h(a);return new olympe.dc.query.Z.Bi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Id(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
681
+ return new olympe.dc.query.Z.ze(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.ee(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.vj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Ok;
681
682
  olympe.dc.query.Aa.regex=olympe.dc.query.Aa.kz;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.uy;olympe.dc.query.Aa.j={kr:0,Jo:1,Gj:2,up:3,Up:4,Dq:5,iq:6,Dn:7};function Ph(a){return Array.from(a.oa)}
682
- function bi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ja()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ke;else if(e=a.oa[a.cursor],null!==e.ua)e=e.ua;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ja()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ha(olympe.dc.CloudObject)&&(null===d||!a.db.Nf(d,e)&&!a.db.Nf(e,d)))throw new olympe.dc.query.xd(`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=
683
+ function bi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ja()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ke;else if(e=a.oa[a.cursor],null!==e.ua)e=e.ua;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ja()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ha(olympe.dc.CloudObject)&&(null===d||!a.db.Nf(d,e)&&!a.db.Nf(e,d)))throw new olympe.dc.query.yd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
683
684
  b.T();for(c=a.cursor+1;c<a.oa.length&&a.oa[c].T()!==d;)c++;b=c<a.oa.length?a.oa:a.oa.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function ci(a,b=a.cursor){return 0<=b?a.oa[b].T():olympe.V.tb(a.D)}
684
- function di(a,b,c,d={}){var e=olympe.dc.Lb.ag;const f=(null==d?0:d.Gd)?d.Gd:olympe.dc.ma.oc.lf,g=(null==d?0:d.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);const h=olympe.dc.$d().Ie(b);b=(new olympe.dc.ma(b,h)).he();b.oa=[f===olympe.dc.ma.oc.Fg?new olympe.dc.query.oa.Uo(ci(b),e,c):new olympe.dc.query.oa.Jd(ci(b),e,c)];let k;b.J=null!=(k=null==d?void 0:d.rs)?k:!1;return b.observe(a,{Gd:f,Dk:g})}
685
- function ei(a){const b=0===a.F.size?a.he():a;if(null!==b.j.Hd&&!b.F.has(ci(a,b.j.Hd)))throw new olympe.dc.query.xd('AndReturn was not called for the current level before sortBy operator');return b}function fi(a,b){let c,d;return b.J||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
686
- olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ke:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.xd('The root of the query cannot be empty.');this.D=a;this.source=b;this.oa=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.J=!1}static from(a,b){a=olympe.dc.ha(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.xd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
687
- b=null!=b?b:olympe.dc.$d().Ie(a);b=new olympe.dc.ma(a,b);b.j.Ke=olympe.dc.ia().model(a);return b}static Ie(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.xd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ha(a);c=null!=c?c:olympe.dc.$d().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ke=olympe.dc.ha(b);return c}static Rk(a,b=!0,c){const d=olympe.dc.ha(a);var e=olympe.dc.ia();if(!e.ei(d))throw new olympe.dc.query.xd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
688
- a=null!=c?c:olympe.dc.$d().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ke=e.model(d);b&&(a=bi(a,new olympe.dc.query.oa.ue(ci(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.sh(ci(a),olympe.dc.CloudObject.instancesRel,!1);e.ua=d;return bi(b,e)}static Nb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.Gd)?f:olympe.dc.ma.oc.lf;f=(null==e?0:e.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);d=null!=d?d:olympe.dc.$d().Ie(b);d=(new olympe.dc.ma(b,d)).he();b=g===olympe.dc.ma.oc.Fg;
689
- d.oa=[b?new olympe.dc.query.oa.Uo(ci(d),c):new olympe.dc.query.oa.Jd(ci(d),c)];let h;d.J=null!=(h=null==e?void 0:e.rs)?h:!1;let k;return d.observe(a,{Gd:g,Dk:f,aj:null!=(k=null==e?void 0:e.aj)?k:b})}hb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.xd(`The relation given to follow() is invalid: ${a}`);return bi(this,new olympe.dc.query.oa.sh(ci(this),a,b))}gg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.xd(`The relation given to followRecursively() is invalid: ${a}`);
690
- return bi(this,new olympe.dc.query.oa.ue(ci(this),a,b,c))}he(){const a=(new Set(this.F)).add(ci(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.xd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}bj(){return this}pj(a,b=0){return new olympe.dc.ma(this.D,
691
- this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ke:this.j.Ke})}Zk(a,b=olympe.dc.query.dk.ASC){if(0>this.cursor)throw new olympe.dc.query.xd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.xd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ke:this.j.Ke},
685
+ function di(a,b,c,d={}){var e=olympe.dc.Lb.bg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.oc.lf,g=(null==d?0:d.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);const h=olympe.dc.$d().Ie(b);b=(new olympe.dc.ma(b,h)).he();b.oa=[f===olympe.dc.ma.oc.Fg?new olympe.dc.query.oa.Uo(ci(b),e,c):new olympe.dc.query.oa.Jd(ci(b),e,c)];let k;b.J=null!=(k=null==d?void 0:d.rs)?k:!1;return b.observe(a,{jd:f,Dk:g})}
686
+ function ei(a){const b=0===a.F.size?a.he():a;if(null!==b.j.Hd&&!b.F.has(ci(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function fi(a,b){let c,d;return b.J||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
687
+ olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ke:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('The root of the query cannot be empty.');this.D=a;this.source=b;this.oa=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.J=!1}static from(a,b){a=olympe.dc.ha(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
688
+ b=null!=b?b:olympe.dc.$d().Ie(a);b=new olympe.dc.ma(a,b);b.j.Ke=olympe.dc.ia().model(a);return b}static Ie(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ha(a);c=null!=c?c:olympe.dc.$d().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ke=olympe.dc.ha(b);return c}static Rk(a,b=!0,c){const d=olympe.dc.ha(a);var e=olympe.dc.ia();if(!e.ei(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
689
+ a=null!=c?c:olympe.dc.$d().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ke=e.model(d);b&&(a=bi(a,new olympe.dc.query.oa.ue(ci(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.oa.sh(ci(a),olympe.dc.CloudObject.instancesRel,!1);e.ua=d;return bi(b,e)}static Nb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.oc.lf;f=(null==e?0:e.xn)?'__code-as-data__':void 0;b=olympe.dc.ha(b);d=null!=d?d:olympe.dc.$d().Ie(b);d=(new olympe.dc.ma(b,d)).he();b=g===olympe.dc.ma.oc.Fg;
690
+ d.oa=[b?new olympe.dc.query.oa.Uo(ci(d),c):new olympe.dc.query.oa.Jd(ci(d),c)];let h;d.J=null!=(h=null==e?void 0:e.rs)?h:!1;let k;return d.observe(a,{jd:g,Dk:f,aj:null!=(k=null==e?void 0:e.aj)?k:b})}gb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return bi(this,new olympe.dc.query.oa.sh(ci(this),a,b))}hg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
691
+ return bi(this,new olympe.dc.query.oa.ue(ci(this),a,b,c))}he(){const a=(new Set(this.F)).add(ci(this));return new olympe.dc.ma(this.D,this.source,this.oa,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.oa);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}bj(){return this}pj(a,b=0){return new olympe.dc.ma(this.D,
692
+ this.source,this.oa,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ke:this.j.Ke})}Zk(a,b=olympe.dc.query.dk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Qb(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.oa[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ke:this.j.Ke},
692
693
  e=Array.from(this.oa);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}Wg(){const a=this.j.Hd;let b;return null!==a?null==(b=this.oa[a])?void 0:b.Wg():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.oa[b].j;for(b--;-1<b&&ci(this,b)!==d;)b--}return new olympe.dc.ma(this.D,this.source,Array.from(this.oa),b,this.F,this.j)}parse(){const a=new Map,b=ci(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
693
694
  filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ei(this.D)?c.dataType=olympe.dc.ha(this.D):(c.root=olympe.dc.ha(this.D),c.dataType=this.j.Ke);this.oa.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.oa.sh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.oa.ue&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
694
- 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.Gd)?a.Gd:olympe.dc.ma.oc.ek;let c;return olympe.dc.query.Nk().executeQuery(ei(this),b,{Th:null!=(c=null==a?void 0:a.Dk)?c:null==a?void 0:a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Qh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Qh(gi(olympe.dc.query.Nk(),ei(this)))}observe(a,b){const c=(null==b?0:b.Gd)?b.Gd:olympe.dc.ma.oc.lf;a='function'===typeof a.D?a.D():
695
+ g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.oc.ek;let c;return olympe.dc.query.Nk().executeQuery(ei(this),b,{Th:null!=(c=null==a?void 0:a.Dk)?c:null==a?void 0:a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Qh(d))?e:olympe.dc.Ia.empty()})}Fc(){return Qh(gi(olympe.dc.query.Nk(),ei(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.oc.lf;a='function'===typeof a.D?a.D():
695
696
  a;let d;return hi(olympe.dc.query.Nk(),ei(this),a,olympe.dc.Ka.SELF,c,{Th:null!=(d=null==b?void 0:b.Dk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc,aj:null==b?void 0:b.aj}).pipe(rxjs.operators.map(e=>Qh(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Ph(this).map(a=>a.J()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.oa.map(b=>b.ga()),
696
697
  r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ke)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.oa.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
697
- olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.Zk;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.pj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.bj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.he;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.gg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.hb;
698
+ olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.Zk;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.pj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.bj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.he;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.hg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.gb;
698
699
  olympe.dc.ma.followRule=olympe.dc.ma.Nb;olympe.dc.ma.instancesOf=olympe.dc.ma.Rk;olympe.dc.ma.fromTag=olympe.dc.ma.Ie;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.oc={lf:1,ek:2,Fg:3};olympe.dc.ma.j={nl:'cacheBucketName',zp:'isCacheable'};function ii(a){null===a.Fa&&null===a.j&&(a.Fa=Bf(a.F))}
699
- olympe.dc.query.yd=class extends olympe.dc.vg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ae}static gj(a){const b=new olympe.dc.query.yd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.yd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Ek=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}tc(a){ii(this);return super.tc(a)}kc(){ii(this);return super.kc()}Kk(){ii(this);return super.Kk()}create(a,b,c){this.F.Pc(a,this.D,c,b);return this}Oa(a,
700
- b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.yd.prototype.createRelation=olympe.dc.query.yd.prototype.Oa;olympe.dc.query.yd.prototype.create=olympe.dc.query.yd.prototype.create;olympe.dc.query.yd.fromQuery=olympe.dc.query.yd.gj;function gi(a,b){const c=new olympe.dc.query.tq(a.G,b);if(a.D.view.Ha(b.D)){Vh(c,b.D);for(const d of Ph(b))d.nb(c)}return c}
700
+ olympe.dc.query.zd=class extends olympe.dc.wg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ae}static gj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Ek=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}tc(a){ii(this);return super.tc(a)}kc(){ii(this);return super.kc()}Kk(){ii(this);return super.Kk()}create(a,b,c){this.F.Pc(a,this.D,c,b);return this}Oa(a,
701
+ b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.gj;function gi(a,b){const c=new olympe.dc.query.tq(a.G,b);if(a.D.view.Ha(b.D)){Vh(c,b.D);for(const d of Ph(b))d.nb(c)}return c}
701
702
  function hi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.J&&k===olympe.dc.Ka.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Bq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);ji(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Th)&&ki(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=>
702
703
  {const n=()=>{p&&c.Wd(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Ka.SELF&&(t.$--,0===t.$&&Yh(t.j));r=0===t.J.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),u.destroy())}},p=c.Y(n),q=li(h,d,l);return n})}
703
- function mi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||ni(c)});a.F.clear()}function oi(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.oc.Fg;if(b instanceof ReadableStream)yield xg(a.D,b,{Nm:e});else{var f;if(f=b instanceof olympe.dc.vg)f=b.T(),f=!a.N.J.has(f);f&&a.D.Tc(b,{Nm:e})}})}function pi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.xg,olympe.dc.Ka.SERVER);return a.Wb.request(b).then(c=>{a.D.Tc(c)})}
704
- function qi(a,b){const c=b.sb();if(c===olympe.dc.Ka.SELF||a.J&&c===olympe.dc.Ka.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Oc(b)).map(d=>new Promise(e=>d.td(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ki(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Hg,e,b),olympe.dc.ma.j.zp,c===olympe.dc.ma.oc.Fg),olympe.dc.ma.j.nl,null==d?void 0:d.Th);return a.Wb.request(e)})}
704
+ function mi(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||ni(c)});a.F.clear()}function oi(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.oc.Fg;if(b instanceof ReadableStream)yield xg(a.D,b,{Nm:e});else{var f;if(f=b instanceof olympe.dc.wg)f=b.T(),f=!a.N.J.has(f);f&&a.D.Tc(b,{Nm:e})}})}function pi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.yg,olympe.dc.Ka.SERVER);return a.Wb.request(b).then(c=>{a.D.Tc(c)})}
705
+ function qi(a,b){const c=b.sb();if(c===olympe.dc.Ka.SELF||a.J&&c===olympe.dc.Ka.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Oc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ki(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Hg,e,b),olympe.dc.ma.j.zp,c===olympe.dc.ma.oc.Fg),olympe.dc.ma.j.nl,null==d?void 0:d.Th);return a.Wb.request(e)})}
705
706
  function ri(a,b,c){const d=[];for(const e of a.j.values())si(e,b,c)&&d.push(ki(a,e.query,olympe.dc.ma.oc.ek,{}).then(f=>oi(a,f,olympe.dc.ma.oc.ek)));return Promise.all(d).then(()=>{})}
706
707
  olympe.dc.query.rv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Wb=d;this.J=e;this.j=new Map;this.F=new Set;yg(b,()=>mi(this));zf(d,olympe.dc.Request.j.so,f=>{oi(this,f.content,olympe.dc.ma.oc.lf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.zc?c.zc:yield qi(d,a);if(!e||(null==c?0:c.Th))try{const f=yield ki(d,a,b,c);e||(yield oi(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
707
- null}return gi(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ka.SELF||b.zc||this.J&&g===olympe.dc.Ka.SERVER)return e(),null;if(a!==olympe.dc.ma.oc.lf)return ki(this,c,a,b).then(r=>{r=d&&r instanceof ReadableStream?r.pipeThrough(d):r;return oi(this,r,a,b.aj)}).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`);ki(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.`),
708
- Promise.resolve();t=d&&t instanceof ReadableStream?t.pipeThrough(d):t;return oi(this,t,a,b.aj).then(()=>{h.forEach(u=>oi(this,u,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.hk,g,c),olympe.dc.ma.j.nl,null==b?void 0:b.Th),q=this.Wb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.jp,()=>{},0)).pipe(nb(olympe.L.errors.Yn,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
709
- l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):oi(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 ti(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ja.$a('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.Ia.create(d,a.a,a.r)}
708
+ null}return gi(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ka.SELF||b.zc||this.J&&g===olympe.dc.Ka.SERVER)return e(),null;if(a!==olympe.dc.ma.oc.lf)return ki(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return oi(this,t,a,b.aj)}).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`);ki(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.`),
709
+ Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return oi(this,u,a,b.aj).then(()=>{h.forEach(x=>oi(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.hk,g,c),olympe.dc.ma.j.nl,null==b?void 0:b.Th),q=this.Wb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.jp,()=>{},0)).pipe(nb(olympe.L.errors.Yn,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
710
+ l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):oi(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 ti(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ja.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ia.create(d,a.a,a.r)}
710
711
  olympe.dc.Ia=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Ia}[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()}Le(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Le().includes(a)}indexOf(a){return null===
711
712
  a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Le().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Gc(){return this.je(0)}je(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Le();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Le();a.pop();return a}shift(){if(0<this.j.length){const a=this.Le();a.shift();return a}return[]}filter(a){return this.Le().filter(a)}find(a){return(a=this.Le().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
712
713
  a(this.D.get(b),c))}map(a){return this.Le().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ia.create(b,Array.from(this.F),Array.from(this.J))}reduce(a,b){return this.Le().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.J.concat(...a.map(d=>d.J));return olympe.dc.Ia.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Le()}hj(){return this.F.map(a=>
@@ -714,478 +715,477 @@ this.D.get(this.j[a]))}mj(){return this.J.map(a=>{a=a.split('.');return 1===a.le
714
715
  if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.J=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
715
716
  return{k:this.j,a:this.F,r:this.J}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.mj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.hj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
716
717
  olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.je;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
717
- olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Le;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function ui(a){return 1<a.size()?(olympe.ja.$a('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.ld=class{constructor(a){this.query=a}static from(a){return new olympe.dc.ld(olympe.dc.ma.from(a))}hb(a){return new olympe.dc.ld(this.query.hb(a))}bj(){return this}nb(a){return this.query.nb(a).then(b=>ui(b))}Fc(){return ui(this.query.Fc())}};olympe.dc.ld.prototype.executeFromCache=olympe.dc.ld.prototype.Fc;
718
- olympe.dc.ld.prototype.execute=olympe.dc.ld.prototype.nb;olympe.dc.ld.prototype.cast=olympe.dc.ld.prototype.bj;olympe.dc.ld.prototype.follow=olympe.dc.ld.prototype.hb;const vi=olympe.dc.va.ORIGIN,wi=olympe.dc.va.DESTINATION;function ji(a,b){Rh(a.j,()=>{a.eb()||null!==a.F||b(a.query.T())})}function li(a,b,c){const d=a.ba;a.ba++;a.J.set(d,c);b===olympe.dc.Ka.SELF?a.td(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.td(()=>Xh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.J.size} subscribers`);return d}
718
+ olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Le;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function ui(a){return 1<a.size()?(olympe.ja.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}gb(a){return new olympe.dc.nd(this.query.gb(a))}bj(){return this}nb(a){return this.query.nb(a).then(b=>ui(b))}Fc(){return ui(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
719
+ olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.bj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.gb;const vi=olympe.dc.va.ORIGIN,wi=olympe.dc.va.DESTINATION;function ji(a,b){Rh(a.j,()=>{a.hb()||null!==a.D||b(a.query.T())})}function li(a,b,c){const d=a.ba;a.ba++;a.J.set(d,c);b===olympe.dc.Ka.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Xh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.J.size} subscribers`);return d}
719
720
  function si(a,b,c){if(a.query.sb()!==b)return!1;c.tc(a.fa);(b=a.fa.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function ni(a){Zh(a.j);a.J.forEach(b=>{b.next(a.j)})}
720
- function xi(a,b,c){const d=[];let e=!1;const f=new olympe.async.fk(olympe.C.Xg());for(const g of b)if(g.Oc(a.query)&&(e||(e=!0),f.add(h=>g.td(k=>{!k&&d.push(g);h()}))),fi(a.query,g.query)){let h;null==(h=a.Y)||h.push(new Promise(k=>{g.td(()=>k())}))}bd(f,g=>c(g?d:[]));f.start();return e}
721
- function yi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Ph(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Vh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.R)||p.push(()=>{qf(h,k,n)});zi(a)}
722
- function Ai(a){const b=a.Ga(a.query,Bi(a),()=>{null===a.F||a.eb()||yi(a)},d=>{a.eb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),zi(a))});let c;b&&(null==(c=a.R)||c.push(b))}function Ci(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.eb()&&Ai(a)}))}
723
- function Bi(a){if(a.Gd===olympe.dc.ma.oc.Fg)return olympe.V.stream.tap(c=>{c=c.Kk().filter(d=>d.o===olympe.dc.Mc.j).map(d=>d.t);a.ua.j.Ga(c)});let b;return 0<(null==(b=a.Y)?void 0:b.length)?new TransformStream({flush:()=>w(function*(){yield Promise.all(a.Y);a.Y=void 0})}):null}function zi(a){const b=a.F;a.F=null;null==b||b.forEach(c=>c())}
724
- olympe.dc.query.Bq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.Gd=d;this.j=new olympe.dc.query.tq(this.G,c);this.$=0;this.ba=1;this.R=[];this.J=new Map;this.F=[()=>Zh(this.j)];this.Ga=e;this.fa=new Di(a,this.db,c,this.j);this.D=this.N=null;this.Y=[]}start(a){return xi(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.D&&(c.D=new Set);c.D.add(this)}),yi(this)):Ai(this)})}Oc(a){return!this.eb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
- (null===this.F||this.query.D===a.D)&&this.j.Oc(a))}td(a){null!==this.F?this.F.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.R;this.R=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.D)||c.forEach(e=>Ci(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.D.delete(this);0===e.D.size&&(e.D=null)});b.forEach(e=>e())}eb(){return null===this.R}};
726
- function Ei(a,b){return a.F.has(wi+b)||a.F.has(vi+b)}
727
- class Di{constructor(a,b,c,d){this.G=a;this.db=b;this.J=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 Ph(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Gh){a=f.relation;a=`${a.Ja()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Fi(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}Pc(){}Wc(a,b){if(!(this.j||
728
- !this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Uh(this.J,a,e)))}}D(a){this.j||this.db.Ha(a)&&!this.N||this.j||(this.j=this.R.some(b=>Uh(this.J,a,b)))}Oa(a,b,c){if(!this.j&&Ei(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.F.get(wi+a);a=this.F.get(vi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Uh(this.J,b,g.j)))||e&&(null==a?void 0:a.some(g=>Uh(this.J,c,g.j))))}}}ic(a,b,c){if(!this.j&&this.N&&Ei(this,a)&&this.db.ss(b,
729
- new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(wi+a);a=this.F.get(vi+a);const e=this.J;this.j||(this.j=(null==d?void 0:d.some(f=>Uh(e,b,f.j)&&Uh(e,c,f.T())))||(null==a?void 0:a.some(f=>Uh(e,c,f.j)&&Uh(e,b,f.T()))))}}}olympe.dc.query.Bq.xa=[olympe.dc.Writable];function Gi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
721
+ function xi(a,b,c){const d=[];let e=!1;const f=new olympe.async.fk(olympe.C.Xg());for(const g of b)if(g.Oc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&fi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
722
+ function yi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Ph(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Vh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});zi(a)}
723
+ function Ai(a){const b=a.Ga(a.query,a.$a.bind(a),()=>{null===a.D||a.hb()||yi(a)},d=>{a.hb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),zi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function Bi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.hb()&&Ai(a)}))}function zi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
724
+ olympe.dc.query.Bq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.tq(this.G,c);this.$=0;this.ba=1;this.Y=[];this.J=new Map;this.D=[()=>Zh(this.j)];this.Ga=e;this.fa=new Ci(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return xi(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)}),yi(this)):Ai(this)})}Oc(a){return!this.hb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
725
+ (null===this.D||this.query.D===a.D)&&this.j.Oc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Bi(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())}hb(){return null===this.Y}$a(){const a=
726
+ olympe.dc.ma.oc.Fg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Kk().filter(d=>d.o===olympe.dc.Mc.j).map(d=>d.t);this.ua.j.Ga(c)});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};function Di(a,b){return a.F.has(wi+b)||a.F.has(vi+b)}
727
+ class Ci{constructor(a,b,c,d){this.G=a;this.db=b;this.J=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 Ph(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.oa.Gh){a=f.relation;a=`${a.Ja()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Ei(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}Pc(){}Wc(a,b){if(!(this.j||
728
+ !this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Uh(this.J,a,e)))}}D(a){this.j||this.db.Ha(a)&&!this.N||this.j||(this.j=this.R.some(b=>Uh(this.J,a,b)))}Oa(a,b,c){if(!this.j&&Di(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.F.get(wi+a);a=this.F.get(vi+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Uh(this.J,b,g.j)))||e&&(null==a?void 0:a.some(g=>Uh(this.J,c,g.j))))}}}ic(a,b,c){if(!this.j&&this.N&&Di(this,a)&&this.db.ss(b,
729
+ new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(wi+a);a=this.F.get(vi+a);const e=this.J;this.j||(this.j=(null==d?void 0:d.some(f=>Uh(e,b,f.j)&&Uh(e,c,f.T())))||(null==a?void 0:a.some(f=>Uh(e,c,f.j)&&Uh(e,b,f.T()))))}}}olympe.dc.query.Bq.xa=[olympe.dc.Writable];function Fi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
730
730
  olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ja())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Ob(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ja(),null!=b?b:a instanceof olympe.dc.da.De)}ac(){const a=
731
- olympe.dc.va.DESTINATION,b=olympe.dc.va.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',gk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.gk,olympe.dc.query.rv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Jg,new olympe.W.pa(olympe.dc.U.Ih))});olympe.W.run([olympe.dc.query.P.gk],a=>{olympe.dc.query.Nk=()=>a});olympe.dc.query.xd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Id=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}sd(){return new olympe.dc.query.Z.ze(...this.Z.map(a=>a.sd()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
731
+ olympe.dc.va.DESTINATION,b=olympe.dc.va.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',gk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.gk,olympe.dc.query.rv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Jg,new olympe.W.pa(olympe.dc.U.Ih))});olympe.W.run([olympe.dc.query.P.gk],a=>{olympe.dc.query.Nk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Id=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}ud(){return new olympe.dc.query.Z.ze(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
732
732
  Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Dn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.nf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.ha(a);this.substring=b;this.db=c;this.j=d}Cb(){return[this.La]}Oc(a,b){return a instanceof olympe.dc.query.Z.nf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
733
733
  this.La))}observe(a,b,c){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(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){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Gj,
734
734
  p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.te=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.ha(a);this.j=olympe.dc.mb.Ac(null!=b?b:null);this.db=c}Cb(){return[this.La]}Oc(a){if(a instanceof olympe.dc.query.Z.te&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
735
735
  a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
736
- this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Jo,p:this.La,t:a,v:b}}};function Hi(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
737
- olympe.dc.query.Z.Bi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ha(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ha(c):c;this.D=d;this.J=e}sd(){return new olympe.dc.query.Z.Bi(this.db,this.La,this.j,!this.D,!this.J)}Cb(){return[this.La]}Oc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Bi&&this.La===a.La?
738
- typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Ng(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Hi(this,a,b));Ng(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)},Hi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.J?
739
- this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Og(this.db,a,this.La,Hi(this,a,b));this.F&&Og(this.db,a,this.j,Hi(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.J,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.up,p:this.La,b:this.j,l:this.D,s:this.J}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.J+'-'+this.j}};olympe.dc.query.Z.de=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.sd();return this.Ea(a)?super.compile():a.compile()}sd(){return this.j}Cb(){return this.j.Cb()}Oc(a,b){return a instanceof olympe.dc.query.Z.de?this.j.Oc(a.j,b):this.j.Oc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.Up,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
- b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.de?this.j.Ea(a.j):!1}};olympe.dc.query.Z.ze=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}sd(){return new olympe.dc.query.Z.Id(...this.Z.map(a=>a.sd()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
736
+ this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Jo,p:this.La,t:a,v:b}}};function Gi(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
737
+ olympe.dc.query.Z.Bi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ha(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ha(c):c;this.D=d;this.J=e}ud(){return new olympe.dc.query.Z.Bi(this.db,this.La,this.j,!this.D,!this.J)}Cb(){return[this.La]}Oc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Bi&&this.La===a.La?
738
+ typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Ng(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Gi(this,a,b));Ng(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)},Gi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.J?
739
+ this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Og(this.db,a,this.La,Gi(this,a,b));this.F&&Og(this.db,a,this.j,Gi(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.J,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.up,p:this.La,b:this.j,l:this.D,s:this.J}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.J+'-'+this.j}};olympe.dc.query.Z.ee=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Cb(){return this.j.Cb()}Oc(a,b){return a instanceof olympe.dc.query.Z.ee?this.j.Oc(a.j,b):this.j.Oc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.Up,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
740
+ b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.ee?this.j.Ea(a.j):!1}};olympe.dc.query.Z.ze=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Id(...this.Z.map(a=>a.ud()))}Cb(){return this.Z.flatMap(a=>a.Cb())}Oc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
741
741
  k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.iq,p:this.Z.map(a=>a.ga())}}toString(){return'And-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.zf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.ha(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]}Oc(a){return a instanceof olympe.dc.query.Z.zf&&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){Ng(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Ac(a);
742
- return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Dq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Am=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.ha))}Cb(){return[]}Oc(a){return a instanceof olympe.dc.query.Z.Am&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.kr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Fi(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Cb())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Ii(a){if(!a.ba){let b,c;a.ba=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.ba}function Ji(a,b){for(const c of b)if(a.some(d=>d.Oc(c,!1)))return!0;return!1}
743
- function Ki(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function Li(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Ng(a.db,f,k,()=>{Sh(b)},h):Og(a.db,f,k,h);c(e,f,g,h)}}
742
+ return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Dq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Og(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Am=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.ha))}Cb(){return[]}Oc(a){return a instanceof olympe.dc.query.Z.Am&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.kr,t:Array.from(this.j)}}};olympe.dc.query.oa={};function Ei(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Cb())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Hi(a){if(!a.ba){let b,c;a.ba=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.ba}function Ii(a,b){for(const c of b)if(a.some(d=>d.Oc(c,!1)))return!0;return!1}
743
+ function Ji(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function Ki(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Ng(a.db,f,k,()=>{Sh(b)},h):Og(a.db,f,k,h);c(e,f,g,h)}}
744
744
  olympe.dc.query.oa.mm=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.ba=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.oa.Jd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.oa.ue(b,d,a.s,c):new olympe.dc.query.oa.sh(b,d,c);void 0!==a.p&&(b.D=ai(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.mf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}J(){let a,
745
- b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}fa(){return new olympe.dc.query.oa.vm}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Oc(a){const b=Ii(this);if(0===b.length)return!0;a=Ii(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
746
- Ji(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.Z.Id?new olympe.dc.query.Z.Id(...Array.from(c.Z),a):new olympe.dc.query.Z.Id(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.mf(this.T(),a,b);return c}Wg(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Th(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Ki(this,Li(this,a,(d,e,f,g)=>{(d?Vh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
745
+ b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}fa(){return new olympe.dc.query.oa.vm}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Oc(a){const b=Hi(this);if(0===b.length)return!0;a=Hi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
746
+ Ii(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.Z.Id?new olympe.dc.query.Z.Id(...Array.from(c.Z),a):new olympe.dc.query.Z.Id(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.mf(this.T(),a,b);return c}Wg(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Th(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Ji(this,Ki(this,a,(d,e,f,g)=>{(d?Vh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
747
747
  f,g)}))}Ea(){}};olympe.dc.query.oa.Gh=class extends olympe.dc.query.oa.mm{constructor(a,b,c){super(a,c);this.relation=b;this.ua=null}};olympe.dc.query.oa.nm=class{has(){}F(){}j(){}dd(){}D(){}remove(){}};olympe.dc.query.oa.Jd=class extends olympe.dc.query.oa.mm{constructor(a,b,c){super(a,!1);this.Nb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Jd(this.j,this.Nb,this.F)}Y(){return olympe.V.tb(this.j+'followRules')}fa(){return new olympe.dc.query.oa.Ap(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Jd?[a]:[olympe.V.tb(a+'followRules')]}Oc(a){if(a instanceof olympe.dc.query.oa.Gh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.hc.Yc,e=olympe.dc.hc.ti,f=
748
748
  olympe.dm.Relation.j.Jq,g=olympe.dm.Relation.j.rr;a=a.relation;const h=a.Ja(),k=a.X();return h!==c||k!==d&&k!==e?!!(Wg(this.db,a,this.Nb)&(a.Ja()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Jd?this.Nb===a.Nb:!1}nb(a){const b=this.T();for(const c of Th(a,this.j))for(const d of Qf(this.db,c,this.Nb))Vh(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Xg(this.db,g,this.Nb,(l,n,p,q,r)=>{p&&(p=q?Vh(a,r,c,g):a.remove(r,c,g),null!==n&&Wh(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
749
749
  Yg(this.db,g,this.Nb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?Vh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.tb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Nb})}J(){return`followRulePart-${this.Nb}-${super.J()}`}Vc(){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.Nb)} (${this.Nb})`}Ea(a){return a instanceof olympe.dc.query.oa.Jd&&this.Nb===a.Nb}toJSON(){return{type:'follow rule',
750
- rule:`${this.db.name(this.Nb)} (${this.Nb})`}}R(){return!1}filter(){olympe.ja.$a('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.$a('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Jd.D='followRules';olympe.dc.query.oa.sh=class extends olympe.dc.query.oa.Gh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.sh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T(),a+Gi(this.relation).T()+!1,a+Gi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&b.relation.Ea(this.relation)&&
751
- c.push(a);return c}nb(a){const b=this.T();for(const c of Th(a,this.j))this.db.ab(c,this.relation).forEach(d=>{Vh(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Wh(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.Ja()})}J(){return`followPart-${this.relation.T()}-${super.J()}`}Vc(){const a=
752
- {recursive:!1,relation:this.relation,filter:Ii(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ea(a){return a instanceof olympe.dc.query.oa.sh&&this.relation.Ea(a.relation)}};olympe.dc.query.oa.ue=class extends olympe.dc.query.oa.Gh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}fa(){return new olympe.dc.query.oa.Nq}N(){const a=new olympe.dc.query.oa.ue(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&
750
+ rule:`${this.db.name(this.Nb)} (${this.Nb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Jd.D='followRules';olympe.dc.query.oa.sh=class extends olympe.dc.query.oa.Gh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.sh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T(),a+Fi(this.relation).T()+!1,a+Fi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&b.relation.Ea(this.relation)&&
751
+ c.push(a);return c}nb(a){const b=this.T();for(const c of Th(a,this.j))this.db.bb(c,this.relation).forEach(d=>{Vh(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Wh(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.Ja()})}J(){return`followPart-${this.relation.T()}-${super.J()}`}Vc(){const a=
752
+ {recursive:!1,relation:this.relation,filter:Hi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ea(a){return a instanceof olympe.dc.query.oa.sh&&this.relation.Ea(a.relation)}};olympe.dc.query.oa.ue=class extends olympe.dc.query.oa.Gh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}fa(){return new olympe.dc.query.oa.Nq}N(){const a=new olympe.dc.query.oa.ue(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Jd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.oa.ue&&
753
753
  b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of Th(a,this.j))this.F&&Vh(a,c,b,c),this.db.$g(c,this.relation).forEach(d=>{Vh(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.X(),d=this.relation.Ja(),e=(f,g,h,k)=>{const l=olympe.V.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{Wh(a,n,c,d,g,p);super.observe(a,(q,r,t,u)=>{b(q,r,t,u);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,
754
- g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ja()})}J(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.J()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Ii(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
754
+ g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ja()})}J(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.J()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Hi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ei});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
755
755
  relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ea(a){return a instanceof olympe.dc.query.oa.ue&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.oa.Uo=class extends olympe.dc.query.oa.Jd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?Vh(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.oa.Ap=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.J=null!=b?b:null}dd(){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)}F(a){let b;return(null==(b=this.J)?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,
756
756
  b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ha(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.oa.Ap.xa=[olympe.dc.query.oa.nm];olympe.dc.query.oa.Nq=class{constructor(){this.content=new Map}dd(){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)}F(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
757
757
  (e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.oa.Nq.xa=[olympe.dc.query.oa.nm];olympe.dc.query.oa.vm=class{constructor(){this.content=new Map}dd(){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)}F(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
758
- return b}};olympe.dc.query.oa.vm.xa=[olympe.dc.query.oa.nm];olympe.dc.sources={};olympe.dc.sources.Rq=class extends Error{};olympe.dc.sources.Mj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Mi=olympe.net.wa.Md.GET,Ni=olympe.net.wa.Md.Ch,Oi=olympe.net.wa.Md.Cc,Pi=olympe.net.wa.Md.sq,Qi=olympe.net.wa.Headers.oi,Ri=olympe.net.wa.Headers.Pn,Si=olympe.net.wa.Tb.Ah,Ti=olympe.net.wa.Tb.ho,Ui=olympe.net.wa.Tb.So,Vi=olympe.net.wa.Tb.Pi,Wi=olympe.net.wa.Tb.$l;
759
- function Xi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Jl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Mi,Ni,Oi,Pi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.jd(`No handler found for datasource ${f} called '${g}'`,Wi,'Invalid source id'))}h=c.method;const k=c.kj();try{var l=yield Yi(a,
760
- k[Ri])}catch(r){return new olympe.net.jd(`Invalid token ${r}`,Ui,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Hg,u=olympe.dc.Request.j.We,x=olympe.dc.Request.j.Rg,y=olympe.dc.Request.j.kh,z=olympe.dc.Request.j.ug,A=olympe.dc.Request.j.Wf,K=olympe.dc.Request.j.cg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Qi]};p instanceof Uint8Array&&
761
- (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ka.wf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let ad;void 0===Pa?ad='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?ad=Pa:ad=JSON.stringify(a.D.ga(Pa));return new olympe.net.jd(ad,h===Pi?Ti:Si)}catch(r){return r instanceof olympe.dc.sources.Rq?new olympe.net.jd(`Authorization error: ${r}`,
762
- Ui,'Forbidden'):new olympe.net.jd(`Internal server error: ${r}`,Vi,'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 Zi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function $i(a,b,c){0===a.F.size&&Xi(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Zi(a)}}
763
- function aj(a,b,c){c=b instanceof olympe.dm.DataSource?b.If(c):bj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
764
- function cj(a,b,c){if(b===olympe.dc.Ka.SERVER){var d;return null!=(d=Ld(a.J,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.th;const f=olympe.dc.sources.U.rf,g=olympe.dc.sources.U.yi,h=olympe.dc.sources.U.Jl;let k;e=`${aj(a,null!=d?d:b,g)?'https':'http'}://${aj(a,null!=d?d:b,e)}:${null!=(k=aj(a,null!=d?d:b,f))?k:aj(a,null!=d?d:b,g)?443:80}`+`/${aj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
765
- function dj(a,b){return b instanceof olympe.net.Ai?Nd(a.J,b,rd(a.Y).Ad()):Promise.reject('No http request to send')}function ej(a,b){var c=cj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Ni,e,olympe.net.wa.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Qi]:'application/json'});return dj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.yd.gj(d))}
766
- function fj(a,b){var c=cj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.jc()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,Ni,d);Ac(c,{['X-Source-Origin']:b.origin,[Qi]:'application/json'});return dj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Yi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.dh(b,(e,f)=>{e?d(e):c(f)})})}
767
- olympe.dc.sources.Nt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.J=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.xg,olympe.L.Yb.xg],[olympe.dc.Request.j.Wf,olympe.L.Yb.Pj],[olympe.dc.Request.j.cg,olympe.L.Yb.Pj],[olympe.dc.Request.j.ug,olympe.L.Yb.Pj],[olympe.dc.Request.j.Rn,olympe.L.Yb.Qn],[olympe.dc.Request.j.Hq,olympe.L.Yb.Gq],[olympe.dc.Request.j.gp,olympe.L.Yb.fp],
768
- [olympe.dc.Request.j.Hg,olympe.L.Yb.$n],[olympe.dc.Request.j.Rg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=cj(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=Cc(N(b,Mi),olympe.net.wa.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return dj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.jc(),f=cj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
769
- const g=N(e===olympe.dc.Ka.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Pi,d);Ac(g,{[Qi]:'application/octet-stream'});e!==olympe.dc.Ka.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return dj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=cj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Oi,b);d!==olympe.dc.Ka.SERVER&&Ac(e,
770
- {['X-Source-Origin']:a.origin});return dj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=cj(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,Xh:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Mi,void 0,olympe.net.wa.ResponseType.Kh);d!==olympe.dc.Ka.SERVER&&
771
- Ac(e,{['X-Source-Origin']:a.origin});dj(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.Xh(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.yp=class{constructor(a,b){this.G=a;this.Wb=b}};olympe.dc.sources.yp.Tb={Ri:0,eC:1,fC:3,AB:4};const gj=olympe.dc.Request.j.pc,hj=olympe.dc.Request.j.Hg,ij=olympe.dc.Request.j.hk,jj=olympe.dc.Request.j.cg,kj=olympe.dc.Request.j.Wf,lj=olympe.dc.Request.j.ug,mj=olympe.dc.Request.j.mi,nj=olympe.dc.Request.j.kh,oj=olympe.dc.Request.j.We,pj=olympe.dc.Request.j.Rg;
772
- function qj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Jh(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.fc(c);b.tc(e);fb(a.D.j,c)||a.D.set(c,e)}
773
- function rj(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.fc(c);let g;null==(g=a.D)||g.delete(c);b.tc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function sj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
774
- olympe.dc.sources.Mp=class{constructor(a,b){this.G=a;this.j=b;this.Wb=null;this.N=olympe.dc.query.Nk();this.J=olympe.dc.Yr();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.If(olympe.dc.sources.U.jm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Wb=a;if(this.T()===olympe.dc.Ka.SELF)return this;(new Promise((b,c)=>{let d=!0;tj(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:`);
775
- for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case gj:const d=olympe.dm.DataSource.pc.zb,e=olympe.dm.DataSource.pc.Fh;
776
- return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case hj:return this.j.executeQuery(b);case mj:return c=b.kc(),qj(this,c),this.J.Tc(rf(c)),Promise.resolve();case oj:case pj:const f=b.kc();return this.applyTransaction(f,c===pj).finally(()=>{if(a.origin===olympe.dc.Ka.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:g,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),this.T());let h;null==(h=this.Wb)||h.ud(g)}});case nj:return rj(this,
777
- b.kc());case jj: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 kj:return this.j.downloadFileContent(b.tag,b.model);case lj:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===ij){const b=a.content;a=a.origin;return a===olympe.dc.Ka.SELF?sj(this,b):hi(this.N,
778
- b,this.F,a,olympe.dc.ma.oc.lf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Je)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=uj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield ri(c.N,c.T(),a);c.J.Tc(rf(a,d));return d})}};olympe.dc.sources.Mp.xa=[olympe.dc.sources.Mj];function uj(a){const b=olympe.dc.sources.bg.j.lt,c=olympe.dc.sources.bg.j.gw,d=olympe.dc.sources.bg.j.rt,e=olympe.dc.sources.bg.j.mt,f=olympe.dc.sources.bg.j.st,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(vj(b,q,r,p.R()?p.Cb():null)):p.Dd()?k.push(vj(d,q,r,null,p.J())):p.R()&&h.push(vj(c,q,r,p.Cb()));for(const [t,u,x]of p.Cd())p=a.Rc(u),x?l.push(new wj(e,t,q,u,r,p.Vb())):n.push(new wj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
779
- function vj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new xj(a,b,c,d,e)}olympe.dc.sources.bg=class{constructor(a){this.type=a}};class xj extends olympe.dc.sources.bg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
780
- class wj extends olympe.dc.sources.bg{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.bg.j={lt:'CREATE',gw:'UPDATE',rt:'DELETE',mt:'CREATE_RELATION',st:'DELETE_RELATION'};function yj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:b,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),a.T());let c;null==(c=a.Wb)||c.ud(b)}
781
- olympe.dc.sources.sl=class{constructor(a,b){this.G=a;this.D=b;this.Wb=null}T(){}R(){}Y(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Hg;const e=olympe.dc.Request.j.We,f=olympe.dc.Request.j.Rg;var g=olympe.dc.Request.j.mi;const h=olympe.dc.Request.j.kh,k=olympe.dc.Request.j.cg;var l=olympe.dc.Request.j.Wf;const n=olympe.dc.Request.j.ug,p=olympe.dc.sources.Yd(),
782
- q=a.getType(),r=a.jc();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.nl))&&(yield zj(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.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.fc(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
783
- x.kc();yield Aj(p,z);z.tc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Cd()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield Bj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Cj(p,null,r,a.content.kc(),!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.pc.ee};
784
- case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.kc().T();return p.applyTransaction(d,r).finally(()=>yj(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.D)return this.Y(a,
785
- b);const c=olympe.dc.sources.Yd(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.As([this.D.Pf()],()=>{h.error(new olympe.L.errors.jp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.As([this.D.Pf()],()=>{f.error(new olympe.L.errors.Yn('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Cj(c,d.T(),e,f.kc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
786
- throw g;}))))}};olympe.dc.sources.sl.xa=[olympe.dc.sources.Mj];const Dj=olympe.dc.Request.j.pc,Ej=olympe.dc.Request.j.Hg,Fj=olympe.dc.Request.j.hk,Gj=olympe.dc.Request.j.We,Hj=olympe.dc.Request.j.Rg,Ij=olympe.dc.Request.j.mi,Jj=olympe.dc.Request.j.kh,Kj=olympe.dc.Request.j.cg,Lj=olympe.dc.Request.j.Wf,Mj=olympe.dc.Request.j.ug;function Nj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.mp}function Oj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.Un}
787
- function Pj(a,b){b=b.Bc();if(b!==olympe.dm.User.j&&a.If(olympe.dc.sources.U.sm))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.dc.sources.Rq(a);}
788
- function Qj(a,b,c,d,e){return w(function*(){var f=olympe.L.bb.j.SEND,g=olympe.L.bb.j.GET;const h=olympe.L.bb.j.PUBLISH,k=olympe.L.bb.j.SUBSCRIBE,l=d.Bs();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');Pj(c,n);let p;if(null==(p=a.Wb)||!p.sources.has(n.jc()))throw Error(`Try to process a message with destination data source ${n.jc()} coming from remote but not started here`);if(l===k){if(n.getType()===Fj)f=n.content.T();else throw Error('Not supported type of subscription');
789
- g=yield d.mn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Rj(a.G,f,b,vf(n,olympe.dc.Ka.wf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.ud(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Hr()):l===h&&(yield b.request(n))})}
790
- olympe.dc.sources.Qq=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.ba=new Map;this.N=new Map;this.$=new Map;this.fa=f}T(){return olympe.dc.Ka.wf}R(a){var b=olympe.L.ub;const c=a.jc(),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 Dj:const e=olympe.dm.DataSource.pc.zb,f=olympe.dm.DataSource.pc.Fh;b=Nj(this,
791
- c)?b.get(c,a):Promise.resolve({s:f});a=Oj(this,c)?this.j.Hc(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 Ej:return Oj(this,c)?ej(this.j,a):b.get(c,a);case Gj:const g=a.content.kc().T();return(Nj(this,c)?b.get(c,a):fj(this.j,a)).finally(()=>yj(this,g));case Hj:const h=a.content.kc().T();return(Oj(this,c)?fj(this.j,
792
- a):b.get(c,a)).finally(()=>yj(this,h));case Ij:return Nj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Jj:return Nj(this,c)?b.get(c,a):fj(this.j,a);case Kj:return Oj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Lj:return Oj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Mj:return Oj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
793
- b){const c=a.jc(),d=a.getType();if(!Nj(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===Fj?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.J,this.J).hb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,
794
- !0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Tr,!0)).observe(this.F).subscribe(b=>{b.hj().forEach(this.Ga.bind(this,a));b.mj().forEach(c=>{let d;null==(d=this.ba.get(c))||d.destroy();this.ba.delete(c)})});this.db.Qa(this.J,olympe.dm.DataSource.Tr)&&(new olympe.L.ub(this.J,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.ud(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ga(a,
795
- b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.ba.set(c,d);let e,f;Sj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ne.Un&&(e=$i(this.j,c,l=>{Pj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ne.mp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Hs(this.ua.bind(this)),f.listen().subscribe(l=>{l.ii().then(n=>Qj(this,
758
+ return b}};olympe.dc.query.oa.vm.xa=[olympe.dc.query.oa.nm];olympe.dc.sources={};olympe.dc.sources.Rq=class extends Error{};olympe.dc.sources.Mj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Li=olympe.net.wa.Md.GET,Mi=olympe.net.wa.Md.Ch,Ni=olympe.net.wa.Md.Cc,Oi=olympe.net.wa.Md.sq,Pi=olympe.net.wa.Headers.oi,Qi=olympe.net.wa.Headers.Pn,Ri=olympe.net.wa.Tb.Ah,Si=olympe.net.wa.Tb.ho,Ti=olympe.net.wa.Tb.So,Ui=olympe.net.wa.Tb.Pi,Vi=olympe.net.wa.Tb.$l;
759
+ function Wi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Jl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Li,Mi,Ni,Oi],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Vi,'Invalid source id'))}h=c.method;const k=c.kj();try{var l=yield Xi(a,
760
+ k[Qi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Ti,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Hg,u=olympe.dc.Request.j.We,x=olympe.dc.Request.j.Rg,y=olympe.dc.Request.j.kh,z=olympe.dc.Request.j.vg,A=olympe.dc.Request.j.Wf,K=olympe.dc.Request.j.dg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Pi]};p instanceof Uint8Array&&
761
+ (X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ka.wf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let ad;void 0===Pa?ad='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?ad=Pa:ad=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(ad,h===Oi?Si:Ri)}catch(r){return r instanceof olympe.dc.sources.Rq?new olympe.net.ld(`Authorization error: ${r}`,
762
+ Ti,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Ui,'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 Yi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Zi(a,b,c){0===a.F.size&&Wi(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Yi(a)}}
763
+ function $i(a,b,c){c=b instanceof olympe.dm.DataSource?b.If(c):aj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
764
+ function bj(a,b,c){if(b===olympe.dc.Ka.SERVER){var d;return null!=(d=Ld(a.J,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.th;const f=olympe.dc.sources.U.rf,g=olympe.dc.sources.U.yi,h=olympe.dc.sources.U.Jl;let k;e=`${$i(a,null!=d?d:b,g)?'https':'http'}://${$i(a,null!=d?d:b,e)}:${null!=(k=$i(a,null!=d?d:b,f))?k:$i(a,null!=d?d:b,g)?443:80}`+`/${$i(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
765
+ function cj(a,b){return b instanceof olympe.net.Ai?Nd(a.J,b,rd(a.Y).Bd()):Promise.reject('No http request to send')}function dj(a,b){var c=bj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Mi,e,olympe.net.wa.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Pi]:'application/json'});return cj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.gj(d))}
766
+ function ej(a,b){var c=bj(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.jc()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,Mi,d);Ac(c,{['X-Source-Origin']:b.origin,[Pi]:'application/json'});return cj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Xi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.dh(b,(e,f)=>{e?d(e):c(f)})})}
767
+ olympe.dc.sources.Nt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.J=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.yg,olympe.L.Yb.yg],[olympe.dc.Request.j.Wf,olympe.L.Yb.Pj],[olympe.dc.Request.j.dg,olympe.L.Yb.Pj],[olympe.dc.Request.j.vg,olympe.L.Yb.Pj],[olympe.dc.Request.j.Rn,olympe.L.Yb.Qn],[olympe.dc.Request.j.Hq,olympe.L.Yb.Gq],[olympe.dc.Request.j.gp,olympe.L.Yb.fp],
768
+ [olympe.dc.Request.j.Hg,olympe.L.Yb.$n],[olympe.dc.Request.j.Rg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=bj(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=Cc(N(b,Li),olympe.net.wa.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return cj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.jc(),f=bj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
769
+ const g=N(e===olympe.dc.Ka.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Oi,d);Ac(g,{[Pi]:'application/octet-stream'});e!==olympe.dc.Ka.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return cj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=bj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Ni,b);d!==olympe.dc.Ka.SERVER&&Ac(e,
770
+ {['X-Source-Origin']:a.origin});return cj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=bj(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,Xh:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ka.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Li,void 0,olympe.net.wa.ResponseType.Kh);d!==olympe.dc.Ka.SERVER&&
771
+ Ac(e,{['X-Source-Origin']:a.origin});cj(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.Xh(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.yp=class{constructor(a,b){this.G=a;this.Wb=b}};olympe.dc.sources.yp.Tb={Ri:0,eC:1,fC:3,AB:4};const fj=olympe.dc.Request.j.pc,gj=olympe.dc.Request.j.Hg,hj=olympe.dc.Request.j.hk,ij=olympe.dc.Request.j.dg,jj=olympe.dc.Request.j.Wf,kj=olympe.dc.Request.j.vg,lj=olympe.dc.Request.j.mi,mj=olympe.dc.Request.j.kh,nj=olympe.dc.Request.j.We,oj=olympe.dc.Request.j.Rg;
772
+ function pj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Jh(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.fc(c);b.tc(e);fb(a.D.j,c)||a.D.set(c,e)}
773
+ function qj(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.fc(c);let g;null==(g=a.D)||g.delete(c);b.tc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function rj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
774
+ olympe.dc.sources.Mp=class{constructor(a,b){this.G=a;this.j=b;this.Wb=null;this.N=olympe.dc.query.Nk();this.J=olympe.dc.Yr();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.If(olympe.dc.sources.U.jm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Wb=a;if(this.T()===olympe.dc.Ka.SELF)return this;(new Promise((b,c)=>{let d=!0;sj(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:`);
775
+ for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case fj:const d=olympe.dm.DataSource.pc.zb,e=olympe.dm.DataSource.pc.Fh;
776
+ return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case gj:return this.j.executeQuery(b);case lj:return c=b.kc(),pj(this,c),this.J.Tc(rf(c)),Promise.resolve();case nj:case oj:const f=b.kc();return this.applyTransaction(f,c===oj).finally(()=>{if(a.origin===olympe.dc.Ka.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:g,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),this.T());let h;null==(h=this.Wb)||h.vd(g)}});case mj:return qj(this,
777
+ b.kc());case ij: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 jj:return this.j.downloadFileContent(b.tag,b.model);case kj:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===hj){const b=a.content;a=a.origin;return a===olympe.dc.Ka.SELF?rj(this,b):hi(this.N,
778
+ b,this.F,a,olympe.dc.ma.oc.lf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Je)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=tj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield ri(c.N,c.T(),a);c.J.Tc(rf(a,d));return d})}};olympe.dc.sources.Mp.xa=[olympe.dc.sources.Mj];function tj(a){const b=olympe.dc.sources.cg.j.lt,c=olympe.dc.sources.cg.j.gw,d=olympe.dc.sources.cg.j.rt,e=olympe.dc.sources.cg.j.mt,f=olympe.dc.sources.cg.j.st,g=[],h=[],k=[],l=[],n=[];a.Ab.forEach((p,q)=>{const r=p.Vb();p.D()?g.push(uj(b,q,r,p.R()?p.Cb():null)):p.Ed()?k.push(uj(d,q,r,null,p.J())):p.R()&&h.push(uj(c,q,r,p.Cb()));for(const [t,u,x]of p.Dd())p=a.Rc(u),x?l.push(new vj(e,t,q,u,r,p.Vb())):n.push(new vj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
779
+ function uj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new wj(a,b,c,d,e)}olympe.dc.sources.cg=class{constructor(a){this.type=a}};class wj extends olympe.dc.sources.cg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
780
+ class vj extends olympe.dc.sources.cg{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.cg.j={lt:'CREATE',gw:'UPDATE',rt:'DELETE',mt:'CREATE_RELATION',st:'DELETE_RELATION'};function xj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Qj,olympe.dc.Ka.SELF,{id:b,finalize:olympe.dc.transaction.Af.j.Ii,error:null}),a.T());let c;null==(c=a.Wb)||c.vd(b)}
781
+ olympe.dc.sources.sl=class{constructor(a,b){this.G=a;this.D=b;this.Wb=null}T(){}R(){}Y(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Hg;const e=olympe.dc.Request.j.We,f=olympe.dc.Request.j.Rg;var g=olympe.dc.Request.j.mi;const h=olympe.dc.Request.j.kh,k=olympe.dc.Request.j.dg;var l=olympe.dc.Request.j.Wf;const n=olympe.dc.Request.j.vg,p=olympe.dc.sources.Yd(),
782
+ q=a.getType(),r=a.jc();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.nl))&&(yield yj(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.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.fc(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
783
+ x.kc();yield zj(p,z);z.tc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Ab.size,'instances',Array.from(z.Dd()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield Aj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Bj(p,null,r,a.content.kc(),!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.pc.ye};
784
+ case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.kc().T();return p.applyTransaction(d,r).finally(()=>xj(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.D)return this.Y(a,
785
+ b);const c=olympe.dc.sources.Yd(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.As([this.D.Pf()],()=>{h.error(new olympe.L.errors.jp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.As([this.D.Pf()],()=>{f.error(new olympe.L.errors.Yn('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Bj(c,d.T(),e,f.kc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
786
+ throw g;}))))}};olympe.dc.sources.sl.xa=[olympe.dc.sources.Mj];const Cj=olympe.dc.Request.j.pc,Dj=olympe.dc.Request.j.Hg,Ej=olympe.dc.Request.j.hk,Fj=olympe.dc.Request.j.We,Gj=olympe.dc.Request.j.Rg,Hj=olympe.dc.Request.j.mi,Ij=olympe.dc.Request.j.kh,Jj=olympe.dc.Request.j.dg,Kj=olympe.dc.Request.j.Wf,Lj=olympe.dc.Request.j.vg;function Mj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.mp}function Nj(a,b){let c;return(null==(c=a.fa.sb(b))?void 0:c.If(olympe.dc.sources.U.Ne))!==olympe.dm.DataSource.Ne.Un}
787
+ function Oj(a,b){b=b.Bc();if(b!==olympe.dm.User.j&&a.If(olympe.dc.sources.U.sm))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.dc.sources.Rq(a);}
788
+ function Pj(a,b,c,d,e){return w(function*(){var f=olympe.L.cb.j.SEND,g=olympe.L.cb.j.GET;const h=olympe.L.cb.j.PUBLISH,k=olympe.L.cb.j.SUBSCRIBE,l=d.Bs();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');Oj(c,n);let p;if(null==(p=a.Wb)||!p.sources.has(n.jc()))throw Error(`Try to process a message with destination data source ${n.jc()} coming from remote but not started here`);if(l===k){if(n.getType()===Ej)f=n.content.T();else throw Error('Not supported type of subscription');
789
+ g=yield d.mn(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Qj(a.G,f,b,vf(n,olympe.dc.Ka.wf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.vd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Hr()):l===h&&(yield b.request(n))})}
790
+ olympe.dc.sources.Qq=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.ba=new Map;this.N=new Map;this.$=new Map;this.fa=f}T(){return olympe.dc.Ka.wf}R(a){var b=olympe.L.ub;const c=a.jc(),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 Cj:const e=olympe.dm.DataSource.pc.zb,f=olympe.dm.DataSource.pc.Fh;b=Mj(this,
791
+ c)?b.get(c,a):Promise.resolve({s:f});a=Nj(this,c)?this.j.Hc(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 Dj:return Nj(this,c)?dj(this.j,a):b.get(c,a);case Fj:const g=a.content.kc().T();return(Mj(this,c)?b.get(c,a):ej(this.j,a)).finally(()=>xj(this,g));case Gj:const h=a.content.kc().T();return(Nj(this,c)?ej(this.j,
792
+ a):b.get(c,a)).finally(()=>xj(this,h));case Hj:return Mj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Ij:return Mj(this,c)?b.get(c,a):ej(this.j,a);case Jj:return Nj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Kj:return Nj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Lj:return Nj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
793
+ b){const c=a.jc(),d=a.getType();if(!Mj(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===Ej?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.J,this.J).gb(olympe.dm.DataSource.sj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Rh,
794
+ !0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Tr,!0)).observe(this.F).subscribe(b=>{b.hj().forEach(this.Ga.bind(this,a));b.mj().forEach(c=>{let d;null==(d=this.ba.get(c))||d.destroy();this.ba.delete(c)})});this.db.Qa(this.J,olympe.dm.DataSource.Tr)&&(new olympe.L.ub(this.J,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.vd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ga(a,
795
+ b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.ba.set(c,d);let e,f;Rj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ne.Un&&(e=Zi(this.j,c,l=>{Oj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ne.mp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Hs(this.ua.bind(this)),f.listen().subscribe(l=>{l.ii().then(n=>Pj(this,
796
796
  a,b,l,n)).catch(n=>{this.G.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Xh(n instanceof Error?n:Error(n))})}))})}ua(a){const b=this.$.get(a);this.$.delete(a);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)}};
797
- class Rj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(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.Qq.xa=[olympe.dc.sources.Mj];const W={Cr:10,fo:11,Oo:12,yq:13,QUERY_RESULT:14,hp:15,xo:16,We:17,zq:18,wo:19,pm:20};function Tj(a,b){const c=new olympe.dc.transaction.Ae,d=new olympe.dc.transaction.Ae;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.Pc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ka.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ka.SELF))}
798
- olympe.dc.sources.ec=class extends olympe.L.ec{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Cr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Cr&&Array.isArray(null==a?void 0:a.i)?(Tj(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.Oo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.J(d),!this.db.ef(d))){const f=
797
+ class Qj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(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.Qq.xa=[olympe.dc.sources.Mj];const W={Cr:10,fo:11,Oo:12,yq:13,QUERY_RESULT:14,hp:15,xo:16,We:17,zq:18,wo:19,pm:20};function Sj(a,b){const c=new olympe.dc.transaction.Ae,d=new olympe.dc.transaction.Ae;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.Pc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ka.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ka.SELF))}
798
+ olympe.dc.sources.ec=class extends olympe.L.ec{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Cr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Cr&&Array.isArray(null==a?void 0:a.i)?(Sj(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.Oo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.J(d),!this.db.ef(d))){const f=
799
799
  a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.cs().ua(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.fo,this.J(a.X()));case a instanceof olympe.dc.ma:return this.format(W.yq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.J.bind(this)));case a instanceof olympe.dc.db.fc:return b=new olympe.dc.transaction.Ae,
800
- a.tc(b),this.format(W.hp,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.xo,{r:a.getType(),o:a.origin,d:a.jc(),u:a.Bc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.Vi:return this.format(W.We,{r:a.gh(),p:this.D(a.kc())});case a instanceof olympe.dc.query.yd:return this.format(W.zq,a.ga());case a instanceof olympe.dc.vg:return this.format(W.wo,a.ga());case a instanceof olympe.dc.vc:return this.format(W.pm,this.J(a.X()));default:return super.D(a)}}j(a){if(null===
801
- a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Oo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.cs().gb(d,a));return olympe.dc.CloudObject.get(d);case W.fo:return olympe.dc.CloudObject.get(c);case W.yq:return d=c.p.map(olympe.dc.query.oa.mm.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ke:a.rm});case W.QUERY_RESULT:return ti(c);case W.hp:return(new olympe.dc.transaction.Ni).j(c.p,c.i);case W.xo:return a=null!=(d=this.j(c.c))?d:void 0,
802
- vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.We:return d=this.j(c.p),new olympe.dc.transaction.Vi(d,c.r);case W.zq:return olympe.dc.query.yd.j(c);case W.wo:return olympe.dc.vg.j(c);case W.pm:return new olympe.dc.vc(c);default:return super.j(a)}}J(a){if(this.F.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.kq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of $g(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
803
- d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.ef(a)||(c.v=!0);this.F.set(a,c);return a}};const Uj=olympe.dc.Request.j.xg,Vj=olympe.dc.Request.j.We,Wj=olympe.dc.Request.j.Rg,Xj=olympe.dc.Request.j.mi,Yj=olympe.dc.Request.j.Rn,Zj=olympe.dc.Request.j.Hq,ak=olympe.dc.Request.j.Hg,bk=olympe.dc.Request.j.hk,ck=olympe.dc.Request.j.gp,dk=olympe.dc.Request.j.It,ek=olympe.dc.Request.j.Jt,fk=olympe.dc.Request.j.Kt,gk=olympe.dc.Request.j.ug,hk=olympe.dc.Request.j.Wf,ik=olympe.dc.Request.j.cg,jk=olympe.dc.Request.j.Qj,kk=olympe.dc.Request.j.ew,lk=olympe.dc.Request.j.vv,mk=olympe.dc.Request.j.ap,nk=
804
- olympe.dc.Request.j.kh,ok=olympe.dc.Request.j.gt,pk=olympe.dc.Request.j.pc;function qk(a){return rk(a,olympe.dc.Request.j.xg).then(b=>{b=b.getData().p;const c=Af(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function sk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc(),e=b.j;d.tc(c);return tk(a,Vj,{i:d.T(),r:b.gh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
805
- function uk(a,b){const c=b.kc(),d=new olympe.dc.transaction.Ae({Yk:!0,ge:!1,Sh:!1});c.tc(d);b=b.j?'bd=true':'';return rk(a,Wj,Bf(d),b,olympe.net.wa.ResponseType.lr).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(()=>{vk(a,jk,{id:c.T(),finalize:olympe.dc.transaction.Af.j.Ii})})}
806
- function wk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc();d.tc(c);return tk(a,Xj,{i:d.T(),r:b.gh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function xk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1});b=b.kc();b.tc(c);return tk(a,nk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
807
- function yk(a,b){const c=encodeURI(bb(olympe.V.Ze(),JSON.stringify(zk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return rk(a,ak,void 0,`query=${c}&v=${a.version}`,olympe.net.wa.ResponseType.fe).then(d=>Ak(a,d))}function Bk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=zk(a,b);return qb(a.ua,()=>rk(a,ck,d,void 0,olympe.net.wa.ResponseType.fe)).then(e=>Ak(a,e))}
808
- function Ck(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=zk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Bo;b=N(cj(a.j,olympe.dc.Ka.SERVER,Yj),olympe.net.wa.Md.Ch,JSON.stringify(b),olympe.net.wa.ResponseType.Kh);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.JSON});return dj(a.j,b).then(c=>c.getData())}
809
- function Dk(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=cj(a.j,olympe.dc.Ka.SERVER,Zj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Md.Ch,b);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.pw});return dj(a.j,b).then(f=>f.getData())}
810
- function tk(a,b,c,d=!0){const e=olympe.L.ye.tg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
811
- function zk(a,b){var c=Ph(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.oa.Jd)Object.assign(b,{f:c[0].Nb,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.oa.ue&&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.ba.bind(a,
812
- e))})}return b}function vk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ka.SELF,c),a.T());let d;null==(d=a.Wb)||d.ud(b)}
813
- function rk(a,b,c,d,e){const f=cj(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.wa.Md.Ch:olympe.net.wa.Md.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.wa.Headers.oi]:'application/json'});Cc(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return dj(a.j,b)}
814
- function Ak(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:rb(e,d))?f:olympe.V.stream.ck.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
815
- function Ek(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.yf){e=new olympe.dc.db.fc(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).tc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
816
- olympe.dc.sources.er=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Ni(this.T());this.J=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.ow:null;this.ua=new olympe.V.promise.ir(f);olympe.C.oj(this.D.Pf(),()=>{this.J.forEach((h,k)=>{h.error(new olympe.L.errors.Ji('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ka.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case pk:return a=
817
- olympe.dm.DataSource.pc.zb,b=olympe.dm.DataSource.pc.Fh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Uj:return qk(this);case Vj:return sk(this,c);case Wj:return uk(this,c);case Xj:return wk(this,c);case nk:return xk(this,c);case ak:return d.get(olympe.dc.ma.j.zp)?yk(this,c):Bk(this,c);case Yj:return Ck(this,c);case Zj:return Dk(this,c.NE,c.debug,c.optional);case kk:case lk:case mk:case ok:return tk(this,b,{});case hk:return this.j.downloadFileContent(a);case gk:return this.j.deleteFileContent(a);
818
- case ik:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===bk){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=zk(this,c);this.N.delete(d);this.J.set(d,e);tk(this,dk,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Ji,(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);tk(this,ek,{i:d}).catch(e=>
819
- {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.J.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ye.tg,this.fa.bind(this));return this}destroy(){return w(function*(){})}fa(a,b){const c=olympe.dc.Request.j.Tn,d=olympe.dc.Request.j.Zl,e=a.c;if(e===olympe.dc.Request.j.so)Ek(this,a,b).then(f=>{vk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
820
- b=rf(b,a.ct),vk(this,e,{rollback:b,error:a.error});else if(e===fk){const f=a.i;Ek(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&vk(this,jk,{id:a.i,finalize:olympe.dc.transaction.Af.j.Zl,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.oa.Gh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ja()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.er.xa=[olympe.dc.sources.Mj];function Fk(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.hb(olympe.dm.vd.F.ac()).hb(olympe.dm.vd.D).he().back().hb(olympe.dm.vd.j).he().observe(d,{Gd:c,zc:!0}).subscribe(e=>{e.hj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.mj().forEach(([f])=>{a.D.delete(f)})});b.hb(olympe.dm.jb.D).observe(d,{Gd:c,zc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
800
+ a.tc(b),this.format(W.hp,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.xo,{r:a.getType(),o:a.origin,d:a.jc(),u:a.Bc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.Vi:return this.format(W.We,{r:a.gh(),p:this.D(a.kc())});case a instanceof olympe.dc.query.zd:return this.format(W.zq,a.ga());case a instanceof olympe.dc.wg:return this.format(W.wo,a.ga());case a instanceof olympe.dc.vc:return this.format(W.pm,this.J(a.X()));default:return super.D(a)}}j(a){if(null===
801
+ a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Oo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.cs().fb(d,a));return olympe.dc.CloudObject.get(d);case W.fo:return olympe.dc.CloudObject.get(c);case W.yq:return d=c.p.map(olympe.dc.query.oa.mm.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ke:a.rm});case W.QUERY_RESULT:return ti(c);case W.hp:return(new olympe.dc.transaction.Ni).j(c.p,c.i);case W.xo:return a=null!=(d=this.j(c.c))?d:void 0,
802
+ vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.We:return d=this.j(c.p),new olympe.dc.transaction.Vi(d,c.r);case W.zq:return olympe.dc.query.zd.j(c);case W.wo:return olympe.dc.wg.j(c);case W.pm:return new olympe.dc.vc(c);default:return super.j(a)}}J(a){if(this.F.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.kq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of $g(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
803
+ d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.ef(a)||(c.v=!0);this.F.set(a,c);return a}};const Tj=olympe.dc.Request.j.yg,Uj=olympe.dc.Request.j.We,Vj=olympe.dc.Request.j.Rg,Wj=olympe.dc.Request.j.mi,Xj=olympe.dc.Request.j.Rn,Yj=olympe.dc.Request.j.Hq,Zj=olympe.dc.Request.j.Hg,ak=olympe.dc.Request.j.hk,bk=olympe.dc.Request.j.gp,ck=olympe.dc.Request.j.It,dk=olympe.dc.Request.j.Jt,ek=olympe.dc.Request.j.Kt,fk=olympe.dc.Request.j.vg,gk=olympe.dc.Request.j.Wf,hk=olympe.dc.Request.j.dg,ik=olympe.dc.Request.j.Qj,jk=olympe.dc.Request.j.ew,kk=olympe.dc.Request.j.vv,lk=olympe.dc.Request.j.ap,mk=
804
+ olympe.dc.Request.j.kh,nk=olympe.dc.Request.j.gt,ok=olympe.dc.Request.j.pc;function pk(a){return qk(a,olympe.dc.Request.j.yg).then(b=>{b=b.getData().p;const c=Af(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function rk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc(),e=b.j;d.tc(c);return sk(a,Uj,{i:d.T(),r:b.gh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
805
+ function tk(a,b){const c=b.kc(),d=new olympe.dc.transaction.Ae({Yk:!0,ge:!1,Sh:!1});c.tc(d);b=b.j?'bd=true':'';return qk(a,Vj,Bf(d),b,olympe.net.wa.ResponseType.lr).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(()=>{uk(a,ik,{id:c.T(),finalize:olympe.dc.transaction.Af.j.Ii})})}
806
+ function vk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1}),d=b.kc();d.tc(c);return sk(a,Wj,{i:d.T(),r:b.gh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function wk(a,b){const c=new olympe.dc.transaction.Ae({ge:!1,Sh:!1});b=b.kc();b.tc(c);return sk(a,mk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
807
+ function xk(a,b){const c=encodeURI(bb(olympe.V.Ze(),JSON.stringify(yk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return qk(a,Zj,void 0,`query=${c}&v=${a.version}`,olympe.net.wa.ResponseType.fe).then(d=>zk(a,d))}function Ak(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=yk(a,b);return qb(a.ua,()=>qk(a,bk,d,void 0,olympe.net.wa.ResponseType.fe)).then(e=>zk(a,e))}
808
+ function Bk(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=yk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Bo;b=N(bj(a.j,olympe.dc.Ka.SERVER,Xj),olympe.net.wa.Md.Ch,JSON.stringify(b),olympe.net.wa.ResponseType.Kh);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.JSON});return cj(a.j,b).then(c=>c.getData())}
809
+ function Ck(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=bj(a.j,olympe.dc.Ka.SERVER,Yj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Md.Ch,b);Ac(b,{[olympe.net.wa.Headers.oi]:olympe.net.wa.ul.pw});return cj(a.j,b).then(f=>f.getData())}
810
+ function sk(a,b,c,d=!0){const e=olympe.L.xe.ug,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
811
+ function yk(a,b){var c=Ph(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.oa.Jd)Object.assign(b,{f:c[0].Nb,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.oa.ue&&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.ba.bind(a,
812
+ e))})}return b}function uk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ka.SELF,c),a.T());let d;null==(d=a.Wb)||d.vd(b)}
813
+ function qk(a,b,c,d,e){const f=bj(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.wa.Md.Ch:olympe.net.wa.Md.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.wa.Headers.oi]:'application/json'});Cc(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return cj(a.j,b)}
814
+ function zk(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:rb(e,d))?f:olympe.V.stream.ck.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
815
+ function Dk(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.yf){e=new olympe.dc.db.fc(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).tc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
816
+ olympe.dc.sources.er=class extends olympe.dc.sources.sl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Ni(this.T());this.J=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.ow:null;this.ua=new olympe.V.promise.ir(f);olympe.C.oj(this.D.Pf(),()=>{this.J.forEach((h,k)=>{h.error(new olympe.L.errors.Ji('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ka.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case ok:return a=
817
+ olympe.dm.DataSource.pc.zb,b=olympe.dm.DataSource.pc.Fh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Tj:return pk(this);case Uj:return rk(this,c);case Vj:return tk(this,c);case Wj:return vk(this,c);case mk:return wk(this,c);case Zj:return d.get(olympe.dc.ma.j.zp)?xk(this,c):Ak(this,c);case Xj:return Bk(this,c);case Yj:return Ck(this,c.NE,c.debug,c.optional);case jk:case kk:case lk:case nk:return sk(this,b,{});case gk:return this.j.downloadFileContent(a);case fk:return this.j.deleteFileContent(a);
818
+ case hk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===ak){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=yk(this,c);this.N.delete(d);this.J.set(d,e);sk(this,ck,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Ji,(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);sk(this,dk,{i:d}).catch(e=>
819
+ {this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.J.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.xe.ug,this.fa.bind(this));return this}destroy(){return w(function*(){})}fa(a,b){const c=olympe.dc.Request.j.Tn,d=olympe.dc.Request.j.Zl,e=a.c;if(e===olympe.dc.Request.j.so)Dk(this,a,b).then(f=>{uk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
820
+ b=rf(b,a.ct),uk(this,e,{rollback:b,error:a.error});else if(e===ek){const f=a.i;Dk(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&uk(this,ik,{id:a.i,finalize:olympe.dc.transaction.Af.j.Zl,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.oa.Gh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ja()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.er.xa=[olympe.dc.sources.Mj];function Ek(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.gb(olympe.dm.wd.F.ac()).gb(olympe.dm.wd.D).he().back().gb(olympe.dm.wd.j).he().observe(d,{jd:c,zc:!0}).subscribe(e=>{e.hj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.mj().forEach(([f])=>{a.D.delete(f)})});b.gb(olympe.dm.jb.D).observe(d,{jd:c,zc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
821
821
  olympe.dc.sources.uk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.J=!1}fromModel(a){a=olympe.dc.ha(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Ie(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ka.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Qb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.J){this.J=
822
- !0;var a=new olympe.dc.Xa;Y(a.create(olympe.dm.DataSource,this.j).gi(this.j),olympe.dm.DataSource.Rh,!0);a.Oa(olympe.dm.DataSource.sj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.Xg()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Ll:'dc.sources.HTTPService',Zt:'dc.sources.IOService',Fq:'dc.sources.RemoteProvider',Yq:'dc.sources.ServerProvider',BB:'dc.sources.OfflineProvider',Te:'dc.sources.SourceSolver',Ee:'dc.sources.Serializer',uo:'dc.sources.cache.Cache',vo:'dc.sources.cache.DATABASE',ol:'dc.sources.cache.Logger'};
822
+ !0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).gi(this.j),olympe.dm.DataSource.Rh,!0);a.Oa(olympe.dm.DataSource.sj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.Xg()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Ll:'dc.sources.HTTPService',Zt:'dc.sources.IOService',Fq:'dc.sources.RemoteProvider',Yq:'dc.sources.ServerProvider',BB:'dc.sources.OfflineProvider',Te:'dc.sources.SourceSolver',Ee:'dc.sources.Serializer',uo:'dc.sources.cache.Cache',vo:'dc.sources.cache.DATABASE',ol:'dc.sources.cache.Logger'};
823
823
  olympe.dc.sources.U={th:'data.httpHost',rf:'data.httpPort',yi:'data.httpSSL',Jl:'data.httpBasePath',jm:'data.pollingFrequency',Ne:'data.communicationMode',sm:'data.restrictedUse',VERSION:'version.version',cr:'data.streamWorker',jq:'data.queryConcurrencyLimit'};olympe.dc.sources.vh={hv:'olympe.internal.data.',th:'olympe.internal.data.httpHost',rf:'olympe.internal.data.httpPort',yi:'olympe.internal.data.httpSSL'};
824
824
  olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.Vl),d=`-${olympe.host.Lg.Dh}`;F(a,olympe.dc.sources.U.th,null);F(a,olympe.dc.sources.U.rf,null);F(a,olympe.dc.sources.U.yi,null);F(a,olympe.dc.sources.U.Jl,'runtime/data');F(a,olympe.dc.sources.U.cr,!1);F(a,olympe.dc.sources.U.jq,10);Ya(a,olympe.dc.sources.vh.th,[olympe.host.U.kk,olympe.L.U.yl,olympe.dc.sources.U.th],(e,f,g)=>{if(g)return g;e=e===olympe.host.Lg.Dh;return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.vh.rf,
825
825
  [olympe.dc.sources.vh.th,olympe.dc.sources.U.rf],(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.vh.yi,[olympe.dc.sources.vh.rf,olympe.dc.sources.U.yi],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.jm,null);F(a,olympe.dc.sources.U.Ne,null);F(a,olympe.dc.sources.U.sm,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ee,olympe.dc.sources.ec,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ee,
826
826
  olympe.dc.sources.P.Ee);D(a,olympe.dc.sources.P.Ll,olympe.dc.sources.Nt,olympe.dc.sources.P.Ca,olympe.net.P.Xi,olympe.L.P.Kl,olympe.auth.P.Da,olympe.dc.sources.P.Te,olympe.L.P.Ee,new olympe.W.pa(olympe.L.U.jl));D(a,olympe.dc.sources.P.Zt,olympe.dc.sources.yp,olympe.dc.sources.P.Ca,olympe.dc.P.Jg,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Fq,olympe.dc.sources.Qq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Mg),olympe.dc.sources.P.Ll,olympe.L.P.kf,olympe.dc.P.oh,olympe.dc.sources.P.Te);
827
827
  D(a,olympe.dc.sources.P.Yq,olympe.dc.sources.er,olympe.dc.sources.P.Ca,olympe.L.P.nk,olympe.L.P.kf,olympe.dc.sources.P.Ll,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.jq),new olympe.W.pa(olympe.dc.sources.U.cr));D(a,olympe.dc.sources.P.Te,olympe.dc.sources.uk,olympe.dc.P.oh,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.Al));E(a,olympe.dc.sources.P.ol,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.uo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.ol,
828
- olympe.dc.P.Jg,olympe.dc.sources.P.vo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.kf,olympe.Db.P.Wl,olympe.V.P.pg,new olympe.W.pa(olympe.net.U.gq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.vo,olympe.dc.sources.cache.ak,olympe.Db.P.Og,olympe.dc.sources.P.ol,olympe.Db.P.Vj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.Te,olympe.dc.sources.P.uo],(a,b)=>{olympe.dc.$d=()=>a;olympe.dc.sources.Yd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.ym=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.pt=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.bw=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.ym{};function Gk(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.Ob(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.Ni).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
829
- olympe.dc.sources.cache.qp=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.fb: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.X()};case a instanceof olympe.dc.db.fc:const b=new olympe.dc.transaction.Ae;a.tc(b);
830
- return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function zj(a,b,c){return w(function*(){Hk(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(Ik(a)));return Jk(a.j,b,c)})}function Aj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
831
- function Bj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.dd()).filter(h=>!h.Dd()).map(h=>h.tag()),yield Kk(a.j)),yield Lk(a.j,d,0<f.length?b:null),Mk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
832
- a.rc.next(f)}finally{b&&Nk(a,'queries',b)}}))().then(()=>{})}function Cj(a,b,c,d,e=!1){return w(function*(){yield Aj(a,d);Bj(a,b,c,d,e)})}function Ok(){var a=olympe.dc.sources.Yd();a.$=!0;a.Bb=!0}function Hk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
833
- function Nk(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 Pk(a){return w(function*(){a.F=new olympe.dc.db.fc;const b=yield Qk(a.j);for(const c of b)c.tc(a.F);a.ba.next(0<b.length)})}
834
- function Mk(a,b,c){return w(function*(){const d=Rk(b),e=[];for(const g of d){const h=g.tag();if(!(yield Sk(a.j,h)))if(Hk(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.wa.ResponseType.il);e.push(Dc(a.Ec,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Nk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
835
- 'application/octet-stream';f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.Wf,c,f);f=qb(a.Kc,()=>a.Wb.request(n).then(p=>Tk(a.j,h,p,l))).finally(()=>Nk(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`)}})})})}
836
- function Rk(a){const b=[olympe.dc.ha(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).gg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Rc(c))?void 0:d.ab(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Rc(d))?void 0:e.ab(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Rc(g));return c.concat(d)},[])}
837
- function Uk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Ik(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Vk(a,b){return w(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Wk(a.j,b);a.N.next(Ik(a));d.filter(f=>!e.has(f));yield Kk(a.j)}else yield Promise.all(Ik(a).map(f=>Vk(a,f)))})}
838
- function Xk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
839
- function Yk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.We;const e=olympe.dc.Request.j.ug,f=olympe.dc.Request.j.cg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Rk(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Vb();if(h.Dd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Zk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.gb))throw Error('Lost connection, stop syncing');
840
- l=yield a.Wb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Vi(b,!1));if(!id(a.gb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
841
- function $k(a,b,c){return c instanceof olympe.L.errors.wk||c instanceof olympe.L.errors.no?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.pt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.L.errors.Pq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.bw('The transaction has been rejected by the datasource',
828
+ olympe.dc.P.Jg,olympe.dc.sources.P.vo,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.kf,olympe.Db.P.Wl,olympe.V.P.qg,new olympe.W.pa(olympe.net.U.gq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.vo,olympe.dc.sources.cache.ak,olympe.Db.P.Og,olympe.dc.sources.P.ol,olympe.Db.P.Vj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.Te,olympe.dc.sources.P.uo],(a,b)=>{olympe.dc.$d=()=>a;olympe.dc.sources.Yd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.ym=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.pt=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.bw=class extends olympe.dc.sources.cache.errors.ym{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.ym{};function Fk(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.Ob(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.Ni).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
829
+ olympe.dc.sources.cache.qp=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.vc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.fc:const b=new olympe.dc.transaction.Ae;a.tc(b);
830
+ return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function yj(a,b,c){return w(function*(){Gk(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(Hk(a)));return Ik(a.j,b,c)})}function zj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
831
+ function Aj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.dd()).filter(h=>!h.Ed()).map(h=>h.tag()),yield Jk(a.j)),yield Kk(a.j,d,0<f.length?b:null),Lk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
832
+ a.rc.next(f)}finally{b&&Mk(a,'queries',b)}}))().then(()=>{})}function Bj(a,b,c,d,e=!1){return w(function*(){yield zj(a,d);Aj(a,b,c,d,e)})}function Nk(){var a=olympe.dc.sources.Yd();a.$=!0;a.Bb=!0}function Gk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
833
+ function Mk(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 Ok(a){return w(function*(){a.F=new olympe.dc.db.fc;const b=yield Pk(a.j);for(const c of b)c.tc(a.F);a.ba.next(0<b.length)})}
834
+ function Lk(a,b,c){return w(function*(){const d=Qk(b),e=[];for(const g of d){const h=g.tag();if(!(yield Rk(a.j,h)))if(Gk(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.wa.ResponseType.il);e.push(Dc(a.Ec,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Mk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
835
+ 'application/octet-stream';f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.Wf,c,f);f=qb(a.Kc,()=>a.Wb.request(n).then(p=>Sk(a.j,h,p,l))).finally(()=>Mk(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`)}})})})}
836
+ function Qk(a){const b=[olympe.dc.ha(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).hg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Rc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Rc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Rc(g));return c.concat(d)},[])}
837
+ function Tk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Hk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Uk(a,b){return w(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Vk(a.j,b);a.N.next(Hk(a));d.filter(f=>!e.has(f));yield Jk(a.j)}else yield Promise.all(Hk(a).map(f=>Uk(a,f)))})}
838
+ function Wk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
839
+ function Xk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.We;const e=olympe.dc.Request.j.vg,f=olympe.dc.Request.j.dg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Qk(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Vb();if(h.Ed())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Yk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.fb))throw Error('Lost connection, stop syncing');
840
+ l=yield a.Wb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Vi(b,!1));if(!id(a.fb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
841
+ function Zk(a,b,c){return c instanceof olympe.L.errors.wk||c instanceof olympe.L.errors.no?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.pt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.L.errors.Pq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.bw('The transaction has been rejected by the datasource',
842
842
  c.message)):new olympe.dc.sources.cache.errors.lw('Synchronisation error',c.message)}
843
- function al(){var a=olympe.dc.sources.Yd();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]);(()=>w(function*(){yield a.init();const c=yield bl(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){Xk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Yk(a,
844
- h,f),yield cl(a.j,h)}catch(k){throw $k(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Pk(a).finally(()=>{a.R=!1})});return b.asObservable()}
845
- function dl(){const a=olympe.dc.sources.Yd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Rk(a.F);for(const e of d)b.has(e.tag())||(d=yield Zk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.ua.j(d.content)}),b.add(e.tag()));b=yield el(a.j);c.patches.push(...b);return JSON.stringify(c)})}
846
- function fl(a){const b=olympe.dc.sources.Yd();return w(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.ua.D(e.c),yield Tk(b.j,e.t,d,e.m);yield gl(b.j,c.patches);yield Pk(b);b.Ga.Tc(rf(b.F))})}
847
- function hl(){const a=olympe.dc.sources.Yd();return w(function*(){yield il(a.j);yield Pk(a)})}
848
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Wb=b;this.j=c;this.Ga=d;this.Ec=e;this.gb=f;this.cb=g;this.ua=h;this.version=l;this.$=this.version!==this.cb.get('__code-as-data-version__');this.Eb=this.Bb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.J=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Ub=this.$b=!1;this.fa=[];this.Y=0;this.$c=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
849
- !1;this.rc=new rxjs.Subject;this.Kc=new olympe.V.promise.ir(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.$b)if(a.Ub)yield new Promise(b=>{a.fa.push(b)});else{a.Ub=!0;(yield jl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Ik(a));yield Pk(a);a.Ga.Tc(rf(a.F));for(const b of a.fa)b();a.$b=!0;a.fa=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Uk(b,a.T())&&Ph(a).some(c=>c instanceof olympe.dc.query.oa.Jd)?kl(b.j,a).then(olympe.V.stream.Wr):
850
- b.j.executeQuery(a).then(olympe.V.stream.Wr)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.kc(),e=Array.from(d.Ab.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.j.Ab.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield ll(c.j,d,b),c.J=new olympe.dc.sources.cache.nt(d,b),c.ba.next(!0)):(d.tc(c.J.j),yield ll(c.j,c.J.j,b));d.tc(c.F);yield Lk(c.j,d,'local-transaction')})}uploadFileContent(a,
851
- b,c){const d=this;return w(function*(){yield d.init();yield Tk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Zk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield ml(b.j,[a])})}};olympe.dc.sources.cache.nt=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 jl(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.lq.Ob(b))})}function Qk(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Bh.Ob(b);return Gk(b.j)})})}function Jk(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Kk(a){return w(function*(){return a.db.D()})}
852
- function Lk(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 Sk(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)))})})}
853
- function Tk(a,b,c,d){c=new olympe.dc.sources.cache.hm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Wk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function bl(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Bh.Ob(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Gk(c.j));b.set(d,f);return b},new Map)})}
854
- function cl(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Zk(a,b){return w(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.hm.Ob(c)})}function el(a){return w(function*(){return a.db.F('pending-transactions')})}
855
- function gl(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Bh.Ob(d);e&&c.set(e.j.i,d)}yield a.db.ba()})}function il(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
856
- function kl(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.yd.gj(b);var e=(yield a.db.J(b.T())).map(f=>olympe.dc.sources.cache.Eg.Ob(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.ak.bc(f);const g=nl(f.Fd);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.hc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
857
- a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.kc().Ab.size,'instances',Array.from(d.kc().Cd()).length,'relations');return d})}function ll(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Bh(c,b,Date.now())).toJSON())}function ol(a){return w(function*(){return a.db.N('pending-transactions')})}function ml(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
858
- function nl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Gk(d)),new Map)}
859
- olympe.dc.sources.cache.ak=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.qp;this.db=c.D(this.J);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.V.Promise.dj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield ol(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
860
- 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 bc(a){const b=new RegExp(`^(${olympe.dc.hc.Yc})>([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 w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.yd.gj(a),e=a.sb();var f=
861
- yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Eg.Ob(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.ak.bc(g),nl(g.Fd));for(const p of Ph(a))if(p instanceof olympe.dc.query.oa.Gh){var k=p.relation;g=k.Ja()===olympe.dc.va.ORIGIN;const q=k.X(),r=k.ac();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 u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
862
- Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.Eg.Ob(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.ue&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.ue&&!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.ak.bc(A),d.create(l,n,nl(A.Fd)));q===olympe.dc.hc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
863
- olympe.dc.query.oa.Jd&&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.kc().Ab.size,'instances',Array.from(d.kc().Cd()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
843
+ function $k(){var a=olympe.dc.sources.Yd();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]);(()=>w(function*(){yield a.init();const c=yield al(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){Wk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Xk(a,
844
+ h,f),yield bl(a.j,h)}catch(k){throw Zk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Ok(a).finally(()=>{a.R=!1})});return b.asObservable()}
845
+ function cl(){const a=olympe.dc.sources.Yd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Qk(a.F);for(const e of d)b.has(e.tag())||(d=yield Yk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.ua.j(d.content)}),b.add(e.tag()));b=yield dl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
846
+ function el(a){const b=olympe.dc.sources.Yd();return w(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.ua.D(e.c),yield Sk(b.j,e.t,d,e.m);yield fl(b.j,c.patches);yield Ok(b);b.Ga.Tc(rf(b.F))})}
847
+ function gl(){const a=olympe.dc.sources.Yd();return w(function*(){yield hl(a.j);yield Ok(a)})}
848
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Wb=b;this.j=c;this.Ga=d;this.Ec=e;this.fb=f;this.$a=g;this.ua=h;this.version=l;this.$=this.version!==this.$a.get('__code-as-data-version__');this.Eb=this.Bb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.J=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Ub=this.$b=!1;this.fa=[];this.Y=0;this.$c=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
849
+ !1;this.rc=new rxjs.Subject;this.Kc=new olympe.V.promise.ir(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.$b)if(a.Ub)yield new Promise(b=>{a.fa.push(b)});else{a.Ub=!0;(yield il(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Hk(a));yield Ok(a);a.Ga.Tc(rf(a.F));for(const b of a.fa)b();a.$b=!0;a.fa=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Tk(b,a.T())&&Ph(a).some(c=>c instanceof olympe.dc.query.oa.Jd)?jl(b.j,a).then(olympe.V.stream.Wr):
850
+ b.j.executeQuery(a).then(olympe.V.stream.Wr)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.kc(),e=Array.from(d.Ab.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.j.Ab.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield kl(c.j,d,b),c.J=new olympe.dc.sources.cache.nt(d,b),c.ba.next(!0)):(d.tc(c.J.j),yield kl(c.j,c.J.j,b));d.tc(c.F);yield Kk(c.j,d,'local-transaction')})}uploadFileContent(a,
851
+ b,c){const d=this;return w(function*(){yield d.init();yield Sk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Yk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield ll(b.j,[a])})}};olympe.dc.sources.cache.nt=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 il(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.lq.Ob(b))})}function Pk(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Bh.Ob(b);return Fk(b.j)})})}function Ik(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Jk(a){return w(function*(){return a.db.D()})}
852
+ function Kk(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 Rk(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)))})})}
853
+ function Sk(a,b,c,d){c=new olympe.dc.sources.cache.hm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Vk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function al(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Bh.Ob(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Fk(c.j));b.set(d,f);return b},new Map)})}
854
+ function bl(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Yk(a,b){return w(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.hm.Ob(c)})}function dl(a){return w(function*(){return a.db.F('pending-transactions')})}
855
+ function fl(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Bh.Ob(d);e&&c.set(e.j.i,d)}yield a.db.ba()})}function hl(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
856
+ function jl(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.zd.gj(b);var e=(yield a.db.J(b.T())).map(f=>olympe.dc.sources.cache.Eg.Ob(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.ak.bc(f);const g=ml(f.Gd);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.hc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
857
+ a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.kc().Ab.size,'instances',Array.from(d.kc().Dd()).length,'relations');return d})}function kl(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Bh(c,b,Date.now())).toJSON())}function nl(a){return w(function*(){return a.db.N('pending-transactions')})}function ll(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
858
+ function ml(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Fk(d)),new Map)}
859
+ olympe.dc.sources.cache.ak=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.qp;this.db=c.D(this.J);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.V.Promise.dj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield nl(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
860
+ 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 bc(a){const b=new RegExp(`^(${olympe.dc.hc.Yc})>([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 w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.zd.gj(a),e=a.sb();var f=
861
+ yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Eg.Ob(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.ak.bc(g),ml(g.Gd));for(const p of Ph(a))if(p instanceof olympe.dc.query.oa.Gh){var k=p.relation;g=k.Ja()===olympe.dc.va.ORIGIN;const q=k.X(),r=k.ac();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 u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
862
+ Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.Eg.Ob(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.oa.ue&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.oa.ue&&!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.ak.bc(A),d.create(l,n,ml(A.Gd)));q===olympe.dc.hc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
863
+ olympe.dc.query.oa.Jd&&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.kc().Ab.size,'instances',Array.from(d.kc().Dd()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
864
864
  olympe.dc.sources.cache.lq=class{constructor(a,b){this.name=a;this.j=b}static Ob(a){return a?new olympe.dc.sources.cache.lq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
865
- olympe.dc.sources.cache.Eg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Fd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Ob(a){return a?new olympe.dc.sources.cache.Eg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Fd,relations:this.ob,queryIds:this.j}}};
865
+ olympe.dc.sources.cache.Eg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Gd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Ob(a){return a?new olympe.dc.sources.cache.Eg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Gd,relations:this.ob,queryIds:this.j}}};
866
866
  olympe.dc.sources.cache.Bh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Ob(a){return a?new olympe.dc.sources.cache.Bh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
867
867
  olympe.dc.sources.cache.bv=class extends olympe.dc.sources.cache.Bh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Ob(a){return a?new olympe.dc.sources.cache.bv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
868
- olympe.dc.sources.cache.hm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Ob(a){return a?new olympe.dc.sources.cache.hm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function pl(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
869
- olympe.dc.sources.cache.Rt=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=new Set;this.J=new olympe.dc.sources.cache.qp;this.N=new Map}dd(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Pc(a,b,c){const d=this.j.get(a);d||this.Y.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.J.ga(k[1]);return h},null!=(e=null==d?void 0:d.Fd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
870
- this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Eg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Fd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ga(g);return e},null!=(d=c.Fd)?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.Eg(b,
871
- 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Eg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=pl(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.va.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=pl(this,f.tag);if(h.has(g)){const k=
872
- f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Rt.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ni=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.Bb=ql(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.J=new Set;this.j=null;let d;this.cb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Sn))?d:30;this.fa=[]}static j(b,c){return`${b},${c}`}Eb(b){for(const c of this.fa)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.J);0<b.size&&rl(this,
873
- b,!1);this.J.clear()}ba(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}$(b,c,d){this.ua(b,c,d);this.Bb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.cb))}ua(b,c,d){b=a.j(b,c);this.F.set(b,d);this.J.add(b)}gb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ha(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ha(f),this.gb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
874
- c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ha(b),f=olympe.dc.ha(c);void 0===e||void 0===f?olympe.ja.$a('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.pn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ja.$a('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Y(()=>{this.N()}))}stop(){this.D.destroy();
875
- this.fa.length=0}getContext(){return this.D}T(){return this.id}gh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.J.clear();const c=this.ba(new Set(this.F.keys()));rl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ni.prototype.complete=olympe.dc.ni.prototype.complete;olympe.dc.ni.prototype.push=olympe.dc.ni.prototype.push;olympe.dc.Mc=class{j(){}toString(){}};olympe.dc.Mc.j=1;olympe.dc.Mc.D=2;olympe.dc.Mc.J=3;olympe.dc.Mc.F=4;olympe.dc.Mc.N=5;olympe.dc.transaction.Ni=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ka.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.ve.Pe+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,
868
+ olympe.dc.sources.cache.hm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Ob(a){return a?new olympe.dc.sources.cache.hm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function ol(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
869
+ olympe.dc.sources.cache.Rt=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=new Set;this.J=new olympe.dc.sources.cache.qp;this.N=new Map}dd(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Pc(a,b,c){const d=this.j.get(a);d||this.Y.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.J.ga(k[1]);return h},null!=(e=null==d?void 0:d.Gd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
870
+ this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Eg(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Gd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ga(g);return e},null!=(d=c.Gd)?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.Eg(b,
871
+ 'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Eg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=ol(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.va.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=ol(this,f.tag);if(h.has(g)){const k=
872
+ f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Rt.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ni=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.Bb=pl(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.J=new Set;this.j=null;let d;this.$a=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Sn))?d:30;this.fa=[]}static j(b,c){return`${b},${c}`}Eb(b){for(const c of this.fa)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.J);0<b.size&&ql(this,
873
+ b,!1);this.J.clear()}ba(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}$(b,c,d){this.ua(b,c,d);this.Bb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.$a))}ua(b,c,d){b=a.j(b,c);this.F.set(b,d);this.J.add(b)}fb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ha(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ha(f),this.fb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
874
+ c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ha(b),f=olympe.dc.ha(c);void 0===e||void 0===f?olympe.ja.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.pn([d],g=>{this.R=!0;if(g instanceof olympe.dc.vc)olympe.ja.ab('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Y(()=>{this.N()}))}stop(){this.D.destroy();
875
+ this.fa.length=0}getContext(){return this.D}T(){return this.id}gh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.J.clear();const c=this.ba(new Set(this.F.keys()));ql(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ni.prototype.complete=olympe.dc.ni.prototype.complete;olympe.dc.ni.prototype.push=olympe.dc.ni.prototype.push;olympe.dc.Mc=class{j(){}toString(){}};olympe.dc.Mc.j=1;olympe.dc.Mc.D=2;olympe.dc.Mc.J=3;olympe.dc.Mc.F=4;olympe.dc.Mc.N=5;olympe.dc.transaction.Ni=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ka.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.ce.Pe+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
876
876
  e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.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.fc(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.Pc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Mc.D:c.Wc(d.t,
877
- a.j(d.p),d.m);break;case olympe.dc.Mc.J: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.ic(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function sl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Ie(b)}function tl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Rc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.ef(b)||!a.db.Ha(b)}function ul(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function vl(a){return Array.from(a.j.dd()).filter(b=>!b.Dd()).map(b=>b.tag())}
878
- function wl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ka.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(a.id),a.D.set(b,c)),d(c))}function xl(a,b,c){const d=sl(a,b),e=Z(a,b),f=tl(a,b);wl(a,d,e,g=>{g.D(b,c,f)})}
879
- olympe.dc.transaction.mv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.J=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}cf(){return 0===this.j.Ab.size}Pc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=Z(this,a);this.sources.set(a,f);wl(this,f,c,g=>{g.Pc(a,f,d,b)})}Wc(a,b){const c=sl(this,a),d=Z(this,a),e=tl(this,a);wl(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=sl(this,b),e=
880
- sl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.$a('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);wl(this,d,f,g=>{g.Oa(a,b,c,tl(this,b),tl(this,c))})}ic(a,b,c){const d=sl(this,b),e=sl(this,c);let f=Z(this,b)&&
881
- Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(olympe.ja.$a('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);wl(this,d,f,g=>{g.ic(a,b,c,tl(this,b),tl(this,c))})}};function yl(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.Cp.br)if(e===olympe.dc.Ka.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ka.SERVER)continue}else g.startsWith(olympe.dc.ve.Pe)&&(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 zl(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}
882
- class Al{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||a instanceof olympe.C.aa?a.valueOf():a instanceof Date||a instanceof olympe.C.fb?(a=a instanceof olympe.C.fb?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.ah().valueOf(),g:a.Yg().valueOf(),b:a.Vg().valueOf(),a:a.Ug().valueOf()}:a&&'function'===
877
+ a.j(d.p),d.m);break;case olympe.dc.Mc.J: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.ic(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function rl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Ie(b)}function sl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Rc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.ef(b)||!a.db.Ha(b)}function tl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function ul(a){return Array.from(a.j.dd()).filter(b=>!b.Ed()).map(b=>b.tag())}
878
+ function vl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ka.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(a.id),a.D.set(b,c)),d(c))}function wl(a,b,c){const d=rl(a,b),e=Z(a,b),f=sl(a,b);vl(a,d,e,g=>{g.D(b,c,f)})}
879
+ olympe.dc.transaction.mv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.J=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}cf(){return 0===this.j.Ab.size}Pc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=Z(this,a);this.sources.set(a,f);vl(this,f,c,g=>{g.Pc(a,f,d,b)})}Wc(a,b){const c=rl(this,a),d=Z(this,a),e=sl(this,a);vl(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=rl(this,b),e=
880
+ rl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.ab('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);vl(this,d,f,g=>{g.Oa(a,b,c,sl(this,b),sl(this,c))})}ic(a,b,c){const d=rl(this,b),e=rl(this,c);let f=Z(this,b)&&
881
+ Z(this,c)&&d!==olympe.dc.Ka.SELF&&e!==olympe.dc.Ka.SELF;f&&d!==e&&a!==olympe.dc.hc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);vl(this,d,f,g=>{g.ic(a,b,c,sl(this,b),sl(this,c))})}};function xl(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.Cp.br)if(e===olympe.dc.Ka.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ka.SERVER)continue}else g.startsWith(olympe.dc.ce.Pe)&&(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 yl(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}
882
+ class zl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||a instanceof olympe.C.aa?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.ah().valueOf(),g:a.Yg().valueOf(),b:a.Vg().valueOf(),a:a.Ug().valueOf()}:a&&'function'===
883
883
  typeof a.X?{c:8,t:a.X()}:a}}function Bf(a){const b=a.J.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.J=[];return b}
884
- olympe.dc.transaction.Ae=class{constructor({Yk:a=!1,Sh:b=!0,ge:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.J=[];this.Yk=null!=a?a:!1;this.ge=null!=c?c:!0;this.Sh=null!=b?b:!0;this.Y=olympe.C?new Al:new class extends Al{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Pc(a,b,c,d=null){c=yl(this.Y,null!=c?c:null,this.Yk);c={o:olympe.dc.Mc.j,t:a,p:c};this.Sh&&(c.s=b);this.ge&&d&&(c.m=d);this.N.push(c);this.Yk&&(b=zl(this.Y))&&this.j.push({o:olympe.dc.Mc.D,
885
- t:a,p:b})}Wc(a,b,c=null){b=yl(this.Y,b||null,!1);a={o:olympe.dc.Mc.D,t:a,p:b};this.ge&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Mc.J,t:a,f:b};this.ge&&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.ge&&d&&(a.lm=d);this.ge&&
886
- e&&(a.rm=e);this.R.push(a)}ic(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.ge&&d&&(a.lm=d);this.ge&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.Ae.xa=[olympe.dc.Writable];function Bl(a){var b=new olympe.dc.Xa;b.Y=a;return b}function Cl(a,b){b instanceof olympe.dc.Xa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
887
- function Dl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Cl(a,new olympe.dc.transaction.Fa.Do(e,b));Cl(a,new olympe.dc.transaction.Fa.vl(e,b,d));return c}
888
- function El(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
889
- olympe.dc.Xa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.J=this.N=!1;this.R=[...olympe.dc.nj().Y]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ha(a)))?b:olympe.dc.ia().model(a)}j(a){ul(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=Cl(this,new olympe.dc.transaction.Fa.qo(a,b));const c=b.X();this.F.set(c,
890
- olympe.dc.ha(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.ha(a);var d=olympe.dc.ia();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.$d().fromModel(b);Cl(this,new olympe.dc.transaction.Fa.nv(c,d))}else{if((e=d.Ha(c))&&d.ef(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
891
- 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.Cc){Cl(this,new olympe.dc.transaction.Fa.Eo(a,b))}update(a,b,c){return Cl(this,new olympe.dc.transaction.Fa.nw(a,b,c))}Oa(a,b,c){Cl(this,new olympe.dc.transaction.Fa.vl(a,b,c))}ic(a,b,c){Cl(this,new olympe.dc.transaction.Fa.zt(a,b,c))}Um(a,b){Cl(this,new olympe.dc.transaction.Fa.Do(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
892
- f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.ve.Pe+d.X(),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}Qr(a,b,c='',{XD:d=olympe.dm.Relation.J.Yu,iE:e=olympe.dm.Relation.j.wv,dE:f=olympe.dm.Relation.j.Ws,GE:g=olympe.dm.Relation.j.sp,UD:h=olympe.dm.el.NONE,FE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
893
- c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.fa,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.sp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.rj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}gh(){return!1}Mm(a){this.$.push(olympe.C.Va().F(a))}nb(a,b){Fl(olympe.dc.nj(),this,El(this,a),b)}Vm(a){a=El(this,
894
- a);Gl(olympe.dc.nj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Xa.xa=[olympe.dc.Mc];function ql(a){var b=olympe.dc.nj();const c=a.T();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
895
- function rl(a,b,c,d){var e=olympe.dc.nj();const f=olympe.dc.Request.j.mi,g=olympe.dc.Request.j.kh,h=a.T();a=a.gh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ka.SELF||!e.db.ef(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(h),k.set(n,p));p.Wc(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.Vi(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
896
- function Fl(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);Gl(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else Gl(a,b,c,!1)}function Hl(a){const b=olympe.dc.Request.j.Qj;zf(a.Wb,olympe.dc.Request.j.Tn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Eb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Wb,b,c=>{c=c.content;Il(a,c.id,c.finalize,c.error)})}
897
- function Jl(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.fa.has(c)||a.Y.push(b);return a}
898
- function Gl(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.mv(a.db,a.ba,e);try{b.j(f)}catch(p){if(p instanceof olympe.dc.cq){p.j.then(()=>Gl(a,b,c,d));return}c(!1,p.message);return}if(f.cf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=vl(f);a.j.j.Ga(h);g=h.filter(p=>Z(f,p));var k=wg(a.j,f.j,g),l=olympe.C.Va().F((p,q)=>c(null!==p,q)),n=[k,l];Kl(a,f,g).then(p=>{n.splice(1,0,p);Ll(a,e,h,f.D.size+1);return Ml(a,f.D,d,b.gh(),b.N)}).then(p=>{n.forEach(q=>q(p));
899
- Il(a,e,olympe.dc.transaction.Af.j.Ii)}).catch(p=>{a.G.error(p);n.forEach(q=>q(null,`${p}`));Nl(a,e)})}}
900
- function Kl(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Qb(n,olympe.dm.File)&&void 0!==(null==(p=d.Rc(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.Ze();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),
884
+ olympe.dc.transaction.Ae=class{constructor({Yk:a=!1,Sh:b=!0,ge:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.J=[];this.Yk=null!=a?a:!1;this.ge=null!=c?c:!0;this.Sh=null!=b?b:!0;this.Y=olympe.C?new zl:new class extends zl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Pc(a,b,c,d=null){c=xl(this.Y,null!=c?c:null,this.Yk);c={o:olympe.dc.Mc.j,t:a,p:c};this.Sh&&(c.s=b);this.ge&&d&&(c.m=d);this.N.push(c);this.Yk&&(b=yl(this.Y))&&this.j.push({o:olympe.dc.Mc.D,
885
+ t:a,p:b})}Wc(a,b,c=null){b=xl(this.Y,b||null,!1);a={o:olympe.dc.Mc.D,t:a,p:b};this.ge&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Mc.J,t:a,f:b};this.ge&&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.ge&&d&&(a.lm=d);this.ge&&
886
+ e&&(a.rm=e);this.R.push(a)}ic(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.ge&&d&&(a.lm=d);this.ge&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.Ae.xa=[olympe.dc.Writable];function Al(a){var b=new olympe.dc.Wa;b.Y=a;return b}function Bl(a,b){b instanceof olympe.dc.Wa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
887
+ function Cl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Bl(a,new olympe.dc.transaction.Fa.Do(e,b));Bl(a,new olympe.dc.transaction.Fa.vl(e,b,d));return c}
888
+ function Dl(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
889
+ olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.J=this.N=!1;this.R=[...olympe.dc.nj().Y]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ha(a)))?b:olympe.dc.ia().model(a)}j(a){tl(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=Bl(this,new olympe.dc.transaction.Fa.qo(a,b));const c=b.X();this.F.set(c,
890
+ olympe.dc.ha(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.ha(a);var d=olympe.dc.ia();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.$d().fromModel(b);Bl(this,new olympe.dc.transaction.Fa.nv(c,d))}else{if((e=d.Ha(c))&&d.ef(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
891
+ 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.Cc){Bl(this,new olympe.dc.transaction.Fa.Eo(a,b))}update(a,b,c){return Bl(this,new olympe.dc.transaction.Fa.nw(a,b,c))}Oa(a,b,c){Bl(this,new olympe.dc.transaction.Fa.vl(a,b,c))}ic(a,b,c){Bl(this,new olympe.dc.transaction.Fa.zt(a,b,c))}Um(a,b){Bl(this,new olympe.dc.transaction.Fa.Do(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
892
+ f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.ce.Pe+d.X(),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}Qr(a,b,c='',{XD:d=olympe.dm.Relation.J.Yu,iE:e=olympe.dm.Relation.j.wv,dE:f=olympe.dm.Relation.j.Ws,GE:g=olympe.dm.Relation.j.sp,UD:h=olympe.dm.el.NONE,FE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
893
+ c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.fa,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.sp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.rj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}gh(){return!1}Mm(a){this.$.push(olympe.C.Xa().F(a))}nb(a,b){El(olympe.dc.nj(),this,Dl(this,a),b)}Vm(a){a=Dl(this,
894
+ a);Fl(olympe.dc.nj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Mc];function pl(a){var b=olympe.dc.nj();const c=a.T();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
895
+ function ql(a,b,c,d){var e=olympe.dc.nj();const f=olympe.dc.Request.j.mi,g=olympe.dc.Request.j.kh,h=a.T();a=a.gh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ka.SELF||!e.db.ef(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(h),k.set(n,p));p.Wc(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.Vi(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
896
+ function El(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);Fl(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else Fl(a,b,c,!1)}function Gl(a){const b=olympe.dc.Request.j.Qj;zf(a.Wb,olympe.dc.Request.j.Tn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Eb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Wb,b,c=>{c=c.content;Hl(a,c.id,c.finalize,c.error)})}
897
+ function Il(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.fa.has(c)||a.Y.push(b);return a}
898
+ function Fl(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.mv(a.db,a.ba,e);try{b.j(f)}catch(p){if(p instanceof olympe.dc.cq){p.j.then(()=>Fl(a,b,c,d));return}c(!1,p.message);return}if(f.cf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=ul(f);a.j.j.Ga(h);g=h.filter(p=>Z(f,p));var k=wg(a.j,f.j,g),l=olympe.C.Xa().F((p,q)=>c(null!==p,q)),n=[k,l];Jl(a,f,g).then(p=>{n.splice(1,0,p);Kl(a,e,h,f.D.size+1);return Ll(a,f.D,d,b.gh(),b.N)}).then(p=>{n.forEach(q=>q(p));
899
+ Hl(a,e,olympe.dc.transaction.Af.j.Ii)}).catch(p=>{a.G.error(p);n.forEach(q=>q(null,`${p}`));Ml(a,e)})}}
900
+ function Jl(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Qb(n,olympe.dm.File)&&void 0!==(null==(p=d.Rc(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.Ze();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),
901
901
  r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.ua.fa(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Rc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Lm(z),k.push([u,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.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Wc(q,r);return p},
902
- new olympe.dc.db.fc);return wg(a.j,n)})}function Ll(a,b,c,d){const e=olympe.C.Xg(),f=new olympe.async.fk(e);0<a.R&&f.Cn(a.R);const g=olympe.dc.transaction.Af.j.Uu;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.F((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.j.Ub(c);Nl(a,b)});f.start()}
903
- function Ml(a,b,c,d,e){if(c&&olympe.C.Pa(a.$.D)!==olympe.auth.Ta.j.gf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Rg:olympe.dc.Request.j.We;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Vi(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
904
- function Il(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 Nl(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Af.j.Ii,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.N)d();a.N=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}function Ol(a,b){if(0<a.F.size){const c=olympe.C.Va();a.N.push(()=>{!c.eb()&&c.run(b)})}else b()}
905
- olympe.dc.transaction.Af=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Wb=c;this.ba=d;this.ua=e;this.$=f;this.R=g.get('notificationTimeout');this.Y=[];let h;this.fa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.V.Jh(g.get('burstHoldTime'));this.F=new Map;this.N=[];this.D=new Map;this.Ga=new olympe.V.promise.wm;Hl(this)}le(a){qb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.j.ap,olympe.dc.Ka.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
902
+ new olympe.dc.db.fc);return wg(a.j,n)})}function Kl(a,b,c,d){const e=olympe.C.Xg(),f=new olympe.async.fk(e);0<a.N&&f.Cn(a.N);const g=olympe.dc.transaction.Af.j.Uu;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.F((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.j.Ub(c);Ml(a,b)});f.start()}
903
+ function Ll(a,b,c,d,e){if(c&&olympe.C.Pa(a.$.D)!==olympe.auth.Ta.j.gf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Rg:olympe.dc.Request.j.We;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Vi(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
904
+ function Hl(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 Ml(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Af.j.Ii,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.R)d();a.R=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
905
+ olympe.dc.transaction.Af=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Wb=c;this.ba=d;this.ua=e;this.$=f;this.N=g.get('notificationTimeout');this.Y=[];let h;this.fa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.V.Jh(g.get('burstHoldTime'));this.F=new Map;this.R=[];this.D=new Map;this.Ga=new olympe.V.promise.wm;Gl(this)}le(a){qb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.j.ap,olympe.dc.Ka.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
906
906
  b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Af.j={Zl:0,Ii:1,Uu:2};olympe.dc.transaction.Vi=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}gh(){return this.F}kc(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.U={Vp:'dc.transaction.timeout',Sn:'dc.transaction.burstInterval',Cl:'dc.transaction.disabledCompilers'};
907
907
  olympe.W.config(function(a){F(a,olympe.dc.transaction.U.Vp,9E4);F(a,olympe.dc.transaction.U.Sn,30);F(a,olympe.dc.transaction.U.Cl,[]);E(a,olympe.dc.transaction.P.Ca,[olympe.ja.P.Da],b=>b.cd('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.Vp),new olympe.W.pa(olympe.dc.transaction.U.Cl),new olympe.W.pa(olympe.dc.db.U.rl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.P.Da,olympe.dc.transaction.Af,
908
- olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Jg,olympe.dc.sources.P.Te,olympe.dc.P.Oj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Pl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.og=class{constructor(){this.ia=olympe.dc.ia()}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.qs(a)?a.valueOf():a}};olympe.dc.transaction.Fa.og.xa=[olympe.dc.Mc];olympe.dc.transaction.Fa.Ln=class extends olympe.dc.transaction.Fa.og{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ha(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ja(){return this.relation.Ja()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Fd.set(olympe.dc.ha(b),c);return a}olympe.dc.transaction.Fa.qo=class extends olympe.dc.transaction.Fa.og{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ha(b))?c:olympe.V.Hf();this.model=olympe.dc.ha(a);this.source=null;this.Fd=new Map}X(){return this.tag}bc(){return this.model}gi(a){this.source=a;return this}j(a){const b=this.bc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Pc(c,b,this.source,Pl(this,this.Fd))}toString(){return`CreateInstance(${this.bc()}, ${this.X()})`}};
908
+ olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Jg,olympe.dc.sources.P.Te,olympe.dc.P.Oj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Nl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.pg=class{constructor(){this.ia=olympe.dc.ia()}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.qs(a)?a.valueOf():a}};olympe.dc.transaction.Fa.pg.xa=[olympe.dc.Mc];olympe.dc.transaction.Fa.Ln=class extends olympe.dc.transaction.Fa.pg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ha(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ja(){return this.relation.Ja()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Gd.set(olympe.dc.ha(b),c);return a}olympe.dc.transaction.Fa.qo=class extends olympe.dc.transaction.Fa.pg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ha(b))?c:olympe.V.Hf();this.model=olympe.dc.ha(a);this.source=null;this.Gd=new Map}X(){return this.tag}bc(){return this.model}gi(a){this.source=a;return this}j(a){const b=this.bc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Pc(c,b,this.source,Nl(this,this.Gd))}toString(){return`CreateInstance(${this.bc()}, ${this.X()})`}};
909
909
  olympe.dc.transaction.Fa.qo.xa=[olympe.dc.Qe];olympe.dc.transaction.Fa.vl=class extends olympe.dc.transaction.Fa.Ln{constructor(a,b,c){super(a,b);this.D=this.ia.Ha(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.hc.Yc)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');
910
- if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ja()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.ha(this.origin),olympe.dc.ha(this.D)):a.Oa(b,olympe.dc.ha(this.D),olympe.dc.ha(this.origin))}toString(){return`CreateRelation('${this.relation.Ja()}${this.relation.X()}, ${olympe.dc.ha(this.origin)}, ${olympe.dc.ha(this.D)})`}};olympe.dc.transaction.Fa.lA=class extends olympe.dc.transaction.Fa.og{constructor(a,b=olympe.dc.Lb.Cc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Nb=b}j(a){for(const b of this.ia.dd(this.model))b!==olympe.dc.ha(this.model)&&(new olympe.dc.transaction.Fa.Eo(b,this.Nb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Nb})`}};olympe.dc.transaction.Fa.Do=class extends olympe.dc.transaction.Fa.Ln{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ja(),e=this.ia.ab(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
911
- a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.Ja()}${this.getType()})`}};olympe.dc.transaction.Fa.Eo=class extends olympe.dc.transaction.Fa.og{constructor(a,b=olympe.dc.Lb.Cc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Nb=b}X(){return olympe.dc.ha(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&xl(a,b,this.Nb)}toString(){return'DeleteInstance('+this.X()+', '+this.Nb+')'}};olympe.dc.transaction.Fa.zt=class extends olympe.dc.transaction.Fa.vl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ha(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
912
- this.relation.Ja()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ja()+this.relation.X()+', '+olympe.dc.ha(this.origin)+', '+olympe.dc.ha(this.D)+')'}};olympe.dc.transaction.Fa.nw=class extends olympe.dc.transaction.Fa.og{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Fd=new Map;void 0!==b&&this.Fd.set(olympe.dc.ha(b),c)}X(){return olympe.dc.ha(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Rc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Pl(this,this.Fd);
913
- for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.vc&&xl(a,d.X(),olympe.dc.Lb.Cc);f instanceof olympe.dc.vc&&!Z(a,f.X())&&(d=new olympe.dc.Xa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Pl(this,this.Fd)+')'}};olympe.dc.transaction.Fa.nv=class a extends olympe.dc.transaction.Fa.og{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ha(this.tag)&&!c.ef(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Rc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ha(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Pc(this.tag,d,this.source,e);for(const [g,h,k]of $g(c,this.tag))Z(b,
910
+ if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ja()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.ha(this.origin),olympe.dc.ha(this.D)):a.Oa(b,olympe.dc.ha(this.D),olympe.dc.ha(this.origin))}toString(){return`CreateRelation('${this.relation.Ja()}${this.relation.X()}, ${olympe.dc.ha(this.origin)}, ${olympe.dc.ha(this.D)})`}};olympe.dc.transaction.Fa.lA=class extends olympe.dc.transaction.Fa.pg{constructor(a,b=olympe.dc.Lb.Cc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Nb=b}j(a){for(const b of this.ia.dd(this.model))b!==olympe.dc.ha(this.model)&&(new olympe.dc.transaction.Fa.Eo(b,this.Nb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Nb})`}};olympe.dc.transaction.Fa.Do=class extends olympe.dc.transaction.Fa.Ln{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ja(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
911
+ a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.Ja()}${this.getType()})`}};olympe.dc.transaction.Fa.Eo=class extends olympe.dc.transaction.Fa.pg{constructor(a,b=olympe.dc.Lb.Cc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Nb=b}X(){return olympe.dc.ha(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&wl(a,b,this.Nb)}toString(){return'DeleteInstance('+this.X()+', '+this.Nb+')'}};olympe.dc.transaction.Fa.zt=class extends olympe.dc.transaction.Fa.vl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ha(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ha(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
912
+ this.relation.Ja()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ja()+this.relation.X()+', '+olympe.dc.ha(this.origin)+', '+olympe.dc.ha(this.D)+')'}};olympe.dc.transaction.Fa.nw=class extends olympe.dc.transaction.Fa.pg{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.ha(b),c)}X(){return olympe.dc.ha(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Rc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Nl(this,this.Gd);
913
+ for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.vc&&wl(a,d.X(),olympe.dc.Lb.Cc);f instanceof olympe.dc.vc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Nl(this,this.Gd)+')'}};olympe.dc.transaction.Fa.nv=class a extends olympe.dc.transaction.Fa.pg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ha(this.tag)&&!c.ef(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Rc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.vc&&c.Ha(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Pc(this.tag,d,this.source,e);for(const [g,h,k]of $g(c,this.tag))Z(b,
914
914
  k)&&(h===olympe.dc.va.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ha=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Tg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.bc(a))?d:''}else if(olympe.C.df(a)){let d;b=olympe.dc.ha(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.ha);olympe.dc.ia=function(){return olympe.dc.Yr().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
915
915
  olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Qr=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.Uw=function(a){return a.ac()};olympe.dc.mb={};olympe.dc.mb.Sm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Pm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Rb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Rm=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
916
- olympe.dc.mb.Qm=a=>'number'===typeof a||a instanceof Number?ic(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.fb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.fb(a):a instanceof olympe.C.fb?a:null;olympe.dc.mb.Kr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Lr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
916
+ olympe.dc.mb.Qm=a=>'number'===typeof a||a instanceof Number?ic(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.mb.Kr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Lr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
917
917
  olympe.dc.mb.cj=a=>a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Ac=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.Ac():a)?b:null};
918
- olympe.dc.mb.qx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Pm;case olympe.C.Sa:return olympe.dc.mb.Sm;case olympe.C.aa:return olympe.dc.mb.Rm;case olympe.C.fb:return olympe.dc.mb.Qm;case olympe.C.Color:return olympe.dc.mb.Kr;case olympe.dc.CloudObject:return olympe.dc.mb.Lr;default:return olympe.dc.mb.cj}};olympe.dc.lc={};olympe.dc.mf=class{la(){}F(){}compare(){}J(){}ga(){}toString(){}};function Ql(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function Rl(a,b){a.R()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ja.$a('dc').warn(a))}
919
- olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.$a('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.ha,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ql(this),this.j=null,this.zc=void 0)}ke(){return olympe.dc.ke()}nb(){if(null===this.j){const a=olympe.dc.lc.Px();this.j=Sl(a,this,this.zc);null!==this.valueType&&this.j.Ld(this.valueType);olympe.C.Va().Y(()=>
920
- {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}nc(){null===this.j&&this.nb();return this.j}Ld(a){this.valueType=a;null!==this.j&&this.j.Ld(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Xd(){return this.D}Rl(){return this.da}td(a,b){return this.nc().td(a,b)}Vk(a){this.nc().Vk(a)}ku(){return this.nc().Kc()}ju(){return this.nc().R()}get(a){return this.nc().get(a)}ci(){return this.nc().ci()}ai(a){const b=
921
- this.nc();Rl(b,'getCurrent');return b.ai(a)}has(a){return this.nc().has(a)}eh(a){const b=this.nc();Rl(b,'hasCurrent');return b.eh(a)}je(a){return this.nc().je(a)}Ty(a){return this.je(a).asObservable()}af(a){const b=this.nc();Rl(b,'getCurrentAt');return b.af(a)}bf(a){return this.nc().bf(a)}Jf(a){const b=this.nc();Rl(b,'getCurrentKeyAt');return b.Jf(a)}Bd(a){return this.nc().Bd(a)}Yy(a){return this.Bd(a).asObservable()}Kf(a){const b=this.nc();Rl(b,'getCurrentRank');return b.Kf(a)}Gc(){return this.nc().Gc()}Uy(){return this.Gc().asObservable()}Lf(){return this.nc().Lf()}sf(){return this.nc().sf()}Zy(){return this.sf().asObservable()}ig(){const a=
922
- this.nc();Rl(a,'getCurrentSize');return a.ig()}forEach(a,b){this.nc().forEach(a,b)}ie(a){const b=this.nc();Rl(b,'forEachCurrentValue');return b.ie(a)}fj(a,b,c,d){a=new olympe.dc.da.xh(a,b);(new olympe.dc.za(this.D,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
923
- if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.zc=this.zc;b.Ld(Ql(b)||this.valueType||Object);return b}$k(a){return this.transform(new olympe.dc.da.Cf(a))}filter(a){return this.transform(new olympe.dc.da.pf(a))}Ck(){const a=new olympe.dc.Wj(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
918
+ olympe.dc.mb.qx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Pm;case olympe.C.Sa:return olympe.dc.mb.Sm;case olympe.C.aa:return olympe.dc.mb.Rm;case olympe.C.eb:return olympe.dc.mb.Qm;case olympe.C.Color:return olympe.dc.mb.Kr;case olympe.dc.CloudObject:return olympe.dc.mb.Lr;default:return olympe.dc.mb.cj}};olympe.dc.lc={};olympe.dc.mf=class{la(){}F(){}compare(){}J(){}ga(){}toString(){}};function Ol(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function Pl(a,b){a.R()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ja.ab('dc').warn(a))}
919
+ olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('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.ha,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ol(this),this.j=null,this.zc=void 0)}ke(){return olympe.dc.ke()}nb(){if(null===this.j){const a=olympe.dc.lc.Px();this.j=Ql(a,this,this.zc);null!==this.valueType&&this.j.Ld(this.valueType);olympe.C.Xa().Y(()=>
920
+ {var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}nc(){null===this.j&&this.nb();return this.j}Ld(a){this.valueType=a;null!==this.j&&this.j.Ld(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Xd(){return this.D}Rl(){return this.da}hd(a,b){return this.nc().hd(a,b)}Vk(a){this.nc().Vk(a)}ku(){return this.nc().Kc()}ju(){return this.nc().R()}get(a){return this.nc().get(a)}ci(){return this.nc().ci()}ai(a){const b=
921
+ this.nc();Pl(b,'getCurrent');return b.ai(a)}has(a){return this.nc().has(a)}eh(a){const b=this.nc();Pl(b,'hasCurrent');return b.eh(a)}je(a){return this.nc().je(a)}Ty(a){return this.je(a).asObservable()}af(a){const b=this.nc();Pl(b,'getCurrentAt');return b.af(a)}bf(a){return this.nc().bf(a)}Jf(a){const b=this.nc();Pl(b,'getCurrentKeyAt');return b.Jf(a)}Cd(a){return this.nc().Cd(a)}Yy(a){return this.Cd(a).asObservable()}Kf(a){const b=this.nc();Pl(b,'getCurrentRank');return b.Kf(a)}Gc(){return this.nc().Gc()}Uy(){return this.Gc().asObservable()}Lf(){return this.nc().Lf()}sf(){return this.nc().sf()}Zy(){return this.sf().asObservable()}jg(){const a=
922
+ this.nc();Pl(a,'getCurrentSize');return a.jg()}forEach(a,b){this.nc().forEach(a,b)}ie(a){const b=this.nc();Pl(b,'forEachCurrentValue');return b.ie(a)}fj(a,b,c,d){a=new olympe.dc.da.xh(a,b);(new olympe.dc.za(this.D,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
923
+ if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.zc=this.zc;b.Ld(Ol(b)||this.valueType||Object);return b}$k(a){return this.transform(new olympe.dc.da.Cf(a))}filter(a){return this.transform(new olympe.dc.da.pf(a))}Ck(){const a=new olympe.dc.Wj(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
924
924
  let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}iu(){return this.nc().Ag()}Uc(){return olympe.C.ta([this.sf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.af(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.$k;
925
- olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ie;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.ig;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Zy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Uy;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Kf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Yy;
926
- olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.af;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Ty;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Vk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.td;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Xd;olympe.dc.za.xa=[olympe.C.od];m=olympe.dc.za.prototype;m.ke.K=olympe.C.H.j;m.nb.K=olympe.C.H.J();m.nc.K=new olympe.C.H(()=>olympe.dc.lc.Subscription,[]);m.Ld.K=new olympe.C.H(()=>{},[]);
927
- m.Xd.K=new olympe.C.H(()=>String,[]);m.Rl.K=new olympe.C.H(()=>Array,[]);m.td.K=new olympe.C.H(()=>String,[]);m.Vk.K=new olympe.C.H(()=>{},[]);m.ku.K=olympe.C.H.N;m.ju.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.ci.K=new olympe.C.H(()=>Array,[]);m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.af.K=olympe.C.H.j;m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.Bd.K=olympe.C.H.F;
928
- m.Kf.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.ig.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;m.fj.K=new olympe.C.H(()=>{},[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.$k.K=new olympe.C.H(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Ck.K=new olympe.C.H(()=>olympe.dc.Wj,[]);m.toString.K=olympe.C.H.j;m.iu.K=olympe.C.H.j;m.Uc.K=olympe.C.H.D;const Tl={Ez:'append',Gl:'filter_not',Qo:'filter_and',Ro:'filter_or'};function Ul(a,b){a=Vl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Mn(a,b)).D}
929
- olympe.dc.Wj=class{constructor(a,b){this.j=Vl(a);this.G=olympe.ja.$a('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Fa=[];this.zc=void 0}Fi(){const a=new olympe.dc.za(this.j,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Wl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Wl('transform','Properties cannot be used as transformer, unlike relations '+
930
- d);if(!d||'function'!==typeof d.j)throw new Wl('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}$k(a){this.da.push(new olympe.dc.da.Cf(a));return this}Cz(a){this.da.push(new olympe.dc.da.Cf(Vl(a)));return this}mu(a){this.valueType=a;return this}hb(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}kx(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}jx(a,
931
- b,c){a=new olympe.dc.da.De(a,a.Ja(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}ix(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ja())}a=new olympe.dc.da.Xj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}lu(){this.hb(olympe.dc.CloudObject.instancesRel);return this}Ye(a){var b=this.Fa.pop();b===Tl.Gl&&(a=new olympe.dc.Z.de(a),b=this.Fa.pop());switch(b){case Tl.Qo:b=this.da.pop().D;b instanceof
932
- olympe.dc.Z.Id?(b=b.Z,b.push(a),a=new olympe.dc.Z.Id(...b)):a=new olympe.dc.Z.Id(b,a);b=this.Fa.pop();break;case Tl.Ro:b=this.da.pop().D,b instanceof olympe.dc.Z.ze?(b=b.Z,b.push(a),a=new olympe.dc.Z.ze(...b)):a=new olympe.dc.Z.ze(b,a),b=this.Fa.pop()}b===Tl.Gl&&(a=new olympe.dc.Z.de(a),this.Fa.pop());this.da.push(new olympe.dc.da.pf(a));return this}bx(a,b,c){return this.Ye(new olympe.dc.Z.te(Ul(a,c),new olympe.dc.Za.Oe(b)))}contains(a,b,c=!1,d){return this.Ye(new olympe.dc.Z.nf(Ul(a,d),new olympe.dc.Za.Oe(b),
933
- c))}Qb(a){if(!(a instanceof Array))throw new Wl('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Vl(a[c]));return this.Ye(new olympe.dc.Z.Ci(b))}Qk(a){return this.Ye(new olympe.dc.Z.te(new olympe.dc.Za.Ui,new olympe.dc.Za.Oe(Vl(a))))}ex(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.sd().Qk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().sd().Qk(a[b])}return this}ty(a,b){if(!(a instanceof
934
- Array))throw new Wl('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ja())});return this.Ye(new olympe.dc.Z.zi(c,d,b))}Ok(a,b,c){a=Ul(a,c);return this.Ye(new olympe.dc.Z.Sj(a,new olympe.dc.Za.Oe(b)))}vj(a,b,c){a=Ul(a,c);return this.Ye(new olympe.dc.Z.tk(a,new olympe.dc.Za.Oe(b)))}Ly(a,b,c,d){a=Ul(a,d);return this.Ye(new olympe.dc.Z.zf(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.ng{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
935
- return this.Ye(b)}sd(){this.Fa.push(Tl.Gl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Tl.Qo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Tl.Ro);return this}Zk(a,b,c){a=Vl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Si(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Ki(a,c));break;case olympe.dm.DateTime.O.X():d=
936
- new olympe.dc.wc.DateTime(new olympe.dc.Za.ri(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Pg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.ng{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Pg(d,c));return this}Yw(){this.da.push(new olympe.dc.da.si);return this}pj(a,b){this.da.push(new olympe.dc.da.xh(a,b));return this}};class Wl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
937
- function Vl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.bc(a):olympe.C.ib(a)?a.Oh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.ha(b)),olympe.C.Sa):a.X()}m=olympe.dc.Wj.prototype;m.Fi.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=olympe.C.H.J();m.$k.K=olympe.C.H.J();m.Cz.K=olympe.C.H.J();m.mu.K=olympe.C.H.J();m.hb.K=olympe.C.H.J();m.kx.K=olympe.C.H.J();m.jx.K=olympe.C.H.J();m.ix.K=olympe.C.H.J();m.lu.K=olympe.C.H.J();m.Ye.K=olympe.C.H.J();
938
- m.bx.K=olympe.C.H.J();m.contains.K=olympe.C.H.J();m.Qb.K=olympe.C.H.J();m.Qk.K=olympe.C.H.J();m.ex.K=olympe.C.H.J();m.ty.K=olympe.C.H.J();m.Ok.K=olympe.C.H.J();m.vj.K=olympe.C.H.J();m.Ly.K=olympe.C.H.J();m.filter.K=olympe.C.H.J();m.sd.K=olympe.C.H.J();m.and.K=olympe.C.H.J();m.or.K=olympe.C.H.J();m.Zk.K=olympe.C.H.J();m.sort.K=olympe.C.H.J();m.Yw.K=olympe.C.H.J();m.pj.K=olympe.C.H.J();function Sl(a,b,c){const d=b.Xd();var e=new olympe.dc.query.lv;let f;f=d;olympe.C.ib(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.lc.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.lc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
939
- function Xl(a,b){if(b.R())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.mc.jr(a.db,a.G),d=b.T();olympe.C.Sc([b.Xd()],e=>{const f=olympe.dc.ha(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.Wh()||b.Pk();sf(a.db,f,Yl(a,b,c),d);olympe.C.Va().Y(()=>qf(a.db,f,d));a.db.Ha(f.valueOf())||Zl(c);b.R()||(Zl(c),b.rc([]))})}}
940
- function $l(a,b,c,d,e){const f=[b.Xd()],g=l=>l instanceof olympe.dc.da.Cf;let h;const k=(null!=(h=b.bh())?h:[]).filter(g);for(const l of k){f.push(l.Xd());let n;k.push(...(null!=(n=l.bh())?n:[]).filter(g))}Ol(a.N,()=>{olympe.C.Sc(f,()=>{const l=b.Vd(c);am(a,l,b.T(),d,e)})})}
941
- function am(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Va(),g=new olympe.async.fk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;hi(a.J,h,f,olympe.dc.Ka.SELF,olympe.dc.ma.oc.lf,{zc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});bd(g,(h,k)=>d(k));g.start()}
942
- function Yl(a,b,c){const d=new olympe.dc.mc.Cj;let e=!1;const f=olympe.C.Va(),g=b.bh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.rd()||f.eb()||(k?b.eh(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.$c(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.Yh(n)),e||(bm(c,()=>{p.dg();Zl(c)}),f.run(()=>p.ke().lg(b.rc.bind(b))),
943
- e=!0),cm(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,dm(p,k,l,n))}}
944
- olympe.dc.lc.Ku=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.N=c;this.J=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.lc.Uv(a),this.j.set(c,d));d.counter++;em(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Gf(),b||this.D&&d===olympe.dc.Ka.SERVER||d===olympe.dc.Ka.SELF?(this.G.debug('QueryMGR: [ID:',c,
945
- '] - Local subscription, no need for coverage check, booting subscription '),Xl(this,a)):$l(this,a,d,e=>{e?this.G.error(e):Xl(this,a)},b))}};function fm(a){return olympe.C.ib(a)?'Node#'+a.Ba.T():String(a)}function gm(a,b){return olympe.C.ib(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
925
+ olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ie;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.jg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Zy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Uy;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Kf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Yy;
926
+ olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.af;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Ty;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Vk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Xd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.ke.K=olympe.C.H.j;m.nb.K=olympe.C.H.J();m.nc.K=new olympe.C.H(()=>olympe.dc.lc.Subscription,[]);m.Ld.K=new olympe.C.H(()=>{},[]);
927
+ m.Xd.K=new olympe.C.H(()=>String,[]);m.Rl.K=new olympe.C.H(()=>Array,[]);m.hd.K=new olympe.C.H(()=>String,[]);m.Vk.K=new olympe.C.H(()=>{},[]);m.ku.K=olympe.C.H.N;m.ju.K=olympe.C.H.j;m.get.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.ci.K=new olympe.C.H(()=>Array,[]);m.ai.K=olympe.C.H.j;m.has.K=olympe.C.H.N;m.eh.K=olympe.C.H.j;m.je.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.af.K=olympe.C.H.j;m.bf.K=new olympe.C.H(()=>String,[]);m.Jf.K=olympe.C.H.j;m.Cd.K=olympe.C.H.F;
928
+ m.Kf.K=olympe.C.H.j;m.Gc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[],'valueType');m.Lf.K=new olympe.C.H(()=>String,[]);m.sf.K=olympe.C.H.F;m.jg.K=olympe.C.H.j;m.forEach.K=new olympe.C.H(()=>{},[]);m.ie.K=olympe.C.H.j;m.fj.K=new olympe.C.H(()=>{},[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.$k.K=new olympe.C.H(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Ck.K=new olympe.C.H(()=>olympe.dc.Wj,[]);m.toString.K=olympe.C.H.j;m.iu.K=olympe.C.H.j;m.Uc.K=olympe.C.H.D;const Rl={Ez:'append',Gl:'filter_not',Qo:'filter_and',Ro:'filter_or'};function Sl(a,b){a=Tl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Mn(a,b)).D}
929
+ olympe.dc.Wj=class{constructor(a,b){this.j=Tl(a);this.G=olympe.ja.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Fa=[];this.zc=void 0}Fi(){const a=new olympe.dc.za(this.j,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ul('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Ul('transform','Properties cannot be used as transformer, unlike relations '+
930
+ d);if(!d||'function'!==typeof d.j)throw new Ul('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}$k(a){this.da.push(new olympe.dc.da.Cf(a));return this}Cz(a){this.da.push(new olympe.dc.da.Cf(Tl(a)));return this}mu(a){this.valueType=a;return this}gb(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}kx(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}jx(a,
931
+ b,c){a=new olympe.dc.da.De(a,a.Ja(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}ix(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ja())}a=new olympe.dc.da.Xj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}lu(){this.gb(olympe.dc.CloudObject.instancesRel);return this}Ye(a){var b=this.Fa.pop();b===Rl.Gl&&(a=new olympe.dc.Z.ee(a),b=this.Fa.pop());switch(b){case Rl.Qo:b=this.da.pop().D;b instanceof
932
+ olympe.dc.Z.Id?(b=b.Z,b.push(a),a=new olympe.dc.Z.Id(...b)):a=new olympe.dc.Z.Id(b,a);b=this.Fa.pop();break;case Rl.Ro:b=this.da.pop().D,b instanceof olympe.dc.Z.ze?(b=b.Z,b.push(a),a=new olympe.dc.Z.ze(...b)):a=new olympe.dc.Z.ze(b,a),b=this.Fa.pop()}b===Rl.Gl&&(a=new olympe.dc.Z.ee(a),this.Fa.pop());this.da.push(new olympe.dc.da.pf(a));return this}bx(a,b,c){return this.Ye(new olympe.dc.Z.te(Sl(a,c),new olympe.dc.Za.Oe(b)))}contains(a,b,c=!1,d){return this.Ye(new olympe.dc.Z.nf(Sl(a,d),new olympe.dc.Za.Oe(b),
933
+ c))}Qb(a){if(!(a instanceof Array))throw new Ul('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Tl(a[c]));return this.Ye(new olympe.dc.Z.Ci(b))}Qk(a){return this.Ye(new olympe.dc.Z.te(new olympe.dc.Za.Ui,new olympe.dc.Za.Oe(Tl(a))))}ex(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.ud().Qk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().ud().Qk(a[b])}return this}ty(a,b){if(!(a instanceof
934
+ Array))throw new Ul('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ja())});return this.Ye(new olympe.dc.Z.zi(c,d,b))}Ok(a,b,c){a=Sl(a,c);return this.Ye(new olympe.dc.Z.Sj(a,new olympe.dc.Za.Oe(b)))}vj(a,b,c){a=Sl(a,c);return this.Ye(new olympe.dc.Z.tk(a,new olympe.dc.Za.Oe(b)))}Ly(a,b,c,d){a=Sl(a,d);return this.Ye(new olympe.dc.Z.zf(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.og{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
935
+ return this.Ye(b)}ud(){this.Fa.push(Rl.Gl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Rl.Qo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.pf&&this.Fa.push(Rl.Ro);return this}Zk(a,b,c){a=Tl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Si(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Ki(a,c));break;case olympe.dm.DateTime.O.X():d=
936
+ new olympe.dc.wc.DateTime(new olympe.dc.Za.ri(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Pg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.og{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Pg(d,c));return this}Yw(){this.da.push(new olympe.dc.da.si);return this}pj(a,b){this.da.push(new olympe.dc.da.xh(a,b));return this}};class Ul extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
937
+ function Tl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.na.bc(a):olympe.C.ib(a)?a.Oh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.ha(b)),olympe.C.Sa):a.X()}m=olympe.dc.Wj.prototype;m.Fi.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=olympe.C.H.J();m.$k.K=olympe.C.H.J();m.Cz.K=olympe.C.H.J();m.mu.K=olympe.C.H.J();m.gb.K=olympe.C.H.J();m.kx.K=olympe.C.H.J();m.jx.K=olympe.C.H.J();m.ix.K=olympe.C.H.J();m.lu.K=olympe.C.H.J();m.Ye.K=olympe.C.H.J();
938
+ m.bx.K=olympe.C.H.J();m.contains.K=olympe.C.H.J();m.Qb.K=olympe.C.H.J();m.Qk.K=olympe.C.H.J();m.ex.K=olympe.C.H.J();m.ty.K=olympe.C.H.J();m.Ok.K=olympe.C.H.J();m.vj.K=olympe.C.H.J();m.Ly.K=olympe.C.H.J();m.filter.K=olympe.C.H.J();m.ud.K=olympe.C.H.J();m.and.K=olympe.C.H.J();m.or.K=olympe.C.H.J();m.Zk.K=olympe.C.H.J();m.sort.K=olympe.C.H.J();m.Yw.K=olympe.C.H.J();m.pj.K=olympe.C.H.J();function Ql(a,b,c){const d=b.Xd();var e=new olympe.dc.query.lv;let f;f=d;olympe.C.ib(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.lc.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.lc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
939
+ function Vl(a,b){if(b.R())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.mc.jr(a.db,a.G),d=b.T();olympe.C.Sc([b.Xd()],e=>{const f=olympe.dc.ha(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.Wh()||b.Pk();sf(a.db,f,Wl(a,b,c),d);olympe.C.Xa().Y(()=>qf(a.db,f,d));a.db.Ha(f.valueOf())||Xl(c);b.R()||(Xl(c),b.rc([]))})}}
940
+ function Yl(a,b,c,d,e){const f=[b.Xd()],g=l=>l instanceof olympe.dc.da.Cf;let h;const k=(null!=(h=b.bh())?h:[]).filter(g);for(const l of k){f.push(l.Xd());let n;k.push(...(null!=(n=l.bh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.Vd(c);Zl(a,l,b.T(),d,e)})}
941
+ function Zl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.fk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;hi(a.J,h,f,olympe.dc.Ka.SELF,olympe.dc.ma.oc.lf,{zc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});bd(g,(h,k)=>d(k));g.start()}
942
+ function Wl(a,b,c){const d=new olympe.dc.mc.Cj;let e=!1;const f=olympe.C.Xa(),g=b.bh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.td()||f.hb()||(k?b.eh(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.$c(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.Yh(n)),e||($l(c,()=>{p.eg();Xl(c)}),f.run(()=>p.ke().mg(b.rc.bind(b))),
943
+ e=!0),am(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,bm(p,k,l,n))}}
944
+ olympe.dc.lc.Ku=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.J=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.lc.Uv(a),this.j.set(c,d));d.counter++;cm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Gf(),b||this.D&&d===olympe.dc.Ka.SERVER||d===olympe.dc.Ka.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
945
+ Vl(this,a)):Yl(this,a,d,e=>{e?this.G.error(e):Vl(this,a)},b))}};function dm(a){return olympe.C.ib(a)?'Node#'+a.Ba.T():String(a)}function em(a,b){return olympe.C.ib(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
946
946
  olympe.dc.query.lv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.ib(a)?'n'+a.Ba.T():'p'+ ++this.j;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.lc.Subscription=class a extends olympe.C.Aj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Ec=c;this.da=d||null;this.F=this.N.run(()=>olympe.C.ae(olympe.dc.lc.Subscription.j.INIT));this.Ub=!1;this.$=this.$b=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ga(d);else e+='|null';e=olympe.V.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Xd(){return this.Ec}bh(){return this.da}Gf(){const b=
947
- olympe.dc.$d(),c=olympe.C.Pa(this.Xd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Ie(c)}Wh(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.dr}Pk(){if(this.F.Ba.eb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.$b;this.$b=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.ae(olympe.dc.lc.Subscription.j.dr))}Kc(){return olympe.C.ta([this.F],
948
- ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.Fh}td(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Va().F(b)));return c||''}Vk(b){null!==this.$&&b&&this.$.delete(b)}Eb(){const b=olympe.dc.lc.Subscription.j.Fh;if(!this.F.Ba.eb()&&olympe.C.Pa(this.F)!==b&&(this.Ef(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}rc(b){if(!this.F.Ba.eb()){for(let c=
949
- 0,d=b.length;c<d;c++)this.Im(b[c],c);if(this.R())this.Ef();else{this.Ub=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.Eb()}}}$c(b,c){if(!this.F.Ba.eb()&&(this.Bk(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.Ub&&!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.Eb()}}Yh(b){this.F.Ba.eb()||(this.Hm(b),
950
- this.Zi(b,!this.R()))}Ag(){return this.R()?super.Ag():'Subscription is not ready!'}Vd(b){const c=olympe.C.Pa(this.Xd());return olympe.dc.lc.Subscription.D(c,b,this.bh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).he();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Se){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.hb(h,!0))}else if(e instanceof olympe.dc.da.De){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.gg(h,!0,!0))}else if(e instanceof
951
- olympe.dc.da.Cf)e=a.D(olympe.C.Pa(e.Xd()),c,e.bh()),b.push(...e);else if(e instanceof olympe.dc.da.pf||e instanceof olympe.dc.da.Pg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.gg(n,!0,!0):k.hb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.lc.Subscription.j={INIT:0,dr:1,Fh:2};olympe.dc.lc.Subscription.prototype.Ag.K=olympe.C.H.j;function em(a){const b=a.D;a.D=!0;return b}olympe.dc.lc.Uv=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Bf=class{la(){}Mb(){}j(){}ga(){}toString(){}};olympe.dc.wq=class{F(){}};olympe.dc.yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let hm=0;olympe.dc.wc.ng=class{constructor(){this.id=hm++}la(){return'CustomLocalComparator#'+hm}J(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.wc.ng.xa=[olympe.dc.mf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}J(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.mf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}J(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.mf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}J(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.mf];olympe.dc.Z={};let im=0;olympe.dc.Z.ng=class{constructor(){this.id=im++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.ng.xa=[olympe.dc.Aa];olympe.dc.Z.fl=class{constructor(a,b){this.F=a;this.J=b}la(){}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.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.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.J.toString()+')'}};
947
+ olympe.dc.$d(),c=olympe.C.Pa(this.Xd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Ie(c)}Wh(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.dr}Pk(){if(this.F.Ba.hb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.$b;this.$b=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.ae(olympe.dc.lc.Subscription.j.dr))}Kc(){return olympe.C.ta([this.F],
948
+ ()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.lc.Subscription.j.Fh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().F(b)));return c||''}Vk(b){null!==this.$&&b&&this.$.delete(b)}Eb(){const b=olympe.dc.lc.Subscription.j.Fh;if(!this.F.Ba.hb()&&olympe.C.Pa(this.F)!==b&&(this.Ef(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}rc(b){if(!this.F.Ba.hb()){for(let c=
949
+ 0,d=b.length;c<d;c++)this.Im(b[c],c);if(this.R())this.Ef();else{this.Ub=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.Eb()}}}$c(b,c){if(!this.F.Ba.hb()&&(this.Bk(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.Ub&&!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.Eb()}}Yh(b){this.F.Ba.hb()||(this.Hm(b),
950
+ this.Zi(b,!this.R()))}Ag(){return this.R()?super.Ag():'Subscription is not ready!'}Vd(b){const c=olympe.C.Pa(this.Xd());return olympe.dc.lc.Subscription.D(c,b,this.bh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).he();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Se){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.gb(h,!0))}else if(e instanceof olympe.dc.da.De){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.hg(h,!0,!0))}else if(e instanceof
951
+ olympe.dc.da.Cf)e=a.D(olympe.C.Pa(e.Xd()),c,e.bh()),b.push(...e);else if(e instanceof olympe.dc.da.pf||e instanceof olympe.dc.da.Pg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.hg(n,!0,!0):k.gb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.lc.Subscription.j={INIT:0,dr:1,Fh:2};olympe.dc.lc.Subscription.prototype.Ag.K=olympe.C.H.j;function cm(a){const b=a.D;a.D=!0;return b}olympe.dc.lc.Uv=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Bf=class{la(){}Mb(){}j(){}ga(){}toString(){}};olympe.dc.wq=class{F(){}};olympe.dc.yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let fm=0;olympe.dc.wc.og=class{constructor(){this.id=fm++}la(){return'CustomLocalComparator#'+fm}J(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.wc.og.xa=[olympe.dc.mf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}J(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.mf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}J(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.mf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}J(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.mf];olympe.dc.Z={};let gm=0;olympe.dc.Z.og=class{constructor(){this.id=gm++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.og.xa=[olympe.dc.Aa];olympe.dc.Z.fl=class{constructor(a,b){this.F=a;this.J=b}la(){}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.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.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.J.toString()+')'}};
952
952
  olympe.dc.Z.fl.xa=[olympe.dc.Aa];olympe.dc.Z.Id=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Id)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.every(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Z.map(a=>
953
953
  a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Id);olympe.dc.Z.Id.xa=[olympe.dc.Aa];olympe.dc.Z.ml=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.ea))}la(){return Q(olympe.dc.Z.ml)}D(){return[this.value.j()]}ga(a){const b=olympe.C.ib(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.la()+'","a":['+b+','+this.value.ga(a)+']}'}toString(){const a=olympe.C.ib(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();
954
- return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.ml);olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.nf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.nf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=gm(a,this.F);
955
- return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=fm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.nf);olympe.dc.Z.nf.xa=[olympe.dc.Aa];olympe.dc.Z.te=class{constructor(a,b){this.F=a;this.J=b}la(){return Q(olympe.dc.Z.te)}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ed?c.Ed(d):'object'===typeof d&&void 0!==d.Ed?d.Ed(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.J.toString()+
956
- ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.te);olympe.dc.Z.te.xa=[olympe.dc.Aa];olympe.dc.Z.Bt=class extends olympe.dc.Z.te{constructor(a,b){super(a,new olympe.dc.Za.Oe(b))}};olympe.dc.Z.Bt.xa=[olympe.dc.Aa];olympe.dc.Z.Sj=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Sj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Sj);olympe.dc.Z.zi=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ha(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new jm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new jm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.zi)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
957
- c.getContext().eb()||c.getContext().rd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=km(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.zi);
958
- function km(a,b,c,d){const e=Object.create(null);d+=olympe.V.Zh();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 jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.zi.xa=[olympe.dc.Aa];olympe.dc.Z.Ml=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ha):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new lm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new lm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ml)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.Zh();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
959
- const g=this.ob;for(let k=g.length-1;0<=k;k--)f=mm(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().rd()||c.getContext().eb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Ml);
960
- function mm(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.Zh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
961
- {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 lm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ml.xa=[olympe.dc.Aa];olympe.dc.Z.Ci=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ha(b))}):this.F.add(olympe.dc.ha(a))}la(){return Q(olympe.dc.Z.Ci)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ha(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})`);
962
- this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new nm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new nm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class nm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.Zh()}}
963
- P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ci);olympe.dc.Z.Ci.xa=[olympe.dc.Aa];olympe.dc.Z.de=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.de)}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.ea))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.de);olympe.dc.Z.de.xa=[olympe.dc.Aa];olympe.dc.Z.ze=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.ze)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
964
- ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.ze);olympe.dc.Z.ze.xa=[olympe.dc.Aa];olympe.dc.Z.zf=class{constructor(a,b,c){this.source=a;this.J=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.zf)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.J,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.ea))}ga(a){const b=this.source.ga(a),c=gm(a,this.J);a=gm(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
965
- ']}'}toString(){const a=fm(this.F);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.zf);olympe.dc.Z.zf.xa=[olympe.dc.Aa];olympe.dc.Z.tk=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.tk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.tk);olympe.dc.mc={};olympe.dc.mc.Cj=class{constructor(){this.$=this.J=this.R=this.D=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.mc.Nj(this),this.R=c,this.J=b):this.J=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.$){const a=[];null!==this.J&&
966
- (0<=this.D?om(pm(this.J,this.D),a):a.push(this.R));this.$(a)}}lg(a){this.$=a}};olympe.dc.mc.Cj.xa=[olympe.dc.mc.Ta];function dm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.mc.Nj(a.j,a));return a.D}function pm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function om(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.mc.Nj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}ke(){return this.j}dg(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class qm extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.J=!1;this.F=null}}
967
- function rm(a,b,c,d,e){const f=Object.create(null),g=a.fa,h=a.J;let k,l,n;a.ba=!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.J||(c.J=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.ba=!1;null!==a.D&&a.F()}
968
- olympe.dc.mc.Xl=class{constructor(){this.J={};this.fa=[];this.D=null;this.ba=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(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.ba){var a=this.fa,b=a.length,c=this.J,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.$){var f=e,g=this.D;f.$=!0;f.F=pm(f,g)}null!==
969
- e.F&&om(e.F,this.R)}}this.$&&this.$(this.R)}}lg(a){this.$=a}j(a,b,c){let d=this.J[c];a?void 0===d?(d=new qm(this,c,b),this.J[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.mc.Xl.xa=[olympe.dc.mc.Ta];olympe.dc.mc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}lg(){}};function sm(a,b){olympe.C.df(a.value)?(a.node=olympe.C.nn(a.value,b),Nb(a.node)||b()):b()}function tm(a,b){if(olympe.C.df(a.value)){const c=olympe.C.Va(),d=a.J;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>sm(a,b)),olympe.C.Va().destroy())})}}
970
- class um extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.J=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}eb(){return null===this.value}}
971
- function vm(a,b){if(!b.eb()){var c=a.D;var d=a.fa,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].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=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()}}}
972
- function wm(a){const b=a.fa;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
973
- olympe.dc.mc.hr=class{constructor(a){this.fa=a;this.J=null;this.D=[];this.R=[];this.$=null;this.ba=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new um(this,c,d),this.ba.set(b,f),this.N()?sm(f,()=>vm(this,f)):(f.position=e.length,e.push(f));else{f=this.ba.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ba.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.J}Y(a){if(null!==this.J)throw Error('Manager already activated (depth='+
974
- this.J+')');this.J=a;wm(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;tm(d,()=>vm(this,d))}this.F()}F(){if(null===this.J)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.J;b.R=!0;b.F=pm(b,c)}0>this.J?this.R.push(e.Y):e.F&&om(e.F,this.R)}this.$&&this.$(this.R)}lg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
975
- c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.mc.hr.xa=[olympe.dc.mc.Ta];function Zl(a){if(!a.D){for(let b in a.F)xm(a.F[b]);a.D=!0}a.J=null;a.N=null}function bm(a,b,c){a.F[c||'root'].R=b}function cm(a,b,c){a.F[c||'root'].dg(b)}function ym(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=bh(a.db,b,c,d),e[f]=g);return g}function zm(a,b){a.D||a.j.dg(b)}function Am(a,b,c,d,e){if(!a.D){let f=ym(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=ym(a,c,d,olympe.dc.va.ORIGIN));0===f&&zm(a,b)}}
976
- function Bm(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 Cm(a){const b=String(++a.R),c=a.j;a.F[b]=new Dm(b,c);Em(c,b);c.J||(c.J=()=>Bm(a,c.T()));return b}function Fm(a,b){const c=a.j;a.j.J=()=>{Bm(a,c.T());b()}}function Gm(a,b){xm(b?a.F[b]:a.j)}
977
- olympe.dc.mc.jr=class{constructor(a,b){this.db=a;this.G=b||null;this.J=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Dm('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=ym(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Em(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function xm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
978
- class Dm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.J=this.D=null;this.N=!1}T(){return this.id}dg(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&xm(this)}notify(a){const b=this.J,c=this.D;if(this.N)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Za={};function Hm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.mc.Cj,g=new olympe.dc.mc.jr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.rd()||a.eb()||(h||(bm(g,()=>{u.dg();Zl(g)}),u.ke().lg(l),h=!0),q?k[t]=r:delete k[t],cm(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,dm(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ha(b)||Zl(g)}
979
- function Im(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Ng(e,b,a.J,d.F(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Og(e,b,a.J,g))}
954
+ return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.ml);olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.nf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.nf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Rb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=em(a,this.F);
955
+ return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=dm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.nf);olympe.dc.Z.nf.xa=[olympe.dc.Aa];olympe.dc.Z.te=class{constructor(a,b){this.F=a;this.J=b}la(){return Q(olympe.dc.Z.te)}D(){return[this.F.j(),this.J.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Rb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.J.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.J.toString()+
956
+ ')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.te);olympe.dc.Z.te.xa=[olympe.dc.Aa];olympe.dc.Z.Bt=class extends olympe.dc.Z.te{constructor(a,b){super(a,new olympe.dc.Za.Oe(b))}};olympe.dc.Z.Bt.xa=[olympe.dc.Aa];olympe.dc.Z.Sj=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Sj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Sj);olympe.dc.Z.zi=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ha(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new hm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new hm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.zi)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
957
+ c.getContext().hb()||c.getContext().td()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=im(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.zi);
958
+ function im(a,b,c,d){const e=Object.create(null);d+=olympe.V.Zh();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 hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.zi.xa=[olympe.dc.Aa];olympe.dc.Z.Ml=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.ha):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.De?this.ob.push(new jm(c.X(),c.Ja(),c.F,c.D)):this.ob.push(new jm(olympe.dc.ha(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ml)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.Zh();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
959
+ const g=this.ob;for(let k=g.length-1;0<=k;k--)f=km(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().td()||c.getContext().hb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Ml);
960
+ function km(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.Zh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
961
+ {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 jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ja()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ml.xa=[olympe.dc.Aa];olympe.dc.Z.Ci=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ha(b))}):this.F.add(olympe.dc.ha(a))}la(){return Q(olympe.dc.Z.Ci)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.cc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ha(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})`);
962
+ this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new lm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new lm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class lm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.Zh()}}
963
+ P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ci);olympe.dc.Z.Ci.xa=[olympe.dc.Aa];olympe.dc.Z.ee=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.ee)}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.ea))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.ee);olympe.dc.Z.ee.xa=[olympe.dc.Aa];olympe.dc.Z.ze=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.ze)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Rb(c.some(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
964
+ ')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.ze);olympe.dc.Z.ze.xa=[olympe.dc.Aa];olympe.dc.Z.zf=class{constructor(a,b,c){this.source=a;this.J=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.zf)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.J,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.ea))}ga(a){const b=this.source.ga(a),c=em(a,this.J);a=em(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
965
+ ']}'}toString(){const a=dm(this.F);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.zf);olympe.dc.Z.zf.xa=[olympe.dc.Aa];olympe.dc.Z.tk=class extends olympe.dc.Z.fl{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.tk)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.tk);olympe.dc.mc={};olympe.dc.mc.Cj=class{constructor(){this.$=this.J=this.R=this.D=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.mc.Nj(this),this.R=c,this.J=b):this.J=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.$){const a=[];null!==this.J&&
966
+ (0<=this.D?mm(nm(this.J,this.D),a):a.push(this.R));this.$(a)}}mg(a){this.$=a}};olympe.dc.mc.Cj.xa=[olympe.dc.mc.Ta];function bm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.mc.Nj(a.j,a));return a.D}function nm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function mm(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.mc.Nj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}ke(){return this.j}eg(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class om extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.J=!1;this.F=null}}
967
+ function pm(a,b,c,d,e){const f=Object.create(null),g=a.fa,h=a.J;let k,l,n;a.ba=!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.J||(c.J=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.ba=!1;null!==a.D&&a.F()}
968
+ olympe.dc.mc.Xl=class{constructor(){this.J={};this.fa=[];this.D=null;this.ba=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(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.ba){var a=this.fa,b=a.length,c=this.J,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.$){var f=e,g=this.D;f.$=!0;f.F=nm(f,g)}null!==
969
+ e.F&&mm(e.F,this.R)}}this.$&&this.$(this.R)}}mg(a){this.$=a}j(a,b,c){let d=this.J[c];a?void 0===d?(d=new om(this,c,b),this.J[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.mc.Xl.xa=[olympe.dc.mc.Ta];olympe.dc.mc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}mg(){}};function qm(a,b){olympe.C.df(a.value)?(a.node=olympe.C.nn(a.value,b),Nb(a.node)||b()):b()}function rm(a,b){if(olympe.C.df(a.value)){const c=olympe.C.Xa(),d=a.J;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>qm(a,b)),olympe.C.Xa().destroy())})}}
970
+ class sm extends olympe.dc.mc.Nj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.J=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}hb(){return null===this.value}}
971
+ function tm(a,b){if(!b.hb()){var c=a.D;var d=a.fa,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].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=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()}}}
972
+ function um(a){const b=a.fa;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
973
+ olympe.dc.mc.hr=class{constructor(a){this.fa=a;this.J=null;this.D=[];this.R=[];this.$=null;this.ba=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new sm(this,c,d),this.ba.set(b,f),this.N()?qm(f,()=>tm(this,f)):(f.position=e.length,e.push(f));else{f=this.ba.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ba.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.J}Y(a){if(null!==this.J)throw Error('Manager already activated (depth='+
974
+ this.J+')');this.J=a;um(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;rm(d,()=>tm(this,d))}this.F()}F(){if(null===this.J)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.J;b.R=!0;b.F=nm(b,c)}0>this.J?this.R.push(e.Y):e.F&&mm(e.F,this.R)}this.$&&this.$(this.R)}mg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
975
+ c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.mc.hr.xa=[olympe.dc.mc.Ta];function Xl(a){if(!a.D){for(let b in a.F)vm(a.F[b]);a.D=!0}a.J=null;a.N=null}function $l(a,b,c){a.F[c||'root'].R=b}function am(a,b,c){a.F[c||'root'].eg(b)}function wm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=bh(a.db,b,c,d),e[f]=g);return g}function xm(a,b){a.D||a.j.eg(b)}function ym(a,b,c,d,e){if(!a.D){let f=wm(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=wm(a,c,d,olympe.dc.va.ORIGIN));0===f&&xm(a,b)}}
976
+ function zm(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 Am(a){const b=String(++a.R),c=a.j;a.F[b]=new Bm(b,c);Cm(c,b);c.J||(c.J=()=>zm(a,c.T()));return b}function Dm(a,b){const c=a.j;a.j.J=()=>{zm(a,c.T());b()}}function Em(a,b){vm(b?a.F[b]:a.j)}
977
+ olympe.dc.mc.jr=class{constructor(a,b){this.db=a;this.G=b||null;this.J=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Bm('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=wm(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Cm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function vm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
978
+ class Bm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.J=this.D=null;this.N=!1}T(){return this.id}eg(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&vm(this)}notify(a){const b=this.J,c=this.D;if(this.N)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Za={};function Fm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.mc.Cj,g=new olympe.dc.mc.jr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.td()||a.hb()||(h||($l(g,()=>{u.eg();Xl(g)}),u.ke().mg(l),h=!0),q?k[t]=r:delete k[t],am(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,bm(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ha(b)||Xl(g)}
979
+ function Gm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Ng(e,b,a.J,d.F(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Og(e,b,a.J,g))}
980
980
  olympe.dc.Za.ki=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Se||d instanceof olympe.dc.da.De)||null;this.D=c||null;this.defaultValue=null}la(){}Mb(){}F(){}j(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}jh(a){this.defaultValue=a;return this}bh(){return this.da}Xd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.cc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
981
- b=this.D||b;null!==this.da?Hm(a,b,this.da,d=>{Im(this,d,c)}):Im(this,b,c);return c.rb()}ga(a){const b=gm(a,this.J),c=gm(a,this.D);let d='null';this.da&&(d=this.da.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=fm(this.J),b=this.D?','+fm(this.D):'';let c='';this.da&&(c=','+this.da.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.ki.xa=[olympe.dc.yk];olympe.dc.Za.Mn=class{constructor(a,b){if(olympe.C.df(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.$g(e,olympe.dc.CloudObject.extendRel,olympe.dm.Be);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Si(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Ki(c,
982
- b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Dj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.ri(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.Mn.xa=[olympe.dc.yk];olympe.dc.Za.Dj=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Dj)}F(){return olympe.dc.mb.Pm}Mb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Dj);olympe.dc.Za.Oe=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Oe)}j(){return[]}getValue(){return this.value}ga(a){a=gm(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${fm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Oe);olympe.dc.Za.Oe.xa=[olympe.dc.yk];olympe.dc.Za.ri=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.ri)}F(){return olympe.dc.mb.Qm}Mb(){return olympe.C.fb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.ri);olympe.dc.Za.Ki=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Ki)}F(){return olympe.dc.mb.Rm}Mb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Ki);olympe.dc.Za.Si=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Si)}F(){return olympe.dc.mb.Sm}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Si);olympe.dc.Za.Ui=class{la(){return Q(olympe.dc.Za.Ui)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.Ui);olympe.dc.Za.Ui.xa=[olympe.dc.yk];olympe.dc.da={};olympe.dc.da.si=class{Mb(){return null}la(){return Q(olympe.dc.da.si)}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,dm(h,!0,f,f))):(d[f]++,zm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,dm(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.da.si);olympe.dc.da.si.xa=[olympe.dc.Bf];olympe.dc.da.pf=class{constructor(a){this.D=a}Mb(){return null}la(){return Q(olympe.dc.da.pf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&zm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,dm(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.ib(n)&&(n=n.Ba);olympe.C.Of(n)?(b.D||void 0!==olympe.C.Pa(n)||zm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
983
- d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.da.pf);olympe.dc.da.pf.xa=[olympe.dc.Bf,olympe.dc.wq];olympe.dc.da.Hl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ha(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ha(b),d||olympe.dc.va.DESTINATION)}Mb(){return Mf(this.D)}la(){return Q(olympe.dc.da.Hl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ja(),h=this.F.X(),k=this.F.Ja();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=dm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,dm(t,!1,z,A))};b.register(A,
984
- u,x,f,g);c(!0,z,A,K)},y.ns=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),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ns<y&&(y=ab.ns,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,Am(b,u,y,f,g),Am(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
985
- '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.da.Hl);olympe.dc.da.Hl.xa=[olympe.dc.Bf];olympe.dc.da.xh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}la(){return Q(olympe.dc.da.xh)}j(a,b,c){const d=new olympe.dc.mc.Xl;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]);rm(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Fm(b,k);const l=Cm(b);Bm(b,l);return(n,p,q,r)=>{h||(r.ke().lg(t=>{e=t;Gm(b,l)}),bm(b,()=>r.dg(),l),h=!0);d.j(n,p,q,null);cm(b,q,l)}}ga(a){return'{"c":"'+
986
- this.la()+'","a":['+gm(a,this.start)+','+gm(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.da.xh);olympe.dc.da.xh.xa=[olympe.dc.Bf];function Jm(a){return a.ob.map(b=>b.X())}
987
- olympe.dc.da.Xj=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.da.Xj)}Ja(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ja()+p+n,20);const q=dm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ja());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{Am(b,h,g,l.X(),l.Ja());e(g,h,k,l)}):this.ob.forEach(l=>
988
- {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Jm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ja()+'['+Jm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.da.Xj);olympe.dc.da.Xj.xa=[olympe.dc.Bf];olympe.dc.da.De=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.De)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.Ja(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.ab(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
989
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,dm(r,u,x,t)):Am(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.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)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.Ja()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ja()+this.X()+'['+this.F+'..'+this.D+'])'}};
990
- P('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.De);olympe.dc.da.De.xa=[olympe.dc.Bf];olympe.dc.da.Se=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.Se)}ac(){return new olympe.dc.da.Se(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ja();return(g,h,k,l)=>{Am(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=dm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
981
+ b=this.D||b;null!==this.da?Fm(a,b,this.da,d=>{Gm(this,d,c)}):Gm(this,b,c);return c.rb()}ga(a){const b=em(a,this.J),c=em(a,this.D);let d='null';this.da&&(d=this.da.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=dm(this.J),b=this.D?','+dm(this.D):'';let c='';this.da&&(c=','+this.da.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.ki.xa=[olympe.dc.yk];olympe.dc.Za.Mn=class{constructor(a,b){if(olympe.C.df(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.$g(e,olympe.dc.CloudObject.extendRel,olympe.dm.Be);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Si(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Ki(c,
982
+ b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Dj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.ri(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.Mn.xa=[olympe.dc.yk];olympe.dc.Za.Dj=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Dj)}F(){return olympe.dc.mb.Pm}Mb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Dj);olympe.dc.Za.Oe=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Oe)}j(){return[]}getValue(){return this.value}ga(a){a=em(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${dm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Oe);olympe.dc.Za.Oe.xa=[olympe.dc.yk];olympe.dc.Za.ri=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.ri)}F(){return olympe.dc.mb.Qm}Mb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.ri);olympe.dc.Za.Ki=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Ki)}F(){return olympe.dc.mb.Rm}Mb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Ki);olympe.dc.Za.Si=class extends olympe.dc.Za.ki{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Si)}F(){return olympe.dc.mb.Sm}Mb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Si);olympe.dc.Za.Ui=class{la(){return Q(olympe.dc.Za.Ui)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.Ui);olympe.dc.Za.Ui.xa=[olympe.dc.yk];olympe.dc.da={};olympe.dc.da.si=class{Mb(){return null}la(){return Q(olympe.dc.da.si)}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,bm(h,!0,f,f))):(d[f]++,xm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,bm(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.da.si);olympe.dc.da.si.xa=[olympe.dc.Bf];olympe.dc.da.pf=class{constructor(a){this.D=a}Mb(){return null}la(){return Q(olympe.dc.da.pf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&xm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,bm(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.ib(n)&&(n=n.Ba);olympe.C.Of(n)?(b.D||void 0!==olympe.C.Pa(n)||xm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
983
+ d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.da.pf);olympe.dc.da.pf.xa=[olympe.dc.Bf,olympe.dc.wq];olympe.dc.da.Hl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ha(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ha(b),d||olympe.dc.va.DESTINATION)}Mb(){return Mf(this.D)}la(){return Q(olympe.dc.da.Hl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ja(),h=this.F.X(),k=this.F.Ja();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=bm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,bm(t,!1,z,A))};b.register(A,
984
+ u,x,f,g);c(!0,z,A,K)},y.ns=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),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ns<y&&(y=ab.ns,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,ym(b,u,y,f,g),ym(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
985
+ '","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.da.Hl);olympe.dc.da.Hl.xa=[olympe.dc.Bf];olympe.dc.da.xh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}la(){return Q(olympe.dc.da.xh)}j(a,b,c){const d=new olympe.dc.mc.Xl;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]);pm(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Dm(b,k);const l=Am(b);zm(b,l);return(n,p,q,r)=>{h||(r.ke().mg(t=>{e=t;Em(b,l)}),$l(b,()=>r.eg(),l),h=!0);d.j(n,p,q,null);am(b,q,l)}}ga(a){return'{"c":"'+
986
+ this.la()+'","a":['+em(a,this.start)+','+em(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.da.xh);olympe.dc.da.xh.xa=[olympe.dc.Bf];function Hm(a){return a.ob.map(b=>b.X())}
987
+ olympe.dc.da.Xj=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.da.Xj)}Ja(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ja()+p+n,20);const q=bm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ja());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{ym(b,h,g,l.X(),l.Ja());e(g,h,k,l)}):this.ob.forEach(l=>
988
+ {d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Hm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ja()+'['+Hm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.da.Xj);olympe.dc.da.Xj.xa=[olympe.dc.Bf];olympe.dc.da.De=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.De)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.Ja(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
989
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,bm(r,u,x,t)):ym(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.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)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.Ja()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ja()+this.X()+'['+this.F+'..'+this.D+'])'}};
990
+ P('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.De);olympe.dc.da.De.xa=[olympe.dc.Bf];olympe.dc.da.Se=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Mb(){return Mf(this)}la(){return Q(olympe.dc.da.Se)}ac(){return new olympe.dc.da.Se(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ja();return(g,h,k,l)=>{ym(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=bm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
991
991
  this.la()+'","a":["'+this.X()+'","'+this.Ja()+'"]}'}toString(){return'Related('+this.Ja()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.da.Se);olympe.dc.da.Se.xa=[olympe.dc.Bf];olympe.dc.da.Pg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Mb(){return null}la(){return Q(olympe.dc.da.Pg)}Wg(){return this.Hb}F(){return[this.Hb.J()]}j(a,b,c){const d=new olympe.dc.mc.hr(a.F(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
992
- ')'}};P('olympe.dc.transformers.Sort',olympe.dc.da.Pg);olympe.dc.da.Pg.xa=[olympe.dc.Bf,olympe.dc.wq];function Km(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,dm(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.C.Sc([a.D],n=>{Lm(k,n,g,h);void 0===k.model(n)&&Zl(e)}))}function Lm(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Va().Y(()=>qf(a,e,d)))}
993
- olympe.dc.da.Cf=class{constructor(a,b){this.da=this.D=null;a instanceof olympe.dc.za?(this.D=a.Xd(),this.da=a.Rl()):(this.D=a,b&&(this.da=b))}Mb(){return null}la(){return Q(olympe.dc.da.Cf)||''}bh(){return this.da}Xd(){return this.D}j(a,b,c){const d=new olympe.dc.mc.Xl,e=new olympe.dc.mc.Cj;let f=[],g=[],h=!1,k=!1;const l=Cm(b),n=Cm(b);Fm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Gm(b);rm(d,p,0,p.length,c)});Bm(b,n);Km(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Va();u.rd()||
994
- u.eb()||(k||(t.ke().lg(x=>{g=x;Gm(b,n)}),bm(b,()=>t.dg(),n),k=!0),d.j(p,q,r),cm(b,r,n))});Bm(b,l);return(p,q,r,t)=>{h||(t.ke().lg(u=>{f=u;Gm(b,l)}),bm(b,()=>t.dg(),l),h=!0);d.j(p,q,r,l);cm(b,r,l)}}ga(a){const b=this.da?'['+this.da.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+gm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.ib(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
995
- P('olympe.dc.transformers.Union',olympe.dc.da.Cf);olympe.dc.da.Cf.xa=[olympe.dc.Bf];olympe.dc.da.Oq={WA:1,Tt:-1,St:0};olympe.dc.da.zC={Fz:!0,eA:!1};olympe.dc.lc.P={Jp:'dc.legacy.listdefProcessor'};olympe.dc.lc.U={Ip:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.lc.U.Ip,!1);D(a,olympe.dc.lc.P.Jp,olympe.dc.lc.Ku,olympe.dc.query.P.Ca,olympe.dc.P.oh,olympe.dc.transaction.P.Da,olympe.dc.query.P.gk,new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.dc.lc.U.Ip))});olympe.W.run([olympe.dc.lc.P.Jp],a=>{olympe.dc.lc.Px=()=>a});function Mm(a){const b=olympe.dc.ia(),c=new Map;b.bs(a).forEach(d=>{b.ab(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
992
+ ')'}};P('olympe.dc.transformers.Sort',olympe.dc.da.Pg);olympe.dc.da.Pg.xa=[olympe.dc.Bf,olympe.dc.wq];function Im(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,bm(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.C.Sc([a.D],n=>{Jm(k,n,g,h);void 0===k.model(n)&&Xl(e)}))}function Jm(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Y(()=>qf(a,e,d)))}
993
+ olympe.dc.da.Cf=class{constructor(a,b){this.da=this.D=null;a instanceof olympe.dc.za?(this.D=a.Xd(),this.da=a.Rl()):(this.D=a,b&&(this.da=b))}Mb(){return null}la(){return Q(olympe.dc.da.Cf)||''}bh(){return this.da}Xd(){return this.D}j(a,b,c){const d=new olympe.dc.mc.Xl,e=new olympe.dc.mc.Cj;let f=[],g=[],h=!1,k=!1;const l=Am(b),n=Am(b);Dm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Em(b);pm(d,p,0,p.length,c)});zm(b,n);Im(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.td()||
994
+ u.hb()||(k||(t.ke().mg(x=>{g=x;Em(b,n)}),$l(b,()=>t.eg(),n),k=!0),d.j(p,q,r),am(b,r,n))});zm(b,l);return(p,q,r,t)=>{h||(t.ke().mg(u=>{f=u;Em(b,l)}),$l(b,()=>t.eg(),l),h=!0);d.j(p,q,r,l);am(b,r,l)}}ga(a){const b=this.da?'['+this.da.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+em(a,this.D)+','+b+']}'}toString(){const a=olympe.C.ib(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
995
+ P('olympe.dc.transformers.Union',olympe.dc.da.Cf);olympe.dc.da.Cf.xa=[olympe.dc.Bf];olympe.dc.da.Oq={WA:1,Tt:-1,St:0};olympe.dc.da.zC={Fz:!0,eA:!1};olympe.dc.lc.P={Jp:'dc.legacy.listdefProcessor'};olympe.dc.lc.U={Ip:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.lc.U.Ip,!1);D(a,olympe.dc.lc.P.Jp,olympe.dc.lc.Ku,olympe.dc.query.P.Ca,olympe.dc.P.oh,olympe.dc.transaction.P.Da,olympe.dc.query.P.gk,new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.dc.lc.U.Ip))});olympe.W.run([olympe.dc.lc.P.Jp],a=>{olympe.dc.lc.Px=()=>a});function Km(a){const b=olympe.dc.ia(),c=new Map;b.bs(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
996
996
  olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static Pc(a,b,c,...d){b=olympe.dc.ha(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.es();a=olympe.dc.ha(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.kq(a);c=c.instantiate(a,b.D);b.j.j.Ga([a]);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.ha(a))}static Tw(a,
997
- b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Mm(b||this));return e.has(k)?e.get(k):null},g=Bl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.gi(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ha(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.$a('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Dw(){return this.get(this)}static Rk(a){return olympe.dc.ma.Rk(a)}static Cb(){return olympe.dc.ia().ab(this,olympe.dc.CloudObject.propertyRel).map(a=>
998
- new olympe.dc.Ra.Property(a))}static Cd(){const a=olympe.dc.ia();return a.ab(this,olympe.dc.CloudObject.rj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.ab(this,olympe.dc.CloudObject.Sr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Rc(a){return olympe.dc.CloudObject.get(a)}static gs(a){var b=tf(olympe.dc.es(),olympe.dc.ha(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.ha(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||
997
+ b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Km(b||this));return e.has(k)?e.get(k):null},g=Al(!1),h=g.create(null!=b?b:this);void 0!==c&&h.gi(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ha(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Dw(){return this.get(this)}static Rk(a){return olympe.dc.ma.Rk(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
998
+ new olympe.dc.Ra.Property(a))}static Dd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.rj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Sr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Rc(a){return olympe.dc.CloudObject.get(a)}static gs(a){var b=tf(olympe.dc.es(),olympe.dc.ha(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.ha(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||
999
999
  (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}ef(){return this.db.ef(this)}sb(){return this.db.source(this)}Mx(){return this.db.ei(this)?olympe.dc.$d().fromModel(this):null}$r(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}bc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.D?a.D():a;return new rxjs.Observable(e=>
1000
1000
  {const f=olympe.dc.mb.Ac(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Ng(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Ac(h))});d.Y(()=>{e.complete();Og(this.db,this.tag,b,g)});return()=>Og(this.db,this.tag,b,g)})}Wy(a){const b='function'===typeof a.D?a.D():a;return new rxjs.Observable(c=>{const d=Pg(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.Y(()=>{c.complete();Qg(this.db,this.tag,d)});return()=>Qg(this.db,
1001
- this.tag,d)})}Xy(a){return this.observe(olympe.C.Va(),a)}get(a){return olympe.dc.mb.Ac(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}hb(a){return olympe.dc.ma.from(this).hb(a)}hg(a){return olympe.dc.ld.from(this).hb(a)}Ac(){return this}wx(){return this.Qc(olympe.dc.CloudObject.Pw,olympe.dc.CloudObject)}$m(){return this.ab(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Mf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=Ng(this.db,this.tag,a,olympe.C.Va().F(f=>{b&&null!==f&&void 0!==f&&
1002
- (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Og(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Mf(a,olympe.dc.mb.Sm,olympe.C.Sa))}qd(a){return M(this.Mf(a,olympe.dc.mb.Rm,olympe.C.aa))}Zg(a){return M(this.Mf(a,olympe.dc.mb.Pm,olympe.C.ea))}lj(a){return M(this.Mf(a,olympe.dc.mb.Qm,olympe.C.fb))}ls(){return M(this.Mf(olympe.dm.Color.valueProp,olympe.dc.mb.Kr,olympe.C.Color))}ms(){return M(this.Mf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.mb.Lr,
1003
- olympe.dc.CloudObject))}ab(a,b){a=a instanceof olympe.dc.da.Se?a:new olympe.dc.da.Se(a.X(),a.Ja());return new olympe.dc.za(this.X(),a,b)}Qc(a,b){return this.ab(a,b).Gc()}Vr(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Va(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}yz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
1001
+ this.tag,d)})}Xy(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Ac(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}gb(a){return olympe.dc.ma.from(this).gb(a)}ig(a){return olympe.dc.nd.from(this).gb(a)}Ac(){return this}wx(){return this.Qc(olympe.dc.CloudObject.Pw,olympe.dc.CloudObject)}$m(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Mf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=Ng(this.db,this.tag,a,olympe.C.Xa().F(f=>{b&&null!==f&&void 0!==f&&
1002
+ (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Og(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Mf(a,olympe.dc.mb.Sm,olympe.C.Sa))}sd(a){return M(this.Mf(a,olympe.dc.mb.Rm,olympe.C.aa))}Zg(a){return M(this.Mf(a,olympe.dc.mb.Pm,olympe.C.ea))}lj(a){return M(this.Mf(a,olympe.dc.mb.Qm,olympe.C.eb))}ls(){return M(this.Mf(olympe.dm.Color.valueProp,olympe.dc.mb.Kr,olympe.C.Color))}ms(){return M(this.Mf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.mb.Lr,
1003
+ olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Se?a:new olympe.dc.da.Se(a.X(),a.Ja());return new olympe.dc.za(this.X(),a,b)}Qc(a,b){return this.bb(a,b).Gc()}Vr(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Xa(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}yz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
1004
1004
  [],this.constructor)).transform(...a)}Uc(){return this.$r()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ha(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ha(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Ac(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
1005
- 'function'===typeof a?olympe.dc.na.bc(a)===this.X():!1}Ed(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ww(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Xa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of $g(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.ic(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
1006
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.hg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.hb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Xy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Wy;
1005
+ 'function'===typeof a?olympe.dc.na.bc(a)===this.X():!1}Fd(a){return olympe.C.ta([a],b=>olympe.C.Rb(this.Ea(b)),olympe.C.ea)}Ww(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of $g(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.ic(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
1006
+ olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ig;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Xy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Wy;
1007
1007
  olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.bc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.ef;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;
1008
- olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.gs;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Rc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Cd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Rk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Dw;
1008
+ olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.gs;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Rc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Dd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Rk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Dw;
1009
1009
  olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Tw;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.LE=olympe.dc.CloudObject.O.ka(olympe.dc.Cp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
1010
1010
  olympe.dc.CloudObject.wE=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.rj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Sr=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.fE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.WD=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');
1011
1011
  B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Yc);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
1012
1012
  olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.ti);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Gj);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
1013
1013
  olympe.dc.CloudObject.Pw=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Vw=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Vw);olympe.dc.BC=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Qe];m=olympe.dc.CloudObject.prototype;m.X.K=new olympe.C.H(()=>String,[]);m.name.K=new olympe.C.H(()=>String,[]);m.la.K=olympe.C.H.D;m.Vb.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1014
- m.sb.K=new olympe.C.H(()=>String,[]);m.Mx.K=new olympe.C.H(()=>String,[]);m.$r.K=olympe.C.H.D;m.bc.K=new olympe.C.H(()=>String,[]);m.wx.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.$m.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Mf.K=new olympe.C.H(()=>olympe.C.Node,[]);m.wb.K=olympe.C.H.D;m.qd.K=olympe.C.H.F;m.Zg.K=olympe.C.H.N;m.lj.K=new olympe.C.H(()=>olympe.C.fb,[]);m.ls.K=new olympe.C.H(()=>olympe.C.Color,[]);m.ms.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1015
- m.ab.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Qc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Vr.K=new olympe.C.H(()=>Function,[]);m.yz.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Ed.K=olympe.C.H.N;m.Ww.K=new olympe.C.H(()=>{},[]);olympe.dc.P={oh:'dc.DBView',xp:'dc.InstanceManager',Ca:'dc.Logger',Zv:'dc.TransactionLogger',Oj:'dc.FileServiceManager',Jg:'dc.Router'};olympe.dc.U={Mg:'dc.tag',Uf:'dc.debug',Ih:'dc.subscribeAll',Al:'dc.defaultSource',Po:'dc.fileCache',ro:'dc.dataConsumerOnly',Ko:'dc.errorOnAbstractInstantiation'};
1016
- olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Uf,!1);F(a,olympe.dc.U.Ih,!1);F(a,olympe.dc.U.Al,olympe.dc.Ka.SERVER);F(a,olympe.dc.U.ro,b);F(a,olympe.dc.U.Po,b);F(a,olympe.dc.U.Ko,!0);F(a,olympe.dc.U.Mg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.Zv,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.oh,olympe.dc.db.P.xl);D(a,olympe.dc.P.Oj,olympe.dc.Gt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Jg,olympe.V.P.pg,new olympe.W.pa(olympe.dc.U.Po));
1017
- D(a,olympe.dc.P.Jg,olympe.dc.Av,olympe.dc.P.Ca,olympe.dc.sources.P.Fq,olympe.dc.sources.P.Yq,olympe.dc.P.oh,olympe.host.P.Re,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.ro));D(a,olympe.dc.P.xp,olympe.dc.$t,olympe.dc.db.P.Il,olympe.dc.db.P.Da,olympe.W.P.rg)},'olympe.dc');
1014
+ m.sb.K=new olympe.C.H(()=>String,[]);m.Mx.K=new olympe.C.H(()=>String,[]);m.$r.K=olympe.C.H.D;m.bc.K=new olympe.C.H(()=>String,[]);m.wx.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.$m.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Mf.K=new olympe.C.H(()=>olympe.C.Node,[]);m.wb.K=olympe.C.H.D;m.sd.K=olympe.C.H.F;m.Zg.K=olympe.C.H.N;m.lj.K=new olympe.C.H(()=>olympe.C.eb,[]);m.ls.K=new olympe.C.H(()=>olympe.C.Color,[]);m.ms.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1015
+ m.bb.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Qc.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Vr.K=new olympe.C.H(()=>Function,[]);m.yz.K=new olympe.C.H(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.H.D;m.toString.K=olympe.C.H.j;m.Ea.K=olympe.C.H.j;m.Fd.K=olympe.C.H.N;m.Ww.K=new olympe.C.H(()=>{},[]);olympe.dc.P={oh:'dc.DBView',xp:'dc.InstanceManager',Ca:'dc.Logger',Zv:'dc.TransactionLogger',Oj:'dc.FileServiceManager',Jg:'dc.Router'};olympe.dc.U={Mg:'dc.tag',Uf:'dc.debug',Ih:'dc.subscribeAll',Al:'dc.defaultSource',Po:'dc.fileCache',ro:'dc.dataConsumerOnly',Ko:'dc.errorOnAbstractInstantiation'};
1016
+ olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Uf,!1);F(a,olympe.dc.U.Ih,!1);F(a,olympe.dc.U.Al,olympe.dc.Ka.SERVER);F(a,olympe.dc.U.ro,b);F(a,olympe.dc.U.Po,b);F(a,olympe.dc.U.Ko,!0);F(a,olympe.dc.U.Mg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.Zv,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.oh,olympe.dc.db.P.xl);D(a,olympe.dc.P.Oj,olympe.dc.Gt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Jg,olympe.V.P.qg,new olympe.W.pa(olympe.dc.U.Po));
1017
+ D(a,olympe.dc.P.Jg,olympe.dc.Av,olympe.dc.P.Ca,olympe.dc.sources.P.Fq,olympe.dc.sources.P.Yq,olympe.dc.P.oh,olympe.host.P.Re,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.ro));D(a,olympe.dc.P.xp,olympe.dc.$t,olympe.dc.db.P.Il,olympe.dc.db.P.Da,olympe.W.P.sg)},'olympe.dc');
1018
1018
  olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.xp,olympe.dc.P.Oj,new olympe.W.pa(olympe.dc.U.Mg)],(a,b,c,d,e)=>{olympe.dc.Yr=()=>a;olympe.dc.nj=()=>b;olympe.dc.es=()=>c;olympe.dc.cs=()=>d;olympe.dc.Ka.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Pd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ea.j}};olympe.dm.Pd.O=olympe.dc.na.j('ff021000000000000002',olympe.dm.Pd);olympe.dm.Pd.N=olympe.dm.Pd.O.ka('ff023000000000000035');olympe.dm.Pd.j=olympe.dm.Pd.O.sa('ff022000000000000005');olympe.dm.Pd.F=Jf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Pd.J=Jf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
1019
- olympe.dm.Pd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Pd.prototype.la.K=olympe.C.H.D;olympe.dm.Pd.prototype.j.K=olympe.C.H.D;olympe.dm.Pd.prototype.D.K=olympe.C.H.N;olympe.dm.el={NONE:0,iA:1,tt:2,jA:4,fA:8,hA:16,gA:31,GB:32,DB:64,HB:128,EB:256,$u:512,FB:992,XA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Jx(){return this.cn()}la(){return this.cn()}cn(){return this.wb(olympe.dm.User.loginProp)}ou(){return this.wb(olympe.dm.User.D)}nu(){return olympe.C.Sa.EMPTY}gy(){return this.wb(olympe.dm.User.saltProp)}py(){return this.wb(olympe.dm.User.verifierProp)}by(){return this.ab(olympe.dm.User.F,olympe.dm.Pd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
1019
+ olympe.dm.Pd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Pd.prototype.la.K=olympe.C.H.D;olympe.dm.Pd.prototype.j.K=olympe.C.H.D;olympe.dm.Pd.prototype.D.K=olympe.C.H.N;olympe.dm.el={NONE:0,iA:1,tt:2,jA:4,fA:8,hA:16,gA:31,GB:32,DB:64,HB:128,EB:256,$u:512,FB:992,XA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Jx(){return this.cn()}la(){return this.cn()}cn(){return this.wb(olympe.dm.User.loginProp)}ou(){return this.wb(olympe.dm.User.D)}nu(){return olympe.C.Sa.EMPTY}gy(){return this.wb(olympe.dm.User.saltProp)}py(){return this.wb(olympe.dm.User.verifierProp)}by(){return this.bb(olympe.dm.User.F,olympe.dm.Pd)}};olympe.dm.User.O=olympe.dc.na.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
1020
1020
  B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ka('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ka('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ka('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ka('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ka('ff023000000000000020');
1021
1021
  olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Pd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.J=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Jx.K=olympe.C.H.D;m.la.K=olympe.C.H.D;m.cn.K=olympe.C.H.D;m.ou.K=olympe.C.H.D;m.nu.K=olympe.C.H.D;m.gy.K=olympe.C.H.D;
1022
- m.py.K=olympe.C.H.D;m.by.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Xf=class extends olympe.dc.CloudObject{Y(){return this.$m()}Ga(){return this.wb(olympe.dm.Xf.ua)}};olympe.dm.Xf.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.Xf);olympe.dm.Xf.ua=olympe.dm.Xf.O.ka('01609de3f292e3c2c6ff');olympe.dm.Xf.prototype.Y.K=new olympe.C.H(()=>olympe.C.od,[]);olympe.dm.Xf.prototype.Ga.K=olympe.C.H.D;olympe.dm.BrickMetadata=class extends olympe.dm.Xf{qy(){return this.wb(olympe.dm.BrickMetadata.$b)}Hc(){return this.wb(olympe.dm.BrickMetadata.ba)}getType(){return this.wb(olympe.dm.BrickMetadata.Eb)}Cy(){return this.Zg(olympe.dm.BrickMetadata.Bb)}oe(){return null}tx(){return this.ab(olympe.sc.ui.Ow.Comment.ZD.ac(),olympe.sc.ui.Ow.Comment)}Lk(){return this.hg(olympe.dm.BrickMetadata.Ga).Fc().Lk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1022
+ m.py.K=olympe.C.H.D;m.by.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Xf=class extends olympe.dc.CloudObject{Y(){return this.$m()}Ga(){return this.wb(olympe.dm.Xf.ua)}};olympe.dm.Xf.O=olympe.dc.na.j('01621fb84e3300000000',olympe.dm.Xf);olympe.dm.Xf.ua=olympe.dm.Xf.O.ka('01609de3f292e3c2c6ff');olympe.dm.Xf.prototype.Y.K=new olympe.C.H(()=>olympe.C.qd,[]);olympe.dm.Xf.prototype.Ga.K=olympe.C.H.D;olympe.dm.BrickMetadata=class extends olympe.dm.Xf{qy(){return this.wb(olympe.dm.BrickMetadata.$b)}Hc(){return this.wb(olympe.dm.BrickMetadata.ba)}getType(){return this.wb(olympe.dm.BrickMetadata.Eb)}Cy(){return this.Zg(olympe.dm.BrickMetadata.Bb)}oe(){return null}tx(){return this.bb(olympe.sc.ui.Ow.Comment.ZD.ac(),olympe.sc.ui.Ow.Comment)}Lk(){return this.ig(olympe.dm.BrickMetadata.Ga).Fc().Lk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.na.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
1023
1023
  olympe.dm.BrickMetadata.$b=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.ba=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Eb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Bb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.$c={PB:'private',RB:'public'};
1024
- olympe.dm.BrickMetadata.Tb={qA:'experimental',gC:'stable',dA:'deprecated'};olympe.dm.BrickMetadata.Kc={Rz:'business',CC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.qy.K=olympe.C.H.D;m.Hc.K=olympe.C.H.D;m.getType.K=olympe.C.H.D;m.Cy.K=olympe.C.H.N;m.oe.K=new olympe.C.H(()=>String,[]);m.tx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Lk.K=olympe.C.H.R;function bj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.vh.hv}${b}`)}
1025
- function tj(a,b){const c=a.query().hb(olympe.dm.vd.j.ac()).hb(olympe.dm.vd.D);a=a.query().hb(olympe.dm.jb.D.ac()).gg(olympe.dm.jb.F,!0).hb(olympe.sc.yc.j.ac());const d=e=>e.he().gg(olympe.dc.CloudObject.extendRel,!0).hb(olympe.dc.CloudObject.rj,!0).hb(olympe.dm.Relation.destinationModelRel).back(2).hb(olympe.dc.CloudObject.propertyRel,!0).hb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1026
- function Sj(a,b){return a.observe(b,olympe.dm.DataSource.Mr).pipe(rxjs.operators.map(()=>a.If(olympe.dc.sources.U.Ne)),rxjs.operators.distinctUntilChanged())}
1024
+ olympe.dm.BrickMetadata.Tb={qA:'experimental',gC:'stable',dA:'deprecated'};olympe.dm.BrickMetadata.Kc={Rz:'business',CC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.qy.K=olympe.C.H.D;m.Hc.K=olympe.C.H.D;m.getType.K=olympe.C.H.D;m.Cy.K=olympe.C.H.N;m.oe.K=new olympe.C.H(()=>String,[]);m.tx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Lk.K=olympe.C.H.R;function aj(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.vh.hv}${b}`)}
1025
+ function sj(a,b){const c=a.query().gb(olympe.dm.wd.j.ac()).gb(olympe.dm.wd.D);a=a.query().gb(olympe.dm.jb.D.ac()).hg(olympe.dm.jb.F,!0).gb(olympe.sc.yc.j.ac());const d=e=>e.he().hg(olympe.dc.CloudObject.extendRel,!0).gb(olympe.dc.CloudObject.rj,!0).gb(olympe.dm.Relation.destinationModelRel).back(2).gb(olympe.dc.CloudObject.propertyRel,!0).gb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
1026
+ function Rj(a,b){return a.observe(b,olympe.dm.DataSource.Mr).pipe(rxjs.operators.map(()=>a.If(olympe.dc.sources.U.Ne)),rxjs.operators.distinctUntilChanged())}
1027
1027
  olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Pr=new Map([[olympe.dc.sources.U.jm,olympe.dm.DataSource.hz],[olympe.dc.sources.U.Ne,olympe.dm.DataSource.Mr],[olympe.dc.sources.U.sm,olympe.dm.DataSource.lz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ka.SERVER:this.tag}If(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
1028
- '_')}.${b}`))?d:bj(this.X(),a))?e:this.Pr.has(c)?this.get(this.Pr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.pc.wt,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Wb.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.ja.$a('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.bq;return e instanceof olympe.L.errors.wk||
1029
- e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.yd.gj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
1028
+ '_')}.${b}`))?d:aj(this.X(),a))?e:this.Pr.has(c)?this.get(this.Pr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.pc.wt,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Wb.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.ja.ab('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.bq;return e instanceof olympe.L.errors.wk||
1029
+ e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.zd.gj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
1030
1030
  })}deleteFileContent(){return w(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;
1031
1031
  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.If;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.Jg);
1032
1032
  olympe.dm.DataSource.Rh=olympe.dm.DataSource.O.ka('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Rh);olympe.dm.DataSource.bE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.hz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.Mr=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.Tr=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.lz=olympe.dm.DataSource.O.ka('ff023000000000000065');
1033
- olympe.dm.DataSource.sj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Ne={aB:'hybrid',Un:'bus',mp:'http'};olympe.dm.DataSource.pc={Fh:'ready',zb:'error',wt:'down',ee:'offline'};olympe.dm.vd=class extends olympe.dc.CloudObject{};olympe.dm.vd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.vd);olympe.dm.vd.j=olympe.dm.vd.O.sa('ff023000000000000071');olympe.dm.vd.D=olympe.dm.vd.O.sa('ff023000000000000072');olympe.dm.vd.F=olympe.dm.vd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.De(olympe.dm.Kb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.da.Oq.St,olympe.dc.da.Oq.Tt),olympe.dm.Kb.J])}oe(){return olympe.sc.qe.Ge.Ft}j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.ab(olympe.dm.Kb.J)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.fa=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1034
- olympe.dm.Kb.J=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.J);olympe.dm.Kb.prototype.J.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Nc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Nc.$?this.ab(olympe.dm.Nc.N,olympe.dm.Kb):this.ab(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.sa('017e9c34cf48bd6965c1');olympe.dm.Nc.N=olympe.dm.Nc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Nc.Yh=olympe.dm.Nc.O.sa('01811f12ad77673770d4');olympe.dm.Nc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Nc.rc=Jf('10000000000000000001','OLYMPE_FOLDER');
1035
- olympe.dm.Nc.Ub=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Nc.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Ix(){return this.wb(olympe.dm.Module.N)}Tx(){return this.qd(olympe.dm.Module.R)}pu(){return this.wb(olympe.dm.Module.D)}Xx(){return this.wb(olympe.dm.Module.Y)}ux(){return this.wb(olympe.dm.Module.F)}Ux(){return this.ab(olympe.dm.Module.J,olympe.dm.Module)}hy(){return this.ab(olympe.dm.Module.j,olympe.dm.Kd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1033
+ olympe.dm.DataSource.sj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Ne={aB:'hybrid',Un:'bus',mp:'http'};olympe.dm.DataSource.pc={Fh:'ready',zb:'error',wt:'down',ye:'offline'};olympe.dm.wd=class extends olympe.dc.CloudObject{};olympe.dm.wd.O=olympe.dc.na.j('ff021000000000000070',olympe.dm.wd);olympe.dm.wd.j=olympe.dm.wd.O.sa('ff023000000000000071');olympe.dm.wd.D=olympe.dm.wd.O.sa('ff023000000000000072');olympe.dm.wd.F=olympe.dm.wd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.De(olympe.dm.Kb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.da.Oq.St,olympe.dc.da.Oq.Tt),olympe.dm.Kb.J])}oe(){return olympe.sc.qe.Ge.Ft}j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.bb(olympe.dm.Kb.J)}};olympe.dm.Kb.O=olympe.dc.na.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.fa=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
1034
+ olympe.dm.Kb.J=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.J);olympe.dm.Kb.prototype.J.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Nc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Nc.$?this.bb(olympe.dm.Nc.N,olympe.dm.Kb):this.bb(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.sa('017e9c34cf48bd6965c1');olympe.dm.Nc.N=olympe.dm.Nc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Nc.Yh=olympe.dm.Nc.O.sa('01811f12ad77673770d4');olympe.dm.Nc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Nc.rc=Jf('10000000000000000001','OLYMPE_FOLDER');
1035
+ olympe.dm.Nc.Ub=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Nc.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Ix(){return this.wb(olympe.dm.Module.N)}Tx(){return this.sd(olympe.dm.Module.R)}pu(){return this.wb(olympe.dm.Module.D)}Xx(){return this.wb(olympe.dm.Module.Y)}ux(){return this.wb(olympe.dm.Module.F)}Ux(){return this.bb(olympe.dm.Module.J,olympe.dm.Module)}hy(){return this.bb(olympe.dm.Module.j,olympe.dm.Kd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
1036
1036
  olympe.dm.Module.R=olympe.dm.Module.O.ka('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ka('ff023000000000000044');olympe.dm.Module.Y=olympe.dm.Module.O.ka('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ka('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ka('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.sa('ff022000000000000013');olympe.dm.Module.J=olympe.dm.Module.O.sa('ff022000000000000014');
1037
- olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Ix.K=olympe.C.H.D;m.Tx.K=olympe.C.H.F;m.pu.K=olympe.C.H.D;m.Xx.K=olympe.C.H.D;m.ux.K=olympe.C.H.D;m.Ux.K=new olympe.C.H(()=>olympe.dc.za,[]);m.hy.K=new olympe.C.H(()=>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.$d().fromModel(a);a=b.create(a,f).gi(g);b=olympe.C.fb.now();Y(Y(Y(Y(Y(Y(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.j,!1);return a.X()}constructor(a,b,c,d,e){super(a,
1038
- b);this.j=c;this.F=d;this.D=e}hs(){return this.wb(olympe.dm.File.mimeTypeProp)}Hk(a,b){void 0===a&&void 0===b||olympe.ja.$a('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Va().F(a),d=b&&olympe.C.Va().F(e=>null==b?void 0:b(`${e}`));return this.j.J(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;})}Zm(a,b){void 0===a&&
1039
- void 0===b||olympe.ja.$a('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Va().F(a),d=b&&olympe.C.Va().F(e=>null==b?void 0:b(`${e}`));return this.Hk().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Ik(a,b){void 0===a&&void 0===b||olympe.ja.$a('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Va().F(a),
1040
- d=b&&olympe.C.Va().F(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.J(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.X()}`;null==d||
1041
- d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Va().F(b);olympe.C.zs([a],d=>{const e=new olympe.dc.Xa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}Ds(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.Ds(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.J(this.get(olympe.dm.File.mimeTypeProp))}Fp(){return this.wb(olympe.dm.File.urlProp)}Ep(){return this.wb(olympe.dm.File.fileNameProp)}yx(){return this.lj(olympe.dm.File.creationDateProp)}Sx(){return this.lj(olympe.dm.File.modificationDateProp)}By(){return this.Zg(olympe.dm.File.j)}};
1042
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ds;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Ik;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Zm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Hk;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Oj,olympe.net.P.Da,olympe.V.P.pg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1037
+ olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Ix.K=olympe.C.H.D;m.Tx.K=olympe.C.H.F;m.pu.K=olympe.C.H.D;m.Xx.K=olympe.C.H.D;m.ux.K=olympe.C.H.D;m.Ux.K=new olympe.C.H(()=>olympe.dc.za,[]);m.hy.K=new olympe.C.H(()=>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.$d().fromModel(a);a=b.create(a,f).gi(g);b=olympe.C.eb.now();Y(Y(Y(Y(Y(Y(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.j,!1);return a.X()}constructor(a,b,c,d,e){super(a,
1038
+ b);this.j=c;this.F=d;this.D=e}hs(){return this.wb(olympe.dm.File.mimeTypeProp)}Hk(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),d=b&&olympe.C.Xa().F(e=>null==b?void 0:b(`${e}`));return this.j.J(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;})}Zm(a,b){void 0===a&&
1039
+ void 0===b||olympe.ja.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),d=b&&olympe.C.Xa().F(e=>null==b?void 0:b(`${e}`));return this.Hk().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Ik(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().F(a),
1040
+ d=b&&olympe.C.Xa().F(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.J(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.X()}`;null==d||
1041
+ d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Xa().F(b);olympe.C.zs([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}Ds(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.Ds(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.J(this.get(olympe.dm.File.mimeTypeProp))}Fp(){return this.wb(olympe.dm.File.urlProp)}Ep(){return this.wb(olympe.dm.File.fileNameProp)}yx(){return this.lj(olympe.dm.File.creationDateProp)}Sx(){return this.lj(olympe.dm.File.modificationDateProp)}By(){return this.Zg(olympe.dm.File.j)}};
1042
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ds;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Ik;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Zm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Hk;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Oj,olympe.net.P.Da,olympe.V.P.qg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
1043
1043
  olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
1044
1044
  B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.hs.K=olympe.C.H.D;m.Hk.K=olympe.C.H.j;m.Zm.K=olympe.C.H.j;m.Ik.K=olympe.C.H.j;m.rename.K=olympe.C.H.j;
1045
- m.Fp.K=olympe.C.H.D;m.Ep.K=olympe.C.H.D;m.yx.K=new olympe.C.H(()=>olympe.C.fb,[]);m.Sx.K=new olympe.C.H(()=>olympe.C.fb,[]);m.By.K=olympe.C.H.N;olympe.dm.Kd=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Kd.D)}F(){return this.qd(olympe.dm.Kd.F)}D(){return this.ab(olympe.dm.Kd.j,olympe.dm.Module)}};olympe.dm.Kd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Kd);olympe.dm.Kd.D=olympe.dm.Kd.O.ka('ff023000000000000047');olympe.dm.Kd.F=olympe.dm.Kd.O.ka('ff023000000000000048');olympe.dm.Kd.j=olympe.dm.Module.j.ac();olympe.dm.Kd.prototype.j.K=olympe.C.H.D;olympe.dm.Kd.prototype.F.K=olympe.C.H.F;
1046
- olympe.dm.Kd.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb=class extends olympe.dm.Nc{j(){return this.ab(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.jb.Y)}R(){return this.wb(olympe.dm.jb.gb)}D(){return this.ab(olympe.dm.jb.F,olympe.dm.jb)}};olympe.dm.jb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.jb);olympe.dm.jb.Y=olympe.dm.jb.O.ka('017869c7d2833c9492c1');olympe.dm.jb.us=olympe.dm.jb.O.ka('017869c7d2833c9492c2');olympe.dm.jb.Vd=olympe.dm.jb.O.ka('017869c7d2833c9492c3');olympe.dm.jb.gb=olympe.dm.jb.O.ka('017869c80bb9929c76d0');
1047
- olympe.dm.jb.cb=olympe.dm.jb.O.sa('ff02200000000000002a');olympe.dm.jb.F=olympe.dm.jb.O.sa('ff02200000000000002b');olympe.dm.jb.Gf=R(olympe.dm.jb.O,olympe.dm.jb.F);olympe.dm.jb.D=olympe.dm.jb.O.sa('ff02200000000000002c');olympe.dm.jb.Wh=olympe.dm.jb.O.sa('017e9c412e2b944bc48f');olympe.dm.jb.Wd=olympe.dm.jb.O.sa('017e9c412e2b944bd590');olympe.dm.jb.ps=olympe.dm.jb.O.sa('017e9c416872a89d3415');olympe.dm.jb.Pk=olympe.dm.jb.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.jb.cb);
1048
- olympe.dm.jb.Ec=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.jb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb.prototype.F.K=olympe.C.H.D;olympe.dm.jb.prototype.R.K=olympe.C.H.D;olympe.dm.jb.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.hg(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Nr(this.la())}};olympe.dm.Property.O=olympe.dc.na.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
1049
- B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.H.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Ox(){return olympe.C.Sa.EMPTY}px(){return this.qd(olympe.dm.Relation.D)}Yx(){return this.qd(olympe.dm.Relation.F)}Zr(){return this.ab(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ks(){return this.ab(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ks().la().concat(['-',this.la(),'->',this.Zr().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1050
- olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.O.ka(olympe.dc.Lb.Bo);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Cc);olympe.dm.Relation.fa=olympe.dm.Relation.O.ka(olympe.dc.Lb.ag);olympe.dm.Relation.ua=olympe.dm.Relation.O.ka(olympe.dc.Lb.Mv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.xt);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ka(olympe.dc.Lb.hw);
1045
+ m.Fp.K=olympe.C.H.D;m.Ep.K=olympe.C.H.D;m.yx.K=new olympe.C.H(()=>olympe.C.eb,[]);m.Sx.K=new olympe.C.H(()=>olympe.C.eb,[]);m.By.K=olympe.C.H.N;olympe.dm.Kd=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Kd.D)}F(){return this.sd(olympe.dm.Kd.F)}D(){return this.bb(olympe.dm.Kd.j,olympe.dm.Module)}};olympe.dm.Kd.O=olympe.dc.na.j('ff021000000000000041',olympe.dm.Kd);olympe.dm.Kd.D=olympe.dm.Kd.O.ka('ff023000000000000047');olympe.dm.Kd.F=olympe.dm.Kd.O.ka('ff023000000000000048');olympe.dm.Kd.j=olympe.dm.Module.j.ac();olympe.dm.Kd.prototype.j.K=olympe.C.H.D;olympe.dm.Kd.prototype.F.K=olympe.C.H.F;
1046
+ olympe.dm.Kd.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb=class extends olympe.dm.Nc{j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.jb.Y)}R(){return this.wb(olympe.dm.jb.fb)}D(){return this.bb(olympe.dm.jb.F,olympe.dm.jb)}};olympe.dm.jb.O=olympe.dc.na.j('0163d9594700fcf61e54',olympe.dm.jb);olympe.dm.jb.Y=olympe.dm.jb.O.ka('017869c7d2833c9492c1');olympe.dm.jb.us=olympe.dm.jb.O.ka('017869c7d2833c9492c2');olympe.dm.jb.Vd=olympe.dm.jb.O.ka('017869c7d2833c9492c3');olympe.dm.jb.fb=olympe.dm.jb.O.ka('017869c80bb9929c76d0');
1047
+ olympe.dm.jb.$a=olympe.dm.jb.O.sa('ff02200000000000002a');olympe.dm.jb.F=olympe.dm.jb.O.sa('ff02200000000000002b');olympe.dm.jb.Gf=R(olympe.dm.jb.O,olympe.dm.jb.F);olympe.dm.jb.D=olympe.dm.jb.O.sa('ff02200000000000002c');olympe.dm.jb.Wh=olympe.dm.jb.O.sa('017e9c412e2b944bc48f');olympe.dm.jb.Wd=olympe.dm.jb.O.sa('017e9c412e2b944bd590');olympe.dm.jb.ps=olympe.dm.jb.O.sa('017e9c416872a89d3415');olympe.dm.jb.Pk=olympe.dm.jb.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.jb.$a);
1048
+ olympe.dm.jb.Ec=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.jb.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.jb.prototype.F.K=olympe.C.H.D;olympe.dm.jb.prototype.R.K=olympe.C.H.D;olympe.dm.jb.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ig(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Nr(this.la())}};olympe.dm.Property.O=olympe.dc.na.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
1049
+ B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.H.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Ox(){return olympe.C.Sa.EMPTY}px(){return this.sd(olympe.dm.Relation.D)}Yx(){return this.sd(olympe.dm.Relation.F)}Zr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ks(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ks().la().concat(['-',this.la(),'->',this.Zr().la()])}};olympe.dm.Relation.O=olympe.dc.na.j('ff021000000000000006',olympe.dm.Relation);
1050
+ olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.O.ka(olympe.dc.Lb.Bo);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Cc);olympe.dm.Relation.fa=olympe.dm.Relation.O.ka(olympe.dc.Lb.bg);olympe.dm.Relation.ua=olympe.dm.Relation.O.ka(olympe.dc.Lb.Mv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.xt);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ka(olympe.dc.Lb.hw);
1051
1051
  olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.rj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Sr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={sp:0,Ws:5,wv:1,aC:4,rr:2,Jq:8,pA:10,XB:6,YB:9,Pe:6,$B:9};
1052
- olympe.dm.Relation.J={CB:3,Yu:4,oB:5,nB:6};olympe.dm.Relation.N=olympe.dm.el.$u+olympe.dm.el.tt;m=olympe.dm.Relation.prototype;m.Ox.K=olympe.C.H.D;m.px.K=olympe.C.H.F;m.Yx.K=olympe.C.H.F;m.Zr.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ks.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);function Nm(a){a=olympe.dc.ha(a);if(olympe.dc.ia().Nf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Be=class extends olympe.dc.CloudObject{getValue(){}};
1052
+ olympe.dm.Relation.J={CB:3,Yu:4,oB:5,nB:6};olympe.dm.Relation.N=olympe.dm.el.$u+olympe.dm.el.tt;m=olympe.dm.Relation.prototype;m.Ox.K=olympe.C.H.D;m.px.K=olympe.C.H.F;m.Yx.K=olympe.C.H.F;m.Zr.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ks.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);function Lm(a){a=olympe.dc.ha(a);if(olympe.dc.ia().Nf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Be=class extends olympe.dc.CloudObject{getValue(){}};
1053
1053
  olympe.dm.Be.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Be);olympe.dm.String=class extends olympe.dm.Be{getValue(){return this.wb(olympe.dm.String.valueProp)}Ac(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.na.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ka('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.H.D;
1054
- olympe.dm.String.prototype.toString.K=olympe.C.H.j;olympe.dm.Boolean=class extends olympe.dm.Be{getValue(){return this.Zg(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.H.N;olympe.dm.Color=class extends olympe.dm.Be{getValue(){return this.ls()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.H(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Be{getValue(){return this.lj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.H(()=>olympe.C.fb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Bd(){return this.qd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Bd.K=olympe.C.H.F;olympe.dm.Zf=class extends olympe.dm.BrickMetadata{oy(){return this.hb(olympe.dc.CloudObject.instancesRel).Zk(olympe.dm.Enum.rankProp,olympe.dc.query.dk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.Zf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Zf.create=olympe.dm.Zf.create;olympe.dm.Zf.prototype.getValues=olympe.dm.Zf.prototype.oy;olympe.dm.Zf.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.Zf);olympe.dm.Number=class extends olympe.dm.Be{getValue(){return this.qd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.H.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',lk:'sc.RootContext',Ee:'sc.Serializer'};olympe.sc.U={Me:'sc.app',Uf:'sc.debug',Gn:'sc.autostartProfiler',yo:'sc.debugger',ut:'sc.disableTheme',PRODUCTION:'sc.production',Zu:'sc.onstartTimeout',Eq:'sc.remoteActionTimeout'};
1055
- olympe.W.config(a=>{F(a,olympe.sc.U.Me,'');F(a,olympe.sc.U.Uf,!1);F(a,olympe.sc.U.ut,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Zu,2E4);F(a,olympe.sc.U.Eq,3E4);F(a,olympe.sc.U.Gn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ee,olympe.sc.ec,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ee,olympe.sc.P.Ee);E(a,olympe.sc.P.lk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.sg('root','root',null);olympe.sc.qn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1054
+ olympe.dm.String.prototype.toString.K=olympe.C.H.j;olympe.dm.Boolean=class extends olympe.dm.Be{getValue(){return this.Zg(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.H.N;olympe.dm.Color=class extends olympe.dm.Be{getValue(){return this.ls()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.H(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Be{getValue(){return this.lj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.H(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Cd(){return this.sd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Cd.K=olympe.C.H.F;olympe.dm.Zf=class extends olympe.dm.BrickMetadata{oy(){return this.gb(olympe.dc.CloudObject.instancesRel).Zk(olympe.dm.Enum.rankProp,olympe.dc.query.dk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.Zf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Zf.create=olympe.dm.Zf.create;olympe.dm.Zf.prototype.getValues=olympe.dm.Zf.prototype.oy;olympe.dm.Zf.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.Zf);olympe.dm.Number=class extends olympe.dm.Be{getValue(){return this.sd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.H.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',lk:'sc.RootContext',Ee:'sc.Serializer'};olympe.sc.U={Me:'sc.app',Uf:'sc.debug',Gn:'sc.autostartProfiler',yo:'sc.debugger',ut:'sc.disableTheme',PRODUCTION:'sc.production',Zu:'sc.onstartTimeout',Eq:'sc.remoteActionTimeout'};
1055
+ olympe.W.config(a=>{F(a,olympe.sc.U.Me,'');F(a,olympe.sc.U.Uf,!1);F(a,olympe.sc.U.ut,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Zu,2E4);F(a,olympe.sc.U.Eq,3E4);F(a,olympe.sc.U.Gn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ee,olympe.sc.ec,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ee,olympe.sc.P.Ee);E(a,olympe.sc.P.lk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.tg('root','root',null);olympe.sc.qn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
1056
1056
  'olympe.sc');olympe.W.run([olympe.sc.P.lk,new olympe.W.pa(olympe.L.U.ql)],(a,b)=>{olympe.Zd().ctx=a;olympe.Zd().oVersion=()=>b});olympe.sc.jn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.ac());olympe.sc.$D=(a,b,c,d)=>{c=Y(Y(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.X()};olympe.sc.cj=(a,b)=>{a=olympe.dc.mb.qx(b)(a);return a instanceof olympe.sc.Od?a.j():a};
1057
- olympe.sc.rE=function(a){const b=olympe.dc.CloudObject.containsRel.ac();var c=olympe.dc.ha(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Qb(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.$a('sc').warn(`Object ${c} has no container`),[];a.Qb(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.ac())||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.$g(e[0],
1057
+ olympe.sc.rE=function(a){const b=olympe.dc.CloudObject.containsRel.ac();var c=olympe.dc.ha(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Qb(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.ab('sc').warn(`Object ${c} has no container`),[];a.Qb(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.ac())||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.$g(e[0],
1058
1058
  olympe.dm.Kb.fa));e=e.concat(a.$g(e[e.length-1],olympe.dm.Nc.R.ac()));e=e.concat(a.$g(e[e.length-1],olympe.dm.Nc.N.ac()));return[...d,...e].reverse()};olympe.sc.sE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.zg:a.startsWith('video/')?olympe.sc.Mh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Lc:olympe.dm.File};
1059
- olympe.sc.qE=a=>a instanceof olympe.sc.zg?'image/*':a instanceof olympe.sc.Mh?'video/*':a instanceof olympe.sc.Lc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Om(a,b){var c=olympe.sc.ya,d=a.j;a=a.D();b=olympe.dc.ha(b);let e,f=null==(e=d.D)?void 0:e.get(b);if(!f){f=d.Uh(a,void 0,b);for(d=f.getParent();d&&d.fa&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Pm(g,b,f)}return new c(f)}function Qm(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
- olympe.sc.ya=class{constructor(a=olympe.sc.qn){this.j=a;this.G=olympe.ja.$a('sc');this.F=null}T(){return this.j.T()}getParent(){if(null===this.F){const a=this.j.getParent();this.F=null===a?null:new olympe.sc.ya(a)}return this.F}sx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.$e();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Qb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}$e(){return this.j.$e()}D(){return this.j.j}set(a,
1059
+ olympe.sc.qE=a=>a instanceof olympe.sc.zg?'image/*':a instanceof olympe.sc.Mh?'video/*':a instanceof olympe.sc.Lc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Mm(a,b){var c=olympe.sc.ya,d=a.j;a=a.D();b=olympe.dc.ha(b);let e,f=null==(e=d.D)?void 0:e.get(b);if(!f){f=d.Uh(a,void 0,b);for(d=f.getParent();d&&d.fa&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Nm(g,b,f)}return new c(f)}function Om(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
1060
+ olympe.sc.ya=class{constructor(a=olympe.sc.qn){this.j=a;this.G=olympe.ja.ab('sc');this.F=null}T(){return this.j.T()}getParent(){if(null===this.F){const a=this.j.getParent();this.F=null===a?null:new olympe.sc.ya(a)}return this.F}sx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.$e();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Qb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}$e(){return this.j.$e()}D(){return this.j.j}set(a,
1061
1061
  b){this.j.set(a,b);return this}An(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.ha(a),e=olympe.C.cc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
1062
- d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Rm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.ih(a.unsubscribe.bind(a));return this}nz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Uh(`Runner ${a.name()}`);a.run(b);return b}Ls(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ha(a)})\``+
1063
- `on the context ${this.T()}:\nStack: ${this.le()}\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.ha(a)})\` `+`has never received any value:\nStack: ${this.le()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.le)?void 0:c.call(a))||this.le();let e,f;c=null!=(f=null==(e=a.Xr)?void 0:e.call(a))?f:0;b=Sm(b,c,d);b.stack=a.stack}else b=
1064
- Sm(b,0,this.le());Tm(this.j,b);return this}oz(a){this.set(olympe.sc.ya.j.rg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Uh(a){return new olympe.sc.ya(this.j.Uh(this.D(),a))}Wk(a,b){return this.j.Wk(a,c=>{b(new olympe.sc.ya(c))})}Wx(a){a=Um(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}ih(a,b){return this.j.ih(a,b)}Uk(a){this.j.Uk(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.D().onDestroy(a)}Qf(a){this.eb()||this.D().Qf(a)}clear(){this.j.clear()}eb(){return this.D().eb()}Qa(a){a=
1065
- Vm(this.j,a);return null!==a?new olympe.sc.ui.Xz(a,this):null}Hx(a){a=Vm(this.j,a);return null!==a?new olympe.sc.ui.Wz(a,this):null}Vy(...a){return rxjs.combineLatest(a.map(b=>{b=Vm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}le(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==olympe.sc.qn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.$e();return null!==
1066
- f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.Vy;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Hx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.eb;olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Qf;
1062
+ d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Pm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.ih(a.unsubscribe.bind(a));return this}nz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Uh(`Runner ${a.name()}`);a.run(b);return b}Ls(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ha(a)})\``+
1063
+ `on the context ${this.T()}:\nStack: ${this.le()}\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.ha(a)})\` `+`has never received any value:\nStack: ${this.le()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.le)?void 0:c.call(a))||this.le();let e,f;c=null!=(f=null==(e=a.Xr)?void 0:e.call(a))?f:0;b=Qm(b,c,d);b.stack=a.stack}else b=
1064
+ Qm(b,0,this.le());Rm(this.j,b);return this}oz(a){this.set(olympe.sc.ya.j.sg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Uh(a){return new olympe.sc.ya(this.j.Uh(this.D(),a))}Wk(a,b){return this.j.Wk(a,c=>{b(new olympe.sc.ya(c))})}Wx(a){a=Sm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}ih(a,b){return this.j.ih(a,b)}Uk(a){this.j.Uk(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.D().onDestroy(a)}Qf(a){this.hb()||this.D().Qf(a)}clear(){this.j.clear()}hb(){return this.D().hb()}Qa(a){a=
1065
+ Tm(this.j,a);return null!==a?new olympe.sc.ui.Xz(a,this):null}Hx(a){a=Tm(this.j,a);return null!==a?new olympe.sc.ui.Wz(a,this):null}Vy(...a){return rxjs.combineLatest(a.map(b=>{b=Tm(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}le(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==olympe.sc.qn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.$e();return null!==
1066
+ f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.Vy;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Hx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.hb;olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Qf;
1067
1067
  olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.Uk;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.ih;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.Wx;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.Wk;olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Uh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.oz;
1068
1068
  olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Ls;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.nz;olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.An;
1069
- olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.sx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',rg:'__htmlContainer',kA:'__dockableElement',En:'__appHasStarted'};olympe.sc.mw=class extends olympe.sc.ya{constructor(a){super(a);this.J=new olympe.C.Xb('SC Update Context',super.D());const b=a.ih(()=>{b&&a.Uk(b);this.J.destroy()})}D(){return this.J}ih(a,b){return this.D().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Wm=0;function Rm(a,b){b=olympe.dc.ha(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Tm(a,b){if(null===a.J)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ba){var c=Xm(olympe.dc.CloudObject.get(a.ba));null!==c&&Ym(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):Tm(a.J,b)}else Tm(a.J,b)}
1070
- function Um(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.J;a;){if(b===a.T()||a.R.has(b))return a;const c=Zm(a.D,b);if(c)return c;a=a.getParent()}return null}function $m(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{Xk:b,depth:c}),an(a,d=>{(-1===b.F||c<b.F)&&$m(d,b,c+1)}),a.onDestroy(()=>{bn(a,b.T())}));return b.T()}
1071
- function bn(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Xk:c,depth:d}=a.Ya.get(b);an(a,f=>{bn(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Vm(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1072
- function cn(a){a.j.Y(()=>{an(a,c=>c.destroy())});a.j.onDestroy(()=>{void 0!==a.Pa(olympe.sc.ya.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.J)){let d;null==(d=c.D)||d.delete(a.T());let e;0===(null==(e=c.D)?void 0:e.size)&&(c.D=null)}a.R.clear()});let b;null==(b=a.J)||dn(b,a)}
1073
- function Zm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.fa&&!c.id.startsWith('_')&&(a=Zm(c.D,b)))return a;return null}function en(a,b,...c){if(null!==a.Ya)for(const {Xk:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function fn(a,b){a.ba=olympe.dc.ha(b);a.fa=b.pd().jn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Pm(a,c,a))});a.$=b.j();en(a,olympe.sc.Ya.qc.j.INIT)}function gn(a){a.ua=!0;let b;null==(b=a.D)||b.forEach(c=>{gn(c)})}
1074
- function hn(a){a.ua=!1;let b;null==(b=a.D)||b.forEach(c=>{hn(c)})}function Ym(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function jn(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.D)||e.forEach(f=>{!f.ua&&f.data.has(b)||jn(f,b,c,d)})}function kn(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));Wm++;const e=Wm;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1075
- function Pm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});an(a,f=>{f.N.has(b)||Pm(f,b,c)});a.N.delete(b)}function an(a,b){let c;null==(c=a.D)||c.forEach(b)}function ln(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function mn(a){var b=olympe.sc.Ya.qc.D.wf;const c=[];if(null!==a.Ya)for(const {Xk:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),bn(a,d.T()))}function dn(a,b){null===a.D&&(a.D=new Map);a.D.set(b.id,b)}
1076
- olympe.sc.sg=class{constructor(a,b='no name',c=olympe.sc.qn){this.id=a;this.ad=b;this.R=new Set;this.J=c;this.j=new olympe.C.Xb('SC Context');this.data=new Map;this.ba=this.Y=this.D=this.F=null;this.fa=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.$a('sc');this.Ya=null;cn(this)}T(){return this.id}getParent(){return this.J}$e(){return this.ba}set(a,b){if(!this.j.rd()&&!this.j.eb()){const g=olympe.dc.ha(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1077
- (d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&en(this,olympe.sc.Ya.qc.j.Ng,a,b),f=Ym(this,a),this.N.add(c),jn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.j.eb()||this.j.rd())return()=>{};const e=Rm(this,a),f=c?olympe.dc.ha(c):
1078
- '*';a=kn(this,'@'+f+'.'+e,b);c=c?(c=Um(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Va().onDestroy(a);return a}has(a,b=!1){a='$'+Rm(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}Uh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.eb()||a.rd())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.sg(d,
1079
- b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Xk:f,depth:g})=>{(-1===f.F||g<f.F)&&$m(e,f,g+1)});return e}Wk(a,b){const c=Um(this,a);if(c)return b(c),()=>{};const d=kn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Rm(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.j.rd()||this.j.eb()||(en(this,olympe.sc.Ya.qc.j.Kj),this.j.destroy(),en(this,olympe.sc.Ya.qc.j.Sd))}ih(a,b){if(this.j.eb())a();
1080
- else return Wm++,b=null!=b?b:String(Wm),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}Uk(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.j.onDestroy(a)}clear(){if(!this.j.eb()){en(this,olympe.sc.Ya.qc.j.Ej);let a;null==(a=this.Y)||a.forEach(b=>b());en(this,olympe.sc.Ya.qc.j.Fj)}}eb(){return this.j.eb()}};olympe.sc.sg.prototype.getParent=olympe.sc.sg.prototype.getParent;olympe.sc.sg.j={Ol:'I#',fm:'O#',dB:'IO#'};function nn(a,b,c){return(c=c.$e())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.qc=class{constructor(a=-1){this.id=olympe.V.Hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.qc.j={INIT:'INIT',Ng:'SET',Ej:'CLEAR',Fj:'CLEARED',Kj:'DESTROY',Sd:'DESTROYED'};olympe.sc.Ya.qc.D={wf:'REMOTE',Eu:'LOCAL',$f:'PROFILER'};olympe.sc.Ud=class a{constructor(){this.D=this.J=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Bm(1E4);gb(this.j,b=>{mn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Ud.j.ev:c=this.F.get(e.f);b.ud(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Ud.j.fv:const h=f+c,k=(l,n,p=0)=>{ln(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.$e())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1081
- t])})};b.mn(h).then(()=>{const l=[];k(g,l,0);an(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Ud.j.Wt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.zv(h);$m(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.Ud.j.gv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Ud.j.Yf:void 0!==g&&(this.j.delete(g),mn(g))}}ba(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
1069
+ olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.sx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',sg:'__htmlContainer',kA:'__dockableElement',En:'__appHasStarted'};olympe.sc.mw=class extends olympe.sc.ya{constructor(a){super(a);this.J=new olympe.C.Xb('SC Update Context',super.D());const b=a.ih(()=>{b&&a.Uk(b);this.J.destroy()})}D(){return this.J}ih(a,b){return this.D().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Um=0;function Pm(a,b){b=olympe.dc.ha(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Rm(a,b){if(null===a.J)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ba){var c=Vm(olympe.dc.CloudObject.get(a.ba));null!==c&&Wm(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):Rm(a.J,b)}else Rm(a.J,b)}
1070
+ function Sm(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.J;a;){if(b===a.T()||a.R.has(b))return a;const c=Xm(a.D,b);if(c)return c;a=a.getParent()}return null}function Ym(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{Xk:b,depth:c}),Zm(a,d=>{(-1===b.F||c<b.F)&&Ym(d,b,c+1)}),a.onDestroy(()=>{$m(a,b.T())}));return b.T()}
1071
+ function $m(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Xk:c,depth:d}=a.Ya.get(b);Zm(a,f=>{$m(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Tm(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
1072
+ function an(a){a.j.Y(()=>{Zm(a,c=>c.destroy())});a.j.onDestroy(()=>{void 0!==a.Pa(olympe.sc.ya.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.J)){let d;null==(d=c.D)||d.delete(a.T());let e;0===(null==(e=c.D)?void 0:e.size)&&(c.D=null)}a.R.clear()});let b;null==(b=a.J)||bn(b,a)}
1073
+ function Xm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.fa&&!c.id.startsWith('_')&&(a=Xm(c.D,b)))return a;return null}function cn(a,b,...c){if(null!==a.Ya)for(const {Xk:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function dn(a,b){a.ba=olympe.dc.ha(b);a.fa=b.rd().jn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Nm(a,c,a))});a.$=b.j();cn(a,olympe.sc.Ya.qc.j.INIT)}function en(a){a.ua=!0;let b;null==(b=a.D)||b.forEach(c=>{en(c)})}
1074
+ function fn(a){a.ua=!1;let b;null==(b=a.D)||b.forEach(c=>{fn(c)})}function Wm(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function gn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.D)||e.forEach(f=>{!f.ua&&f.data.has(b)||gn(f,b,c,d)})}function hn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));Um++;const e=Um;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
1075
+ function Nm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Zm(a,f=>{f.N.has(b)||Nm(f,b,c)});a.N.delete(b)}function Zm(a,b){let c;null==(c=a.D)||c.forEach(b)}function jn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function kn(a){var b=olympe.sc.Ya.qc.D.wf;const c=[];if(null!==a.Ya)for(const {Xk:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),$m(a,d.T()))}function bn(a,b){null===a.D&&(a.D=new Map);a.D.set(b.id,b)}
1076
+ olympe.sc.tg=class{constructor(a,b='no name',c=olympe.sc.qn){this.id=a;this.ad=b;this.R=new Set;this.J=c;this.j=new olympe.C.Xb('SC Context');this.data=new Map;this.ba=this.Y=this.D=this.F=null;this.fa=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.ab('sc');this.Ya=null;an(this)}T(){return this.id}getParent(){return this.J}$e(){return this.ba}set(a,b){if(!this.j.td()&&!this.j.hb()){const g=olympe.dc.ha(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
1077
+ (d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&cn(this,olympe.sc.Ya.qc.j.Ng,a,b),f=Wm(this,a),this.N.add(c),gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.j.hb()||this.j.td())return()=>{};const e=Pm(this,a),f=c?olympe.dc.ha(c):
1078
+ '*';a=hn(this,'@'+f+'.'+e,b);c=c?(c=Sm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Pm(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Uh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.hb()||a.td())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.tg(d,
1079
+ b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Xk:f,depth:g})=>{(-1===f.F||g<f.F)&&Ym(e,f,g+1)});return e}Wk(a,b){const c=Sm(this,a);if(c)return b(c),()=>{};const d=hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Pm(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.j.td()||this.j.hb()||(cn(this,olympe.sc.Ya.qc.j.Kj),this.j.destroy(),cn(this,olympe.sc.Ya.qc.j.Sd))}ih(a,b){if(this.j.hb())a();
1080
+ else return Um++,b=null!=b?b:String(Um),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}Uk(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.j.onDestroy(a)}clear(){if(!this.j.hb()){cn(this,olympe.sc.Ya.qc.j.Ej);let a;null==(a=this.Y)||a.forEach(b=>b());cn(this,olympe.sc.Ya.qc.j.Fj)}}hb(){return this.j.hb()}};olympe.sc.tg.prototype.getParent=olympe.sc.tg.prototype.getParent;olympe.sc.tg.j={Ol:'I#',fm:'O#',dB:'IO#'};function ln(a,b,c){return(c=c.$e())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.qc=class{constructor(a=-1){this.id=olympe.V.Hf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.qc.j={INIT:'INIT',Ng:'SET',Ej:'CLEAR',Fj:'CLEARED',Kj:'DESTROY',Sd:'DESTROYED'};olympe.sc.Ya.qc.D={wf:'REMOTE',Eu:'LOCAL',ag:'PROFILER'};olympe.sc.Ud=class a{constructor(){this.D=this.J=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Bm(1E4);gb(this.j,b=>{kn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Ud.j.ev:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Ud.j.fv:const h=f+c,k=(l,n,p=0)=>{jn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.$e())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1081
+ t])})};b.mn(h).then(()=>{const l=[];k(g,l,0);Zm(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Ud.j.Wt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.zv(h);Ym(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Ud.j.gv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Ud.j.Yf:void 0!==g&&(this.j.delete(g),kn(g))}}ba(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
1082
1082
  c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Ud.j.vt){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.Hf(),f=new olympe.C.Xb(this.D,c.D()),this.J=new olympe.L.ub(this.D,f),this.J.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Ud.j.Ms,n:olympe.W.getParameter(olympe.sc.U.yo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
1083
- d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{an(h,l=>{if(null!==l.$e()){const n=olympe.dc.CloudObject.get(l.$e()).hg(olympe.sc.Runnable.J).Fc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Ud.j.xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.$a('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1084
- b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.bc();if(!c.Qb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).gg(olympe.dc.CloudObject.extendRel,!0).he().hb(olympe.dc.CloudObject.propertyRel).he().Fc();e=olympe.dc.ma.from(e).gg(olympe.dc.CloudObject.extendRel,!0).he().hb(olympe.dc.CloudObject.rj).he().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1085
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Ud.J='discovery_debug_id';olympe.sc.Ud.j={vt:0,Ms:1,ev:2,fv:3,Wt:4,xk:5,gv:6,Yf:7};olympe.sc.Ya.mB=class extends olympe.sc.Ya.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.qc.D.Eu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.qc.j.Ng){a=nn(c,Rm(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 on(a,b,c,d=new Map){for(var e=[];b;){const n=b.$e();if(!n)break;e.push(n);b=b.getParent()}mb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
1083
+ d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Zm(h,l=>{if(null!==l.$e()){const n=olympe.dc.CloudObject.get(l.$e()).ig(olympe.sc.Runnable.J).Fc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Ud.j.xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.ab('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
1084
+ b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.bc();if(!c.Qb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).hg(olympe.dc.CloudObject.extendRel,!0).he().gb(olympe.dc.CloudObject.propertyRel).he().Fc();e=olympe.dc.ma.from(e).hg(olympe.dc.CloudObject.extendRel,!0).he().gb(olympe.dc.CloudObject.rj).he().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1085
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Ud.J='discovery_debug_id';olympe.sc.Ud.j={vt:0,Ms:1,ev:2,fv:3,Wt:4,xk:5,gv:6,Yf:7};olympe.sc.Ya.mB=class extends olympe.sc.Ya.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.qc.D.Eu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.qc.j.Ng){a=ln(c,Pm(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function mn(a,b,c,d=new Map){for(var e=[];b;){const n=b.$e();if(!n)break;e.push(n);b=b.getParent()}mb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
1086
1086
  q)}}
1087
- olympe.sc.Ya.pv=class extends olympe.sc.Ya.qc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Ya.qc.D.$f}process(a,b,c,...d){var e=pn.Ol,f=pn.fm,g=pn.kv;const h=pn.INIT,k=pn.Ej,l=pn.Fj,n=pn.Kj,p=pn.Sd;c=pn.av;if(b===olympe.sc.Ya.qc.j.Ng){const [q,r]=d;b=(d=a.$e())?olympe.dc.ia().Qb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Qb(d,olympe.sc.ui.cC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Qb(q,olympe.sc.logic.vb),d=this.ia.Qb(q,olympe.sc.logic.Gb),
1088
- on(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Qb(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),on(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.qc.j.INIT?on(this,a,h):b===olympe.sc.Ya.qc.j.Ej?on(this,a,k):b===olympe.sc.Ya.qc.j.Fj?on(this,a,l):b===olympe.sc.Ya.qc.j.Kj?on(this,a,n):b===olympe.sc.Ya.qc.j.Sd&&on(this,a,p)}};
1089
- const pn={Ol:'input',fm:'output',kv:'prop',INIT:'init',Ej:'clear',Fj:'cleared',Kj:'destroy',Sd:'destroyed',av:'other'};olympe.sc.Ya.zv=class extends olympe.sc.Ya.qc{constructor(a){super(1);this.J=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.qc.D.wf}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.qc.j.Ng&&void 0!==d[0]&&null!==d[0]){const e=nn(c,Rm(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.Vb()instanceof olympe.sc.yc){const h=Pg(this.db,f,()=>{olympe.sc.Ud.D(this.J,
1090
- e,f)});this.j.set(e,()=>{Qg(this.db,f,h)})}olympe.sc.Ud.D(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{qu(){return this.qd(this.en())}ru(){return this.qd(this.fn())}Lk(){return new olympe.C.Zb(this.qd(this.en()),this.qd(this.fn()))}en(){}fn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.qu.K=olympe.C.H.F;m.ru.K=olympe.C.H.F;m.Lk.K=olympe.C.H.R;m.en.K=olympe.C.H.j;m.fn.K=olympe.C.H.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.gd.F)}j(){return this.wb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ka('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ka('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.H.D;olympe.sc.gd.prototype.j.K=olympe.C.H.D;olympe.sc.qe={};olympe.sc.qe.Ge={Ft:'folders',Dv:'screenflow',cw:'ui-design',ar:'software-intelligence',nh:'data-management',QB:'projects'};olympe.sc.xf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Bd(){return this.qd(olympe.sc.xf.D)}};olympe.sc.xf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.xf);olympe.sc.xf.D=olympe.sc.xf.O.ka('016d1bb681929c2cc3f1');olympe.sc.xf.j=olympe.sc.xf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.xf.j);olympe.sc.xf.prototype.Bd.K=olympe.C.H.F;olympe.sc.md=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.ar}j(){return this.ab(olympe.sc.md.j,olympe.sc.logic.Eh)}D(){return this.ab(olympe.sc.md.D,olympe.sc.logic.Gg)}};olympe.sc.md.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.md);olympe.sc.md.j=olympe.sc.md.O.sa('016ac4f59a2917fdef01');olympe.sc.md.D=olympe.sc.md.O.sa('016ac4f59a2917fdef02');olympe.sc.md.O.j=(a,b)=>Dl(a,b||'New function signature',olympe.sc.md,olympe.sc.logic.wd).X();
1091
- olympe.sc.md.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.md.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);function qn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function rn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Qb(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 sn(a){return rn(a,a.db.ab(a.tag,olympe.sc.Ua.F))}function tn(a){return rn(a,a.db.ab(a.tag,olympe.sc.Ua.D))}
1092
- olympe.sc.Ua=class extends olympe.dm.BrickMetadata{tu(a,b,c,d,e=!0){e||olympe.ja.$a('sc').error('parameter own= false ignored, investigate');return olympe.C.jh(M(this.Mf(a,olympe.dc.mb.cj,c)),d)}J(){return[]}F(){return rxjs.of([])}ey(){return this.ab(olympe.sc.Ua.N,olympe.sc.Runnable)}vx(){return this.ab(olympe.sc.Ua.R,olympe.sc.Runnable)}di(){return this.db.Qa(this,olympe.sc.Ua.$)}jn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.ac())}su(){return this.ab(olympe.sc.Ua.F,olympe.sc.logic.vb)}Gp(){return this.ab(olympe.sc.Ua.D,
1093
- olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.cb]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.gb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.cb=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
1094
- olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Ec=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.rc=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.tu.K=olympe.C.H.j;m.ey.K=new olympe.C.H(()=>olympe.dc.za,[]);m.vx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.di.K=olympe.C.H.j;m.jn.K=olympe.C.H.j;m.su.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Gp.K=new olympe.C.H(()=>olympe.dc.za,[]);function Xm(a){let b;return null!=(b=a.pd().N().map(olympe.dc.ha)[0])?b:null}function un(a){const b=new olympe.dc.Xa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.$a('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Va().onDestroy(()=>{const d=new olympe.dc.Xa;d.delete(c);d.nb()});return c}
1095
- function vn(a,b){fn(b.j,a);qn(a.pd(),b);const c=a.N(),d=wn(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(xn(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
1096
- function yn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.bc()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=zn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.eb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.mw(b.j);l.D().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
- function An(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{const k=Om(d,h);if(g){const l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&e?e.push(()=>l.run(k)):l.run(k)}else k.destroy()});e.forEach(g=>g());e=null;d.D().onDestroy(a.db.D.bind(a.db,b,c,f,!0))}function zn(a,b){return a.pd().J(b)}
1098
- function wn(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 xn(a,b,c,d){b=b.D();const e=Pg(a.db,a.tag,b.F((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Qg(a.db,a.tag,e)})}
1099
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.D().run(()=>{vn(this,a);this.init(a);a.ih(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));yn(this,a);this.D(a)})}pd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.pd();if(d.di())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),An(this,d,olympe.sc.Ua.N,a),this.ba()&&An(this,d,
1100
- olympe.sc.Ua.Y,a)}D(a){a.An(olympe.sc.Ua.gb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.pd().F(a)}onInit(){}onUpdate(){const a=this.bc(),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 sn(this.pd())}getOutputs(){return tn(this.pd())}F(){return[]}j(){return null}ba(){return!1}J(a,
1101
- b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.jh(a,d);return a}cb(a,b,c,d,e){olympe.C.pn([d],f=>{b.set(a,olympe.C.qs(f)?f.valueOf():f)});return this.J(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){xn(this,a,b,null)}R(a,b){xn(this,a,null,b)}gb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.ac(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.Vr(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return Bn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1102
- olympe.sc.Runnable.J=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.J);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.pd.K=new olympe.C.H(()=>olympe.sc.Ua,[]);
1103
- olympe.sc.Runnable.prototype.J.K=new olympe.C.H(()=>Object,[]);olympe.sc.Runnable.prototype.cb.K=olympe.C.H.j;function Cn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Od)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Od=class extends olympe.dc.CloudObject{D(){return this.db.ab(this,olympe.sc.Od.j)[0]}j(){const a=Cn(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.j().Ac()}toString(){const a=Cn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Od.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Od);
1104
- olympe.sc.Od.j=olympe.sc.Od.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Od.j);olympe.sc.Od.prototype.D.K=new olympe.C.H(()=>String,[]);olympe.sc.Od.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.Co=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Co.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Co);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Dl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Dn=null,En=null,Fn=[];
1105
- function Gn(a,b){Dn=a;const c=olympe.C.Va();return olympe.dc.ld.from(a).hb(olympe.sc.qa.Xc.j).hb(olympe.sc.hf.j.ac()).nb({Th:'__code-as-data__'}).then(d=>{let e;null==(e=Fn)||e.forEach(f=>f());Fn=null;En=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{di(c,d,h=>{h=f.ei(h)?h:f.model(h);return null!==h&&f.Qb(h,olympe.sc.yc)},{xn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.$a('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1106
- g()}))})}olympe.ja.$a('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.$a('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{Fn=null;throw d;})}function pf(){return null===Fn?Promise.resolve():new Promise(a=>{Fn.push(()=>a())})}olympe.sc.hf=class extends olympe.dc.CloudObject{};olympe.sc.hf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.hf);olympe.sc.hf.j=olympe.sc.hf.O.sa('017b3aa8fd1659291b92');
1087
+ olympe.sc.Ya.pv=class extends olympe.sc.Ya.qc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Ya.qc.D.ag}process(a,b,c,...d){var e=nn.Ol,f=nn.fm,g=nn.kv;const h=nn.INIT,k=nn.Ej,l=nn.Fj,n=nn.Kj,p=nn.Sd;c=nn.av;if(b===olympe.sc.Ya.qc.j.Ng){const [q,r]=d;b=(d=a.$e())?olympe.dc.ia().Qb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Qb(d,olympe.sc.ui.cC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Qb(q,olympe.sc.logic.vb),d=this.ia.Qb(q,olympe.sc.logic.Gb),
1088
+ mn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Qb(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),mn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.qc.j.INIT?mn(this,a,h):b===olympe.sc.Ya.qc.j.Ej?mn(this,a,k):b===olympe.sc.Ya.qc.j.Fj?mn(this,a,l):b===olympe.sc.Ya.qc.j.Kj?mn(this,a,n):b===olympe.sc.Ya.qc.j.Sd&&mn(this,a,p)}};
1089
+ const nn={Ol:'input',fm:'output',kv:'prop',INIT:'init',Ej:'clear',Fj:'cleared',Kj:'destroy',Sd:'destroyed',av:'other'};olympe.sc.Ya.zv=class extends olympe.sc.Ya.qc{constructor(a){super(1);this.J=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.qc.D.wf}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.qc.j.Ng&&void 0!==d[0]&&null!==d[0]){const e=ln(c,Pm(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.yc){const h=Pg(this.db,f,()=>{olympe.sc.Ud.D(this.J,
1090
+ e,f)});this.j.set(e,()=>{Qg(this.db,f,h)})}olympe.sc.Ud.D(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{qu(){return this.sd(this.en())}ru(){return this.sd(this.fn())}Lk(){return new olympe.C.Zb(this.sd(this.en()),this.sd(this.fn()))}en(){}fn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.qu.K=olympe.C.H.F;m.ru.K=olympe.C.H.F;m.Lk.K=olympe.C.H.R;m.en.K=olympe.C.H.j;m.fn.K=olympe.C.H.j;olympe.sc.gd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.gd.F)}j(){return this.wb(olympe.sc.gd.j)}};olympe.sc.gd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.gd);olympe.sc.gd.F=olympe.sc.gd.O.ka('01703376c4a81c0e9d91');olympe.sc.gd.j=olympe.sc.gd.O.ka('01703376c4a81c0e9d92');olympe.sc.gd.D=olympe.sc.gd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.gd.D);olympe.sc.gd.prototype.D.K=olympe.C.H.D;olympe.sc.gd.prototype.j.K=olympe.C.H.D;olympe.sc.qe={};olympe.sc.qe.Ge={Ft:'folders',Dv:'screenflow',cw:'ui-design',ar:'software-intelligence',nh:'data-management',QB:'projects'};olympe.sc.xf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Cd(){return this.sd(olympe.sc.xf.D)}};olympe.sc.xf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.xf);olympe.sc.xf.D=olympe.sc.xf.O.ka('016d1bb681929c2cc3f1');olympe.sc.xf.j=olympe.sc.xf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.xf.j);olympe.sc.xf.prototype.Cd.K=olympe.C.H.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.ar}j(){return this.bb(olympe.sc.od.j,olympe.sc.logic.Eh)}D(){return this.bb(olympe.sc.od.D,olympe.sc.logic.Gg)}};olympe.sc.od.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Cl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
1091
+ olympe.sc.od.prototype.j.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.H(()=>olympe.dc.za,[]);function on(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function pn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Qb(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 qn(a){return pn(a,a.db.bb(a.tag,olympe.sc.Ua.F))}function rn(a){return pn(a,a.db.bb(a.tag,olympe.sc.Ua.D))}
1092
+ olympe.sc.Ua=class extends olympe.dm.BrickMetadata{tu(a,b,c,d,e=!0){e||olympe.ja.ab('sc').error('parameter own= false ignored, investigate');return olympe.C.jh(M(this.Mf(a,olympe.dc.mb.cj,c)),d)}J(){return[]}F(){return rxjs.of([])}ey(){return this.bb(olympe.sc.Ua.N,olympe.sc.Runnable)}vx(){return this.bb(olympe.sc.Ua.R,olympe.sc.Runnable)}di(){return this.db.Qa(this,olympe.sc.Ua.$)}jn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.ac())}su(){return this.bb(olympe.sc.Ua.F,olympe.sc.logic.vb)}Gp(){return this.bb(olympe.sc.Ua.D,
1093
+ olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.$a]}};olympe.sc.Ua.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.fb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.$a=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
1094
+ olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Ec=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.rc=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.tu.K=olympe.C.H.j;m.ey.K=new olympe.C.H(()=>olympe.dc.za,[]);m.vx.K=new olympe.C.H(()=>olympe.dc.za,[]);m.di.K=olympe.C.H.j;m.jn.K=olympe.C.H.j;m.su.K=new olympe.C.H(()=>olympe.dc.za,[]);m.Gp.K=new olympe.C.H(()=>olympe.dc.za,[]);function Vm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.ha)[0])?b:null}function sn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
1095
+ function tn(a,b){dn(b.j,a);on(a.rd(),b);const c=a.N(),d=un(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(vn(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
1096
+ function wn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.bc()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=xn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.hb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.mw(b.j);l.D().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
1097
+ function yn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{const k=Mm(d,h);if(g){const l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.ed&&e?e.push(()=>l.run(k)):l.run(k)}else k.destroy()});e.forEach(g=>g());e=null;d.D().onDestroy(a.db.D.bind(a.db,b,c,f,!0))}function xn(a,b){return a.rd().J(b)}
1098
+ function un(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}function vn(a,b,c,d){b=b.D();const e=Pg(a.db,a.tag,b.F((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Qg(a.db,a.tag,e)})}
1099
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.D().run(()=>{tn(this,a);this.init(a);a.ih(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));wn(this,a);this.D(a)})}rd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.di())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),yn(this,d,olympe.sc.Ua.N,a),this.ba()&&yn(this,d,
1100
+ olympe.sc.Ua.Y,a)}D(a){a.An(olympe.sc.Ua.fb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.bc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return qn(this.rd())}getOutputs(){return rn(this.rd())}F(){return[]}j(){return null}ba(){return!1}J(a,
1101
+ b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.jh(a,d);return a}$a(a,b,c,d,e){olympe.C.pn([d],f=>{b.set(a,olympe.C.qs(f)?f.valueOf():f)});return this.J(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){vn(this,a,b,null)}R(a,b){vn(this,a,null,b)}fb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.ac(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.Vr(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return zn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.na.j('01130000000000ca1100',olympe.sc.Runnable));
1102
+ olympe.sc.Runnable.J=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.J);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.H(()=>olympe.sc.Ua,[]);
1103
+ olympe.sc.Runnable.prototype.J.K=new olympe.C.H(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.H.j;function An(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Od)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Od=class extends olympe.dc.CloudObject{D(){return this.db.bb(this,olympe.sc.Od.j)[0]}j(){const a=An(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.j().Ac()}toString(){const a=An(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Od.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Od);
1104
+ olympe.sc.Od.j=olympe.sc.Od.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Od.j);olympe.sc.Od.prototype.D.K=new olympe.C.H(()=>String,[]);olympe.sc.Od.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.Co=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Co.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.Co);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Cl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Bn=null,Cn=null,Dn=[];
1105
+ function En(a,b){Bn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.sc.hf.j.ac()).nb({Th:'__code-as-data__'}).then(d=>{let e;null==(e=Dn)||e.forEach(f=>f());Dn=null;Cn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{di(c,d,h=>{h=f.ei(h)?h:f.model(h);return null!==h&&f.Qb(h,olympe.sc.yc)},{xn:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
1106
+ g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{Dn=null;throw d;})}function pf(){return null===Dn?Promise.resolve():new Promise(a=>{Dn.push(()=>a())})}olympe.sc.hf=class extends olympe.dc.CloudObject{};olympe.sc.hf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.hf);olympe.sc.hf.j=olympe.sc.hf.O.sa('017b3aa8fd1659291b92');
1107
1107
  olympe.sc.hf.D=olympe.sc.hf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Dg=class extends olympe.sc.Map{};olympe.sc.Dg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Dg);olympe.sc.File=class extends olympe.dm.File{static Qw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Fs(a,e,b,c,d);return e}static Rw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.wn(a,e,b,c,d);return e}static Fs(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.wn(a,b,c,d,e)}static wn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Nf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1108
1108
  h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.ys(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.wn;olympe.sc.File.setContent=olympe.sc.File.Fs;olympe.sc.File.createFromURL=olympe.sc.File.Rw;olympe.sc.File.createFromContent=olympe.sc.File.Qw;
1109
- olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.zg=class extends olympe.sc.File{J(){const a=olympe.C.cc(olympe.C.Sa);this.Ik(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.zg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.zg);olympe.sc.zg.O.j=olympe.sc.File.D.bind(null,olympe.sc.zg);olympe.sc.zg.prototype.J.K=olympe.C.H.D;olympe.sc.Lc=class extends olympe.sc.File{J(){return this.wb(olympe.sc.Lc.fontFamilyProp)}N(){return this.wb(olympe.sc.Lc.F)}R(){return this.qd(olympe.sc.Lc.J)}};olympe.sc.Lc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Lc);olympe.sc.Lc.fontFamilyProp=olympe.sc.Lc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Lc.F=olympe.sc.Lc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Lc.J=olympe.sc.Lc.O.ka('01647e6780999bf8bd25');
1109
+ olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.zg=class extends olympe.sc.File{J(){const a=olympe.C.cc(olympe.C.Sa);this.Ik(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.zg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.zg);olympe.sc.zg.O.j=olympe.sc.File.D.bind(null,olympe.sc.zg);olympe.sc.zg.prototype.J.K=olympe.C.H.D;olympe.sc.Lc=class extends olympe.sc.File{J(){return this.wb(olympe.sc.Lc.fontFamilyProp)}N(){return this.wb(olympe.sc.Lc.F)}R(){return this.sd(olympe.sc.Lc.J)}};olympe.sc.Lc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Lc);olympe.sc.Lc.fontFamilyProp=olympe.sc.Lc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Lc.F=olympe.sc.Lc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Lc.J=olympe.sc.Lc.O.ka('01647e6780999bf8bd25');
1110
1110
  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.J.K=olympe.C.H.D;olympe.sc.Lc.prototype.N.K=olympe.C.H.D;olympe.sc.Lc.prototype.R.K=olympe.C.H.F;olympe.sc.Mh=class extends olympe.sc.File{};olympe.sc.Mh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Mh);olympe.sc.Mh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Mh);olympe.sc.yr=class extends olympe.dc.CloudObject{};olympe.sc.yr.O=olympe.dc.na.j('016421bb3797e22d1c4e',olympe.sc.yr);olympe.sc.logic={};olympe.sc.logic.ip=(a,b)=>a===b?0:a>b?1:-1;
1111
- olympe.sc.logic.lB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.ha(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ha(olympe.dm.Number))k=c.valueOf(),l=p=>p.qd(h);else if(b===olympe.dc.ha(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.lj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1111
+ olympe.sc.logic.lB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.ha(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ha(olympe.dm.Number))k=c.valueOf(),l=p=>p.sd(h);else if(b===olympe.dc.ha(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.lj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1112
1112
  return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.ip(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.ip(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Ck().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.ea,'FilterList ListDefBuilder Filter TransformFlows')).Fi())};
1113
- olympe.sc.logic.YD=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Is();if(a instanceof olympe.C.ea)return a.js();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Sp};olympe.sc.logic.Ra={};function Hn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.Xo=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Hn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.Xo.xa=[olympe.dc.Qe];const In=Object.create(null),Jn=new Map;function Kn(a){if(void 0===In[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Ln(a,b,c=olympe.sc.logic.Function){if(Jn.has(a))throw c=Kn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);Jn.set(a,{O:d,oE:b,VD:c});return d}
1114
- olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(In[a])throw c=Kn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Xo(a,b,[olympe.sc.P.Ca].concat(c));return In[a]=b}};olympe.sc.logic.$z=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Ij);function Sm(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)}Rx(){return this.message}Xr(){return this.code}le(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.le()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.le;
1115
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Xr;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Rx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.wi=class extends olympe.sc.logic.Ij{};olympe.sc.logic.wi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.wi);olympe.sc.logic.kd=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.sc.logic.kd.j,olympe.dc.CloudObject)}};olympe.sc.logic.kd.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.kd);olympe.sc.logic.kd.D=olympe.sc.logic.kd.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.kd.j=olympe.sc.logic.kd.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.kd.j);olympe.sc.logic.kd.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Eh=class extends olympe.sc.logic.kd{};olympe.sc.logic.Eh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Eh);olympe.sc.logic.Eh.F=olympe.sc.md.j.ac();olympe.sc.logic.Eh.O.j=(a,b,c,d,e)=>{b=Dl(a,b||'New Predefined Input',olympe.sc.logic.Eh,olympe.sc.logic.vb);Y(b,olympe.sc.logic.kd.D,e);a.Oa(olympe.sc.logic.kd.j,b,c);a.Oa(olympe.sc.md.j,d,b);return b.X()};olympe.sc.logic.Gg=class extends olympe.sc.logic.kd{};olympe.sc.logic.Gg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Gg);olympe.sc.logic.Gg.F=R(olympe.sc.logic.Gg.O,olympe.sc.md.D);olympe.sc.logic.Gg.O.j=(a,b,c,d,e)=>{b=Dl(a,b||'New Predefined Output',olympe.sc.logic.Gg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.kd.D,e);a.Oa(olympe.sc.logic.kd.j,b,c);a.Oa(olympe.sc.md.D,d,b);return b.X()};olympe.sc.logic.wd=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.ar}Y(){return this.$m().Ck().Qb([olympe.sc.logic.Function]).and().sd().Qb([olympe.sc.logic.hd,olympe.sc.logic.ed]).Fi()}N(){const a=olympe.dc.ha(olympe.sc.logic.wi);return this.db.ab(this,olympe.sc.logic.wd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.Xm(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.Xm(this,[olympe.sc.Ua.D],
1116
- c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}J(a){if(!this.di())return super.J(a);const b=olympe.dc.ha(olympe.sc.logic.Ij),c=olympe.dc.ha(olympe.sc.logic.wi);return tn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Sb.typeRel)){case b:return a.An.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.di())return super.F(a);const b=sn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1117
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.wd.O=Ln('01621fb84e320000f000',olympe.sc.logic.wd,olympe.sc.logic.Function);olympe.sc.logic.wd.prototype.j.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.wd.prototype.D.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);let Mn=null;function Nn(){if(null===Mn){let a;Mn=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Mn}
1118
- olympe.sc.logic.Tf=class extends olympe.sc.logic.wd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}ba(){return this.Gp().Ck().hb(olympe.sc.logic.Sb.typeRel).Qk(olympe.sc.logic.wi).Fi().sf().kn(olympe.C.aa.ZERO)}F(a){if(this.di()||Nn()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:sn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Tf.j='016ac63229782039429f';olympe.sc.logic.Tf.J='016ac6322acf67eebfe7';
1119
- olympe.sc.logic.Tf.O=Ln('01621fb84e320000a000',olympe.sc.logic.Tf,olympe.sc.logic.Action);olympe.sc.logic.Tf.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Tf.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Tf.prototype.ba.K=olympe.C.H.N;olympe.sc.logic.lo=class extends olympe.sc.logic.wd{};olympe.sc.logic.lo.O=Ln('01621fb84e320000f011',olympe.sc.logic.lo);olympe.sc.logic.ko=class extends olympe.sc.logic.Tf{};olympe.sc.logic.ko.O=Ln('01621fb84e320000f012',olympe.sc.logic.ko);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.gb]}j(){if(!this.pd().di())return super.j();const a=olympe.sc.sg.j.Ol,b=olympe.sc.sg.j.fm,c=this.db,d=new Map,e=this.bc();c.ab(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.ab(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.na.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Sb=class extends olympe.dc.CloudObject{getType(){return this.Qc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.qd(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.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1113
+ olympe.sc.logic.YD=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Is();if(a instanceof olympe.C.ea)return a.js();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Sp};olympe.sc.logic.Ra={};function Fn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.Xo=class{constructor(a,b,c){this.O=olympe.dc.na.j(a,b,...c);Fn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.Xo.xa=[olympe.dc.Qe];const Gn=Object.create(null),Hn=new Map;function In(a){if(void 0===Gn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Jn(a,b,c=olympe.sc.logic.Function){if(Hn.has(a))throw c=In(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.j(a,b,...[]);Hn.set(a,{O:d,oE:b,VD:c});return d}
1114
+ olympe.sc.logic.na=class{constructor(){}static j(a,b,...c){if(Gn[a])throw c=In(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Xo(a,b,[olympe.sc.P.Ca].concat(c));return Gn[a]=b}};olympe.sc.logic.$z=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.O=olympe.dc.na.j('01621fb84e320000cf00',olympe.sc.logic.Ij);function Qm(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Rx(){return this.message}Xr(){return this.code}le(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.le()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.le;
1115
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Xr;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Rx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.wi=class extends olympe.sc.logic.Ij{};olympe.sc.logic.wi.O=olympe.dc.na.j('016eeb5ede9f3094d8f0',olympe.sc.logic.wi);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Qc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.na.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Eh=class extends olympe.sc.logic.md{};olympe.sc.logic.Eh.O=olympe.dc.na.j('016ac4f59c592b862457',olympe.sc.logic.Eh);olympe.sc.logic.Eh.F=olympe.sc.od.j.ac();olympe.sc.logic.Eh.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Input',olympe.sc.logic.Eh,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Gg=class extends olympe.sc.logic.md{};olympe.sc.logic.Gg.O=olympe.dc.na.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Gg);olympe.sc.logic.Gg.F=R(olympe.sc.logic.Gg.O,olympe.sc.od.D);olympe.sc.logic.Gg.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Output',olympe.sc.logic.Gg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.ar}Y(){return this.$m().Ck().Qb([olympe.sc.logic.Function]).and().ud().Qb([olympe.sc.logic.kd,olympe.sc.logic.ed]).Fi()}N(){const a=olympe.dc.ha(olympe.sc.logic.wi);return this.db.bb(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Sb.typeRel)===a)}j(a){const b=this.db.Xm(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.Xm(this,[olympe.sc.Ua.D],
1116
+ c=>this.db.model(c)===olympe.dc.ha(a));return b?olympe.dc.CloudObject.get(b):null}J(a){if(!this.di())return super.J(a);const b=olympe.dc.ha(olympe.sc.logic.Ij),c=olympe.dc.ha(olympe.sc.logic.wi);return rn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Sb.typeRel)){case b:return a.An.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.di())return super.F(a);const b=qn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
1117
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Jn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);let Kn=null;function Ln(){if(null===Kn){let a;Kn=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Kn}
1118
+ olympe.sc.logic.Tf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}ba(){return this.Gp().Ck().gb(olympe.sc.logic.Sb.typeRel).Qk(olympe.sc.logic.wi).Fi().sf().kn(olympe.C.aa.ZERO)}F(a){if(this.di()||Ln()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:qn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Tf.j='016ac63229782039429f';olympe.sc.logic.Tf.J='016ac6322acf67eebfe7';
1119
+ olympe.sc.logic.Tf.O=Jn('01621fb84e320000a000',olympe.sc.logic.Tf,olympe.sc.logic.Action);olympe.sc.logic.Tf.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Tf.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Tf.prototype.ba.K=olympe.C.H.N;olympe.sc.logic.lo=class extends olympe.sc.logic.xd{};olympe.sc.logic.lo.O=Jn('01621fb84e320000f011',olympe.sc.logic.lo);olympe.sc.logic.ko=class extends olympe.sc.logic.Tf{};olympe.sc.logic.ko.O=Jn('01621fb84e320000f012',olympe.sc.logic.ko);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.fb]}j(){if(!this.rd().di())return super.j();const a=olympe.sc.tg.j.Ol,b=olympe.sc.tg.j.fm,c=this.db,d=new Map,e=this.bc();c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.bb(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.Qc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}j(){return this.sd(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.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Sb.typeRel);
1120
1120
  olympe.sc.logic.Sb.prototype.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.j.K=olympe.C.H.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.vb.O=olympe.dc.na.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Sb.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
1121
1121
  olympe.sc.logic.vb.J=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.Gb.O=olympe.dc.na.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.J=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
1122
- olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.hd=class extends olympe.sc.logic.Function{run(a){vn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.hd.F),d=this.db.Jb(this,olympe.sc.logic.hd.D);a.on(c,e=>b.set(d,e),this.tag)}fa(){return this.hg(olympe.sc.logic.hd.F).Fc()}ua(){return this.hg(olympe.sc.logic.hd.D).Fc()}};olympe.sc.logic.hd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.hd,olympe.sc.P.Ca);olympe.sc.logic.hd.F=R(olympe.sc.logic.hd.O,olympe.sc.logic.vb.F);
1123
- olympe.sc.logic.hd.D=R(olympe.sc.logic.hd.O,olympe.sc.logic.Gb.J);olympe.sc.logic.hd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.hd);a.Oa(olympe.sc.logic.hd.D,b,c);return b.X()};olympe.sc.logic.hd.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.hd.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.ed.D),d=this.db.Jb(this,olympe.sc.logic.ed.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.hg(olympe.sc.logic.ed.D).Fc()}fa(){return this.hg(olympe.sc.logic.ed.F).Fc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Ca);olympe.sc.logic.ed.D=R(olympe.sc.logic.ed.O,olympe.sc.logic.vb.J);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.Gb.F);
1124
- olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.D,b,c);return b.X()};olympe.sc.logic.ed.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.ed.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);function Bn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.J),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Nf(On(a),olympe.dm.Be)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.Wk(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.Ac(k)),h=Ng(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Og(a.db,a,olympe.sc.logic.pb.valueProp,
1125
- h)}}function On(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ha(olympe.dc.CloudObject)}
1122
+ olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Sb.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){tn(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}fa(){return this.ig(olympe.sc.logic.kd.F).Fc()}ua(){return this.ig(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.na.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
1123
+ olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.J);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.ed=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.ed.D),d=this.db.Jb(this,olympe.sc.logic.ed.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.ig(olympe.sc.logic.ed.D).Fc()}fa(){return this.ig(olympe.sc.logic.ed.F).Fc()}};olympe.sc.logic.ed.O=olympe.dc.na.j('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.P.Ca);olympe.sc.logic.ed.D=R(olympe.sc.logic.ed.O,olympe.sc.logic.vb.J);olympe.sc.logic.ed.F=R(olympe.sc.logic.ed.O,olympe.sc.logic.Gb.F);
1124
+ olympe.sc.logic.ed.O.j=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Oa(olympe.sc.logic.ed.D,b,c);return b.X()};olympe.sc.logic.ed.prototype.ua.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.ed.prototype.fa.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);function zn(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.J),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Nf(Mn(a),olympe.dm.Be)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.Wk(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.Ac(k)),h=Ng(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Og(a.db,a,olympe.sc.logic.pb.valueProp,
1125
+ h)}}function Mn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ha(olympe.dc.CloudObject)}
1126
1126
  olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.cj(c);null==b||b.fa();b&&d instanceof olympe.dm.Be?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Mf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.cj,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Sb.typeRel);a.Ld(olympe.dc.CloudObject);return a.Gc()}ly(){return this.Qc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}jy(){return this.Qc(olympe.sc.logic.pb.R,
1127
1127
  olympe.sc.logic.Gb)}ky(){return this.Qc(olympe.sc.logic.pb.J,olympe.dm.Property)}Ex(){return this.Qc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Cx(){return this.Qc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Dx(){return this.Qc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.na.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
1128
1128
  olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.J=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.J);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
1129
- R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ly.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.jy.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.ky.K=new olympe.C.H(()=>olympe.dm.Property,[]);m.Ex.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Cx.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Dx.K=new olympe.C.H(()=>olympe.dm.Property,[]);function Pn(a,b){const c=a.pd(),d=c.Sl().X(),e=c.Tl().X(),f=c.Ul().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.bc(),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=Sm(k.message,k.code,k.le()+'\n===== Remote Call =====\n'+b.le()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1129
+ R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.ly.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.jy.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.ky.K=new olympe.C.H(()=>olympe.dm.Property,[]);m.Ex.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);m.Cx.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Dx.K=new olympe.C.H(()=>olympe.dm.Property,[]);function Nn(a,b){const c=a.rd(),d=c.Sl().X(),e=c.Tl().X(),f=c.Ul().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.bc(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Qm(k.message,k.code,k.le()+'\n===== Remote Call =====\n'+b.le()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
1130
1130
  400))})}},b.T())}
1131
- function Qn(a,b,c,d,e,f){const g=n=>w(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.ud(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.bc()}): ${r}`);f.Xh(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.bc()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1132
- olympe.sc.logic.Hh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Hh.D)?(fn(a.j,this),this.fa(a)):(vn(this,a),Pn(this,a)))}fa(a){const b=this.bc(),c=this.pd(),d=c.Hp().X(),e=c.Sl().X(),f=c.Tl().X(),g=c.Ul().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Uh('remote call'),l=h.body(),n=wc(()=>{h.Xh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1133
- k.destroy()},this.timeout);Qn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ii().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ha(q)!==p&&(q=this.bc(),this.G.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.bc();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1134
- 1))})},h=>{const k=this.bc();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Hh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Hh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Eq));olympe.sc.logic.Hh.D=olympe.sc.logic.Hh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Pl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Pl.j={cA:-1,cB:1};olympe.sc.logic.controllers.VB=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.kd.j)}};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.Gk={};olympe.sc.logic.Gk.Tv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ha(b);d?olympe.dc.ma.Nb(a,d,olympe.dc.Lb.ag).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.Gk.Tv);olympe.sc.logic.actions={};olympe.sc.logic.Gk.Lu=class extends olympe.sc.logic.Function{run(a){vn(this,a);const [b,c,d]=zn(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.af(f)),f++,c(Date.now())):(hn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.ig();f=0;gn(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1135
- olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Gk.Lu);olympe.sc.logic.Pb={};olympe.sc.logic.Pb.Fl=class extends olympe.sc.logic.wd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Pb.Fl.O=Ln('0169b6876a03f14ae61b',olympe.sc.logic.Pb.Fl);olympe.sc.logic.Pb.Fl.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);let Rn=null;olympe.sc.logic.Pb.Ql=class extends olympe.sc.logic.wd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Rn){let b;Rn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Rn?a.observe(sn(this)[0]):super.F(a)}};olympe.sc.logic.Pb.Ql.O=Ln('0169b6876a03f139d50a',olympe.sc.logic.Pb.Ql);olympe.sc.logic.Pb.Ql.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm=class extends olympe.sc.logic.wd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Ln('01646ad602f933b8caaf',olympe.sc.logic.Pb.gm);olympe.sc.logic.Pb.gm.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j=class extends olympe.sc.logic.wd{R(){return this.j('016ac6380bd98f1d91a0')}ba(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Ln('0168ec42fc01747a98b6',olympe.sc.logic.Pb.$j);olympe.sc.logic.Pb.$j.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.$j.prototype.ba.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.Kg=class extends olympe.sc.logic.wd{Sl(){return this.j('017a7b07b09e3b22c8b4')}Hp(){return this.j('017a7b07ba05807a74b0')}Tl(){return this.D('017a7b0818c12388d731')}Ul(){return this.D('017a7b085146d5e69aec')}uu(){return olympe.C.ea.D}};olympe.sc.logic.Pb.Kg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Pb.Kg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Pb.Kg.fa='017a7b0818c12388d731';olympe.sc.logic.Pb.Kg.j='017a7b085146d5e69aec';
1136
- olympe.sc.logic.Pb.Kg.O=Ln('017a7b07a948e30508fa',olympe.sc.logic.Pb.Kg,olympe.sc.logic.Hh);m=olympe.sc.logic.Pb.Kg.prototype;m.Sl.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Hp.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Tl.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.Ul.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.uu.K=olympe.C.H.N;olympe.sc.logic.Pb.fr=class extends olympe.sc.logic.wd{R(){return this.j('016ac63c5b3ed0562740')}};Ln('016a9766c230916ea5ec',olympe.sc.logic.Pb.fr);olympe.sc.logic.Pb.fr.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.On=class extends olympe.sc.Dg{};olympe.sc.query.On.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.On);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.nq);olympe.sc.query.xq=class extends olympe.dm.Enum{};olympe.sc.query.xq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.xq);olympe.sc.query.Aq=class extends olympe.sc.Dg{};olympe.sc.query.Aq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Aq);olympe.sc.query.oc=class extends olympe.dc.CloudObject{};olympe.sc.query.oc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.oc);olympe.sc.po=class extends olympe.dc.CloudObject{};olympe.sc.po.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.po);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
1137
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.vf=class extends olympe.sc.logic.wd{vu(){return this.j('017ffe02381f9fac5060')}yu(){return this.j('017ffe02381f9fac5061')}zu(){return this.j('017ffe02381f9fac5062')}Ax(){return this.j('017ffe02381f9fac5065')}wu(){return this.D('017ffe02381f9fac5063')}xu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.vf.O=Ln('017ffde21f5fe0f704ce',olympe.sc.workflow.vf);olympe.sc.workflow.vf.j='017ffe02381f9fac5060';olympe.sc.workflow.vf.Vd='017ffe02381f9fac5061';
1131
+ function On(a,b,c,d,e,f){const g=n=>w(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.bc()}): ${r}`);f.Xh(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.bc()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
1132
+ olympe.sc.logic.Hh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Hh.D)?(dn(a.j,this),this.fa(a)):(tn(this,a),Nn(this,a)))}fa(a){const b=this.bc(),c=this.rd(),d=c.Hp().X(),e=c.Sl().X(),f=c.Tl().X(),g=c.Ul().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Uh('remote call'),l=h.body(),n=wc(()=>{h.Xh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1133
+ k.destroy()},this.timeout);On(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ii().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ha(q)!==p&&(q=this.bc(),this.G.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.bc();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1134
+ 1))})},h=>{const k=this.bc();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Hh.O=olympe.dc.na.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Hh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Eq));olympe.sc.logic.Hh.D=olympe.sc.logic.Hh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Pl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Pl.j={cA:-1,cB:1};olympe.sc.logic.controllers.VB=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.Gk={};olympe.sc.logic.Gk.Tv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ha(b);d?olympe.dc.ma.Nb(a,d,olympe.dc.Lb.bg).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.Gk.Tv);olympe.sc.logic.actions={};olympe.sc.logic.Gk.Lu=class extends olympe.sc.logic.Function{run(a){tn(this,a);const [b,c,d]=xn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.af(f)),f++,c(Date.now())):(fn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.jg();f=0;en(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
1135
+ olympe.sc.logic.na.j('0171889b060b6cd54300',olympe.sc.logic.Gk.Lu);olympe.sc.logic.Pb={};olympe.sc.logic.Pb.Fl=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Pb.Fl.O=Jn('0169b6876a03f14ae61b',olympe.sc.logic.Pb.Fl);olympe.sc.logic.Pb.Fl.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);let Pn=null;olympe.sc.logic.Pb.Ql=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Pn){let b;Pn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Pn?a.observe(qn(this)[0]):super.F(a)}};olympe.sc.logic.Pb.Ql.O=Jn('0169b6876a03f139d50a',olympe.sc.logic.Pb.Ql);olympe.sc.logic.Pb.Ql.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Jn('01646ad602f933b8caaf',olympe.sc.logic.Pb.gm);olympe.sc.logic.Pb.gm.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.gm.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}ba(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Jn('0168ec42fc01747a98b6',olympe.sc.logic.Pb.$j);olympe.sc.logic.Pb.$j.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Pb.$j.prototype.ba.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.$j.prototype.$.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Pb.Kg=class extends olympe.sc.logic.xd{Sl(){return this.j('017a7b07b09e3b22c8b4')}Hp(){return this.j('017a7b07ba05807a74b0')}Tl(){return this.D('017a7b0818c12388d731')}Ul(){return this.D('017a7b085146d5e69aec')}uu(){return olympe.C.ea.D}};olympe.sc.logic.Pb.Kg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Pb.Kg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Pb.Kg.fa='017a7b0818c12388d731';olympe.sc.logic.Pb.Kg.j='017a7b085146d5e69aec';
1136
+ olympe.sc.logic.Pb.Kg.O=Jn('017a7b07a948e30508fa',olympe.sc.logic.Pb.Kg,olympe.sc.logic.Hh);m=olympe.sc.logic.Pb.Kg.prototype;m.Sl.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Hp.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Tl.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.Ul.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.uu.K=olympe.C.H.N;olympe.sc.logic.Pb.fr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Jn('016a9766c230916ea5ec',olympe.sc.logic.Pb.fr);olympe.sc.logic.Pb.fr.prototype.R.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.On=class extends olympe.sc.Dg{};olympe.sc.query.On.O=olympe.dc.na.j('01631aacd8276ea98491',olympe.sc.query.On);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.O=olympe.dc.na.j('01631aacd8276ea98495',olympe.sc.query.nq);olympe.sc.query.xq=class extends olympe.dm.Enum{};olympe.sc.query.xq.O=olympe.dc.na.j('01631aacd8276ea98494',olympe.sc.query.xq);olympe.sc.query.Aq=class extends olympe.sc.Dg{};olympe.sc.query.Aq.O=olympe.dc.na.j('01631aacd8276ea98492',olympe.sc.query.Aq);olympe.sc.query.oc=class extends olympe.dc.CloudObject{};olympe.sc.query.oc.O=olympe.dc.na.j('01631aacd8276ea98493',olympe.sc.query.oc);olympe.sc.po=class extends olympe.dc.CloudObject{};olympe.sc.po.O=olympe.dc.na.j('018312ceeb3e93618a85',olympe.sc.po);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.na.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
1137
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.vf=class extends olympe.sc.logic.xd{vu(){return this.j('017ffe02381f9fac5060')}yu(){return this.j('017ffe02381f9fac5061')}zu(){return this.j('017ffe02381f9fac5062')}Ax(){return this.j('017ffe02381f9fac5065')}wu(){return this.D('017ffe02381f9fac5063')}xu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.vf.O=Jn('017ffde21f5fe0f704ce',olympe.sc.workflow.vf);olympe.sc.workflow.vf.j='017ffe02381f9fac5060';olympe.sc.workflow.vf.Vd='017ffe02381f9fac5061';
1138
1138
  olympe.sc.workflow.vf.Wd='017ffe02381f9fac5062';olympe.sc.workflow.vf.fa='017ffe02381f9fac5065';olympe.sc.workflow.vf.J='017ffe02381f9fac5063';olympe.sc.workflow.vf.Ub='017ffe02381f9fac5064';m=olympe.sc.workflow.vf.prototype;m.vu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.yu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.zu.K=new olympe.C.H(()=>olympe.sc.logic.vb,[]);m.Ax.K=new olympe.C.H(()=>Map,[]);m.wu.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);m.xu.K=new olympe.C.H(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ve=class extends olympe.dm.BrickMetadata{Uc(){return this.Qc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ve.O=olympe.dc.na.j('017ffdc2dda51d46b430',olympe.sc.workflow.Ve);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.ms()}j(){return this.Qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ve)}F(){return this.Qc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ve)}Uc(){const a=this.Qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ve);return a.Qc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
1139
1139
  olympe.sc.workflow.Transition.O=olympe.dc.na.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ka('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.H(()=>olympe.dc.CloudObject,[]);
1140
1140
  olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}F(){return this.Zg(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Qc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Qc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ve)}};olympe.sc.workflow.Workflow.O=olympe.dc.na.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ka('017ffdc010e5bcc9c972');
1141
1141
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.F.K=olympe.C.H.N;olympe.sc.workflow.Workflow.prototype.j.K=new olympe.C.H(()=>olympe.sc.yc,[]);
1142
- olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.Dv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.fa=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Nc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.li=class extends olympe.sc.Runnable{F(){return[this.bc()]}fa(){return olympe.dc.ld.from(this.bc()).hb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.li.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.li));olympe.sc.qa.li.prototype.fa.K=new olympe.C.H(()=>olympe.dm.jb,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Bu(){return this.Zg(olympe.sc.qa.lb.Rh)}Py(){return this.Zg(olympe.sc.qa.lb.fa)}Hc(){return this.qd(olympe.sc.qa.lb.j)}Gx(){return this.wb(olympe.sc.qa.lb.J)}ay(){return this.wb(olympe.sc.qa.lb.ba)}$x(){return this.wb(olympe.sc.qa.lb.Y)}If(){return this.wb(olympe.sc.qa.lb.$)}Qx(){return this.wb(olympe.sc.qa.lb.N)}ox(){return this.wb(olympe.sc.qa.lb.D)}Zx(){return this.wb(olympe.sc.qa.lb.R)}Au(){return this.wb(olympe.sc.qa.lb.F)}};
1142
+ olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.H(()=>olympe.sc.workflow.Ve,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{oe(){return olympe.sc.qe.Ge.Dv}};olympe.sc.qa.Xc.O=olympe.dc.na.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.fa=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Nc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.li=class extends olympe.sc.Runnable{F(){return[this.bc()]}fa(){return olympe.dc.nd.from(this.bc()).gb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.li.O=Of(olympe.dc.na.j('0113030000000aca1100',olympe.sc.qa.li));olympe.sc.qa.li.prototype.fa.K=new olympe.C.H(()=>olympe.dm.jb,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Bu(){return this.Zg(olympe.sc.qa.lb.Rh)}Py(){return this.Zg(olympe.sc.qa.lb.fa)}Hc(){return this.sd(olympe.sc.qa.lb.j)}Gx(){return this.wb(olympe.sc.qa.lb.J)}ay(){return this.wb(olympe.sc.qa.lb.ba)}$x(){return this.wb(olympe.sc.qa.lb.Y)}If(){return this.wb(olympe.sc.qa.lb.$)}Qx(){return this.wb(olympe.sc.qa.lb.N)}ox(){return this.wb(olympe.sc.qa.lb.D)}Zx(){return this.wb(olympe.sc.qa.lb.R)}Au(){return this.wb(olympe.sc.qa.lb.F)}};
1143
1143
  olympe.sc.qa.lb.O=olympe.dc.na.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Rh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.fa=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.J=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.ba=olympe.sc.qa.lb.O.ka('011203300000000adefa');olympe.sc.qa.lb.Y=olympe.sc.qa.lb.O.ka('011203300000000adefb');olympe.sc.qa.lb.D=olympe.sc.qa.lb.O.ka('011203300000000adefc');
1144
1144
  olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.pc={INIT:0,Qz:1,qk:2,pk:3,um:4,xC:5,zb:9};m=olympe.sc.qa.lb.prototype;m.Bu.K=olympe.C.H.N;m.Py.K=olympe.C.H.N;m.Hc.K=olympe.C.H.F;m.Gx.K=olympe.C.H.D;m.ay.K=olympe.C.H.D;m.$x.K=olympe.C.H.D;m.If.K=olympe.C.H.D;m.Qx.K=olympe.C.H.D;
1145
- m.ox.K=olympe.C.H.D;m.Zx.K=olympe.C.H.D;m.Au.K=olympe.C.H.D;olympe.sc.qa.Nl=class extends olympe.sc.qa.li{D(a){a.set(olympe.sc.ya.j.En,!0);super.D(a)}ba(){return!0}};olympe.sc.qa.Nl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Nl,olympe.sc.P.Ca);olympe.sc.qa.Ue=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.Wj(this.X(),olympe.sc.qa.lb)).hb(olympe.sc.qa.Ue.J).Fi().Gc()}};olympe.sc.qa.Ue.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Ue);olympe.sc.qa.Ue.J=olympe.sc.qa.Ue.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Ue.J);
1146
- olympe.sc.qa.Ue.O.j=(a,b,c)=>{b=Dl(a,b||'New Service Application model',olympe.sc.qa.Ue,olympe.sc.qa.Nl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Ue.J,b,c);return b.X()};olympe.sc.qa.Ue.prototype.j.K=new olympe.C.H(()=>olympe.sc.qa.lb,[]);olympe.sc.Qg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Qg.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Qg);olympe.sc.Qg.D=olympe.sc.Qg.O.ka('011203300000000adf01');olympe.sc.Qg.j=olympe.sc.Qg.O.ka('011203300000000adf02');olympe.sc.Qg.F='011203300000000adf0f';olympe.sc.mg={};olympe.sc.mg.Fy=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Fn;for(const f of b.dd())if((b=f.Vb())&&f.D()&&f.sb()===olympe.dc.Ka.SERVER&&Z(a,f.tag())&&c.Qb(b,olympe.sc.yc)){if(!e)throw new olympe.dc.cq;let g,h;null==d&&(d=null,null!==En?d=En:'string'===typeof Dn&&(d=olympe.dc.ld.from(Dn).hb(olympe.sc.qa.Xc.j).hb(olympe.sc.hf.j.ac()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ha(b)}`);a.Oa(olympe.sc.hf.D.X(),
1145
+ m.ox.K=olympe.C.H.D;m.Zx.K=olympe.C.H.D;m.Au.K=olympe.C.H.D;olympe.sc.qa.Nl=class extends olympe.sc.qa.li{D(a){a.set(olympe.sc.ya.j.En,!0);super.D(a)}ba(){return!0}};olympe.sc.qa.Nl.O=olympe.dc.na.j('0113032000000aca1102',olympe.sc.qa.Nl,olympe.sc.P.Ca);olympe.sc.qa.Ue=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.Wj(this.X(),olympe.sc.qa.lb)).gb(olympe.sc.qa.Ue.J).Fi().Gc()}};olympe.sc.qa.Ue.O=olympe.dc.na.j('011203300000000adef3',olympe.sc.qa.Ue);olympe.sc.qa.Ue.J=olympe.sc.qa.Ue.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Ue.J);
1146
+ olympe.sc.qa.Ue.O.j=(a,b,c)=>{b=Cl(a,b||'New Service Application model',olympe.sc.qa.Ue,olympe.sc.qa.Nl);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Ue.J,b,c);return b.X()};olympe.sc.qa.Ue.prototype.j.K=new olympe.C.H(()=>olympe.sc.qa.lb,[]);olympe.sc.Qg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Qg.O=olympe.dc.na.j('011203300000000adf00',olympe.sc.Qg);olympe.sc.Qg.D=olympe.sc.Qg.O.ka('011203300000000adf01');olympe.sc.Qg.j=olympe.sc.Qg.O.ka('011203300000000adf02');olympe.sc.Qg.F='011203300000000adf0f';olympe.sc.ng={};olympe.sc.ng.Fy=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===Dn;for(const f of b.dd())if((b=f.Vb())&&f.D()&&f.sb()===olympe.dc.Ka.SERVER&&Z(a,f.tag())&&c.Qb(b,olympe.sc.yc)){if(!e)throw new olympe.dc.cq;let g,h;null==d&&(d=null,null!==Cn?d=Cn:'string'===typeof Bn&&(d=olympe.dc.nd.from(Bn).gb(olympe.sc.qa.Xc.j).gb(olympe.sc.hf.j.ac()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ha(b)}`);a.Oa(olympe.sc.hf.D.X(),
1147
1147
  d,f.tag())}};
1148
- olympe.sc.mg.Ry=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.dd()){const e=d.Vb();e&&!d.Dd()&&c.Qb(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Rc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.ha(olympe.sc.Od)){h=l.Jb(olympe.sc.Od.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1149
- let p;f=null!=(p=null==(k=b.Rc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Nf(f,olympe.dm.Be)){k=Nm(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Wc(d.tag(),new Map([[g,n]]));xl(a,l.tag(),olympe.dc.Lb.Cc)}})}};
1150
- olympe.sc.mg.Lw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Kc()&&(d.has(g)||c.Qb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.fa()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Rc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Qb(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Rc(h))?void 0:k.Vb())?l:c.model(h))?
1151
- n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.mg.fz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.dd()){b=d.tag();const e=d.Vb();if(e&&!c.Qb(e,olympe.sc.yc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1152
- olympe.W.run([olympe.dc.transaction.P.Da],a=>{Jl(Jl(Jl(a,olympe.sc.mg.Lw,'businessDataRelations'),olympe.sc.mg.Fy,'linkBusinessContainer'),olympe.sc.mg.Ry,'noBusinessComplexProperty')});olympe.sc.Hj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Hj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Hj);olympe.sc.Hj.j=olympe.sc.Hj.O.sa('017ed8ac775f48d4d589');olympe.sc.mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.mo.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.mo);olympe.sc.lh=class extends olympe.dm.BrickMetadata{};olympe.sc.lh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.lh);olympe.sc.lh.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.lh.O.j=(a,b)=>Dl(a,null!=b?b:'New config type',olympe.sc.lh).X();olympe.sc.Zz=class{};olympe.sc.Lj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Lj.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Lj);olympe.sc.Lj.O.j=(a,b)=>Dl(a,null!=b?b:'New data connector',olympe.sc.Lj,olympe.dm.DataSource).X();olympe.sc.se=class extends olympe.sc.Runnable{ua(){return this.ab(olympe.sc.se.F,olympe.sc.Runnable)}fa(){return this.ab(olympe.sc.se.D,olympe.dm.Property)}};olympe.sc.se.O=Of(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.se));olympe.sc.se.F=olympe.sc.se.O.sa('016c3cb7742ec9309e0b');olympe.sc.se.D=olympe.sc.se.O.sa('016c42d3454636f90533');olympe.sc.se.prototype.ua.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.se.prototype.fa.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.Mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Mo.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.Mo);olympe.sc.vi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.dd(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.vi.create=olympe.sc.vi.create;olympe.sc.vi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.vi);olympe.sc.Qp=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.cw}};olympe.sc.Qp.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.Qp);olympe.sc.Rp=class extends olympe.dc.CloudObject{};olympe.sc.Rp.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Rp);const Sn={Lo:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(Sn.Lo,{c:a.code,m:a.message,s:a.le()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Sn.Lo?(a=a.v,Sm(a.m,a.c,a.s)):super.j(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Od.O.X()){const b=olympe.sc.Od.j;this.F.get(a).r.push({r:b.X(),d:this.db.Jb(a,b)})}return a}};olympe.sc.gr=class extends olympe.sc.se{};olympe.sc.gr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.gr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Xa=class{constructor(a=!0){a=Bl(a);a.N=!0;var b=olympe.sc.mg.fz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Cl))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Xa}static process(a,b){return a.has(olympe.sc.ya.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='string'===
1153
- typeof c?c:olympe.dc.$d().fromModel(a);a=this.j.create(a,d).gi(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ys(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Fd.set(olympe.dc.ha(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}Um(a,b){this.j.Um(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}ez(a,b=!0){olympe.ja.$a('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1154
- return this.persist(a,b)}gi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Cl(this.j,a.j);return this}Mm(a){this.j.Mm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}Vm(){return new Promise((a,b)=>{this.j.Vm((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}};olympe.sc.Xa.prototype.executeAsLarge=olympe.sc.Xa.prototype.Vm;olympe.sc.Xa.prototype.execute=olympe.sc.Xa.prototype.nb;olympe.sc.Xa.prototype.afterExecution=olympe.sc.Xa.prototype.Mm;
1155
- olympe.sc.Xa.prototype.merge=olympe.sc.Xa.prototype.merge;olympe.sc.Xa.prototype.model=olympe.sc.Xa.prototype.model;olympe.sc.Xa.prototype.setSource=olympe.sc.Xa.prototype.gi;olympe.sc.Xa.prototype.persistInstance=olympe.sc.Xa.prototype.ez;olympe.sc.Xa.prototype.persist=olympe.sc.Xa.prototype.persist;olympe.sc.Xa.prototype.deleteAllRelations=olympe.sc.Xa.prototype.Um;olympe.sc.Xa.prototype.deleteRelation=olympe.sc.Xa.prototype.ic;olympe.sc.Xa.prototype.createRelation=olympe.sc.Xa.prototype.Oa;
1156
- olympe.sc.Xa.prototype['delete']=olympe.sc.Xa.prototype.delete;olympe.sc.Xa.prototype.multiUpdate=olympe.sc.Xa.prototype.ys;olympe.sc.Xa.prototype.update=olympe.sc.Xa.prototype.update;olympe.sc.Xa.prototype.create=olympe.sc.Xa.prototype.create;olympe.sc.Xa.prototype.getId=olympe.sc.Xa.prototype.T;olympe.sc.Xa.process=olympe.sc.Xa.process;olympe.sc.Xa.from=olympe.sc.Xa.from;olympe.sc.Wi=class{constructor(a){this.j=a}xx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.Wi.prototype.getCreatedObjects=olympe.sc.Wi.prototype.xx;olympe.xc={};olympe.xc.Ts=class{run(){}};function Tn(a,b='default'){return a.j===b}
1148
+ olympe.sc.ng.Ry=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.dd()){const e=d.Vb();e&&!d.Ed()&&c.Qb(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Rc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.ha(olympe.sc.Od)){h=l.Jb(olympe.sc.Od.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
1149
+ let p;f=null!=(p=null==(k=b.Rc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Nf(f,olympe.dm.Be)){k=Lm(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Wc(d.tag(),new Map([[g,n]]));wl(a,l.tag(),olympe.dc.Lb.Cc)}})}};
1150
+ olympe.sc.ng.Lw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Kc()&&(d.has(g)||c.Qb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.fa()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Rc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Qb(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Rc(h))?void 0:k.Vb())?l:c.model(h))?
1151
+ n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.ng.fz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.dd()){b=d.tag();const e=d.Vb();if(e&&!c.Qb(e,olympe.sc.yc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1152
+ olympe.W.run([olympe.dc.transaction.P.Da],a=>{Il(Il(Il(a,olympe.sc.ng.Lw,'businessDataRelations'),olympe.sc.ng.Fy,'linkBusinessContainer'),olympe.sc.ng.Ry,'noBusinessComplexProperty')});olympe.sc.Hj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Hj.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.Hj);olympe.sc.Hj.j=olympe.sc.Hj.O.sa('017ed8ac775f48d4d589');olympe.sc.mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.mo.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.mo);olympe.sc.lh=class extends olympe.dm.BrickMetadata{};olympe.sc.lh.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.lh);olympe.sc.lh.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.lh.O.j=(a,b)=>Cl(a,null!=b?b:'New config type',olympe.sc.lh).X();olympe.sc.Zz=class{};olympe.sc.Lj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Lj.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Lj);olympe.sc.Lj.O.j=(a,b)=>Cl(a,null!=b?b:'New data connector',olympe.sc.Lj,olympe.dm.DataSource).X();olympe.sc.se=class extends olympe.sc.Runnable{ua(){return this.bb(olympe.sc.se.F,olympe.sc.Runnable)}fa(){return this.bb(olympe.sc.se.D,olympe.dm.Property)}};olympe.sc.se.O=Of(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.se));olympe.sc.se.F=olympe.sc.se.O.sa('016c3cb7742ec9309e0b');olympe.sc.se.D=olympe.sc.se.O.sa('016c42d3454636f90533');olympe.sc.se.prototype.ua.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.se.prototype.fa.K=new olympe.C.H(()=>olympe.dc.za,[]);olympe.sc.Mo=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.nh}};olympe.sc.Mo.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.Mo);olympe.sc.vi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.dd(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.vi.create=olympe.sc.vi.create;olympe.sc.vi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.vi);olympe.sc.Qp=class extends olympe.dm.Kb{oe(){return olympe.sc.qe.Ge.cw}};olympe.sc.Qp.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.Qp);olympe.sc.Rp=class extends olympe.dc.CloudObject{};olympe.sc.Rp.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.Rp);const Qn={Lo:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(Qn.Lo,{c:a.code,m:a.message,s:a.le()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Qn.Lo?(a=a.v,Qm(a.m,a.c,a.s)):super.j(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Od.O.X()){const b=olympe.sc.Od.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.gr=class extends olympe.sc.se{};olympe.sc.gr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.gr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=Al(a);a.N=!0;var b=olympe.sc.ng.fz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Cl))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.ya.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='string'===
1153
+ typeof c?c:olympe.dc.$d().fromModel(a);a=this.j.create(a,d).gi(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ys(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.ha(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}Um(a,b){this.j.Um(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}ez(a,b=!0){olympe.ja.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
1154
+ return this.persist(a,b)}gi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Bl(this.j,a.j);return this}Mm(a){this.j.Mm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}Vm(){return new Promise((a,b)=>{this.j.Vm((c,d)=>{c?a(new olympe.sc.Wi(this.D)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.Vm;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.nb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Mm;
1155
+ olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.gi;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.ez;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Um;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.ic;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
1156
+ olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.ys;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.Wi=class{constructor(a){this.j=a}xx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.Wi.prototype.getCreatedObjects=olympe.sc.Wi.prototype.xx;olympe.xc={};olympe.xc.Ts=class{run(){}};function Rn(a,b='default'){return a.j===b}
1157
1157
  olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}tj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
1158
- this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.tj=function(a,b,c='default'){const d=a.$a();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Me+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.pd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.tj(e,c,b),e=>Tn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Me:'hc.app',ep:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Me,'default');F(a,olympe.xc.U.ep,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Db.P.Og,[new olympe.W.pa(olympe.xc.U.Me)],b=>b);E(a,olympe.auth.P.dl,[olympe.Db.P.Og,new olympe.W.pa(olympe.xc.U.ep)],(b,c)=>new olympe.auth.Nn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Me),olympe.xc.P.Ca)},'olympe.hc');
1159
- olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Un(a){a.Y=a.F.D(()=>w(function*(){return Vn(a)}),'Stop application')}function Wn(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ce.j.READINESS)}
1160
- function Xn(a){if(a.ua)return a.G.debug('Sending getContext request'),pi(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Fn=null;Dn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Qm(a.D);!b&&Ok();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.D(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);di(k,a.j,l=>{l=h.ei(l)?l:h.model(l);return null!==l&&
1161
- h.Qb(l,olympe.sc.lh)},{Gd:Yn(b),xn:!0,rs:!0}).subscribe(rxjs.Subscriber.create(c.F(()=>{h.Qb(a.j,olympe.sc.qa.Xc)?(a.cb.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.fa.ne()],g=>{const h=Yn(b,!1);olympe.dc.ma.Ie(g,olympe.dm.User,olympe.dc.Ka.SERVER).observe(c,
1162
- {Gd:h,Dk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ba)return Zn(a);Zn(a).then(()=>{})})}
1163
- function $n(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.D().F((f,g)=>{if(f)if(f=un(g),f instanceof olympe.sc.qa.li){a.G.debug('application retrieved: running');g=Om(a.D,f);const h=new olympe.sc.Ya.pv(a.J);jb(a.J,()=>$m(a.D.j,h));kb(a.J,()=>{var k=h.T();return bn(a.D.j,k)});a.gb&&a.J.start();f.run(g);'string'===typeof a.Bb&&(new olympe.sc.Ud).ba(f.X(),g,a.G);g.Ls(olympe.sc.ya.j.En).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1164
- a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Yd();k.Eb=!0;k.Y+=0;k.$c.next(0<k.Y);0===k.Y&&k.$&&k.Eb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.cb.set('__code-as-data-version__',k.version),k.Bb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Vn(a)}));olympe.C.Va().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1165
- 3E4);let e;null==(e=a.Eb)||e.start()}}function Yn(a,b=!0){return a?olympe.dc.ma.oc.Fg:b?olympe.dc.ma.oc.lf:olympe.dc.ma.oc.ek}function Zn(a){return w(function*(){ao(a.j)&&(yield Gn(a.j,a.ba).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Vn(a){a.G.info('Stop the application');a.D.D().fa();a.F.F(a.R);a.F.N(a.Y)}
1166
- olympe.sc.Ib.tm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.fa=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.cb=g;this.J=h;this.Eb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.Bb=null!=(n=k.get('debuggerName'))?n:null;this.gb=k.get('autostartProfiler');this.ba=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Un(this);Wn(this);const b=olympe.L.uc.j.Mi,
1167
- c=olympe.L.uc.j.ee,d=olympe.L.uc.j.Td;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,Xn(this).then(olympe.C.Va().F(()=>$n(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.tm.j='app_instance';olympe.sc.Ib.tm.xa=[olympe.xc.Ts];olympe.sc.Ib.Bv=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.kj();this.G.debug('Request headers',b);return b.origin?b.origin:b.jz?(new URL(b.jz)).origin:b[olympe.net.wa.Headers.Vo]&&
1168
- b[olympe.net.wa.Headers.Wo]?b[olympe.net.wa.Headers.Wo]+'://'+b[olympe.net.wa.Headers.Vo]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Md.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.jd('Invalid appTag',olympe.net.wa.Tb.gl);try{var f=yield olympe.dc.ma.Ie(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.jd(`Something went wrong: ${'string'===typeof h?
1169
- h:h.message}`,olympe.net.wa.Tb.gl)}if(0===f.size())return new olympe.net.jd('App not found',olympe.net.wa.Tb.$l);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1170
- typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.jd(JSON.stringify(e),olympe.net.wa.Tb.Ah,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function ao(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).hb(olympe.sc.qa.Xc.j).hb(olympe.dm.vd.F.ac()).hb(olympe.dm.vd.j).Fc();a=olympe.dc.ma.from(a).hb(olympe.sc.qa.Xc.j).hb(olympe.dm.jb.D).Fc();return c.concat(a).has(b)}
1171
- olympe.sc.Ib.uk=class extends olympe.dc.sources.uk{R(a){return this.db.Qb(a,olympe.sc.yc)}Y(a,b){if(!this.J){super.init();var c=olympe.dc.ld.from(a).hb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.jb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Fg:olympe.dc.ma.oc.lf;Fk(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).hb(olympe.sc.qa.Xc.fa).observe(c,{Gd:b}).subscribe(d=>{const e=
1172
- new olympe.dc.Xa;d.hj().forEach(f=>{e.Oa(olympe.dm.DataSource.sj,this.j,f)});d.mj().forEach(f=>{e.ic(olympe.dm.DataSource.sj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={ag:'sc.runtime.Main',Te:'sc.runtime.SourceSolver',Kq:'sc.runtime.appConfig',Mq:'sc.runtime.runtimeHTTPServiceConfig',Lq:'sc.runtime.RuntimeHTTPService',fq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={pp:'app.httpManifestPath',Op:'app.manifest.common',Kp:'sc.loadBusinessContainer'};
1158
+ this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.tj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Me+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.tj(e,c,b),e=>Rn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Me:'hc.app',ep:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Me,'default');F(a,olympe.xc.U.ep,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Db.P.Og,[new olympe.W.pa(olympe.xc.U.Me)],b=>b);E(a,olympe.auth.P.dl,[olympe.Db.P.Og,new olympe.W.pa(olympe.xc.U.ep)],(b,c)=>new olympe.auth.Nn(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Me),olympe.xc.P.Ca)},'olympe.hc');
1159
+ olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Sn(a){a.Y=a.F.D(()=>w(function*(){return Tn(a)}),'Stop application')}function Un(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ce.j.READINESS)}
1160
+ function Vn(a){if(a.ua)return a.G.debug('Sending getContext request'),pi(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;Dn=null;Bn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Om(a.D);!b&&Nk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.D(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);di(k,a.j,l=>{l=h.ei(l)?l:h.model(l);return null!==l&&
1161
+ h.Qb(l,olympe.sc.lh)},{jd:Wn(b),xn:!0,rs:!0}).subscribe(rxjs.Subscriber.create(c.F(()=>{h.Qb(a.j,olympe.sc.qa.Xc)?(a.$a.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.fa.ne()],g=>{const h=Wn(b,!1);olympe.dc.ma.Ie(g,olympe.dm.User,olympe.dc.Ka.SERVER).observe(c,
1162
+ {jd:h,Dk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ba)return Xn(a);Xn(a).then(()=>{})})}
1163
+ function Yn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.D().F((f,g)=>{if(f)if(f=sn(g),f instanceof olympe.sc.qa.li){a.G.debug('application retrieved: running');g=Mm(a.D,f);const h=new olympe.sc.Ya.pv(a.J);jb(a.J,()=>Ym(a.D.j,h));kb(a.J,()=>{var k=h.T();return $m(a.D.j,k)});a.fb&&a.J.start();f.run(g);'string'===typeof a.Bb&&(new olympe.sc.Ud).ba(f.X(),g,a.G);g.Ls(olympe.sc.ya.j.En).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
1164
+ a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Yd();k.Eb=!0;k.Y+=0;k.$c.next(0<k.Y);0===k.Y&&k.$&&k.Eb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.Bb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Tn(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1165
+ 3E4);let e;null==(e=a.Eb)||e.start()}}function Wn(a,b=!0){return a?olympe.dc.ma.oc.Fg:b?olympe.dc.ma.oc.lf:olympe.dc.ma.oc.ek}function Xn(a){return w(function*(){Zn(a.j)&&(yield En(a.j,a.ba).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Tn(a){a.G.info('Stop the application');a.D.D().fa();a.F.F(a.R);a.F.N(a.Y)}
1166
+ olympe.sc.Ib.tm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.fa=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.$a=g;this.J=h;this.Eb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.Bb=null!=(n=k.get('debuggerName'))?n:null;this.fb=k.get('autostartProfiler');this.ba=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Sn(this);Un(this);const b=olympe.L.uc.j.Mi,
1167
+ c=olympe.L.uc.j.ye,d=olympe.L.uc.j.Td;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,Vn(this).then(olympe.C.Xa().F(()=>Yn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.tm.j='app_instance';olympe.sc.Ib.tm.xa=[olympe.xc.Ts];olympe.sc.Ib.Bv=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.kj();this.G.debug('Request headers',b);return b.origin?b.origin:b.jz?(new URL(b.jz)).origin:b[olympe.net.wa.Headers.Vo]&&
1168
+ b[olympe.net.wa.Headers.Wo]?b[olympe.net.wa.Headers.Wo]+'://'+b[olympe.net.wa.Headers.Vo]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Md.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ld('Invalid appTag',olympe.net.wa.Tb.gl);try{var f=yield olympe.dc.ma.Ie(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
1169
+ h:h.message}`,olympe.net.wa.Tb.gl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.wa.Tb.$l);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
1170
+ typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.wa.Tb.Ah,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.dm.wd.F.ac()).gb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.j).gb(olympe.dm.jb.D).Fc();return c.concat(a).has(b)}
1171
+ olympe.sc.Ib.uk=class extends olympe.dc.sources.uk{R(a){return this.db.Qb(a,olympe.sc.yc)}Y(a,b){if(!this.J){super.init();var c=olympe.dc.nd.from(a).gb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.jb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Fg:olympe.dc.ma.oc.lf;Ek(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).gb(olympe.sc.qa.Xc.fa).observe(c,{jd:b}).subscribe(d=>{const e=
1172
+ new olympe.dc.Wa;d.hj().forEach(f=>{e.Oa(olympe.dm.DataSource.sj,this.j,f)});d.mj().forEach(f=>{e.ic(olympe.dm.DataSource.sj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={bg:'sc.runtime.Main',Te:'sc.runtime.SourceSolver',Kq:'sc.runtime.appConfig',Mq:'sc.runtime.runtimeHTTPServiceConfig',Lq:'sc.runtime.RuntimeHTTPService',fq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={pp:'app.httpManifestPath',Op:'app.manifest.common',Kp:'sc.loadBusinessContainer'};
1173
1173
  olympe.W.config(function(a){F(a,olympe.sc.Ib.U.pp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Op,null);F(a,olympe.sc.Ib.U.Kp,!1);E(a,olympe.Db.P.Og,[new olympe.W.pa(olympe.xc.U.Me),new olympe.W.pa(olympe.sc.U.Me)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.fq,[new olympe.W.pa(olympe.sc.U.Me),new olympe.W.pa(olympe.net.U.Li),new olympe.W.pa(olympe.net.U.bm)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1174
1174
  g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.cm,olympe.sc.Ib.P.fq);D(a,olympe.sc.Ib.P.Te,olympe.sc.Ib.uk,olympe.dc.P.oh,new olympe.W.pa(olympe.dc.U.Mg),new olympe.W.pa(olympe.dc.U.Al));Wa(a,olympe.dc.sources.P.Te,olympe.sc.Ib.P.Te);E(a,olympe.sc.Ib.P.Kq,[new olympe.W.pa(olympe.sc.U.Me),new olympe.W.pa(olympe.dc.U.Ih),new olympe.W.pa(olympe.sc.U.yo),new olympe.W.pa(olympe.sc.U.Gn),new olympe.W.pa(olympe.sc.Ib.U.Kp)],(b,c,d,e,f)=>new Map([['appTag',
1175
- b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.ag,olympe.sc.Ib.tm,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.kf,olympe.dc.query.P.gk,olympe.host.P.Re,olympe.sc.P.lk,olympe.sc.Ib.P.Te,olympe.V.P.$f,olympe.sc.Ib.P.Kq,olympe.sc.Ib.P.Lq);E(a,olympe.sc.Ib.P.Mq,[new olympe.W.pa(olympe.sc.Ib.U.pp),new olympe.W.pa(olympe.sc.Ib.U.Op)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Lq,olympe.sc.Ib.Bv,
1176
- olympe.sc.P.Ca,olympe.net.P.Xi,olympe.sc.P.lk,olympe.sc.Ib.P.Mq);olympe.xc.tj(a,olympe.sc.Ib.P.ag,'sc.runtime');olympe.xc.tj(a,olympe.sc.Ib.P.ag,'sc.headless');olympe.xc.tj(a,olympe.sc.Ib.P.ag)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static mx(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ve(olympe.public.Ma.get())}static Sk(b){return a.D(olympe.public.Ma.get().Sk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static zx(){return olympe.C.Pa(olympe.public.Ma.get().ne())}static $y(b){return a.D(olympe.public.Ma.get().ne(),b)}static me(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Ad();return c.call(b,
1177
- d)}static kg(){return new Promise((b,c)=>{olympe.public.Ma.get().kg(d=>d?c(d):b())})}static Lx(){return olympe.C.Pa(olympe.public.Ma.get().bi())||void 0}static ny(){const b=rd(olympe.public.Ma.get());return{user:b.Bc(),userTag:b.ne(),nonce:b.Ad(),payload:b.Di(),idpName:b.tf(),protocol:b.Bg()}}static Kx(){return Array.from(We().keys())}static ff(){olympe.public.Ma.get().ff()}static dh(b){return new Promise((c,d)=>{olympe.public.Ma.get().dh(b,e=>e?d(e):c())})}static Iy(b,c){return olympe.public.Ma.j((new Map).set('username',
1175
+ b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.bg,olympe.sc.Ib.tm,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.kf,olympe.dc.query.P.gk,olympe.host.P.Re,olympe.sc.P.lk,olympe.sc.Ib.P.Te,olympe.V.P.ag,olympe.sc.Ib.P.Kq,olympe.sc.Ib.P.Lq);E(a,olympe.sc.Ib.P.Mq,[new olympe.W.pa(olympe.sc.Ib.U.pp),new olympe.W.pa(olympe.sc.Ib.U.Op)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Lq,olympe.sc.Ib.Bv,
1176
+ olympe.sc.P.Ca,olympe.net.P.Xi,olympe.sc.P.lk,olympe.sc.Ib.P.Mq);olympe.xc.tj(a,olympe.sc.Ib.P.bg,'sc.runtime');olympe.xc.tj(a,olympe.sc.Ib.P.bg,'sc.headless');olympe.xc.tj(a,olympe.sc.Ib.P.bg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static mx(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ve(olympe.public.Ma.get())}static Sk(b){return a.D(olympe.public.Ma.get().Sk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static zx(){return olympe.C.Pa(olympe.public.Ma.get().ne())}static $y(b){return a.D(olympe.public.Ma.get().ne(),b)}static me(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Bd();return c.call(b,
1177
+ d)}static lg(){return new Promise((b,c)=>{olympe.public.Ma.get().lg(d=>d?c(d):b())})}static Lx(){return olympe.C.Pa(olympe.public.Ma.get().bi())||void 0}static ny(){const b=rd(olympe.public.Ma.get());return{user:b.Bc(),userTag:b.ne(),nonce:b.Bd(),payload:b.Di(),idpName:b.tf(),protocol:b.Bg()}}static Kx(){return Array.from(We().keys())}static ff(){olympe.public.Ma.get().ff()}static dh(b){return new Promise((c,d)=>{olympe.public.Ma.get().dh(b,e=>e?d(e):c())})}static Iy(b,c){return olympe.public.Ma.j((new Map).set('username',
1178
1178
  b).set('password',c),olympe.auth.Dc.j.SRP)}static Jy(b){const c=We();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static Hy(){return olympe.public.Ma.j(new Map,olympe.auth.Dc.j.SAML)}static Ky(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
1179
1179
  c),olympe.auth.Dc.j.em)}static Gy(){return olympe.public.Ma.j(new Map,olympe.auth.Dc.j.OAUTH2)}static fi(){return olympe.public.Ma.get().fi()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.ke()}static D(b,c){return b.asObservable('function'===typeof c.D?c.D():c)}};olympe.public.Ma.logout=olympe.public.Ma.fi;olympe.public.Ma.loginOpenID=olympe.public.Ma.Gy;
1180
- olympe.public.Ma.loginToken=olympe.public.Ma.Ky;olympe.public.Ma.loginSAML=olympe.public.Ma.Hy;olympe.public.Ma.loginSSO=olympe.public.Ma.Jy;olympe.public.Ma.loginSRP=olympe.public.Ma.Iy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.dh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.ff;olympe.public.Ma.getIDPNames=olympe.public.Ma.Kx;olympe.public.Ma.getUserToken=olympe.public.Ma.ny;olympe.public.Ma.getIDPToken=olympe.public.Ma.Lx;olympe.public.Ma.refreshToken=olympe.public.Ma.kg;
1181
- olympe.public.Ma.getToken=olympe.public.Ma.me;olympe.public.Ma.observeUser=olympe.public.Ma.$y;olympe.public.Ma.getCurrentUser=olympe.public.Ma.zx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Sk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.mx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.ng{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Va().Y(()=>e.unsubscribe());return d.rb()}}}};
1182
- olympe.public.mf=class{static create(a){return new class extends olympe.dc.wc.ng{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.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Va().Y(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static az(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.Mk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static bz(a,b){const c=olympe.host.Mk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.Ym().connect()}static disconnect(){return olympe.L.Ym().disconnect()}static Pf(a){a='function'===typeof a.D?a.D():a;return olympe.L.Ym().Pf().asObservable(a).pipe(rxjs.operators.map(b=>
1180
+ olympe.public.Ma.loginToken=olympe.public.Ma.Ky;olympe.public.Ma.loginSAML=olympe.public.Ma.Hy;olympe.public.Ma.loginSSO=olympe.public.Ma.Jy;olympe.public.Ma.loginSRP=olympe.public.Ma.Iy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.dh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.ff;olympe.public.Ma.getIDPNames=olympe.public.Ma.Kx;olympe.public.Ma.getUserToken=olympe.public.Ma.ny;olympe.public.Ma.getIDPToken=olympe.public.Ma.Lx;olympe.public.Ma.refreshToken=olympe.public.Ma.lg;
1181
+ olympe.public.Ma.getToken=olympe.public.Ma.me;olympe.public.Ma.observeUser=olympe.public.Ma.$y;olympe.public.Ma.getCurrentUser=olympe.public.Ma.zx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Sk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.mx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.og{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Rb(f)));olympe.C.Xa().Y(()=>e.unsubscribe());return d.rb()}}}};
1182
+ olympe.public.mf=class{static create(a){return new class extends olympe.dc.wc.og{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.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Y(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static az(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.Mk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.F(d)}static bz(a,b){const c=olympe.host.Mk(),d=c.D(a,b);return()=>c.N(d)}static connect(){return olympe.L.Ym().connect()}static disconnect(){return olympe.L.Ym().disconnect()}static Pf(a){a='function'===typeof a.D?a.D():a;return olympe.L.Ym().Pf().asObservable(a).pipe(rxjs.operators.map(b=>
1183
1183
  b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Pf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.bz;olympe.public.Process.onHealthCheck=olympe.public.Process.az;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.V.Hf,tagToString:olympe.dc.ha,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Qr,defineInverseRelation:olympe.dc.Uw,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
1184
- Context:olympe.sc.ya,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.Zf,EnumValue:olympe.sc.vi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.yd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ve,WorkflowTransition:olympe.sc.workflow.Transition,
1185
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Xa,BurstTransaction:olympe.dc.ni,TransactionResult:olympe.sc.Wi,PredefinedDataSource:olympe.dc.Ka,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.ld,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.dk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ce.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Yd().N,clearCache:a=>Vk(olympe.dc.sources.Yd(),
1186
- a),getProcessingStatus:()=>olympe.dc.sources.Yd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Yd().rc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Yd().ba.asObservable(),synchroniseChanges:()=>al(),getPendingChanges:()=>dl(),clearPendingChanges:()=>hl(),loadPendingChanges:a=>fl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.bb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.zj,
1184
+ Context:olympe.sc.ya,Entry:olympe.dc.Ra.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.sc.File,User:olympe.dm.User,Enum:olympe.dm.Zf,EnumValue:olympe.sc.vi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ve,WorkflowTransition:olympe.sc.workflow.Transition,
1185
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ni,TransactionResult:olympe.sc.Wi,PredefinedDataSource:olympe.dc.Ka,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.dk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ce.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Yd().N,clearCache:a=>Uk(olympe.dc.sources.Yd(),
1186
+ a),getProcessingStatus:()=>olympe.dc.sources.Yd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Yd().rc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Yd().ba.asObservable(),synchroniseChanges:()=>$k(),getPendingChanges:()=>cl(),clearPendingChanges:()=>gl(),loadPendingChanges:a=>el(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.cb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.zj,
1187
1187
  GUEST:olympe.auth.Ta.j.xi,AUTHENTICATED:olympe.auth.Ta.j.gf,ERROR:olympe.auth.Ta.j.zb},AuthProtocol:olympe.auth.Dc.j,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
1188
- instanceToTag:olympe.dc.ha,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Hf,onDestroy:a=>olympe.C.Va().onDestroy(a),offDestroy:a=>olympe.C.Va().Qf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.da.Se,RecursiveRelated:olympe.dc.da.De,Distinct:olympe.dc.da.si,Filter:olympe.dc.da.pf,Limit:olympe.dc.da.xh,Sort:olympe.dc.da.Pg,Union:olympe.dc.da.Cf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Id,Or:olympe.dc.Z.ze,Not:olympe.dc.Z.de,Equals:olympe.dc.Z.te,Contains:olympe.dc.Z.nf,
1188
+ instanceToTag:olympe.dc.ha,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.Hf,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Qf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.da.Se,RecursiveRelated:olympe.dc.da.De,Distinct:olympe.dc.da.si,Filter:olympe.dc.da.pf,Limit:olympe.dc.da.xh,Sort:olympe.dc.da.Pg,Union:olympe.dc.da.Cf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Id,Or:olympe.dc.Z.ze,Not:olympe.dc.Z.ee,Equals:olympe.dc.Z.te,Contains:olympe.dc.Z.nf,
1189
1189
  Greater:olympe.dc.Z.Sj,Smaller:olympe.dc.Z.tk,HasRelated:olympe.dc.Z.zi,InstanceOf:olympe.dc.Z.Ci,Regex:olympe.dc.Z.zf},Comparator:olympe.public.mf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.Dj,StringProperty:olympe.dc.Za.Si,NumberProperty:olympe.dc.Za.Ki,DateTimeProperty:olympe.dc.Za.ri,Constant:olympe.dc.Za.Oe,Tag:olympe.dc.Za.Ui}});
1190
1190
 
1191
1191